/* ════════════════════════════════════════════
   Shared base styles – Football Games
   Geladen von ttt.html und darts.html
   ════════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --bg:        #0d1117;
    --surface:   #161b22;
    --surface2:  #1c2130;
    --border:    #21262d;
    --border2:   #30363d;
    --text:      #e6edf3;
    --muted:     #8b949e;
    --red:       #e94560;
    --red-dim:   rgba(233,69,96,.12);
    --green:     #3fb950;
    --green-dim: rgba(63,185,80,.12);
    --amber:     #f5a623;
    --radius:    12px;
}

*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

/* ── Top bar ── */
.top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 12px;
    width: 100%;
    max-width: 700px;
}
.top-bar h1 {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-bar-sub {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: flex-end;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    color: var(--muted);
    text-decoration: none;
    font-size: .85rem;
    border-radius: 9px;
    border: 1px solid var(--border2);
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
    gap: 4px;
}
.back-btn:hover { color: var(--text); border-color: var(--muted); }
@media (max-width: 600px) {
    .back-btn { width: 38px; padding: 0; }
    .back-label { display: none; }
}
.data-period {
    font-size: .72rem;
    color: var(--muted);
    opacity: .55;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}
.user-chip .user-name {
    font-size: .78rem;
    color: var(--muted);
    font-weight: 600;
}
.user-chip a {
    font-size: .75rem;
    font-weight: 700;
    color: var(--red);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--red);
    border-radius: 16px;
    transition: all .2s;
}
.user-chip a:hover {
    background: var(--red);
    color: white;
}

h1 { font-size: 1.6rem; color: var(--red); letter-spacing: 2px; font-weight: 800; }

/* ── Lobby (gemeinsame Teile) ── */
#lobby {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 16px;
    width: 100%;
    max-width: 400px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
#lobby h2 { color: var(--muted); font-size: 1rem; font-weight: 400; text-align: center; }

.lobby-btn {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius);
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--red);
    color: white;
    transition: background .2s, transform .1s;
    letter-spacing: .3px;
}
.lobby-btn:hover  { background: #c73652; }
.lobby-btn:active { transform: scale(.98); }

.or-divider {
    color: var(--border2);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.or-divider::before,
.or-divider::after { content: ""; flex: 1; height: 1px; background: var(--border2); }

#join-wrapper { display: flex; gap: 8px; width: 100%; min-width: 0; }

#join-code {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 16px;
    background: var(--surface);
    border: 2px solid var(--border2);
    border-radius: 10px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    outline: none;
    box-sizing: border-box;
}
#join-code:focus { border-color: var(--red); }

#join-btn {
    height: 52px;
    padding: 0 20px;
    background: var(--surface2);
    border: 2px solid var(--border2);
    border-radius: 10px;
    color: var(--text);
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}
#join-btn:hover { background: var(--border2); }

/* ── Warteraum ── */
#waiting {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    text-align: center;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}
#waiting p { color: var(--muted); font-size: .9rem; }

.room-code-display {
    background: var(--surface);
    border-radius: 16px;
    padding: 22px 40px;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--red);
    border: 2px solid var(--red);
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 22px;
    height: 44px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: .9rem;
    transition: background .2s;
}
.copy-btn:hover { background: var(--border2); }

/* ── Spielbereich ── */
#game { display: none; flex-direction: column; align-items: center; width: 100%; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

/* ── Status-Zeile ── */
.status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    min-height: 34px;
    width: 100%;
}

.turn-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 700;
    border: 1px solid transparent;
}
.turn-pill.your-turn  { background: var(--green-dim); border-color: var(--green); color: var(--green); }
.turn-pill.their-turn { background: var(--surface);   border-color: var(--border2); color: var(--muted); }

.timer-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border2);
    font-size: .85rem;
    font-weight: 700;
    color: var(--green);
    transition: color .3s, border-color .3s;
}
.timer-pill.warn   { color: var(--amber); border-color: rgba(245,166,35,.4); }
.timer-pill.danger { color: var(--red); border-color: rgba(233,69,96,.4); animation: blink .6s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.5} }
.timer-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

#status-msg {
    font-size: .85rem;
    color: var(--muted);
    text-align: center;
    min-height: 20px;
    margin-bottom: 8px;
}
#status-msg.ok  { color: var(--green); }
#status-msg.err { color: var(--red); }

/* ── Untere Leiste ── */
.bottom-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.player-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: .85rem;
    font-weight: 700;
    border: 1px solid transparent;
    transition: transform .15s;
}
.player-pill.p1 { background: var(--green-dim); border-color: rgba(63,185,80,.3); color: var(--green); }
.player-pill.p2 { background: var(--red-dim);   border-color: rgba(233,69,96,.3); color: var(--red); }
.player-pill.active-turn { transform: scale(1.06); }
.player-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

#new-game-btn {
    padding: 7px 20px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 20px;
    color: var(--muted);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
#new-game-btn:hover { background: var(--border2); color: var(--text); }

#room-info { font-size: .72rem; color: #444; margin-top: 6px; }

/* ── Gewinner-Banner ── */
#winner-banner {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.82);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
#winner-banner.visible { display: flex; }

.winner-card {
    background: var(--surface);
    border: 2px solid var(--border2);
    border-radius: 24px;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 380px;
    width: 100%;
    animation: pop-in .35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes pop-in {
    from { transform: scale(.75); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

#winner-text {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text);
    text-align: center;
    line-height: 1.4;
    white-space: pre-line;
}

.winner-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.winner-btns button {
    padding: 13px 32px;
    border-radius: var(--radius);
    border: none;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    background: var(--red);
    color: white;
    transition: background .2s, transform .1s;
}
.winner-btns button:hover  { background: #c73652; }
.winner-btns button:active { transform: scale(.97); }

/* ── Einstellungs-Panel (Lobby) ── */
.settings-panel { width: 100%; background: var(--surface); border-radius: var(--radius); padding: 18px; }
.settings-panel h3 { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.setting-row { margin-bottom: 14px; }
.setting-row:last-child { margin-bottom: 0; }
.setting-label { display: block; color: var(--muted); font-size: .8rem; font-weight: 600; margin-bottom: 6px; }
.setting-select {
    width: 100%; padding: 11px 12px;
    background: var(--bg); border: 2px solid var(--border2);
    border-radius: 8px; color: var(--text);
    font-size: 1rem; cursor: pointer;
}
.setting-select:focus { outline: none; border-color: var(--red); }
.setting-select option { background: var(--bg); }

/* ── League Card Grid ── */
.league-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
}
@media (min-width: 460px) {
    .league-grid { grid-template-columns: repeat(6, 1fr); }
}
.league-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 4px 7px;
    background: var(--bg);
    border: 2px solid var(--border2);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .18s, background .18s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.league-card .lc-flag { font-size: 1.35rem; line-height: 1; }
.league-card .lc-name {
    font-size: .58rem;
    font-weight: 700;
    color: var(--muted);
    text-align: center;
    line-height: 1.25;
    letter-spacing: .2px;
}
.league-card:hover { border-color: var(--red); }
.league-card.active {
    border-color: var(--red);
    background: rgba(233,69,96,.1);
}
.league-card.active .lc-name { color: var(--red); }

/* ── Difficulty Gradient Bar ── */
.diff-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.diff-label {
    font-size: .68rem;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.diff-bar {
    display: flex;
    flex: 1;
    gap: 3px;
    height: 32px;
}
.diff-seg {
    flex: 1;
    border-radius: 6px;
    background: var(--border2);
    cursor: pointer;
    border: none;
    transition: background .15s, opacity .15s;
    -webkit-tap-highlight-color: transparent;
}
.diff-seg[data-i="0"].lit     { background: #3fb950; }
.diff-seg[data-i="1"].lit     { background: #8bc34a; }
.diff-seg[data-i="2"].lit     { background: #f5a623; }
.diff-seg[data-i="3"].lit     { background: #ff7043; }
.diff-seg[data-i="4"].lit     { background: #e94560; }
.diff-seg[data-i="0"].preview { background: #3fb950; opacity: .4; }
.diff-seg[data-i="1"].preview { background: #8bc34a; opacity: .4; }
.diff-seg[data-i="2"].preview { background: #f5a623; opacity: .4; }
.diff-seg[data-i="3"].preview { background: #ff7043; opacity: .4; }
.diff-seg[data-i="4"].preview { background: #e94560; opacity: .4; }

/* ── Mode / Leg Buttons ── */
.bo-container { display: flex; gap: 8px; width: 100%; }
.bo-btn {
    flex: 1; padding: 10px; border-radius: 10px;
    border: 2px solid var(--border2); background: var(--surface);
    color: var(--muted); font-size: .85rem; font-weight: 700;
    cursor: pointer; transition: all .2s;
}
.bo-btn:hover  { border-color: var(--green); color: var(--text); }
.bo-btn.active { border-color: var(--green); background: var(--green-dim); color: var(--green); }

.mode-container { display: flex; gap: 6px; width: 100%; }
.mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 10px 4px;
    border-radius: 10px;
    border: 2px solid var(--border2);
    background: var(--bg);
    cursor: pointer;
    transition: border-color .18s, background .18s;
    -webkit-tap-highlight-color: transparent;
}
.mode-btn .mode-num {
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
    color: var(--text);
    transition: color .18s;
}
.mode-btn .mode-sub {
    font-size: .58rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: .4px;
    text-transform: uppercase;
    transition: color .18s;
}
.mode-btn:hover { border-color: var(--green); }
.mode-btn.active { border-color: var(--green); background: var(--green-dim); }
.mode-btn.active .mode-num { color: var(--green); }
.mode-btn.active .mode-sub { color: var(--green); }

/* ── Info-Details-Box ── */
.info-details { width: 100%; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.info-details summary {
    padding: 12px 16px; cursor: pointer; font-size: .85rem; color: var(--muted);
    user-select: none; list-style: none; display: flex; align-items: center; gap: 6px;
}
.info-details summary::-webkit-details-marker { display: none; }
.info-details summary::before { content: "▶"; font-size: .65rem; transition: transform .2s; }
.info-details[open] summary::before { transform: rotate(90deg); }
.info-details[open] summary { border-bottom: 1px solid var(--border); }
.info-body { padding: 14px 16px; font-size: .82rem; color: var(--muted); line-height: 1.6; }
.info-body p { margin: 0 0 10px; }
.info-body p:last-child { margin: 0; }
.info-body ul { margin: 6px 0 10px 0; padding-left: 18px; }
.info-body li { margin-bottom: 4px; }

/* ── Skip-Panel ── */
/* ── Game Controls: feste Höhe, kein Layout-Shift ── */
#game-controls {
    position: relative;
    width: 100%;
    max-width: 660px;
    height: 40px;
    flex-shrink: 0;
}
#action-btns {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
}
#skip-panel {
    position: absolute;
    inset: 0;
    background: var(--bg);
    border: 1px solid var(--amber);
    border-radius: var(--radius);
    padding: 0 16px;
    display: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: .88rem;
}
#skip-msg { color: var(--amber); font-weight: 600; flex: 1; }
#skip-actions { display: flex; gap: 8px; }
#skip-confirm-btn, #skip-decline-btn {
    padding: 5px 14px; border-radius: 8px; border: none;
    font-size: .82rem; font-weight: 700; cursor: pointer;
}
#skip-confirm-btn { background: var(--green); color: #000; }
#skip-decline-btn { background: var(--surface2); border: 1px solid var(--border2); color: var(--text); }

/* ── Icon-Buttons (Reroll / Pass) ── */
.icon-btn {
    height: 34px;
    padding: 0 14px;
    gap: 5px;
    border-radius: 17px;
    border: 1px solid var(--border2);
    background: var(--surface);
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .2s, border-color .2s;
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--muted);
}
.icon-btn:disabled { opacity: 0.25; cursor: default; }
.icon-btn:not(:disabled):hover { border-color: var(--amber); color: var(--text); }
.skip-link {
    font-size: .8rem; color: var(--amber); cursor: pointer;
    background: var(--surface); border: 2px solid var(--border2);
    border-radius: 10px; padding: 8px 14px;
    flex: 0 1 160px; font-weight: 700; transition: border-color .2s, color .2s;
}
.skip-link:hover { border-color: var(--amber); }
.pass-btn {
    font-size: .8rem; color: var(--muted); cursor: pointer;
    background: var(--surface); border: 2px solid var(--border2);
    border-radius: 10px; padding: 8px 14px;
    flex: 0 1 160px; font-weight: 700; transition: border-color .2s, color .2s;
}
.pass-btn:hover { border-color: var(--border2); color: var(--text); }

/* ── Responsive Basis ── */
@media (max-width: 600px) {
    h1 { font-size: 1.2rem; letter-spacing: 1px; }
    .room-code-display { font-size: 2rem; padding: 16px 24px; letter-spacing: 5px; }
    .winner-card { padding: 28px 20px; }
    #winner-text { font-size: 1.4rem; }
    .site-footer { display: none; }
}

/* ── Site Footer ── */
.site-footer {
    margin-top: auto;
    padding: 24px 16px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: .75rem;
    color: var(--muted, #8b949e);
    opacity: .5;
    width: 100%;
}
.site-footer a {
    color: inherit;
    text-decoration: none;
    transition: opacity .15s;
}
.site-footer a:hover { opacity: 2; color: var(--text, #e6edf3); }
.site-footer .sep { opacity: .4; }

/* ── Hamburger Menu (Sub-Pages) ── */
.menu-btn {
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 9px;
    width: 38px; height: 38px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color .2s;
}
.menu-btn:hover { border-color: var(--muted); }
.menu-btn span {
    display: block;
    width: 16px; height: 2px;
    background: var(--muted);
    border-radius: 2px;
    transition: all .22s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.menu-panel {
    position: fixed;
    top: 10px; right: 16px;
    z-index: 300;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    transform-origin: top right;
    transform: scale(.88);
    opacity: 0;
    pointer-events: none;
    transition: transform .2s cubic-bezier(0.34,1.56,0.64,1), opacity .15s;
}
.menu-panel.open { transform: scale(1); opacity: 1; pointer-events: all; }
.menu-panel .menu-user {
    font-size: .82rem;
    color: var(--muted);
    font-weight: 600;
}
.menu-panel .menu-divider { height: 1px; background: var(--border); margin: 0 -4px; }
.menu-panel .menu-auth a {
    display: block;
    text-align: center;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid var(--red);
    color: var(--red);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 700;
    transition: all .2s;
}
.menu-panel .menu-auth a:hover { background: var(--red); color: white; }

/* ── Top-bar-sub: date on second row ── */
.top-bar-sub {
    width: 100%;
    padding-left: 2px;
}

/* ── Language Switcher ── */
.lang-switcher {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}
.lang-btn {
    font-size: .7rem;
    font-weight: 700;
    color: var(--muted);
    text-decoration: none;
    padding: 3px 7px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all .2s;
    letter-spacing: .5px;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active { color: var(--text); border-color: var(--border2); background: var(--surface2); }

/* ── Cookie Notice ── */
.cookie-notice {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1c2130;
    border: 1px solid #30363d;
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: .82rem;
    color: #8b949e;
    z-index: 9999;
    max-width: 560px;
    width: calc(100% - 40px);
    box-shadow: 0 8px 32px rgba(0,0,0,.5);
    animation: slide-up .3s ease;
}
.cookie-notice a { color: #e94560; text-decoration: none; }
.cookie-notice a:hover { text-decoration: underline; }
.cookie-notice .cookie-ok {
    flex-shrink: 0;
    background: #e94560;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 16px;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}
@keyframes slide-up {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ── Beta Badge ── */
.beta-badge {
    display: inline-block;
    font-size: .55em;
    font-weight: 800;
    color: #e94560;
    background: rgba(233,69,96,.12);
    border: 1px solid rgba(233,69,96,.35);
    border-radius: 6px;
    padding: 2px 6px;
    letter-spacing: .5px;
    vertical-align: middle;
    margin-left: 8px;
    position: relative;
    top: -2px;
}

/* ── Menu Bug Button ── */
.menu-bug-btn {
    background: none;
    border: 1px solid var(--border2);
    border-radius: 20px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: border-color .2s, color .2s;
    width: 100%;
}
.menu-bug-btn:hover { border-color: var(--muted); color: var(--text); }
