* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: #0a0a0a; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #0a0a0a; color: #fff; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: #fff; text-decoration: none; }
.navbar { display: flex; justify-content: space-between; align-items: center; background: #0a0a0a; border-bottom: 2px solid #cc0000; padding: 1rem 2rem; position: sticky; top: 0; z-index: 100; }
.navbar-brand a { color: #cc0000; text-decoration: none; font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.navbar-brand a small { font-size: 0.8rem; color: #888; font-weight: 400; text-transform: none; letter-spacing: 0.5px; margin-left: 4px; }
.navbar-links { list-style: none; display: flex; align-items: center; gap: 1.5rem; }
.navbar-links a { color: #fff; text-decoration: none; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; }
.navbar-links a:hover { color: #cc0000; }
.navbar-utils { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.nav-logout, .nav-login { background: none; border: none; color: #fff; cursor: pointer; font-weight: 600; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.5px; }
.nav-logout:hover { color: #cc0000; }
.user-badge { background: #cc0000; padding: 0.25rem 0.75rem; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; border: none; color: #fff; cursor: pointer; font-family: inherit; }
.user-menu { position: relative; display: inline-flex; align-items: center; }
.user-menu-dropdown { display: none; position: absolute; top: 100%; right: 0; z-index: 200; background: #111; border: 1px solid #222; padding: 0.5rem; margin-top: 0.25rem; }
.user-menu-dropdown.show { display: block; }
.user-menu-dropdown .nav-logout { white-space: nowrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; flex: 1; }
.hero { text-align: center; padding: 4rem 2rem; background: linear-gradient(180deg, #0a0a0a 0%, #1a0505 100%); border-bottom: 2px solid #cc0000; margin-bottom: 2rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: 0.5rem; color: #fff; text-transform: uppercase; font-weight: 900; letter-spacing: 2px; }
.hero p { font-size: 1.1rem; color: #777; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 1px; }
.hero-actions, .header-actions { display: flex; gap: 1rem; justify-content: center; }
.section { margin-bottom: 2.5rem; }
.section h2 { margin-bottom: 1rem; font-size: 1.4rem; text-transform: uppercase; font-weight: 700; border-left: 3px solid #cc0000; padding-left: 0.75rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

.legal h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: 0.5rem; color: #cc0000; border-left: none; padding-left: 0; text-transform: none; }
.legal p, .legal li { color: #999; line-height: 1.8; }
.legal ul { padding-left: 1.5rem; margin: 0.5rem 0; }
.legal li { margin-bottom: 0.25rem; }
.legal a { color: #cc0000; text-decoration: underline; }
.legal-date { margin-bottom: 2rem; font-size: 0.85rem; color: #666; }

.footer-links { margin-top: 0.5rem; font-size: 0.8rem; text-align: center; }
.footer-links a { color: #888; }
.footer-links a:hover { color: #cc0000; }
.footer-links-sep { color: #333; margin: 0 0.5rem; }
.card { background: #111; border: 1px solid #222; border-radius: 0; padding: 1.5rem; text-decoration: none; color: inherit; transition: all 0.2s; display: block; }
.card:hover { border-color: #cc0000; background: #1a0505; }
.card h3 { margin-bottom: 0.5rem; text-transform: uppercase; font-weight: 700; }
.card p { color: #777; font-size: 0.9rem; }
.card .card-meta { display: flex; justify-content: space-between; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #222; }
.btn { display: inline-block; padding: 0.6rem 1.2rem; border: 2px solid #cc0000; color: #cc0000; font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s; background: transparent; border-radius: 0; cursor: pointer; text-decoration: none; }
.btn:hover { background: #cc0000; color: #fff; }
.btn-primary { background: #cc0000; border-color: #cc0000; color: #fff; }
.btn-primary:hover { background: #ff0000; border-color: #ff0000; color: #fff; }
.btn-secondary { background: transparent; border: 2px solid #cc0000; color: #cc0000; }
.btn-outline { background: transparent; border: 2px solid #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: #000; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; line-height: 1.2; height: 28px; }
.btn-danger { background: #cc0000; border: 2px solid #cc0000; color: #fff; line-height: 1.2; padding: 0.3rem 0.6rem; }
.btn-block { display: block; width: 100%; }
.page-header { margin-bottom: 1.5rem; border-bottom: 1px solid #222; padding-bottom: 1rem; }
.page-header-row { display: flex; justify-content: space-between; align-items: center; }
.page-header-label { font-size: 1.2rem; font-weight: 700; text-transform: uppercase; }
.score-driver-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; border-bottom: 1px solid #222; padding-bottom: 1rem; }
.score-driver-info h2 { font-size: 1.2rem; margin: 0; }
.page-header-title { display: flex; align-items: center; gap: 1rem; }
.table-wrap { overflow-x: auto; background: #111; border: 1px solid #222; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid #222; }
.table th { background: #0a0a0a; color: #cc0000; font-size: 0.8rem; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.table a { color: #cc0000; text-decoration: none; }
.table a:hover { color: #fff; }
.wf { color: #fff !important; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions > * + * { margin-left: 0.5rem; }
.text-center { text-align: center; color: #777; padding: 2rem !important; }
.avatar-sm { width: 48px; height: 48px; border-radius: 0; object-fit: cover; border: 2px solid #cc0000; }
.avatar-lg { width: 80px; height: 80px; border-radius: 0; object-fit: cover; border: 2px solid #cc0000; }
.avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #cc0000; color: #fff; font-weight: 700; }
.badge { display: inline-block; padding: 0.2rem 0.6rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-mode { background: #cc0000; color: #fff; }
.badge-draft { background: #444; color: #fff; }
.badge-active { background: #cc0000; color: #fff; }
.badge-finished { background: #333; color: #fff; }
.badge-hidden { background: #222; color: #666; }
.form-card { background: #111; border: 1px solid #222; padding: 2rem; max-width: 600px; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-weight: 700; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.7rem 0.9rem; background: #0a0a0a; border: 1px solid #222; color: #fff; box-sizing: border-box; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #cc0000; }
.form-group input[type="number"] { border-width: 1px; font-size: inherit; text-align: center; line-height: normal; }
.form-group input[type="number"]:focus { border-color: #cc0000; }
.form-fieldset { border: 1px solid #222; padding: 1rem; margin-bottom: 1.25rem; }
.form-fieldset legend { font-weight: 700; padding: 0 0.5rem; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.5px; }
.multi-select { max-height: 250px; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-label input[type="checkbox"] { width: 18px; height: 18px; accent-color: #cc0000; }
.checkbox-label span { font-weight: 600; }
.role-select { padding: 0.3rem 0.5rem; background: #0a0a0a; border: 1px solid #222; color: #fff; }
.photo-preview { width: 80px; height: 80px; object-fit: cover; }
.auth-container { display: flex; justify-content: center; align-items: center; min-height: 70vh; }
.auth-box { background: #111; border: 1px solid #222; padding: 2.5rem; width: 100%; max-width: 380px; }
.auth-box h2 { margin-bottom: 1.5rem; text-align: center; text-transform: uppercase; font-weight: 800; letter-spacing: 2px; }
.alert-error { background: #cc0000; color: #fff; padding: 0.75rem; margin-bottom: 1rem; text-align: center; text-transform: uppercase; font-weight: 700; }
.mt-2 { margin-top: 1rem; }
.bracket-wrap { display: flex; gap: 1.5rem; overflow-x: auto; padding: 1rem 0; align-items: flex-start; }
.bracket-col { flex-shrink: 0; width: 200px; }
.bracket-col-third { border-left: 2px dashed #444; padding-left: 1rem; }
.col-title { font-size: 0.75rem; color: #cc0000; text-align: center; margin-bottom: 0.75rem; text-transform: uppercase; font-weight: 700; letter-spacing: 1px; }
.match { background: #111; border: 1px solid #222; padding: 0.5rem; margin-bottom: 0.75rem; }
.match-done { border-left: 3px solid #cc0000; }
.match-omt { border-left: 3px solid #ff6600; }
.match-player { display: flex; justify-content: space-between; align-items: center; padding: 0.2rem 0; font-size: 0.85rem; }
.match-player.winner .player-name { color: #cc0000; }
.match-vs { text-align: center; font-size: 0.65rem; color: #444; padding: 0.1rem 0; }
.win-mark { font-size: 0.65rem; background: #cc0000; padding: 0.1rem 0.3rem; font-weight: 700; }
.match-btns { display: flex; gap: 0.25rem; margin-top: 0.4rem; }

.score-form { background: #111; border: 1px solid #222; padding: 1.5rem; margin-bottom: 1rem; }
.score-form h4 { margin-bottom: 1rem; color: #cc0000; text-transform: uppercase; font-weight: 700; }
.score-table { margin: 1rem 0; }
.score-table th, .score-table td { padding: 0.5rem; text-align: center; }
.score-table th { background: #0a0a0a; border-bottom: 2px solid #cc0000; }
.empty-state { text-align: center; padding: 4rem; color: #777; text-transform: uppercase; letter-spacing: 1px; }
.drivers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.driver-card { background: #111; border: 1px solid #222; padding: 1.5rem; }
.driver-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.driver-info { flex: 1; }
.driver-card h3 { margin-bottom: 0.25rem; text-transform: uppercase; font-weight: 700; font-size: 1.2rem; }
.driver-vehicle { color: #777; font-size: 0.9rem; }
.driver-team { color: #555; font-size: 0.8rem; margin-top: 0.15rem; }
.driver-avatar-card { width: 130px; height: 130px; object-fit: cover; border: 2px solid #cc0000; flex-shrink: 0; }
.driver-photo-wrapper { position: relative; display: inline-block; }
.driver-number-name { color: #cc0000; font-weight: 700; font-family: monospace; font-size: 1.1rem; }
.car-photo-wrapper { position: relative; display: inline-block; }
.driver-photos { display: flex; gap: 0.5rem; align-items: flex-start; }
.car-avatar-card { display: none; width: 130px; height: 130px; object-fit: cover; border: 2px solid #666; flex-shrink: 0; }
.driver-card h4 { color: #cc0000; margin: 1rem 0 0.5rem; font-size: 0.9rem; text-transform: uppercase; }
.rankings-section { background: #111; border: 1px solid #222; padding: 1.5rem; margin-bottom: 2rem; }
.rankings-section h3 { color: #cc0000; margin-bottom: 1rem; text-align: center; text-transform: uppercase; font-weight: 700; letter-spacing: 2px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 0.5rem; margin: 1rem 0 2rem; }
.podium-place { text-align: center; padding: 1rem; min-width: 120px; }
.podium-place.first { height: 150px; order: 2; background: linear-gradient(180deg, #cc0000 0%, #990000 100%); }
.podium-place.second { height: 125px; order: 1; background: linear-gradient(180deg, #b0b0b0 0%, #777 100%); }
.podium-place.third { height: 100px; order: 3; background: linear-gradient(180deg, #cd7f32 0%, #8b4513 100%); }
.podium-place .place-num { font-size: 2rem; font-weight: 700; }
.podium-place .driver-name { font-weight: 600; margin-top: 0.5rem; }
.podium-place.first .driver-name { font-size: 1.1rem; }
.rankings-list { background: #111; border: 1px solid #222; padding: 1.5rem; margin-bottom: 2rem; }
.rankings-list h4 { color: #cc0000; margin-bottom: 1rem; text-align: center; text-transform: uppercase; font-weight: 700; letter-spacing: 2px; }
.rankings-list ol { list-style: none; padding: 0; max-width: 400px; margin: 0 auto; }
.rankings-list li { padding: 0.5rem 0.75rem; border-bottom: 1px solid #222; display: flex; align-items: center; font-size: 0.95rem; }
.rankings-list li:last-child { border-bottom: none; }
.rankings-list .pos { color: #888; min-width: 2.5rem; font-weight: 700; }
.tournament-settings { margin: 0 0 0.5rem; }
.standings-section { background: #111; border: 1px solid #222; padding: 1.5rem; margin-bottom: 2rem; overflow-x: auto; }
.standings-section h3 { color: #cc0000; margin-bottom: 1rem; text-align: center; text-transform: uppercase; font-weight: 700; letter-spacing: 2px; }
.standings-table { width: 100%; border-collapse: collapse; }
.standings-table th, .standings-table td { padding: 0.6rem 0.75rem; text-align: center; }
.standings-table th { background: #0a0a0a; border-bottom: 2px solid #cc0000; color: #ccc; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; }
.standings-table td { border-bottom: 1px solid #222; font-size: 0.9rem; }
.standings-table tr:last-child td { border-bottom: none; }
.standings-table .row-positioned td:first-child { color: #cc0000; font-weight: 700; }
.standings-table .row-omt td:first-child { color: #ff6600; font-weight: 700; }
.standings-table tr:hover td { background: #1a1a1a; }
.battle-card { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 2rem; background: #111; border: 1px solid #222; margin-bottom: 1.5rem; }
.driver-side { text-align: center; flex: 1; }
.driver-side.left { text-align: right; }
.driver-side.right { text-align: left; }
.driver-avatar { width: 100px; height: 100px; object-fit: cover; border: 2px solid #cc0000; margin-bottom: 0.5rem; }
.vs-divider { font-size: 2rem; font-weight: 900; color: #cc0000; text-transform: uppercase; }
.winner-badge { display: inline-block; background: #cc0000; color: #fff; padding: 0.25rem 0.75rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; margin-top: 0.5rem; }
.badge-warning { background: #ff6600; color: #fff; padding: 0.25rem 0.75rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; margin-left: 1rem; }
.badge-omt { background: #ff6600; color: #fff; }
.score-hint { font-size: 0.7rem; color: #777; margin-left: 0.5rem; text-transform: uppercase; }
.totals-row { background: #0a0a0a; border-top: 2px solid #cc0000; }
.vote-buttons { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; margin-bottom: 1.5rem; }
.vote-option { flex: 1; max-width: 200px; cursor: pointer; position: relative; }
.vote-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.vote-label { display: flex; align-items: center; justify-content: center; height: 48px; padding: 0.8rem 1rem; font-size: 0.95rem; text-align: center; border: 2px solid #cc0000; color: #cc0000; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; transition: all 0.2s; background: transparent; }
.vote-label.vote-omt { border-color: #fff; color: #cc0000; background: #fff; }
.vote-option input:checked + .vote-label { background: #cc0000; color: #fff; }
.vote-option input:checked + .vote-label.vote-omt { background: #fff; color: #cc0000; border-color: #cc0000; }
.vote-option input:disabled + .vote-label { opacity: 0.35; cursor: not-allowed; }
.run-info { text-align: center; color: #777; font-size: 0.85rem; margin: 0.5rem 0 1rem; text-transform: uppercase; }
.run-info .leader { color: #fff; }
.run-info .chaser { color: #fff; }
.btn-vote { flex: 1; max-width: 200px; padding: 1rem; font-size: 1rem; text-align: center; }
.btn-vote.voted { background: #cc0000; color: #fff; }
.help-text { text-align: center; color: #777; font-size: 0.85rem; margin-top: 0.75rem; text-transform: uppercase; }
.alert-info { background: #222; color: #fff; padding: 0.75rem; margin-bottom: 1rem; text-align: center; text-transform: uppercase; font-weight: 700; border: 1px solid #cc0000; }
.battle-notes { margin-top: 0.5rem; padding: 0.5rem; background: #0a0a0a; border-top: 1px solid #333; font-size: 0.85rem; }
.battle-notes strong { color: #cc0000; }
.judge-notes { margin-top: 0.25rem; color: #777; }
.judge-notes .judge-name { color: #fff; margin-right: 0.5rem; }
.score-table th.col-sep, .score-table td.col-sep { border-left: 2px solid #cc0000; }
.score-notes { display: block; font-size: 0.7em; color: #888; margin-top: 2px; font-style: italic; }
.info-text { color: #888; font-style: italic; margin: 1em 0; }
.input-locked { background: #1a1a1a; color: #888; border: 1px solid #333; cursor: not-allowed; }
.battle-result { display: flex; justify-content: center; gap: 2rem; margin: 1.5rem 0; }
.result-driver { text-align: center; padding: 1rem 2rem; background: #111; border: 1px solid #333; min-width: 160px; }
.result-driver.winner { border-color: #cc0000; }
.result-driver .wins { display: block; color: #888; font-size: 0.85rem; margin-top: 0.25rem; }

.ad-slot { text-align: center; overflow: hidden; margin: 1.5rem 0; background: #0d0d0d; border: 1px solid #1a1a1a; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.ad-slot-content { margin: 1.5rem 0; }
.ad-slot-global { margin: 0; border-left: none; border-right: none; border-top: none; }
.ad-slot__label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.4rem 0.75rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid #222; text-align: left; }
.ad-slot-global .ad-slot__label { background: linear-gradient(90deg, #0a2228 0%, #0d1214 55%); border-bottom-color: #1a4a55; }
.ad-slot-content .ad-slot__label { background: linear-gradient(90deg, #281a0a 0%, #0d1214 55%); border-bottom-color: #553a1a; }
.ad-slot__tag { font-weight: 800; color: #fff; display: inline-flex; align-items: center; gap: 0.35rem; }
.ad-slot__num { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; height: 1.5rem; padding: 0 0.25rem; font-size: 0.95rem; border: 2px solid; border-radius: 2px; }
.ad-slot-global .ad-slot__num { border-color: #2a9cad; color: #5dd4e8; }
.ad-slot-content .ad-slot__num { border-color: #cc8800; color: #ffb84d; }
.ad-slot__hint { color: #666; font-weight: 600; }
.ad-slot__hint code { font-size: 0.65rem; color: #888; text-transform: none; letter-spacing: 0; }
.ad-slot__payload { min-height: 90px; display: flex; align-items: center; justify-content: center; padding: 0.75rem 1rem; position: relative; }
.ad-slot__demo { width: 100%; max-width: 728px; margin: 0 auto; padding: 1rem 1.25rem; border: 2px dashed #333; background: #111; color: #888; position: relative; }
.ad-slot__demo-badge { position: absolute; top: 0.35rem; right: 0.5rem; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em; color: #555; border: 1px solid #333; padding: 0.15rem 0.4rem; }
.ad-slot__demo-title { font-size: 0.95rem; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.ad-slot__demo-meta { font-size: 0.75rem; line-height: 1.45; color: #666; }

@media (max-width: 768px) {
  .ad-slot { margin: 1rem 0; }
  .ad-slot__payload { min-height: 60px; padding: 0.5rem; }
  .ad-slot__label { font-size: 0.65rem; }
}

footer { text-align: center; padding: 2rem; color: #444; border-top: 1px solid #222; margin-top: auto; }
.footer-contact { margin-bottom: 1rem; }
.footer-contact-title { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: #888; margin-bottom: 0.5rem; font-weight: 700; }
.footer-contact-item { font-size: 0.85rem; text-transform: none; letter-spacing: 0; margin: 0.2rem 0; }
.footer-contact-item a { color: #ccc; }
.footer-contact-item a:hover { color: #cc0000; }
.footer-copy { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 1px; color: #444; }
.qr-btn { display: inline-flex; align-items: center; gap: 0.35rem; background: none; border: 1px solid #444; color: #888; padding: 0.3rem 0.6rem; border-radius: 4px; cursor: pointer; font-size: 0.8rem; margin-top: 0.5rem; transition: color 0.2s, border-color 0.2s; }
.qr-btn:hover { color: #cc0000; border-color: #cc0000; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 999; align-items: center; justify-content: center; }
.modal-content { background: #111; border: 1px solid #333; border-radius: 8px; padding: 2rem; text-align: center; max-width: 320px; position: relative; }
.modal-close { position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: none; color: #888; font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #cc0000; }
.qr-img { width: 250px; height: 250px; display: block; margin: 1rem auto; border-radius: 4px; }
.qr-url { color: #888; font-size: 0.85rem; margin-top: 0.5rem; }
.share-buttons { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1rem; flex-wrap: wrap; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #333; background: #1a1a1a; color: #888; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s; text-decoration: none; font-size: 0.75rem; }
.share-btn:hover { color: #cc0000; border-color: #cc0000; background: #222; }
.share-btn-more { color: #666; }

.loc-mob { display: none; }
/* ====== WhatsApp Link ====== */
.wa-link { display: inline-flex; align-items: center; gap: 0.35rem; text-decoration: none; }
.wa-icon { transition: transform 0.15s; display: block; }
.wa-link:hover .wa-icon { transform: scale(1.2); }

@media (max-width: 768px) {
  .container { padding: 1rem; }
  .navbar { padding: 0.75rem 1rem; flex-wrap: wrap; gap: 0.5rem; }
  .navbar-links { gap: 0.5rem; flex-wrap: wrap; justify-content: center; width: 100%; padding-top: 0.25rem; border-top: 1px solid #222; order: 3; }
  .navbar-links a, .nav-logout, .nav-login { font-size: 0.75rem; }
  .navbar-brand a { font-size: 1.2rem; }
  .navbar-utils { gap: 0.5rem; order: 2; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .page-header-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .page-header-title { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .page-header-row { flex-direction: column; align-items: flex-start; }
  .tournament-actions { align-self: flex-end; }
  .header-actions { flex-wrap: wrap; }
  .hero { padding: 2rem 1rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.9rem; }
  .drivers-grid { grid-template-columns: 1fr; }
  .driver-card { padding: 1rem; }
  .driver-header { flex-direction: column; align-items: center; text-align: center; }
  .driver-avatar-card { width: 80px; height: 80px; }
  .driver-photos:has(.car-photo-wrapper) .driver-number-desktop { display: none; }

  .car-avatar-card { display: block; width: 80px; height: 80px; }
  .score-table { font-size: 0.8rem; }
  .score-table th, .score-table td { padding: 0.35rem; }
  .podium-place { min-width: 90px; padding: 0.75rem 0.5rem; }
  .podium-place.first { height: 120px; }
  .podium-place.second { height: 100px; }
  .podium-place.third { height: 80px; }
  .podium-place .place-num { font-size: 1.4rem; }
  .podium-place .driver-name { font-size: 0.8rem; }
  .bracket-wrap { gap: 0.75rem; }
  .bracket-col { width: 160px; }
  .match-player { font-size: 0.75rem; }
  .match-btns .btn-sm { font-size: 0.65rem; padding: 0.2rem 0.4rem; }
  .battle-card { flex-direction: column; gap: 0.5rem; padding: 1rem; }
  .driver-side.left, .driver-side.right { text-align: center; }
  .driver-avatar { width: 70px; height: 70px; }
  .vs-divider { font-size: 1.5rem; }
  .vote-buttons { flex-direction: column; align-items: stretch; }
  .vote-option { max-width: none; }
  .vote-label { height: 44px; font-size: 0.85rem; }
  .battle-result { flex-direction: column; align-items: center; gap: 0.75rem; }
  .result-driver { min-width: 120px; width: 100%; max-width: 250px; }
  .rankings-section, .rankings-list, .form-card { padding: 1rem; }
  .table th, .table td { padding: 0.5rem; font-size: 0.75rem; }
  .row-actions { flex-wrap: wrap; }
  .btn { padding: 0.5rem 0.8rem; font-size: 0.75rem; }
  .empty-state { padding: 2rem 1rem; }
  .form-card { max-width: none; }

  .th-loc, .td-loc { display: none; }
  .loc-mob { display: inline; color: #999; font-size: 0.75rem; }
}

@media (min-width: 769px) {
  .navbar-links { flex: 1; justify-content: center; }
}

@media (max-width: 480px) {
  .container { padding: 0.5rem; }
  .navbar { padding: 0.5rem; }
  .navbar-links { gap: 0.5rem; }
  .navbar-links a, .nav-logout { font-size: 0.7rem; letter-spacing: 0; }
  .user-badge { font-size: 0.65rem; padding: 0.2rem 0.5rem; }
  .page-header h2 { font-size: 1.2rem; }
  .hero h1 { font-size: 1.4rem; }
  .score-table th, .score-table td { padding: 0.25rem; font-size: 0.7rem; }
  .podium { gap: 0.25rem; }
  .podium-place { min-width: 70px; padding: 0.5rem 0.25rem; }
  .podium-place.first { height: 90px; }
  .podium-place.second { height: 70px; }
  .podium-place.third { height: 55px; }
  .podium-place .place-num { font-size: 1.1rem; }
  .podium-place .driver-name { font-size: 0.7rem; }
  .bracket-col { width: 130px; }
  .bracket-wrap { gap: 0.5rem; }
  .vote-label { height: 40px; font-size: 0.8rem; padding: 0.5rem; }
  .btn { padding: 0.4rem 0.6rem; font-size: 0.7rem; }
  .btn-sm { padding: 0.2rem 0.4rem; font-size: 0.65rem; }
}

/* ====== Tabs ====== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #333;
    margin-bottom: 1.5rem;
    list-style: none;
    padding: 0;
}
.tabs li {
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    color: #888;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}
.tabs li:hover { color: #fff; }
.tabs li.tab-active {
    color: #cc0000;
    border-bottom-color: #cc0000;
}

/* ====== Car-related ====== */
.car-thumb { width: 80px; height: 60px; object-fit: cover; border-radius: 4px; }
.car-select { margin-left: 0.5rem; padding: 0.2rem; font-size: 0.8rem; }
.preview-thumb { width: 120px; height: auto; border-radius: 4px; margin-bottom: 0.5rem; }
.badge-car { background: #1a1a2e; color: #e0e0ff; border: 1px solid #333; font-size: 0.75rem; }
.badge-power { background: #1a2e1a; color: #a0ffa0; border: 1px solid #2a4a2a; font-size: 0.75rem; }
.driver-car { margin-top: 0.25rem; }
.driver-car .badge { display: inline-block; margin-right: 0.25rem; }

/* ====== Grid List (cars, etc) ====== */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.grid-list .card { background: #111; border: 1px solid #222; border-radius: 6px; }
.grid-list .card-body { padding: 1rem; }
.grid-list .card-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.5rem; }
.grid-list .card-header-row h3 { margin: 0; font-size: 1rem; text-transform: uppercase; }
.grid-list .card-body p { margin: 0.25rem 0; font-size: 0.85rem; color: #ccc; }
.grid-list .card-actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; }

/* ====== Multi-select with car dropdown ====== */
.multi-select-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.multi-select-row select { margin-left: auto; }
.car-select-wrap { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.car-select { padding: 0.2rem; font-size: 0.8rem; }
.car-preview { width: 40px; height: 30px; flex-shrink: 0; }
.car-preview-img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; border: 1px solid #333; }

/* ====== Season/Standings ====== */
.driver-info-cell { display: flex; align-items: center; gap: 0.5rem; }
.driver-mini-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.champion-row { background: rgba(204, 0, 0, 0.08) !important; }
.champion-row td { border-bottom-color: #cc0000 !important; }

/* ====== Team/City ====== */
.badge-team { background: #1a1a2e; color: #ffcc00; border: 1px solid #554400; font-size: 0.75rem; }
.badge-city { background: #1a2e1a; color: #a0ffa0; border: 1px solid #2a4a2a; font-size: 0.75rem; }
.team-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 50%; }
.team-icon { width: 20px; height: 20px; object-fit: cover; border-radius: 50%; vertical-align: middle; margin-left: 0.25rem; }
.flag-thumb { width: 60px; height: 40px; object-fit: cover; border-radius: 3px; }
.flag-icon { width: 24px; height: 16px; object-fit: cover; vertical-align: middle; margin-right: 0.25rem; border-radius: 2px; }
.flag-icon-sm { width: 18px; height: 12px; object-fit: cover; vertical-align: middle; margin-right: 0.15rem; border-radius: 1px; }
.driver-meta { margin-top: 0.25rem; font-size: 0.8rem; color: #aaa; }
.driver-meta .badge { display: inline-block; margin-right: 0.25rem; }

/* ====== Visual Picker Grid ====== */
.picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 6px;
}
.picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem;
    background: #111;
    border: 2px solid #222;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.picker-item:hover { border-color: #444; background: #1a1a1a; }
.picker-item.picker-selected { border-color: #cc0000; background: #1a0a0a; }
.picker-item input { display: none; }
.card-link { color: #fff; text-decoration: none; }
.card-link:hover { color: #cc0000; }
.picker-thumb { width: 100%; height: 50px; object-fit: cover; border-radius: 3px; margin-bottom: 0.15rem; }
.picker-label { font-weight: 600; font-size: 0.85rem; color: #fff; line-height: 1.2; }
.picker-detail { font-size: 0.75rem; color: #888; }
.picker-none { justify-content: center; min-height: 60px; }
.picker-none .picker-label { color: #666; }

/* ====== Section Title ====== */
.section-title { margin: 1.5rem 0 0.75rem; font-size: 1rem; text-transform: uppercase; color: #cc0000; }

/* ====== Instagram Link ====== */
.ig-link { display: inline-flex; align-items: center; margin-left: 0.4rem; vertical-align: middle; }
.ig-icon { transition: transform 0.15s; display: block; }
.ig-link:hover .ig-icon { transform: scale(1.2); }

/* ====== OMT Driver Card ====== */
.driver-omt { border-color: #cc4400 !important; background: #1e1208 !important; position: relative; }
.omt-ribbon {
    position: absolute; top: 0; right: 0; background: #cc4400; color: #fff;
    padding: 0.2rem 0.6rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    border-radius: 0 6px 0 4px; letter-spacing: 1px; z-index: 1;
}
.driver-positioned { border-color: #e6b800 !important; background: #1a1708 !important; position: relative; }
.best-score-badge { display: inline-flex; align-items: center; gap: 0.35rem;
    background: #1a0a33; border: 1px solid #b388ff; color: #b388ff;
    padding: 0.25rem 0.6rem; font-size: 0.7rem; font-weight: 700;
    border-radius: 4px; letter-spacing: 0.5px; position: relative; top: -0.6rem; }
.best-score-badge .label { text-transform: uppercase; opacity: 0.7; }
.position-ribbon {
    position: absolute; top: 0; right: 0; background: #e6b800; color: #1a1a1a;
    padding: 0.25rem 0.6rem; font-size: 0.75rem; font-weight: 800;
    border-radius: 0 0 0 4px; letter-spacing: 1px; z-index: 1;
}

/* ====== Detail Card ====== */
.detail-card { background: #111; border: 1px solid #222; border-radius: 6px; padding: 1.5rem; }
.detail-card-body { display: flex; gap: 1.5rem; align-items: flex-start; }
.detail-card-image { flex-shrink: 0; }
.detail-card-image img { max-width: 300px; max-height: 200px; object-fit: cover; border-radius: 6px; }
.detail-card-info { flex: 1; }
.detail-row { display: flex; padding: 0.75rem 0; border-bottom: 1px solid #1a1a1a; }
.detail-row:last-child { border-bottom: none; }
.detail-label { width: 120px; font-weight: 600; color: #888; text-transform: uppercase; font-size: 0.8rem; }
.detail-value { flex: 1; color: #fff; font-size: 0.95rem; }
.points-row td { border-top: 3px solid #e6b800; font-weight: 700; background: #1a1708; }
.points-row td:first-child { text-transform: uppercase; font-size: 0.75rem; color: #e6b800; letter-spacing: 1px; }
.points-row td.best-run { color: #e6b800; }
@media (max-width: 600px) {
    .detail-card-body { flex-direction: column; }
    .detail-card-image img { max-width: 100%; }
}

/* ====== Judge Roles & Weights ====== */
.judge-info { font-size: 0.8em; color: #999; font-weight: 400; }
.judge-role { font-size: 0.75em; color: #999; font-weight: 400; }
.badge-weighted { background: #b388ff; color: #1a1a1a; padding: 0.15rem 0.5rem;
    font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; margin-left: 0.5rem; border-radius: 2px; }
