body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

h1, h2 { color: #1a237e; text-shadow: none; position: relative; z-index: 1; }

a { color: #0d47a1; text-decoration: none; }
a:hover { text-decoration: underline; }

.tournament-card {
    background: rgba(255,255,255,0.95);
    padding: 20px;
    margin: 15px 0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    align-items: start;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 1;
    border-left: 5px solid #0d47a1;
}

.tournament-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.tournament-card > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tournament-card h2 { 
    margin: 0; 
    color: #1a237e; 
    text-shadow: none; 
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tournament-card h2 a {
    color: #0d47a1;
    text-decoration: none;
}

.tournament-card h2 a:hover {
    text-decoration: underline;
}

.tournament-card p {
    margin: 4px 0;
    color: #555;
    font-size: 0.95em;
}

.tournament-card .details {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #666;
    font-size: 0.9em;
}

.tournament-card .location {
    font-weight: 500;
    color: #1a237e;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tournament-card .date {
    color: #0d47a1;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tournament-card > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.tournament-card button {
    width: auto;
    padding: 8px 16px;
    margin: 0;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .tournament-card {
        grid-template-columns: 1fr;
        padding: 15px;
        margin: 12px 0;
    }
    
    .tournament-card h2 {
        font-size: 1.1em;
        flex-wrap: wrap;
    }
    
    .tournament-card .details {
        font-size: 0.85em;
        gap: 5px;
    }
    
    .tournament-card > div:first-child {
        gap: 8px;
    }
    
    .tournament-card > div:last-child {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .tournament-card button {
        flex: 0 1 auto;
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    input, select, button {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .tournament-card {
        padding: 12px;
        margin: 10px 0;
        border-left: 4px solid #0d47a1;
    }
    
    .tournament-card h2 {
        font-size: 0.95em;
    }
    
    .tournament-card .details {
        font-size: 0.8em;
        gap: 4px;
    }
    
    .tournament-card > div:last-child {
        gap: 4px;
    }
    
    .tournament-card button {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    
    form {
        padding: 15px;
    }
    
    input, select, button {
        padding: 12px 10px;
        font-size: 16px;
    }
    
    table {
        font-size: 0.85em;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    h1 {
        font-size: 1.5em;
    }
    
    h2 {
        font-size: 1.1em;
    }
}

form {
    background: rgba(255,255,255,0.95);
    padding: 30px;
    border-radius: 15px;
    margin: 15px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
    border-top: 4px solid #0d47a1;
}

input, select, button {
    display: block;
    width: 100%;
    padding: 13px 14px;
    margin: 10px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1em;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

input:focus, select:focus {
    border-color: #0d47a1;
    outline: none;
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.1);
}

button {
    background: linear-gradient(135deg, #0d47a1, #1a237e);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(13, 71, 161, 0.3);
    background: linear-gradient(135deg, #1a237e, #0d47a1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th { 
    background: linear-gradient(135deg, #0d47a1, #1a237e); 
    color: white; 
    font-weight: 600;
}

#search-results, .partner-results {
    background: white;
    border: 2px solid #0d47a1;
    max-height: 250px;
    overflow-y: auto;
    position: absolute;
    width: 100%;
    z-index: 10;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.search-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.search-item:hover { 
    background: #f5f5f5;
    color: #0d47a1;
}

#levels-container label {
    display: inline-block;
    margin: 4px 8px;
}

/* General content containers */
div[style*="display:flex"] { position: relative; z-index: 1; }
p, #loading-msg { color: rgba(0,0,0,0.7); position: relative; z-index: 1; }

/* Page padding for main content */
body > div:first-of-type,
body > p,
body > div[id] {
    margin: 0 20px;
}
