*{box-sizing:border-box}
:root{color-scheme:dark}
body{margin:0;min-height:100vh;padding-bottom:35px;font-family:Arial,Helvetica,sans-serif;background:radial-gradient(circle at top,#1d4ed8 0%,#0f172a 55%,#050816 100%);color:#fff}
.hidden{display:none!important}
.header{text-align:center;padding:24px 15px 18px}
.logo{font-size:48px;font-weight:900;letter-spacing:-1px}
.mode{margin-top:7px;color:#facc15;font-size:26px;font-weight:800}
.setup-card,.countdown-card{width:min(92%,560px);margin:25px auto;padding:30px;background:#202427;border:1px solid rgba(255,255,255,.12);border-radius:26px;box-shadow:0 25px 70px rgba(0,0,0,.45)}
.setup-card h1,.countdown-card h1{text-align:center;margin-top:0}
.muted{color:#aeb8c8;text-align:center}
label{display:block;margin:15px 0 7px;font-weight:800}
.text-input{width:100%;padding:15px;border:2px solid transparent;border-radius:14px;background:#f8fafc;color:#111827;font-size:18px;outline:none}
.text-input:focus{border-color:#2563eb}
.room-code-input{text-transform:uppercase;letter-spacing:5px;font-weight:900;text-align:center}
.primary-button,.secondary-button,.small-button,.ready-button,.send-button,.result-button{border:0;border-radius:15px;color:#fff;font-weight:900;cursor:pointer;transition:.2s}
.primary-button,.secondary-button,.ready-button{width:100%;padding:16px;margin-top:14px;font-size:18px}
.primary-button{background:#2563eb}
.secondary-button{background:#16a34a}
.ready-button{background:#f59e0b;color:#111827}
.ready-button.ready{background:#16a34a;color:white}
.small-button{padding:12px 16px;background:#2563eb}
button:hover{transform:translateY(-2px)}
button:disabled{cursor:not-allowed;opacity:.5;transform:none}
.divider{display:flex;align-items:center;gap:12px;margin:22px 0;color:#94a3b8}
.divider:before,.divider:after{content:"";flex:1;height:1px;background:#475569}
.setup-message{min-height:24px;margin-top:15px;text-align:center;color:#fca5a5;font-weight:700}
.room-code-large{text-align:center;font-size:43px;letter-spacing:8px;font-weight:900;color:#facc15}
.share-row{display:flex;gap:8px}
.waiting-animation{text-align:center;font-size:65px;margin:25px 0;animation:ball 1s infinite alternate}
@keyframes ball{to{transform:translateY(-14px) rotate(25deg)}}
#waitingStatus{text-align:center;font-weight:800}
.ready-lobby{margin-top:24px;padding:20px;background:#111827;border-radius:20px}
.ready-lobby h2{margin-top:0;text-align:center}
.ready-player-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0;padding:14px;background:#202427;border-radius:14px;font-size:17px;font-weight:800}
.ready-state{padding:7px 10px;border-radius:10px;font-size:14px}
.ready-state.waiting{background:#3f2f0b;color:#fde68a}
.ready-state.ready{background:#08351a;color:#86efac}
.ready-message{min-height:24px;margin-top:12px;text-align:center;color:#cbd5e1;font-weight:800}
.countdown-card{text-align:center}
.countdown-kicker{color:#4ade80;font-size:24px;font-weight:900}
.start-countdown{width:125px;height:125px;margin:24px auto;display:grid;place-items:center;border-radius:50%;background:#2563eb;font-size:55px;font-weight:900;box-shadow:0 0 40px rgba(37,99,235,.55)}
.countdown-note{color:#94a3b8}
.game-container{width:96%;max-width:1380px;min-height:650px;margin:0 auto;padding:22px;display:grid;grid-template-columns:270px minmax(400px,1fr) 330px;gap:22px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.14);border-radius:30px;box-shadow:0 25px 70px rgba(0,0,0,.45);backdrop-filter:blur(12px)}
.panel{padding:22px;background:#202427;border-radius:24px;box-shadow:0 15px 35px rgba(0,0,0,.22)}
.panel-title{margin:0 0 20px;font-size:25px;font-weight:800;text-align:center}
.info-card{margin-bottom:13px;padding:14px;background:#111827;border:2px solid transparent;border-radius:16px;text-align:center;transition:.25s}
.info-card.match-warning{background:#7f1d1d;border-color:#ef4444;box-shadow:0 0 22px rgba(239,68,68,.42);animation:warningPulse .8s infinite alternate}
.info-label{color:#94a3b8;font-size:14px;font-weight:bold}
.info-value{display:block;margin-top:5px;color:#fff;font-size:25px;font-weight:900}
.ranking-title{margin:24px 0 12px;font-size:21px;text-align:center}
.ranking-list{display:flex;flex-direction:column;gap:10px}
.ranking-player{min-height:72px;padding:14px;display:flex;align-items:center;justify-content:space-between;background:#111827;border:2px solid transparent;border-radius:17px;transition:.25s}
.ranking-player.first{border-color:#22c55e;background:#092f1b}
.ranking-player.second{border-color:#ef4444;background:#351313}
.ranking-player.tie{border-color:#facc15;background:#332d0e}
.ranking-position{font-size:25px;font-weight:900}
.ranking-name{flex:1;margin-left:10px;font-size:18px;font-weight:bold}
.ranking-score{font-size:20px;font-weight:900}
.movement{display:block;margin-top:4px;font-size:13px}
.movement-up{color:#4ade80}.movement-down{color:#f87171}
.game-ended-label{margin-bottom:18px;padding:14px;background:#111827;border-radius:16px;color:#facc15;font-size:18px;font-weight:900;text-align:center}
.question{margin:0 0 20px;font-size:29px;line-height:1.25;text-align:center}
.top-seven-list{display:flex;flex-direction:column;gap:10px}
.top-row{min-height:56px;padding:13px 17px;display:flex;align-items:center;background:#111;border:1px solid rgba(255,255,255,.04);border-radius:17px;color:#fff;font-size:18px;font-weight:700;transition:.3s}
.top-row .position{width:38px;flex-shrink:0;text-align:right}
.top-row .content{flex:1;text-align:center}
.top-row.completed-answer{background:#07351a;border-color:#166534;color:#4ade80}
.top-row.new-answer-animation{animation:newAnswerFlash .8s ease}
@keyframes newAnswerFlash{0%{transform:scale(.96);background:#16a34a}40%{transform:scale(1.025);background:#15803d;box-shadow:0 0 28px rgba(34,197,94,.7)}100%{transform:scale(1);background:#111;box-shadow:none}}
.answer-note{margin-top:17px;padding:13px;background:#07351a;border:1px solid #166534;border-radius:15px;color:#4ade80;font-weight:bold;text-align:center}
.play-panel{display:flex;flex-direction:column}
.turn-label{color:#94a3b8;font-size:15px;text-align:center}
.current-turn{margin-top:6px;color:#facc15;font-size:26px;font-weight:900;text-align:center}
.answer-timer{width:105px;height:105px;margin:22px auto;display:flex;align-items:center;justify-content:center;background:#16a34a;border:7px solid rgba(255,255,255,.16);border-radius:50%;color:#fff;font-size:39px;font-weight:900;box-shadow:0 12px 30px rgba(22,163,74,.35);transition:.25s}
.answer-timer.answer-warning{background:#ef4444;box-shadow:0 12px 30px rgba(239,68,68,.45);animation:warningPulse .65s infinite alternate}
@keyframes warningPulse{from{transform:scale(1)}to{transform:scale(1.05)}}
.answer-input{width:100%;padding:16px;background:#f8fafc;border:3px solid transparent;border-radius:15px;outline:none;color:#111827;font-size:18px}
.answer-input:focus{border-color:#2563eb}
.send-button,.result-button{width:100%;padding:16px;margin-top:13px;background:#2563eb;font-size:18px}
.next-button{background:#16a34a}
.message{min-height:52px;margin-top:15px;padding:13px;display:flex;align-items:center;justify-content:center;background:#111827;border-radius:15px;font-size:16px;font-weight:bold;text-align:center}
.result-panel{text-align:center}
.result-icon{font-size:54px}
.result-title{margin-top:5px;font-size:41px;font-weight:500}
.result-title.win{color:#22c55e}.result-title.lose{color:#ff414b}.result-title.draw{color:#facc15}
.result-scores{margin:24px 0;font-size:24px;line-height:1.25}
.result-list-title{margin:22px 0 15px;font-size:26px;font-weight:900}
.result-answer-list{display:flex;flex-direction:column;gap:9px}
.result-row{min-height:49px;padding:12px;display:flex;align-items:center;background:#111;border-radius:15px;color:#fff;font-size:16px;font-weight:bold}
.result-row .position{width:32px;flex-shrink:0;text-align:right}
.result-row .content{flex:1;text-align:center}
.owner-badge{display:inline-flex;align-items:center;justify-content:center;min-width:31px;height:25px;margin-right:7px;padding:0 7px;border-radius:8px;font-size:13px;font-weight:900}
.owner-self{background:#14532d;border:1px solid #22c55e;color:#86efac}
.owner-rival{background:#450a0a;border:1px solid #ef4444;color:#fca5a5}
.rematch-status{min-height:48px;margin:18px 0 5px;padding:12px;background:#111827;border-radius:14px;color:#cbd5e1;font-weight:800}
@media(max-width:1050px){.game-container{grid-template-columns:240px 1fr}.play-panel,.result-panel{grid-column:1/-1}}
@media(max-width:720px){.logo{font-size:36px}.mode{font-size:21px}.game-container{width:94%;padding:14px;grid-template-columns:1fr}.question{font-size:23px}.panel{padding:17px}.share-row{flex-direction:column}}


.game-log-card{margin-top:18px;padding:14px;background:#111827;border:1px solid rgba(255,255,255,.08);border-radius:17px}
.activity-title{margin-bottom:10px;color:#facc15;font-size:15px;font-weight:900;text-align:center;text-transform:uppercase;letter-spacing:.4px}
.game-log-list{display:flex;flex-direction:column;gap:8px}
.game-log-item{padding:10px 11px;background:#202427;border-radius:11px;font-size:13px;font-weight:800;line-height:1.35;word-break:break-word}
.game-log-item.correct{border-left:4px solid #22c55e}
.game-log-item.wrong,.game-log-item.timeout{border-left:4px solid #ef4444}
.game-log-item.hint{border-left:4px solid #facc15;color:#fde68a}
.game-log-empty{padding:10px;color:#94a3b8;font-size:13px;text-align:center}
.hint-answer{color:#facc15;letter-spacing:2px;font-weight:900}


.sound-toggle{position:fixed;top:18px;right:20px;z-index:1000;width:48px;height:48px;border:1px solid rgba(255,255,255,.18);border-radius:50%;background:#111827;color:#fff;font-size:23px;cursor:pointer;box-shadow:0 10px 30px rgba(0,0,0,.28);transition:.2s}
.sound-toggle:hover{transform:scale(1.06)}
.sound-toggle.muted{background:#450a0a;border-color:#ef4444}
.sound-toast{position:fixed;top:76px;right:18px;z-index:1000;padding:10px 14px;border-radius:12px;background:#111827;color:#fff;font-weight:800;box-shadow:0 12px 30px rgba(0,0,0,.35)}
.sound-toast.show{animation:soundToast 1.2s ease}
@keyframes soundToast{0%{opacity:0;transform:translateY(-8px)}15%,80%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-8px)}}
.top-row.sound-correct{animation:soundCorrect .45s ease}
@keyframes soundCorrect{0%{transform:scale(.96)}50%{transform:scale(1.035);box-shadow:0 0 28px rgba(34,197,94,.75)}100%{transform:scale(1)}}
.message.sound-wrong{animation:soundWrong .35s ease}
@keyframes soundWrong{0%,100%{transform:translateX(0)}25%{transform:translateX(-8px)}75%{transform:translateX(8px)}}
.hint-answer.sound-hint{animation:soundHint .75s ease}
@keyframes soundHint{0%{opacity:.25;filter:blur(2px)}50%{opacity:1;filter:blur(0);text-shadow:0 0 16px #facc15}100%{text-shadow:none}}
.start-countdown.sound-countdown{animation:soundCountdown .38s ease}
@keyframes soundCountdown{0%{transform:scale(.85)}60%{transform:scale(1.12)}100%{transform:scale(1)}}
.result-panel.sound-result{animation:soundResult .7s ease}
@keyframes soundResult{0%{transform:scale(.92);opacity:.2}100%{transform:scale(1);opacity:1}}


.pin-input{letter-spacing:9px;text-align:center;font-size:24px;font-weight:900}
.auth-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.auth-warning{margin:15px 0 0;color:#94a3b8;font-size:13px;text-align:center}
.profile-card{width:min(94%,820px);margin:25px auto;padding:28px;background:#202427;border:1px solid rgba(255,255,255,.12);border-radius:28px;box-shadow:0 25px 70px rgba(0,0,0,.45)}
.profile-top{display:flex;align-items:center;justify-content:space-between;gap:20px}
.profile-top h1{margin:4px 0 0;font-size:36px}
.profile-kicker{color:#4ade80;font-size:13px;font-weight:900;letter-spacing:1.4px}
.logout-button{padding:11px 16px;border:1px solid #ef4444;border-radius:12px;background:#450a0a;color:#fecaca;font-weight:900;cursor:pointer}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:24px 0}
.stat-card{padding:18px;background:#111827;border-radius:17px;text-align:center}
.stat-card span{display:block;color:#cbd5e1;font-size:14px;font-weight:800}
.stat-card strong{display:block;margin-top:9px;color:#fff;font-size:30px}
.friends-card{padding:20px;background:#111827;border-radius:20px}
.friends-card h2{margin-top:0;text-align:center}
.friend-add-row{display:grid;grid-template-columns:1fr auto;gap:9px}
.friends-list{display:flex;flex-direction:column;gap:9px;margin-top:13px}
.friend-row{display:flex;align-items:center;justify-content:space-between;padding:13px 15px;background:#202427;border-radius:13px;font-weight:800}
.friend-private-label{color:#94a3b8;font-size:12px}
.profile-play-button{margin-top:20px}
@media(max-width:720px){
  .auth-actions{grid-template-columns:1fr}
  .profile-top{align-items:flex-start}
  .stats-grid{grid-template-columns:1fr 1fr}
  .friend-add-row{grid-template-columns:1fr}
}


.auth-card{position:relative;overflow:hidden}
.auth-card:before{content:"";position:absolute;width:180px;height:180px;right:-70px;top:-80px;border-radius:50%;background:rgba(37,99,235,.20)}
.auth-brand-mark{width:82px;height:82px;margin:0 auto 14px;display:grid;place-items:center;border-radius:24px;background:linear-gradient(145deg,#2563eb,#1d4ed8);font-size:44px;box-shadow:0 18px 40px rgba(37,99,235,.35)}
.profile-identity{display:flex;align-items:center;gap:15px}
.profile-avatar{width:78px;height:78px;border:2px solid rgba(255,255,255,.16);border-radius:23px;background:linear-gradient(145deg,#111827,#202427);font-size:39px;cursor:pointer;box-shadow:0 12px 30px rgba(0,0,0,.28)}
.profile-avatar:hover{transform:scale(1.04)}
.profile-online{margin-top:5px;color:#86efac;font-size:13px;font-weight:800}
.online-dot{display:inline-block;width:9px;height:9px;margin-right:5px;border-radius:50%;background:#22c55e;box-shadow:0 0 12px rgba(34,197,94,.8)}
.avatar-picker{margin:18px 0;padding:16px;background:#111827;border:1px solid rgba(255,255,255,.1);border-radius:18px}
.avatar-picker-title{margin-bottom:12px;color:#facc15;font-weight:900;text-align:center}
.avatar-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:9px}
.avatar-option{min-height:52px;border:2px solid transparent;border-radius:13px;background:#202427;font-size:28px;cursor:pointer}
.avatar-option:hover{border-color:#2563eb;transform:translateY(-2px)}
.private-stats-note{margin:18px 0 0;padding:11px 14px;border:1px solid rgba(34,197,94,.24);border-radius:13px;background:#092f1b;color:#86efac;font-size:13px;font-weight:800;text-align:center}
.stat-card{position:relative;overflow:hidden;transition:.2s}
.stat-card:hover{transform:translateY(-3px);box-shadow:0 12px 25px rgba(0,0,0,.24)}
.friend-row:before{content:"●";margin-right:8px;color:#22c55e;font-size:11px}
@media(max-width:720px){
  .profile-identity{align-items:flex-start}
  .profile-avatar{width:64px;height:64px;font-size:32px}
  .avatar-grid{grid-template-columns:repeat(4,1fr)}
}

.owner-system{background:#3f2f0b;border:1px solid #facc15;color:#fde68a}


.result-navigation{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px;padding-top:12px;border-top:1px solid rgba(255,255,255,.1)}
.profile-button{background:#7c3aed}
.menu-button{background:#334155}
@media(max-width:720px){.result-navigation{grid-template-columns:1fr}}


.waiting-menu-button{margin-top:18px;background:#334155}
.friend-invite-category{margin-bottom:16px;padding:14px;background:#202427;border-radius:14px}
.friend-invite-category label{margin-top:0}
.friend-row{gap:10px}
.friend-main{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.friend-actions{display:flex;align-items:center;gap:8px}
.friend-invite-button{padding:9px 12px;border:0;border-radius:10px;background:#2563eb;color:#fff;font-weight:900;cursor:pointer;white-space:nowrap}
.friend-invite-button:hover{transform:translateY(-1px)}
.friend-invite-button:disabled{opacity:.55;cursor:not-allowed;transform:none}
.invite-modal{position:fixed;inset:0;z-index:3000;display:grid;place-items:center;padding:20px;background:rgba(2,6,23,.78);backdrop-filter:blur(8px)}
.invite-modal-card{width:min(92vw,430px);padding:28px;background:#202427;border:1px solid rgba(255,255,255,.14);border-radius:25px;box-shadow:0 30px 80px rgba(0,0,0,.55);text-align:center}
.invite-modal-icon{font-size:56px}
.invite-modal-card h2{margin:8px 0 10px;font-size:31px}
.invite-modal-card p{color:#cbd5e1;line-height:1.5}
.invite-category-badge{display:inline-flex;margin:10px 0 16px;padding:9px 14px;border-radius:12px;background:#08351a;color:#86efac;font-weight:900}
.invite-modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.reject-invite-button{background:#b91c1c}
@media(max-width:720px){
  .friend-row{align-items:flex-start;flex-direction:column}
  .friend-actions{width:100%}
  .friend-invite-button{width:100%}
  .invite-modal-actions{grid-template-columns:1fr}
}


.setup-profile-button{margin-top:12px;background:#7c3aed}


.game-selection-screen{width:min(94%,980px);margin:25px auto;padding:30px;background:#202427;border:1px solid rgba(255,255,255,.12);border-radius:28px;box-shadow:0 25px 70px rgba(0,0,0,.45)}
.game-selection-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:24px}
.game-selection-header h1{margin:5px 0 4px;font-size:38px}
.game-selection-subtitle{text-align:left;margin:0}
.game-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.game-mode-card{min-height:235px;padding:24px;border:2px solid rgba(255,255,255,.08);border-radius:24px;background:#111827;color:#fff;text-align:left;display:flex;flex-direction:column;justify-content:space-between;transition:.25s}
button.game-mode-card{cursor:pointer}
.active-game-card{border-color:#2563eb;background:linear-gradient(145deg,#10234f,#111827)}
.active-game-card:hover{transform:translateY(-5px);border-color:#60a5fa;box-shadow:0 20px 45px rgba(37,99,235,.24)}
.coming-soon-card{opacity:.72;background:linear-gradient(145deg,#202427,#111827)}
.game-mode-icon{font-size:52px}
.game-mode-info h2{margin:15px 0 8px;font-size:28px}
.game-mode-info p{margin:0 0 16px;color:#cbd5e1;line-height:1.5}
.game-status-badge{display:inline-flex;padding:8px 12px;border-radius:10px;font-size:13px;font-weight:900;letter-spacing:.6px}
.game-status-badge.available{background:#14532d;color:#86efac}
.game-status-badge.coming{background:#3f2f0b;color:#fde68a}
.setup-game-label{margin-bottom:8px;color:#facc15;font-size:14px;font-weight:900;text-align:center;letter-spacing:1px}
.setup-navigation-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.setup-navigation-buttons .secondary-button{margin-top:0}
.back-games-button{background:#334155}
@media(max-width:720px){
  .game-selection-header{flex-direction:column}
  .game-selection-header .logout-button{width:100%}
  .game-card-grid{grid-template-columns:1fr}
  .setup-navigation-buttons{grid-template-columns:1fr}
}


.top-seven-friends-card{margin-top:18px;padding:18px;background:#111827;border:1px solid rgba(255,255,255,.08);border-radius:18px}
.top-seven-friends-card h2{margin:0 0 6px;text-align:center}
.invite-helper-text{margin:0 0 14px;font-size:14px}
.profile-card .friend-invite-category{display:none}
.profile-card .friend-invite-button{display:none}

.level-card{margin:20px 0;padding:18px;background:linear-gradient(145deg,#111827,#172033);border:1px solid rgba(96,165,250,.22);border-radius:19px}
.level-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.level-label{color:#94a3b8;font-size:12px;font-weight:900;letter-spacing:1.2px}
.level-name{margin-top:3px;color:#fff;font-size:20px;font-weight:900}
.level-number{width:48px;height:48px;display:grid;place-items:center;border-radius:15px;background:#2563eb;color:#fff;font-size:24px;font-weight:900}
.xp-progress-shell{height:14px;margin-top:16px;overflow:hidden;border-radius:999px;background:#0b1220;border:1px solid rgba(255,255,255,.08)}
.xp-progress-fill{height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,#2563eb,#22c55e);transition:width .7s ease}
.xp-progress-text{display:flex;justify-content:space-between;gap:10px;margin-top:9px;color:#cbd5e1;font-size:13px;font-weight:800}
.match-xp-summary{margin:16px 0;padding:16px;background:#111827;border:1px solid rgba(250,204,21,.22);border-radius:16px}
.match-xp-title{color:#facc15;font-size:16px;font-weight:900;text-align:center}
.match-xp-lines{display:flex;flex-direction:column;gap:7px;margin-top:12px;color:#cbd5e1;font-size:14px}
.match-xp-line{display:flex;justify-content:space-between;gap:12px}
.match-xp-total{margin-top:12px;padding-top:10px;border-top:1px solid rgba(255,255,255,.1);color:#86efac;font-size:22px;font-weight:900;text-align:center}
.level-up-overlay{position:fixed;inset:0;z-index:4000;display:grid;place-items:center;background:rgba(2,6,23,.74);backdrop-filter:blur(8px)}
.level-up-card{width:min(88vw,420px);padding:34px 26px;border:1px solid rgba(250,204,21,.35);border-radius:28px;background:linear-gradient(145deg,#1f2937,#111827);text-align:center;animation:levelUpPop .6s ease}
.level-up-icon{font-size:64px}
.level-up-kicker{margin-top:8px;color:#facc15;font-size:18px;font-weight:900;letter-spacing:1.6px}
.level-up-text{margin-top:8px;color:#fff;font-size:34px;font-weight:900}
@keyframes levelUpPop{0%{transform:scale(.72);opacity:0}65%{transform:scale(1.07);opacity:1}100%{transform:scale(1)}}
@media(max-width:720px){.xp-progress-text{flex-direction:column}.level-name{font-size:18px}}


.grid-game-card{border-color:#16a34a;background:linear-gradient(145deg,#0d3a24,#111827)}
.grid-game-card:hover{border-color:#4ade80;box-shadow:0 20px 45px rgba(34,197,94,.2)}

.grid-shell{width:min(94%,1050px);margin:25px auto;padding:30px;background:#202427;border:1px solid rgba(255,255,255,.12);border-radius:28px;box-shadow:0 25px 70px rgba(0,0,0,.45)}
.grid-page-header,.grid-match-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:22px}
.grid-page-header h1,.grid-match-header h1{margin:5px 0;font-size:38px}
.grid-page-subtitle{text-align:left;margin:0}
.grid-mode-choice{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.grid-battle-mode-card{padding:24px;border:2px solid rgba(255,255,255,.1);border-radius:22px;background:#111827;color:#fff;text-align:left}
button.grid-battle-mode-card{cursor:pointer}
.grid-quick-card{border-color:#16a34a;background:linear-gradient(145deg,#0c3b21,#111827);transition:.2s}
.grid-quick-card:hover{transform:translateY(-4px);border-color:#4ade80}
.grid-locked-card{opacity:.55}
.grid-mode-icon{font-size:48px}
.grid-battle-mode-card h2{margin:12px 0 7px;font-size:27px}
.grid-battle-mode-card p{color:#cbd5e1;line-height:1.5}
.grid-battle-mode-card span{display:inline-flex;padding:7px 11px;border-radius:9px;background:#14532d;color:#86efac;font-size:12px;font-weight:900}
.grid-locked-card span{background:#3f2f0b;color:#fde68a}
.grid-difficulty-panel{margin-top:18px;padding:18px;background:#111827;border-radius:18px}
.grid-difficulty-panel h2{margin-top:0;text-align:center}
.grid-difficulty-options{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.grid-difficulty{padding:13px;border:2px solid transparent;border-radius:13px;background:#202427;color:#fff;font-size:20px;font-weight:900}
.grid-difficulty small{display:block;margin-top:3px;color:#94a3b8;font-size:11px}
.grid-difficulty.active{border-color:#22c55e;background:#0b3b22}
.grid-difficulty.locked{opacity:.45}

.grid-lobby-card{width:min(94%,720px)}
.grid-rule-strip{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin:16px 0}
.grid-rule-strip span{padding:10px;border-radius:10px;background:#111827;color:#dbeafe;font-size:13px;font-weight:800;text-align:center}
.grid-created-room{margin:16px 0;padding:16px;border-radius:16px;background:#111827}

.grid-game-screen{width:min(97%,1500px);margin:18px auto 35px}
.grid-match-header{padding:18px 22px;background:#202427;border:1px solid rgba(255,255,255,.1);border-radius:22px}
.grid-match-header h1{font-size:30px}
.grid-countdown-panel{min-height:520px;display:grid;place-items:center;align-content:center;background:#202427;border-radius:24px}
.grid-countdown-label{color:#94a3b8;font-weight:900;letter-spacing:2px}
.grid-countdown-number{font-size:120px;font-weight:1000;color:#facc15}
.grid-battle-layout{display:grid;grid-template-columns:230px minmax(0,1fr) 280px;gap:14px}
.grid-side-panel,.grid-board-card,.grid-log-panel{background:#202427;border:1px solid rgba(255,255,255,.1);border-radius:20px}
.grid-side-panel,.grid-log-panel{padding:16px}
.grid-player-card{padding:14px;border-radius:14px;background:#111827;margin-bottom:10px}
.grid-player-card span{display:block;color:#94a3b8;font-size:12px;font-weight:900}
.grid-player-card strong{display:block;margin-top:4px;font-size:20px}
.grid-player-card small{font-size:22px}
.grid-player-card.self{border:1px solid #3b82f6}
.grid-player-card.rival{border:1px solid #ef4444}
.grid-turn-card{padding:14px;margin:12px 0;border-radius:15px;background:#0f172a;text-align:center}
.grid-turn-card span{color:#94a3b8;font-size:11px;font-weight:900}
.grid-turn-card strong{display:block;margin:5px 0;color:#facc15;font-size:18px}
.grid-turn-timer{width:76px;height:76px;margin:8px auto 0;display:grid;place-items:center;border-radius:50%;background:#16a34a;color:#fff;font-size:31px;font-weight:1000}
.grid-turn-timer.danger{background:#dc2626;animation:gridPulse .6s infinite alternate}
@keyframes gridPulse{to{transform:scale(1.06)}}
.grid-used-panel{margin-top:16px}
.grid-used-panel h3{font-size:14px}
.grid-used-list{display:flex;flex-direction:column;gap:5px;color:#cbd5e1;font-size:12px;max-height:220px;overflow:auto}

.grid-board-card{padding:16px}
.football-grid-board{display:grid;grid-template-columns:140px repeat(3,minmax(125px,1fr));gap:7px}
.grid-axis-corner,.grid-axis-header,.grid-row-header,.grid-cell{min-height:104px;border-radius:13px;display:flex;align-items:center;justify-content:center;text-align:center}
.grid-axis-corner{background:#0b1220;color:#64748b;font-size:28px}
.grid-axis-header,.grid-row-header{padding:10px;background:#111827;color:#fff;font-weight:900}
.grid-axis-header small,.grid-row-header small{display:block;color:#94a3b8;font-size:10px}
.grid-cell{position:relative;padding:8px;border:2px solid rgba(255,255,255,.08);background:#0e141b;color:#fff;cursor:pointer;transition:.15s;overflow:hidden}
.grid-cell:hover{border-color:#60a5fa;transform:translateY(-1px)}
.grid-cell.selected{border-color:#facc15;box-shadow:0 0 0 2px rgba(250,204,21,.15)}
.grid-cell.claimed-p1{border-color:#3b82f6;background:linear-gradient(145deg,#0b2a56,#111827)}
.grid-cell.claimed-p2{border-color:#ef4444;background:linear-gradient(145deg,#521414,#111827)}
.grid-cell.winning{animation:gridWinGlow .7s infinite alternate}
@keyframes gridWinGlow{to{box-shadow:0 0 25px rgba(250,204,21,.9);border-color:#facc15}}
.grid-cell-player{font-weight:1000;line-height:1.15}
.grid-cell-owner{position:absolute;top:6px;right:7px;font-size:16px}
.grid-selection-info{margin-top:11px;padding:11px;border-radius:11px;background:#111827;color:#cbd5e1;text-align:center;font-weight:800}
.grid-answer-row{display:grid;grid-template-columns:1fr auto;gap:9px;margin-top:10px}
.grid-answer-row .primary-button{margin:0;width:auto}
.grid-log-panel h3{margin-top:0}
.grid-game-log{display:flex;flex-direction:column;gap:7px;max-height:650px;overflow:auto}
.grid-log-item{padding:9px 10px;border-radius:10px;background:#111827;color:#dbeafe;font-size:12px;line-height:1.35}
.grid-log-item.correct{border-left:3px solid #22c55e}
.grid-log-item.wrong{border-left:3px solid #ef4444}
.grid-log-item.system{border-left:3px solid #facc15}
.grid-result-panel{padding:35px;background:#202427;border:1px solid rgba(255,255,255,.1);border-radius:24px;text-align:center}
.grid-result-icon{font-size:68px}
.grid-result-panel h1{font-size:42px;margin:5px}
.grid-winning-line{margin:18px auto;max-width:560px;color:#facc15;font-weight:900}
.grid-result-actions{grid-template-columns:repeat(3,1fr)}

@media(max-width:1050px){
  .grid-battle-layout{grid-template-columns:1fr}
  .grid-side-panel{display:grid;grid-template-columns:1fr 1fr 1fr;gap:9px}
  .grid-player-card,.grid-turn-card{margin:0}
  .grid-used-panel{grid-column:1/-1}
  .grid-log-panel{max-height:260px}
  .grid-game-log{max-height:190px}
}
@media(max-width:760px){
  .grid-page-header,.grid-match-header{flex-direction:column}
  .grid-mode-choice,.grid-difficulty-options{grid-template-columns:1fr}
  .grid-rule-strip{grid-template-columns:1fr}
  .grid-side-panel{grid-template-columns:1fr 1fr}
  .grid-turn-card{grid-column:1/-1;grid-row:1}
  .football-grid-board{grid-template-columns:92px repeat(3,minmax(78px,1fr));gap:4px}
  .grid-axis-corner,.grid-axis-header,.grid-row-header,.grid-cell{min-height:84px;font-size:12px;border-radius:9px}
  .grid-cell-player{font-size:11px}
  .grid-answer-row{grid-template-columns:1fr}
  .grid-result-actions{grid-template-columns:1fr}
}


.grid-long-card{border-color:#f59e0b;background:linear-gradient(145deg,#4b3109,#111827);transition:.2s}
.grid-long-card:hover{transform:translateY(-4px);border-color:#facc15}
.grid-long-card span{background:#713f12;color:#fde68a}

.grid-draft-panel{padding:22px;background:#202427;border:1px solid rgba(255,255,255,.1);border-radius:22px}
.grid-draft-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}
.grid-draft-header h2{margin:4px 0}
.grid-draft-turn{min-width:150px;padding:12px;border-radius:13px;background:#111827;text-align:center}
.grid-draft-turn span{display:block;color:#94a3b8;font-size:11px;font-weight:900}
.grid-draft-turn strong{display:block;margin-top:4px;color:#facc15;font-size:18px}
.grid-draft-preview-wrap{padding:14px;background:#111827;border-radius:17px}
.grid-draft-preview{display:grid;grid-template-columns:125px repeat(3,1fr);gap:6px}
.grid-draft-preview-cell{min-height:72px;padding:8px;border-radius:10px;background:#0e141b;border:1px dashed rgba(255,255,255,.14);display:grid;place-items:center;text-align:center;color:#94a3b8;font-size:12px;font-weight:800}
.grid-draft-preview-cell.filled{border-style:solid;border-color:#475569;background:#172033;color:#fff}
.grid-draft-preview-cell.corner{font-size:23px;color:#64748b}
.grid-draft-input-card{margin-top:14px;padding:18px;background:#111827;border-radius:16px}
.grid-draft-input-card .primary-button{margin-bottom:0}
.grid-first-placement{margin:12px 0}
.grid-first-placement-title{margin-bottom:8px;color:#fde68a;font-size:13px;font-weight:900}
.grid-position-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.grid-position-button{padding:10px;border:2px solid transparent;border-radius:10px;background:#202427;color:#fff;font-weight:900;cursor:pointer}
.grid-position-button.active{border-color:#facc15;background:#3f2f0b}
.grid-draft-help{margin-top:12px;padding:12px;border-radius:12px;background:#0f172a;color:#cbd5e1;font-size:12px;line-height:1.5}
@media(max-width:720px){
  .grid-draft-header{flex-direction:column}
  .grid-draft-turn{width:100%}
  .grid-draft-preview{grid-template-columns:86px repeat(3,minmax(65px,1fr));gap:4px}
  .grid-draft-preview-cell{min-height:63px;font-size:10px}
}


.grid-player-search-wrap{position:relative;min-width:0}
.grid-player-search-wrap .text-input{margin:0}
.grid-player-suggestions{position:absolute;left:0;right:0;top:calc(100% + 5px);z-index:1200;max-height:250px;overflow:auto;padding:6px;background:#0b1220;border:1px solid rgba(255,255,255,.16);border-radius:12px;box-shadow:0 18px 45px rgba(0,0,0,.55)}
.grid-player-suggestion{width:100%;padding:10px 12px;border:0;border-radius:8px;background:transparent;color:#fff;text-align:left;font-weight:800;cursor:pointer}
.grid-player-suggestion:hover,.grid-player-suggestion.active{background:#1e293b}
.grid-player-suggestion small{display:block;margin-top:2px;color:#64748b;font-size:10px;font-weight:700}


.grid-criterion-type{
  margin:12px 0;
  padding:12px;
  border-radius:12px;
  background:#0f172a;
  border:1px solid rgba(255,255,255,.08)
}
.grid-criterion-type .grid-position-buttons{
  grid-template-columns:1fr 1fr;
}


.site-footer{
  width:min(1180px,calc(100% - 32px));
  margin:18px auto 24px;
  padding:14px 18px;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  color:#94a3b8;
  font-size:12px;
  font-weight:700;
  text-align:center;
}
.footer-divider{color:#475569}
@media(max-width:640px){
  .site-footer{
    margin-top:12px;
    font-size:11px;
  }
}


/* ===== Online Football Clash Dashboard v2.4 ===== */
#profileScreen{
  padding:18px;
}
.ofc-dashboard-shell{
  width:min(1500px,calc(100vw - 36px));
  margin:0 auto;
  display:grid;
  grid-template-columns:360px minmax(0,1fr) 410px;
  gap:18px;
  align-items:start;
}
.ofc-profile-panel,.ofc-main-panel,.ofc-daily-card,.ofc-friends-card{
  background:linear-gradient(180deg,rgba(8,18,29,.98),rgba(5,13,22,.98));
  border:1px solid rgba(148,163,184,.18);
  border-radius:20px;
  box-shadow:0 18px 48px rgba(0,0,0,.25);
}
.ofc-profile-panel,.ofc-main-panel{padding:20px}
.ofc-right-panel{display:grid;gap:18px}
.ofc-daily-card,.ofc-friends-card{padding:18px}
.ofc-panel-title,.ofc-section-heading,.ofc-right-heading>span{
  color:#22c55e;
  font-weight:1000;
  letter-spacing:.02em;
  font-size:18px;
}
.ofc-panel-subtitle{margin:7px 0 18px;color:#cbd5e1}
.ofc-avatar-wrap{position:relative;width:150px;height:150px;margin:8px auto 6px}
.ofc-avatar{
  width:100%;height:100%;border-radius:50%;display:grid;place-items:center;
  font-size:76px;border:2px solid #22c55e;background:#07111b;
  box-shadow:0 0 35px rgba(34,197,94,.08)
}
.ofc-avatar-edit{
  position:absolute;right:-2px;bottom:15px;width:38px;height:38px;border:0;border-radius:50%;
  background:#22c55e;color:#fff;font-weight:1000;cursor:pointer
}
.ofc-profile-name{text-align:center;margin:4px 0 2px;font-size:30px}
.ofc-online-row{display:flex;justify-content:center;align-items:center;gap:8px;color:#22c55e;margin-bottom:18px}
.ofc-online-dot{width:9px;height:9px;border-radius:50%;background:#22c55e;box-shadow:0 0 10px #22c55e}
.ofc-level-card{padding:15px;border:1px solid rgba(148,163,184,.2);border-radius:16px;background:#07111b}
.ofc-level-top{display:grid;grid-template-columns:52px 1fr;gap:12px;align-items:center}
.ofc-level-badge{width:46px;height:52px;display:grid;place-items:center;background:#155eef;color:#fff;border-radius:12px;font-size:24px;font-weight:1000}
.ofc-level-name{font-weight:1000;font-size:15px}
.ofc-level-bar{height:10px;background:#111827;border-radius:999px;overflow:hidden;margin:10px 0 6px}
.ofc-level-fill{height:100%;width:0;background:linear-gradient(90deg,#16a34a,#22c55e);border-radius:999px}
.ofc-level-meta{display:flex;justify-content:space-between;color:#cbd5e1;font-size:11px;font-weight:800}
.ofc-stats-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:16px 0}
.ofc-stat-card{padding:15px 10px;border-radius:14px;background:#07111b;border:1px solid rgba(148,163,184,.12);text-align:center}
.ofc-stat-card span{display:block;color:#e2e8f0;font-size:13px}
.ofc-stat-card strong{display:block;font-size:30px;margin-top:5px}
.ofc-stat-card:nth-child(1) strong{color:#22c55e}
.ofc-stat-card:nth-child(2) strong{color:#ef4444}
.ofc-stat-card:nth-child(3) strong{color:#fbbf24}
.ofc-stat-card:nth-child(4) strong{color:#38bdf8}
.ofc-secondary-wide,.ofc-logout-button,.ofc-outline-button{
  width:100%;padding:13px 15px;border-radius:12px;font-weight:900;cursor:pointer
}
.ofc-secondary-wide{display:flex;justify-content:space-between;background:#07111b;color:#fff;border:1px solid rgba(148,163,184,.2)}
.ofc-private-note{margin-top:13px;padding:13px;border:1px solid rgba(34,197,94,.55);border-radius:12px;color:#22c55e;text-align:center;font-size:12px;font-weight:900}
.ofc-logout-button{margin-top:12px;border:1px solid #ef4444;background:#3f0808;color:#fff}
.ofc-game-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.ofc-game-card{
  border-radius:18px;overflow:hidden;background:#07111b;color:#fff;text-align:left;
  border:1px solid #22c55e;cursor:pointer;padding:0;transition:.2s
}
.ofc-game-card:hover{transform:translateY(-3px);box-shadow:0 16px 34px rgba(0,0,0,.3)}
.ofc-grid-card{border-color:#7c3aed}
.ofc-game-visual{
  min-height:270px;padding:24px;display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:radial-gradient(circle at 50% 45%,rgba(34,197,94,.22),transparent 56%),linear-gradient(180deg,#09261d,#08131a)
}
.ofc-grid-card .ofc-game-visual{background:radial-gradient(circle at 50% 45%,rgba(124,58,237,.35),transparent 58%),linear-gradient(180deg,#1b0a2b,#0b0d19)}
.ofc-trophy{font-size:92px;filter:drop-shadow(0 12px 18px rgba(0,0,0,.4))}
.ofc-grid-mini{display:grid;grid-template-columns:repeat(3,48px);gap:5px;margin-bottom:18px}
.ofc-grid-mini span{height:48px;border:1px solid rgba(168,85,247,.5);border-radius:8px;display:grid;place-items:center;background:rgba(16,8,30,.78)}
.ofc-game-title{text-align:center;font-size:30px;font-weight:1000;line-height:1}
.ofc-game-title span{color:#22c55e}.ofc-grid-card .ofc-game-title span{color:#a855f7}
.ofc-game-card p{padding:14px 18px 2px;color:#cbd5e1;min-height:56px;text-align:center}
.ofc-play-cta{margin:12px 15px 15px;padding:14px 18px;border-radius:11px;background:#16a34a;text-align:center;font-size:18px;font-weight:1000;display:flex;justify-content:space-between}
.ofc-play-cta.purple{background:#5b21b6}
.ofc-quick-card,.ofc-settings-card{margin-top:14px;padding:18px;border-radius:16px;background:#07111b;border:1px solid rgba(148,163,184,.14)}
.ofc-quick-card p{color:#cbd5e1}
.ofc-quick-row{display:grid;grid-template-columns:1fr 150px;gap:12px}
.ofc-quick-row .text-input,.ofc-add-friend-row .text-input{margin:0}
.ofc-quick-row .primary-button,.ofc-add-friend-row .primary-button{margin:0}
.ofc-setting-row{display:flex;justify-content:space-between;align-items:center;padding:11px 0;border-bottom:1px solid rgba(148,163,184,.08);font-weight:800}
.ofc-setting-row:last-child{border-bottom:0}
.ofc-toggle{width:54px;height:30px;border:0;border-radius:999px;background:#334155;padding:3px;cursor:pointer}
.ofc-toggle span{display:block;width:24px;height:24px;border-radius:50%;background:#fff;transition:.2s}
.ofc-toggle.active{background:#22c55e}.ofc-toggle.active span{transform:translateX(24px)}
.ofc-right-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.ofc-right-heading small{color:#94a3b8;font-size:11px}
.ofc-task{display:grid;grid-template-columns:42px 1fr auto;gap:10px;align-items:center;padding:13px 8px;border-bottom:1px solid rgba(148,163,184,.08)}
.ofc-task-icon{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#0f172a}
.ofc-task strong,.ofc-task small{display:block}.ofc-task small{color:#94a3b8;margin-top:4px}.ofc-task b{color:#22c55e}
.ofc-outline-button{margin-top:12px;background:transparent;border:1px solid rgba(34,197,94,.6);color:#22c55e}
.ofc-friends-list{display:grid;gap:8px}
.ofc-friend-row{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;padding:9px 0;border-bottom:1px solid rgba(148,163,184,.08)}
.ofc-friend-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#1d4ed8;color:#fff;font-weight:1000}
.ofc-friend-meta strong{display:block}.ofc-friend-meta small{color:#22c55e}
.ofc-friend-invite{padding:7px 10px;border-radius:8px;border:1px solid rgba(148,163,184,.2);background:#0f172a;color:#fff;cursor:pointer}
.ofc-add-friend-row{display:grid;grid-template-columns:1fr 86px;gap:8px;margin-top:12px}
@media(max-width:1180px){
  .ofc-dashboard-shell{grid-template-columns:300px 1fr}
  .ofc-right-panel{grid-column:1/-1;grid-template-columns:1fr 1fr}
}
@media(max-width:820px){
  #profileScreen{padding:10px}
  .ofc-dashboard-shell{width:100%;grid-template-columns:1fr}
  .ofc-right-panel{grid-column:auto;grid-template-columns:1fr}
  .ofc-game-grid{grid-template-columns:1fr}
}


.ofc-legacy-compat{display:none!important}
button.ofc-avatar{
  border:2px solid #22c55e;
  color:#fff;
  cursor:pointer;
  padding:0;
}
.ofc-avatar-wrap .avatar-picker{
  position:absolute;
  z-index:50;
  top:122px;
  left:50%;
  transform:translateX(-50%);
  display:flex;
  gap:6px;
  padding:8px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.25);
  background:#07111b;
  box-shadow:0 14px 34px rgba(0,0,0,.4);
}
.ofc-avatar-wrap .avatar-picker.hidden{display:none}
.ofc-avatar-wrap .avatar-option{
  width:38px;height:38px;border-radius:9px;border:1px solid rgba(148,163,184,.18);
  background:#0f172a;color:#fff;cursor:pointer;font-size:20px
}


/* =========================================================
   Online Football Clash v2.5.0 - Unified post-login UI
   ========================================================= */

:root{
  --ofc-bg:#030b12;
  --ofc-panel:#07111b;
  --ofc-panel-2:#0a1622;
  --ofc-border:rgba(148,163,184,.16);
  --ofc-green:#22c55e;
  --ofc-green-2:#16a34a;
  --ofc-purple:#7c3aed;
  --ofc-blue:#2563eb;
  --ofc-text:#f8fafc;
  --ofc-muted:#94a3b8;
}

/* Common cards after dashboard */
.game-selection-screen,
.grid-shell,
.grid-game-screen,
.game-container,
.countdown-card{
  width:min(1480px,calc(100vw - 36px));
  margin:18px auto 28px;
}

.setup-card,
.countdown-card{
  width:min(760px,calc(100vw - 30px));
  margin:28px auto;
  background:linear-gradient(180deg,rgba(8,18,29,.98),rgba(5,13,22,.98));
  border:1px solid var(--ofc-border);
  border-radius:22px;
  box-shadow:0 22px 60px rgba(0,0,0,.35);
  color:var(--ofc-text);
}

.setup-card{
  padding:26px;
}

.setup-game-label,
.profile-kicker,
.countdown-kicker,
.grid-countdown-label{
  color:var(--ofc-green)!important;
  font-weight:1000;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:12px;
}

.setup-card h1,
.grid-page-header h1,
.grid-match-header h1,
.game-selection-header h1,
.countdown-card h1{
  color:#fff;
  font-weight:1000;
  letter-spacing:-.03em;
}

.setup-card .muted,
.grid-page-subtitle,
.game-selection-subtitle{
  color:#94a3b8!important;
}

.text-input,
select.text-input{
  background:#f8fafc!important;
  color:#0f172a!important;
  border:2px solid transparent!important;
  border-radius:13px!important;
  min-height:50px;
  box-shadow:none!important;
}
.text-input:focus,
select.text-input:focus{
  border-color:#22c55e!important;
  outline:none!important;
}

.primary-button{
  background:linear-gradient(135deg,#16a34a,#22c55e)!important;
  border:0!important;
  border-radius:12px!important;
  color:#fff!important;
  font-weight:1000!important;
  min-height:48px;
  box-shadow:0 10px 24px rgba(34,197,94,.14);
}
.primary-button:hover{filter:brightness(1.06);transform:translateY(-1px)}

.secondary-button,
.logout-button,
.small-button{
  border-radius:11px!important;
  font-weight:900!important;
}

.logout-button{
  background:#3b0a0a!important;
  border:1px solid #ef4444!important;
  color:#fff!important;
}

/* Game selection */
.game-selection-screen,
.grid-shell{
  background:transparent!important;
}

.game-selection-header,
.grid-page-header,
.grid-match-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:20px 24px;
  margin-bottom:16px;
  border:1px solid var(--ofc-border);
  border-radius:18px;
  background:linear-gradient(180deg,#08121d,#06101a);
  box-shadow:0 16px 36px rgba(0,0,0,.22);
}

.game-card-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:18px!important;
}

.game-mode-card{
  min-height:260px!important;
  padding:24px!important;
  text-align:left!important;
  border-radius:18px!important;
  border:1px solid var(--ofc-border)!important;
  background:linear-gradient(180deg,#08121d,#06101a)!important;
  color:#fff!important;
  box-shadow:0 18px 38px rgba(0,0,0,.2)!important;
}
.game-mode-card:hover{transform:translateY(-3px)}
.game-mode-card.active-game-card{
  border-color:rgba(34,197,94,.7)!important;
  background:
    radial-gradient(circle at 85% 15%,rgba(34,197,94,.14),transparent 30%),
    linear-gradient(180deg,#081a15,#06101a)!important;
}
.game-mode-icon{font-size:54px!important}
.game-mode-info h2{font-size:28px!important}
.game-mode-info p{color:#cbd5e1!important}
.game-status-badge.available{
  background:#123d24!important;
  color:#4ade80!important;
  border:1px solid rgba(34,197,94,.55)!important;
}

/* Football Grid mode cards */
.grid-mode-choice{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  gap:18px!important;
}

.grid-battle-mode-card{
  min-height:320px;
  padding:26px!important;
  border-radius:20px!important;
  color:#fff!important;
  background:linear-gradient(180deg,#08121d,#06101a)!important;
  border:1px solid var(--ofc-border)!important;
  box-shadow:0 18px 40px rgba(0,0,0,.22);
}
.grid-quick-card{
  border-color:rgba(34,197,94,.55)!important;
  background:
    radial-gradient(circle at 50% 22%,rgba(34,197,94,.16),transparent 34%),
    linear-gradient(180deg,#081a15,#06101a)!important;
}
.grid-long-card{
  border-color:rgba(124,58,237,.6)!important;
  background:
    radial-gradient(circle at 50% 22%,rgba(124,58,237,.18),transparent 34%),
    linear-gradient(180deg,#160d23,#06101a)!important;
}
.grid-battle-mode-card h2{font-size:30px!important}
.grid-battle-mode-card p{color:#cbd5e1!important;font-size:15px!important}
.grid-battle-mode-card span{
  display:inline-block;
  margin-top:18px;
  padding:10px 18px;
  border-radius:10px;
  background:#16a34a;
  color:#fff!important;
  font-weight:1000;
}
.grid-long-card span{background:#5b21b6}

/* Lobby / waiting */
.grid-lobby-card,
#setupScreen,
#waitingScreen{
  max-width:820px;
}

.grid-rule-strip{
  display:grid!important;
  grid-template-columns:repeat(4,1fr)!important;
  gap:8px!important;
  margin:18px 0!important;
}
.grid-rule-strip span{
  padding:10px 8px!important;
  border-radius:10px!important;
  background:#0b1723!important;
  border:1px solid rgba(148,163,184,.12)!important;
  text-align:center;
  color:#cbd5e1!important;
  font-size:12px;
}

.top-seven-friends-card,
.grid-created-room,
.ready-lobby{
  margin-top:18px!important;
  padding:18px!important;
  border-radius:16px!important;
  background:#07111b!important;
  border:1px solid rgba(148,163,184,.14)!important;
}

.room-code-large{
  color:#22c55e!important;
  background:#06101a!important;
  border:1px solid rgba(34,197,94,.35)!important;
  border-radius:14px!important;
  letter-spacing:.22em!important;
  font-weight:1000!important;
}

.share-row{
  display:grid!important;
  grid-template-columns:1fr auto!important;
  gap:10px!important;
}

.waiting-animation{
  width:92px!important;
  height:92px!important;
  margin:22px auto 12px!important;
  border-radius:50%!important;
  display:grid!important;
  place-items:center!important;
  font-size:48px!important;
  background:#07111b!important;
  border:1px solid rgba(34,197,94,.35)!important;
  box-shadow:0 0 38px rgba(34,197,94,.08)!important;
}

.ready-player-row{
  border-bottom:1px solid rgba(148,163,184,.1)!important;
  padding:11px 0!important;
}

/* Countdown */
.countdown-card{
  padding:42px!important;
  text-align:center!important;
}
.start-countdown,
.grid-countdown-number{
  color:#22c55e!important;
  text-shadow:0 0 36px rgba(34,197,94,.28)!important;
}
.countdown-note{color:#94a3b8!important}

/* Top Seven game */
.game-container:not(.hidden){
  display:grid!important;
  grid-template-columns:300px minmax(0,1fr) 320px!important;
  gap:14px!important;
  background:transparent!important;
}

.game-container .panel{
  background:linear-gradient(180deg,#08121d,#06101a)!important;
  border:1px solid var(--ofc-border)!important;
  border-radius:18px!important;
  color:#fff!important;
  box-shadow:0 18px 40px rgba(0,0,0,.18);
}

.panel-title,
.ranking-title,
.activity-title{
  color:#fff!important;
}
.info-card{
  background:#0b1723!important;
  border:1px solid rgba(148,163,184,.12)!important;
  border-radius:13px!important;
}
.info-label{color:#94a3b8!important}
.info-value{color:#fff!important}

.answer-slot,
.answer-row,
.top-seven-row{
  border-radius:12px!important;
}

.game-log-card{
  background:#07111b!important;
  border:1px solid rgba(148,163,184,.12)!important;
  border-radius:14px!important;
}

/* Football Grid in-game */
.grid-game-screen{
  background:transparent!important;
}
.grid-match-layout,
.grid-game-layout{
  gap:14px!important;
}
.grid-player-panel,
.grid-board-panel,
.grid-log-panel,
.grid-draft-panel,
.grid-countdown-panel{
  background:linear-gradient(180deg,#08121d,#06101a)!important;
  border:1px solid var(--ofc-border)!important;
  border-radius:18px!important;
  color:#fff!important;
  box-shadow:0 18px 40px rgba(0,0,0,.18);
}

.grid-cell,
.grid-axis-cell{
  border-radius:12px!important;
  border:1px solid rgba(148,163,184,.14)!important;
}
.grid-cell{
  background:#07111b!important;
}
.grid-cell:hover{
  border-color:#22c55e!important;
}
.grid-axis-cell{
  background:#0b1723!important;
}

.grid-selection-info,
.grid-game-message{
  background:#0b1723!important;
  border-radius:11px!important;
  color:#e2e8f0!important;
}

/* Invite modal */
.invite-modal-card{
  background:linear-gradient(180deg,#08121d,#06101a)!important;
  border:1px solid rgba(34,197,94,.35)!important;
  border-radius:20px!important;
  color:#fff!important;
  box-shadow:0 28px 80px rgba(0,0,0,.55)!important;
}

/* Mobile */
@media(max-width:980px){
  .game-container{grid-template-columns:1fr!important}
  .grid-mode-choice,.game-card-grid{grid-template-columns:1fr!important}
  .grid-rule-strip{grid-template-columns:1fr 1fr!important}
  .game-selection-header,.grid-page-header,.grid-match-header{
    align-items:flex-start;
    flex-direction:column;
  }
}
@media(max-width:560px){
  .game-selection-screen,.grid-shell,.grid-game-screen,.game-container,.countdown-card{
    width:calc(100vw - 16px);
    margin:8px auto 18px;
  }
  .setup-card{width:calc(100vw - 16px);padding:18px}
  .grid-rule-strip{grid-template-columns:1fr!important}
  .share-row{grid-template-columns:1fr!important}
}


/* =========================================================
   v2.5.1 - Critical screen visibility + viewport fit fix
   ========================================================= */

/* ALWAYS win over layout display rules. Inactive screens must never consume space. */
.hidden{
  display:none!important;
}

/* The app should fit in a normal desktop viewport without requiring page scroll
   on the main dashboard. */
html,body{
  min-height:100%;
}
body{
  overflow-x:hidden;
}

/* Compact global top header */
header,
.app-header,
.main-header{
  padding-top:10px!important;
  padding-bottom:10px!important;
}
.logo{
  font-size:clamp(28px,2.4vw,44px)!important;
  line-height:1!important;
}
.mode{
  font-size:clamp(16px,1.45vw,24px)!important;
  margin-top:6px!important;
}

/* Dashboard should fit inside viewport on standard desktop screens. */
#profileScreen:not(.hidden){
  min-height:calc(100vh - 112px);
  padding:10px 14px 4px!important;
  display:block;
}
#profileScreen .ofc-dashboard-shell{
  width:min(1500px,calc(100vw - 28px));
  gap:12px;
  grid-template-columns:330px minmax(0,1fr) 390px;
  align-items:stretch;
}
#profileScreen .ofc-profile-panel,
#profileScreen .ofc-main-panel{
  padding:15px;
}
#profileScreen .ofc-right-panel{
  gap:12px;
}
#profileScreen .ofc-daily-card,
#profileScreen .ofc-friends-card{
  padding:14px;
}
#profileScreen .ofc-avatar-wrap{
  width:108px;
  height:108px;
  margin:4px auto 2px;
}
#profileScreen .ofc-avatar{
  font-size:56px;
}
#profileScreen .ofc-avatar-edit{
  width:30px;
  height:30px;
  bottom:8px;
}
#profileScreen .ofc-profile-name{
  font-size:25px;
  margin:2px 0;
}
#profileScreen .ofc-online-row{
  margin-bottom:10px;
}
#profileScreen .ofc-level-card{
  padding:10px;
}
#profileScreen .ofc-stats-grid{
  gap:8px;
  margin:10px 0;
}
#profileScreen .ofc-stat-card{
  padding:10px 7px;
}
#profileScreen .ofc-stat-card strong{
  font-size:25px;
}
#profileScreen .ofc-secondary-wide,
#profileScreen .ofc-logout-button{
  padding:9px 12px;
}
#profileScreen .ofc-private-note{
  margin-top:9px;
  padding:9px;
}

/* Center game cards: reduce height, keep everything visible. */
#profileScreen .ofc-panel-title{
  font-size:17px;
}
#profileScreen .ofc-panel-subtitle{
  margin:4px 0 10px;
}
#profileScreen .ofc-game-grid{
  gap:10px;
}
#profileScreen .ofc-game-visual{
  min-height:185px;
  padding:14px;
}
#profileScreen .ofc-trophy{
  font-size:64px;
}
#profileScreen .ofc-grid-mini{
  grid-template-columns:repeat(3,34px);
  gap:4px;
  margin-bottom:10px;
}
#profileScreen .ofc-grid-mini span{
  height:34px;
}
#profileScreen .ofc-game-title{
  font-size:25px;
}
#profileScreen .ofc-game-card p{
  padding:9px 12px 0;
  min-height:42px;
  font-size:12px;
}
#profileScreen .ofc-play-cta{
  margin:8px 10px 10px;
  padding:10px 13px;
  font-size:16px;
}
#profileScreen .ofc-quick-card,
#profileScreen .ofc-settings-card{
  margin-top:10px;
  padding:13px 15px;
}
#profileScreen .ofc-quick-card p{
  margin:4px 0 9px;
}
#profileScreen .ofc-quick-row .text-input{
  min-height:44px;
}
#profileScreen .ofc-quick-row .primary-button{
  min-height:44px;
}
#profileScreen .ofc-setting-row{
  padding:7px 0;
}

/* Right column compactness */
#profileScreen .ofc-right-heading{
  margin-bottom:6px;
}
#profileScreen .ofc-task{
  padding:8px 5px;
}
#profileScreen .ofc-task-icon{
  width:31px;
  height:31px;
}
#profileScreen .ofc-outline-button{
  margin-top:8px;
  padding:9px 12px;
}
#profileScreen .ofc-friend-row{
  padding:6px 0;
}
#profileScreen .ofc-add-friend-row{
  margin-top:8px;
}
#profileScreen .ofc-add-friend-row .text-input,
#profileScreen .ofc-add-friend-row .primary-button{
  min-height:42px;
}

/* Footer must not force dashboard below the fold. */
.site-footer{
  margin:4px auto 8px!important;
  padding:6px 12px!important;
}

/* Active downstream screens are centered, but only when not hidden. */
.game-selection-screen:not(.hidden),
.grid-shell:not(.hidden),
.grid-game-screen:not(.hidden),
.game-container:not(.hidden),
.countdown-card:not(.hidden){
  margin-top:12px;
}

/* Ensure only actual active game container becomes grid. */
.game-container:not(.hidden){
  display:grid!important;
}
.game-container.hidden,
.game-selection-screen.hidden,
.grid-shell.hidden,
.grid-game-screen.hidden,
.countdown-card.hidden,
.setup-card.hidden{
  display:none!important;
}

@media(max-height:850px) and (min-width:981px){
  .logo{font-size:34px!important}
  .mode{font-size:18px!important}
  #profileScreen .ofc-dashboard-shell{
    transform-origin:top center;
  }
  #profileScreen .ofc-avatar-wrap{
    width:92px;height:92px;
  }
  #profileScreen .ofc-avatar{font-size:46px}
  #profileScreen .ofc-game-visual{min-height:160px}
  #profileScreen .ofc-trophy{font-size:54px}
  #profileScreen .ofc-game-title{font-size:22px}
  #profileScreen .ofc-task{padding:6px 4px}
}

@media(max-width:1180px){
  #profileScreen .ofc-dashboard-shell{
    grid-template-columns:280px 1fr;
  }
  #profileScreen .ofc-right-panel{
    grid-column:1/-1;
  }
}

@media(max-width:820px){
  body{overflow-y:auto}
  #profileScreen:not(.hidden){min-height:auto}
  #profileScreen .ofc-dashboard-shell{
    width:100%;
    grid-template-columns:1fr;
  }
}

/* =========================================================
   Online Football Clash v10.6.0 — Top Seven Modern Match Lobby
   Only #setupScreen / .top-seven-lobby is visually redesigned.
   ========================================================= */
body:has(#setupScreen:not(.hidden)) > .header{display:none}
body:has(#setupScreen:not(.hidden)){padding-bottom:18px;background:radial-gradient(circle at 50% 0,#0c2431 0,#07131d 38%,#030913 100%)}
body:has(#setupScreen:not(.hidden)) .site-footer{margin-top:8px}

.top-seven-lobby{
  width:min(96vw,1500px)!important;
  min-height:0!important;
  margin:14px auto 6px!important;
  padding:14px 18px 12px!important;
  border-radius:30px!important;
  border:1px solid rgba(71,85,105,.55)!important;
  background:
    radial-gradient(circle at 50% 24%,rgba(15,90,61,.18),transparent 38%),
    linear-gradient(180deg,rgba(3,12,20,.98),rgba(4,14,22,.98))!important;
  box-shadow:0 28px 80px rgba(0,0,0,.48)!important;
  overflow:visible;
  position:relative;
}
.top-seven-lobby:before{
  content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;
  background:linear-gradient(90deg,transparent,rgba(34,197,94,.035),transparent);
}
.ts-hidden-field{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important}
.ts-lobby-topbar{display:grid;grid-template-columns:150px 1fr 150px;align-items:center;gap:16px;position:relative;z-index:2}
.ts-nav-button{height:42px;padding:0 15px;border:1px solid rgba(34,197,94,.48);border-radius:12px;background:#07131b;color:#e5eef6;font-size:14px;font-weight:900;cursor:pointer}
.ts-nav-button:last-child{justify-self:end}
.ts-brand-block{text-align:center;line-height:1.05}
.ts-brand-title{font-size:27px;font-weight:950;letter-spacing:-.7px}
.ts-brand-subtitle{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:4px;color:#4ade80;font-size:11px;font-weight:900;letter-spacing:.3px}
.ts-brand-subtitle span{width:48px;height:1px;background:linear-gradient(90deg,transparent,#22c55e)}
.ts-brand-subtitle span:last-child{background:linear-gradient(90deg,#22c55e,transparent)}
.ts-lobby-hero{text-align:center;margin:5px auto 9px;position:relative;z-index:1}
.ts-kicker{color:#facc15;font-size:11px;font-weight:950;letter-spacing:1.4px}
.ts-lobby-hero h1{margin:1px 0 0!important;font-size:38px!important;font-weight:950!important;font-style:italic;letter-spacing:-1.8px;line-height:1}
.ts-lobby-hero h1 em{color:#4ade80;font-style:italic}
.ts-lobby-hero p{margin:5px 0 6px;color:#cbd5e1;font-size:12px}
.ts-online-pill{display:inline-flex;align-items:center;gap:7px;padding:5px 11px;border:1px solid rgba(148,163,184,.28);border-radius:999px;background:rgba(8,19,28,.8);color:#d8e3ec;font-size:10px;font-weight:800}
.ts-online-pill span{width:8px;height:8px;border-radius:50%;background:#22c55e;box-shadow:0 0 12px rgba(34,197,94,.85)}

.ts-mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px;position:relative;z-index:3}
.ts-mode-card{min-height:142px;padding:13px;border-radius:18px;background:linear-gradient(145deg,rgba(7,20,27,.96),rgba(5,13,20,.98));display:flex;flex-direction:column;justify-content:space-between;box-shadow:inset 0 1px rgba(255,255,255,.025),0 14px 30px rgba(0,0,0,.18)}
.ts-quick-mode{border:1px solid rgba(34,197,94,.72);box-shadow:inset 0 0 28px rgba(34,197,94,.055)}
.ts-friend-mode{border:1px solid rgba(250,204,21,.72);box-shadow:inset 0 0 28px rgba(250,204,21,.045)}
.ts-private-mode{border:1px solid rgba(14,165,233,.72);box-shadow:inset 0 0 28px rgba(14,165,233,.05)}
.ts-mode-copy{display:flex;align-items:center;gap:13px}
.ts-mode-icon{width:56px;height:56px;flex:0 0 56px;display:grid;place-items:center;border-radius:50%;font-size:29px;background:#0a1721;border:1px solid currentColor}
.ts-quick-mode .ts-mode-icon{color:#22c55e;box-shadow:0 0 25px rgba(34,197,94,.17)}
.ts-friend-mode .ts-mode-icon{color:#facc15;box-shadow:0 0 25px rgba(250,204,21,.12)}
.ts-private-mode .ts-mode-icon{color:#0ea5e9;box-shadow:0 0 25px rgba(14,165,233,.15)}
.ts-mode-card h2{margin:0 0 5px;font-size:16px;letter-spacing:.1px}
.ts-mode-card p{margin:0;color:#aebdcb;font-size:10px;line-height:1.35;max-width:240px}
.ts-card-action{width:100%;height:34px;margin-top:10px;padding:0 13px;border:0;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:11px;font-weight:950;cursor:pointer;list-style:none}
.ts-card-action::-webkit-details-marker{display:none}
.ts-card-action span{margin-left:auto;font-size:15px}
.ts-green-action{background:linear-gradient(180deg,#19c95c,#0da447);color:white}
.ts-yellow-action{background:linear-gradient(180deg,#ffd52b,#f0b800);color:#111827}
.ts-blue-action{background:linear-gradient(180deg,#1684e6,#0b63bd);color:white}
.ts-friends-drawer{position:relative}
.ts-friends-drawer[open]{z-index:20}
.ts-friends-popover{position:absolute;left:0;right:0;top:38px;z-index:30;max-height:190px;overflow:auto;padding:8px;background:#07131b;border:1px solid rgba(250,204,21,.34);border-radius:12px;box-shadow:0 18px 45px rgba(0,0,0,.58)}
.ts-friends-popover .friends-list{margin:0;gap:6px}
.ts-friends-popover .friend-row{padding:8px 9px;border-radius:8px;font-size:11px}
.ts-friends-popover .friend-invite-button{padding:7px 8px;font-size:10px}

.ts-room-grid{display:grid;grid-template-columns:minmax(0,1.08fr) 38px minmax(0,.92fr);gap:10px;align-items:stretch;margin-top:11px;position:relative;z-index:2}
.ts-room-panel{padding:12px 13px;border:1px solid rgba(71,85,105,.54);border-radius:16px;background:rgba(5,16,24,.9)}
.ts-panel-heading{display:flex;align-items:center;gap:8px;margin-bottom:9px;font-size:13px;font-weight:950}
.ts-heading-icon{width:22px;height:22px;display:grid;place-items:center;border:1px solid;border-radius:50%;font-size:14px}
.ts-heading-icon.green{color:#22c55e}.ts-heading-icon.blue{color:#0ea5e9}
.ts-room-options{display:grid;grid-template-columns:repeat(3,1fr);gap:7px}
.ts-option-chip{min-height:48px;padding:7px 8px;display:flex;align-items:center;gap:7px;border:1px solid rgba(71,85,105,.55);border-radius:10px;background:#091722}
.ts-option-icon{font-size:20px}
.ts-option-chip small{display:block;color:#8da0b2;font-size:7px;font-weight:900;letter-spacing:.45px}
.ts-option-chip strong{display:block;margin-top:2px;color:#4ade80;font-size:11px}
.ts-main-action{width:100%;height:36px;margin-top:9px;border:0;border-radius:8px;display:flex;align-items:center;justify-content:center;gap:8px;color:#fff;font-size:11px;font-weight:950;cursor:pointer}
.ts-main-action span{margin-left:auto;margin-right:8px;font-size:16px}
.ts-create-button{background:linear-gradient(180deg,#17c85b,#0c9d42)}
.ts-join-button{background:linear-gradient(180deg,#1579dc,#0a5bb3)}
.ts-or-badge{align-self:center;justify-self:center;width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(100,116,139,.55);border-radius:50%;background:#07131b;color:#d5dee7;font-size:9px;font-weight:900}
.ts-input-label{margin:0 0 5px!important;color:#91a5b7;font-size:8px!important;letter-spacing:.6px}
.top-seven-lobby .ts-room-code{height:38px!important;padding:7px 11px!important;border:1px solid rgba(71,85,105,.62)!important;border-radius:9px!important;background:#0a1721!important;color:#fff!important;font-size:13px!important;text-align:left!important;letter-spacing:2px!important}
.top-seven-lobby .ts-room-code::placeholder{color:#637383;letter-spacing:0}
.top-seven-lobby .ts-room-code:focus{border-color:#0ea5e9!important}
.ts-setup-message{min-height:14px!important;margin:4px 0 0!important;font-size:10px!important}

.ts-howto-strip{display:grid;grid-template-columns:210px 1fr 150px;align-items:center;gap:12px;margin-top:5px;padding:8px 10px;border:1px solid rgba(71,85,105,.45);border-radius:13px;background:rgba(5,15,23,.9);position:relative;z-index:1}
.ts-howto-title{display:flex;align-items:center;gap:9px;font-size:12px;font-weight:950}
.ts-howto-title span{width:25px;height:25px;display:grid;place-items:center;border:1px solid #22c55e;border-radius:50%;color:#4ade80;font-size:15px}
.ts-howto-strip p{margin:0;color:#aab9c6;font-size:9px;line-height:1.35}
.ts-rules-button{height:30px;border:1px solid rgba(34,197,94,.45);border-radius:8px;background:#071c15;color:#4ade80;font-size:9px;font-weight:950;cursor:pointer}
.ts-rules-button span{float:right;margin-right:8px}
.ts-rules-details{display:none;grid-column:1/-1;padding-top:7px;border-top:1px solid rgba(71,85,105,.4);color:#9fb0be;font-size:9px;line-height:1.4}
.ts-howto-strip.open .ts-rules-details{display:block}

@media (max-height:760px) and (min-width:900px){
  .top-seven-lobby{margin-top:7px!important;padding-top:9px!important;padding-bottom:8px!important}
  .ts-brand-title{font-size:23px}.ts-lobby-hero h1{font-size:32px!important}.ts-lobby-hero{margin:2px auto 6px}
  .ts-mode-card{min-height:127px;padding:10px}.ts-mode-icon{width:48px;height:48px;flex-basis:48px;font-size:24px}
  .ts-room-grid{margin-top:8px}.ts-room-panel{padding:9px 11px}.ts-howto-strip{padding:6px 9px}
}
@media (max-width:900px){
  body:has(#setupScreen:not(.hidden)){overflow:auto}
  .top-seven-lobby{width:94%!important;margin:12px auto!important;padding:14px!important}
  .ts-lobby-topbar{grid-template-columns:90px 1fr 90px}.ts-nav-button{padding:0 9px}.ts-nav-button span{display:none}
  .ts-brand-title{font-size:20px}.ts-brand-subtitle{font-size:9px}.ts-brand-subtitle span{display:none}
  .ts-mode-grid{grid-template-columns:1fr}.ts-room-grid{grid-template-columns:1fr}.ts-or-badge{margin:-1px auto}.ts-room-options{grid-template-columns:1fr 1fr 1fr}
  .ts-howto-strip{grid-template-columns:1fr}.ts-howto-strip p{font-size:10px}.ts-rules-button{width:100%}
}
@media (max-width:560px){
  .ts-room-options{grid-template-columns:1fr}.ts-lobby-hero h1{font-size:31px!important}.ts-mode-card{min-height:130px}.ts-brand-title{font-size:17px}
}


/* =========================================================
   Top Seven Match Lobby — Desktop full-size scale adjustment
   Visual design unchanged; only dimensions/spacing are enlarged
   to match the main dashboard footprint.
   ========================================================= */
@media (min-width: 901px) and (min-height: 761px) {
  .top-seven-lobby{
    width:min(1500px,calc(100vw - 28px))!important;
    max-width:1500px!important;
    min-height:min(730px,calc(100vh - 70px))!important;
    margin:10px auto 4px!important;
    padding:18px 22px 16px!important;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
  }

  .ts-lobby-topbar{
    grid-template-columns:170px 1fr 170px;
    gap:18px;
  }

  .ts-nav-button{
    height:48px;
    padding:0 18px;
    font-size:16px;
  }

  .ts-brand-title{
    font-size:34px;
  }

  .ts-brand-subtitle{
    margin-top:5px;
    font-size:13px;
  }

  .ts-brand-subtitle span{
    width:62px;
  }

  .ts-lobby-hero{
    margin:7px auto 12px;
  }

  .ts-kicker{
    font-size:13px;
  }

  .ts-lobby-hero h1{
    font-size:48px!important;
  }

  .ts-lobby-hero p{
    margin:6px 0 7px;
    font-size:14px;
  }

  .ts-online-pill{
    padding:6px 13px;
    font-size:12px;
  }

  .ts-mode-grid{
    gap:16px;
  }

  .ts-mode-card{
    min-height:170px;
    padding:16px;
    border-radius:20px;
  }

  .ts-mode-copy{
    gap:16px;
  }

  .ts-mode-icon{
    width:68px;
    height:68px;
    flex-basis:68px;
    font-size:34px;
  }

  .ts-mode-card h2{
    margin-bottom:6px;
    font-size:20px;
  }

  .ts-mode-card p{
    font-size:12px;
    line-height:1.45;
    max-width:320px;
  }

  .ts-card-action{
    height:40px;
    margin-top:12px;
    padding:0 15px;
    font-size:13px;
  }

  .ts-room-grid{
    grid-template-columns:minmax(0,1.08fr) 46px minmax(0,.92fr);
    gap:14px;
    margin-top:14px;
  }

  .ts-room-panel{
    padding:15px 16px;
    border-radius:18px;
  }

  .ts-panel-heading{
    margin-bottom:11px;
    font-size:16px;
  }

  .ts-heading-icon{
    width:27px;
    height:27px;
    font-size:17px;
  }

  .ts-room-options{
    gap:9px;
  }

  .ts-option-chip{
    min-height:58px;
    padding:9px 10px;
    gap:9px;
  }

  .ts-option-icon{
    font-size:24px;
  }

  .ts-option-chip small{
    font-size:8px;
  }

  .ts-option-chip strong{
    font-size:13px;
  }

  .ts-main-action{
    height:42px;
    margin-top:11px;
    font-size:13px;
  }

  .ts-or-badge{
    width:46px;
    height:46px;
    font-size:10px;
  }

  .ts-input-label{
    margin-bottom:6px!important;
    font-size:9px!important;
  }

  .top-seven-lobby .ts-room-code{
    height:46px!important;
    padding:9px 13px!important;
    font-size:15px!important;
  }

  .ts-setup-message{
    min-height:16px!important;
    font-size:11px!important;
  }

  .ts-howto-strip{
    grid-template-columns:240px 1fr 180px;
    gap:14px;
    margin-top:10px;
    padding:10px 13px;
    border-radius:15px;
  }

  .ts-howto-title{
    font-size:14px;
  }

  .ts-howto-title span{
    width:30px;
    height:30px;
    font-size:17px;
  }

  .ts-howto-strip p{
    font-size:10px;
  }

  .ts-rules-button{
    height:34px;
    font-size:10px;
  }

  body:has(#setupScreen:not(.hidden)) .site-footer{
    margin-top:3px!important;
  }
}


/* =========================================================
   Football Grid Battle — claimed cells use the owner's color
   ========================================================= */

/* p1 = Mavi */
.grid-cell.claimed-p1{
  background:linear-gradient(145deg,#0b57b7 0%,#073b82 100%)!important;
  border-color:#2494ff!important;
  box-shadow:
    inset 0 0 24px rgba(36,148,255,.18),
    0 0 12px rgba(36,148,255,.14)!important;
  color:#fff!important;
}

/* p2 = Kırmızı */
.grid-cell.claimed-p2{
  background:linear-gradient(145deg,#b51d30 0%,#72101d 100%)!important;
  border-color:#ff334d!important;
  box-shadow:
    inset 0 0 24px rgba(255,51,77,.18),
    0 0 12px rgba(255,51,77,.14)!important;
  color:#fff!important;
}

/* Alınmış karelerde hover rengi sahibin rengini bozmasın */
.grid-cell.claimed-p1:hover{
  border-color:#5ab0ff!important;
}

.grid-cell.claimed-p2:hover{
  border-color:#ff667b!important;
}

/* Futbolcu adı renkli zeminde daha net görünsün */
.grid-cell.claimed-p1 .grid-cell-player,
.grid-cell.claimed-p2 .grid-cell-player{
  color:#fff!important;
  text-shadow:0 1px 3px rgba(0,0,0,.45);
}


/* TOP SEVEN — BİLGİSAYARA KARŞI */
.top-seven-lobby .ts-mode-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
.ts-bot-mode{
  border-color:rgba(168,85,247,.42)!important;
  background:radial-gradient(circle at 82% 18%,rgba(168,85,247,.18),transparent 34%),linear-gradient(145deg,rgba(22,18,40,.96),rgba(8,16,26,.96))!important
}
.ts-bot-mode .ts-mode-icon{background:rgba(126,34,206,.18)!important;border-color:rgba(192,132,252,.38)!important;color:#e9d5ff}
.ts-bot-action{background:linear-gradient(90deg,#7e22ce,#9333ea)!important;border-color:#a855f7!important;color:#fff!important;box-shadow:0 9px 22px rgba(126,34,206,.24)!important}
.ts-bot-action:hover{background:linear-gradient(90deg,#9333ea,#a855f7)!important}
.ts-bot-difficulty-overlay{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:22px;background:rgba(2,6,15,.82);backdrop-filter:blur(10px)}
.ts-bot-difficulty-card{position:relative;width:min(92vw,520px);padding:30px;border:1px solid rgba(168,85,247,.34);border-radius:26px;background:radial-gradient(circle at 50% 0%,rgba(126,34,206,.20),transparent 38%),linear-gradient(145deg,#101827,#08101a);box-shadow:0 30px 80px rgba(0,0,0,.58),0 0 45px rgba(126,34,206,.10);text-align:center}
.ts-bot-close{position:absolute;top:14px;right:14px;width:38px;height:38px;display:grid;place-items:center;border:1px solid rgba(255,255,255,.10);border-radius:12px;background:#111827;color:#cbd5e1;font-size:25px;line-height:1;cursor:pointer}
.ts-bot-difficulty-icon{font-size:54px}
.ts-bot-difficulty-kicker{margin-top:8px;color:#c084fc;font-size:12px;font-weight:900;letter-spacing:1.4px}
.ts-bot-difficulty-card h2{margin:5px 0 7px;font-size:34px}
.ts-bot-difficulty-card>p{margin:0 auto 20px;color:#94a3b8;font-size:14px}
.ts-bot-difficulty-options{display:grid;gap:12px}
.ts-bot-level{min-height:78px;width:100%;display:grid;grid-template-columns:52px 1fr 28px;align-items:center;gap:12px;padding:12px 16px;border-radius:17px;color:#fff;text-align:left;cursor:pointer;transition:.2s}
.ts-bot-level.normal{border:1px solid rgba(250,204,21,.42);background:linear-gradient(145deg,rgba(113,63,18,.44),rgba(17,24,39,.96))}
.ts-bot-level.hard{border:1px solid rgba(239,68,68,.48);background:linear-gradient(145deg,rgba(127,29,29,.48),rgba(17,24,39,.96))}
.ts-bot-level:hover{transform:translateY(-2px)}
.ts-bot-level-icon{font-size:30px;text-align:center}
.ts-bot-level strong{display:block;font-size:18px;letter-spacing:.4px}
.ts-bot-level small{display:block;margin-top:4px;color:#cbd5e1;font-size:12px;font-weight:700}
.ts-bot-level b{font-size:22px}
@media(max-width:1100px){.top-seven-lobby .ts-mode-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:700px){.top-seven-lobby .ts-mode-grid{grid-template-columns:1fr}.ts-bot-difficulty-card{padding:26px 18px 20px}}


/* =========================================================
   FOOTBALL GRID BATTLE — BİLGİSAYARA KARŞI
   ========================================================= */

.grid-mode-choice{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
}

.grid-bot-card{
  border-color:rgba(168,85,247,.62)!important;
  background:
    radial-gradient(circle at 50% 22%,rgba(168,85,247,.20),transparent 34%),
    linear-gradient(180deg,#160d23,#06101a)!important;
}

.grid-bot-card span{
  background:#3b1760!important;
  color:#e9d5ff!important;
}

.grid-bot-difficulty-overlay{
  position:fixed;
  inset:0;
  z-index:5000;
  display:grid;
  place-items:center;
  padding:22px;
  background:rgba(2,6,15,.82);
  backdrop-filter:blur(10px);
}

.grid-bot-difficulty-card{
  position:relative;
  width:min(92vw,500px);
  padding:30px;
  border:1px solid rgba(168,85,247,.34);
  border-radius:26px;
  background:
    radial-gradient(circle at 50% 0%,rgba(126,34,206,.20),transparent 38%),
    linear-gradient(145deg,#101827,#08101a);
  box-shadow:0 30px 80px rgba(0,0,0,.58),0 0 45px rgba(126,34,206,.10);
  text-align:center;
}

.grid-bot-close{
  position:absolute;
  top:14px;
  right:14px;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  border:1px solid rgba(255,255,255,.10);
  border-radius:12px;
  background:#111827;
  color:#cbd5e1;
  font-size:25px;
  line-height:1;
  cursor:pointer;
}

.grid-bot-difficulty-icon{font-size:54px}

.grid-bot-difficulty-kicker{
  margin-top:8px;
  color:#c084fc;
  font-size:12px;
  font-weight:900;
  letter-spacing:1.4px;
}

.grid-bot-difficulty-card h2{
  margin:5px 0 20px;
  font-size:34px;
}

.grid-bot-difficulty-options{
  display:grid;
  gap:12px;
}

.grid-bot-level{
  min-height:74px;
  width:100%;
  display:grid;
  grid-template-columns:52px 1fr 28px;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  border-radius:17px;
  color:#fff;
  text-align:left;
  cursor:pointer;
  transition:.2s;
}

.grid-bot-level.normal{
  border:1px solid rgba(250,204,21,.42);
  background:linear-gradient(145deg,rgba(113,63,18,.44),rgba(17,24,39,.96));
}

.grid-bot-level.hard{
  border:1px solid rgba(239,68,68,.48);
  background:linear-gradient(145deg,rgba(127,29,29,.48),rgba(17,24,39,.96));
}

.grid-bot-level:hover{transform:translateY(-2px)}
.grid-bot-level-icon{font-size:30px;text-align:center}
.grid-bot-level strong{font-size:18px;letter-spacing:.5px}
.grid-bot-level b{font-size:22px}

@media(max-width:1100px){
  .grid-mode-choice{
    grid-template-columns:1fr 1fr!important;
  }
}

@media(max-width:720px){
  .grid-mode-choice{
    grid-template-columns:1fr!important;
  }
}

.ts-bot-level>span:nth-child(2){
  display:flex;
  align-items:center;
}


/* ARKADAŞ DAVETİ — OYUN / MOD SEÇİM AKIŞI */
.friend-invite-flow-card{position:relative;width:min(92vw,560px)}
.friend-invite-flow-close{position:absolute;top:14px;right:14px;width:38px;height:38px;border:1px solid rgba(255,255,255,.12);border-radius:12px;background:#111827;color:#cbd5e1;font-size:24px;cursor:pointer}
.friend-invite-flow-step{display:grid;gap:12px;margin-top:18px}
.friend-invite-choice{width:100%;min-height:86px;display:grid;grid-template-columns:58px 1fr 28px;align-items:center;gap:13px;padding:14px 16px;border-radius:18px;color:#fff;text-align:left;cursor:pointer;transition:.2s}
.friend-invite-choice.top-seven{border:1px solid rgba(34,197,94,.40);background:linear-gradient(145deg,rgba(6,78,59,.58),rgba(17,24,39,.96))}
.friend-invite-choice.grid{border:1px solid rgba(168,85,247,.48);background:linear-gradient(145deg,rgba(88,28,135,.52),rgba(17,24,39,.96))}
.friend-invite-choice:hover,.friend-invite-mode-button:hover{transform:translateY(-2px)}
.friend-invite-choice-icon{font-size:34px;text-align:center}
.friend-invite-choice strong{display:block;font-size:17px}
.friend-invite-choice small{display:block;margin-top:4px;color:#cbd5e1;font-size:12px;line-height:1.35}
.friend-invite-choice b{font-size:22px}
.friend-invite-step-title{display:grid;grid-template-columns:42px 1fr 42px;align-items:center;margin-bottom:2px;color:#cbd5e1;font-weight:900}
.friend-invite-step-title button{width:38px;height:38px;border:1px solid rgba(255,255,255,.12);border-radius:11px;background:#111827;color:#fff;cursor:pointer}
.friend-invite-step-title span{text-align:center;font-size:15px}
.friend-invite-mode-list{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.friend-invite-mode-button{min-height:76px;display:grid;grid-template-columns:38px 1fr 22px;align-items:center;gap:8px;padding:12px;border:1px solid rgba(255,255,255,.12);border-radius:16px;background:#111827;color:#fff;text-align:left;cursor:pointer;transition:.2s}
.friend-invite-mode-button>span{font-size:25px;text-align:center}
.friend-invite-mode-button strong{font-size:14px}
.friend-invite-mode-button b{font-size:19px}
@media(max-width:620px){.friend-invite-mode-list{grid-template-columns:1fr}}


/* ARKADAŞLIK İSTEKLERİ */
.ofc-pending-friend-button{width:100%;min-height:38px;margin:8px 0 10px;padding:8px 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid rgba(250,204,21,.25);border-radius:12px;background:rgba(63,47,11,.42);color:#fde68a;font-size:12px;font-weight:900;cursor:pointer}
.ofc-pending-friend-button span{min-width:25px;height:24px;display:grid;place-items:center;padding:0 7px;border-radius:999px;background:#facc15;color:#111827;font-size:11px}
.friend-requests-modal-card{position:relative;width:min(92vw,520px)}
.friend-requests-list{display:flex;flex-direction:column;gap:10px;max-height:360px;margin-top:16px;overflow:auto}
.friend-request-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:12px 14px;border:1px solid rgba(255,255,255,.09);border-radius:14px;background:#111827}
.friend-request-meta strong{display:block;color:#fff;font-size:14px}
.friend-request-meta small{display:block;margin-top:4px;color:#94a3b8;font-size:11px}
.friend-request-actions{display:flex;gap:7px}
.friend-request-actions button{min-width:72px;height:34px;border:0;border-radius:10px;color:#fff;font-size:11px;font-weight:900;cursor:pointer}
.friend-request-accept{background:#16a34a}
.friend-request-reject{background:#b91c1c}
@media(max-width:560px){.friend-request-row{grid-template-columns:1fr}.friend-request-actions button{flex:1}}
