/* ====================================================================
   Farbjagd – „Farbstudio" Theme
   Ruhiger, neutral-dunkler Hintergrund, damit die Farbe der Held ist.
   Weiche Farbchip-Optik, bewusst zurückhaltend – die Farbfelder sind der Held.
   ==================================================================== */

:root {
    --fj-bg: #0e0e15;
    --fj-bg-2: #16161f;
    --fj-panel: #1b1b26;
    --fj-panel-2: #21212e;
    --fj-line: rgba(255, 255, 255, 0.10);
    --fj-line-soft: rgba(255, 255, 255, 0.06);
    --fj-text: #f2f2f7;
    --fj-muted: #9a9aae;
    --fj-btn: #2a2a32;
    --fj-btn-hover: #34343f;
    --fj-radius: 22px;
    --fj-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body.no-nav {
    background: linear-gradient(180deg, var(--fj-bg-2), var(--fj-bg));
    color: var(--fj-text);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Standard-Theme-Hintergrund (body::before aus main.css) auf dieser Seite ausblenden,
   damit der flache, minimalistische Verlauf des Body sichtbar bleibt. */
body.no-nav::before {
    background: none;
}

#star-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.fj-home {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 30;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(27, 27, 38, 0.7);
    border: 1px solid var(--fj-line);
    color: var(--fj-text);
    font-size: 1.2rem;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: transform 0.15s ease, background 0.15s ease;
}

.fj-home:hover {
    transform: translateX(-2px);
    background: rgba(33, 33, 46, 0.9);
    color: #fff;
}

/* ---------- Screen system ---------- */
#fj-app {
    position: relative;
    z-index: 1;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 28px 18px 40px;
}

.fj-screen {
    display: none;
    width: 100%;
    max-width: 560px;
    animation: fj-fade 0.35s ease both;
}

.fj-screen.is-active {
    display: block;
}

@keyframes fj-fade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Menu ---------- */
.fj-hero {
    text-align: center;
    margin-bottom: 22px;
}

.fj-kicker {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--fj-muted);
    margin-bottom: 10px;
}

.fj-title {
    font-size: clamp(2.4rem, 9vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 12px;
    color: #e6e6ee;
}

.fj-sub {
    color: var(--fj-muted);
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 420px;
    margin: 0 auto;
}

.fj-sub strong {
    color: var(--fj-text);
    font-weight: 600;
}

.fj-menu-card,
.fj-result-card,
.fj-final-card {
    background: linear-gradient(180deg, var(--fj-panel-2), var(--fj-panel));
    border: 1px solid var(--fj-line);
    border-radius: var(--fj-radius);
    box-shadow: var(--fj-shadow);
    padding: 24px;
}

.fj-how {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: grid;
    gap: 12px;
}

.fj-how li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--fj-text);
    font-size: 0.95rem;
}

.fj-step {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
    color: var(--fj-text);
    border: 1px solid var(--fj-line);
}

.fj-menu-foot {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.fj-best {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.fj-best-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fj-muted);
}

.fj-best-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--fj-text);
}

/* ---------- Buttons ---------- */
.fj-btn {
    border: 0;
    border-radius: 14px;
    padding: 13px 18px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.12s ease, filter 0.15s ease, background 0.15s ease;
}

.fj-btn:active {
    transform: translateY(1px) scale(0.99);
}

.fj-btn-primary {
    width: 100%;
    color: var(--fj-text);
    background: var(--fj-btn);
    border: 1px solid var(--fj-line);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.fj-btn-primary:hover {
    background: var(--fj-btn-hover);
}

.fj-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--fj-text);
    border: 1px solid var(--fj-line);
}

.fj-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ---------- Play: topbar ---------- */
.fj-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.fj-round-pill,
.fj-score-pill {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--fj-panel);
    border: 1px solid var(--fj-line);
}

.fj-score-pill i {
    color: var(--fj-muted);
}

.fj-progress {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 22px;
}

.fj-progress-dot {
    width: 30px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.25s ease, transform 0.25s ease;
}

.fj-progress-dot.is-done {
    background: rgba(255, 255, 255, 0.40);
}

.fj-progress-dot.is-current {
    background: rgba(255, 255, 255, 0.92);
    transform: scaleY(1.34);
}

/* ---------- Reveal ---------- */
.fj-reveal {
    text-align: center;
    padding: 10px 0;
}

.fj-reveal-hint {
    color: var(--fj-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin-bottom: 18px;
}

.fj-reveal-swatch {
    width: min(78vw, 320px);
    height: min(78vw, 320px);
    margin: 0 auto;
    border-radius: 32px;
    display: grid;
    place-items: center;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    background: #888;
    transition: background 0.2s ease;
}

.fj-count-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(3px);
    color: #fff;
    font-size: 2.4rem;
    font-weight: 800;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.55);
}

.fj-count-ring.is-pulse {
    animation: fj-pulse 1s ease-in-out infinite;
}

@keyframes fj-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

/* ---------- Picker ---------- */
.fj-picker-hint,
.fj-result-kicker,
.fj-final-kicker {
    text-align: center;
    color: var(--fj-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.78rem;
    margin-bottom: 16px;
}

.fj-picker-row {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: stretch;
}

.fj-sv {
    position: relative;
    flex: 1 1 auto;
    max-width: 360px;
    aspect-ratio: 4 / 3;
    border-radius: 20px;
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 30px rgba(0, 0, 0, 0.4);
}

.fj-sv canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.fj-sv-thumb,
.fj-hue-thumb {
    position: absolute;
    pointer-events: none;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.fj-sv-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    left: 50%;
    top: 50%;
}

.fj-hue {
    position: relative;
    flex: 0 0 46px;
    width: 46px;
    border-radius: 16px;
    cursor: ns-resize;
    touch-action: none;
    background: linear-gradient(to bottom,
            #ff0000 0%, #ffff00 16.66%, #00ff00 33.33%, #00ffff 50%,
            #0000ff 66.66%, #ff00ff 83.33%, #ff0000 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 12px 30px rgba(0, 0, 0, 0.4);
}

.fj-hue-thumb {
    left: -4px;
    right: -4px;
    width: auto;
    height: 14px;
    border-radius: 8px;
    transform: translateY(-50%);
    top: 0;
}

/* Große Vorschau der aktuell gewählten Farbe */
.fj-current-preview {
    margin: 18px 0 14px;
    width: 100%;
    height: 96px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 10px 26px rgba(0, 0, 0, 0.35);
    transition: background 0.12s ease;
}

.fj-current-hex {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    color: #111;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.35);
}

/* ---------- Round result ---------- */
.fj-compare {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-bottom: 20px;
}

.fj-compare-item {
    flex: 1 1 0;
    text-align: center;
}

.fj-compare-swatch {
    display: block;
    width: 100%;
    height: 120px;
    border-radius: 16px;
    background: #888;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    margin-bottom: 8px;
}

.fj-compare-label {
    font-size: 0.82rem;
    color: var(--fj-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.fj-accuracy {
    text-align: center;
    margin-bottom: 6px;
}

.fj-accuracy-pct {
    display: block;
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: #e6e6ee;
}

.fj-accuracy-label {
    font-size: 0.78rem;
    color: var(--fj-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.fj-round-points {
    text-align: center;
    font-weight: 700;
    color: var(--fj-text);
    margin: 12px 0 20px;
    font-size: 1.05rem;
}

.fj-round-points span {
    font-variant-numeric: tabular-nums;
}

#screen-round .fj-btn-primary,
.fj-final-card .fj-btn {
    width: 100%;
}

/* ---------- Final ---------- */
.fj-final-card {
    text-align: center;
}

.fj-final-total {
    font-weight: 800;
    line-height: 1;
    margin: 6px 0 4px;
}

#finalScore {
    font-size: 3.6rem;
    font-variant-numeric: tabular-nums;
    color: #e6e6ee;
}

.fj-final-max {
    font-size: 1.4rem;
    color: var(--fj-muted);
    margin-left: 8px;
    font-weight: 700;
}

.fj-final-grade {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 4px 0 2px;
}

.fj-final-best {
    color: var(--fj-muted);
    font-size: 0.9rem;
    margin: 0 0 18px;
    min-height: 1.1em;
}

.fj-breakdown {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.fj-bd-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fj-line-soft);
    border-radius: 12px;
    padding: 8px 4px;
}

.fj-bd-swatch {
    width: 100%;
    height: 26px;
    border-radius: 7px;
    margin-bottom: 6px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.fj-bd-pts {
    font-size: 0.82rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.fj-final-actions {
    display: flex;
    gap: 12px;
}

.fj-final-actions .fj-btn {
    flex: 1 1 0;
}

.fj-login-hint {
    margin: 14px 0 0;
    font-size: 0.82rem;
    color: var(--fj-muted);
}

/* ---------- Leaderboard modal ---------- */
.fj-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(6, 6, 12, 0.7);
    backdrop-filter: blur(6px);
}

.fj-modal-card {
    width: 100%;
    max-width: 440px;
    background: linear-gradient(180deg, var(--fj-panel-2), var(--fj-panel));
    border: 1px solid var(--fj-line);
    border-radius: var(--fj-radius);
    box-shadow: var(--fj-shadow);
    padding: 22px;
}

.fj-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.fj-modal-head h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0;
}

.fj-modal-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--fj-line);
    color: var(--fj-text);
    width: 36px;
    height: 36px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 0.95rem;
}

.fj-lb-list {
    max-height: 360px;
    overflow-y: auto;
    display: grid;
    gap: 8px;
}

.fj-lb-empty {
    text-align: center;
    color: var(--fj-muted);
    padding: 24px 0;
}

.fj-lb-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fj-line-soft);
}

.fj-lb-item.is-me {
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--fj-line);
}

.fj-lb-rank {
    flex: 0 0 34px;
    font-weight: 800;
    font-size: 1rem;
}

.fj-lb-name {
    flex: 1 1 auto;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fj-lb-score {
    font-weight: 800;
    color: var(--fj-text);
    font-variant-numeric: tabular-nums;
}

/* ====================================================================
   Multiplayer (Tabs, Lobby, Timer, Standings, Runden-Vergleich)
   ==================================================================== */

.fj-title-sm {
    font-size: clamp(1.9rem, 7vw, 2.6rem);
}

/* ---------- Mode-Tabs ---------- */
.fj-tabs {
    position: relative;
    display: flex;
    gap: 6px;
    padding: 5px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fj-line-soft);
    border-radius: 14px;
}

/* Gleitender Indikator hinter dem aktiven Tab */
.fj-tab-indicator {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 5px;
    width: calc((100% - 16px) / 2); /* 10px Padding + 6px Gap */
    border-radius: 10px;
    background: var(--fj-btn);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 0;
    transition: transform 0.34s cubic-bezier(0.5, 0.05, 0.2, 1);
    will-change: transform;
}

.fj-tabs.is-online .fj-tab-indicator {
    transform: translateX(calc(100% + 6px));
}

.fj-tab {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    border: 0;
    background: transparent;
    color: var(--fj-muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 10px 8px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: color 0.2s ease;
}

.fj-tab:hover {
    color: var(--fj-text);
}

.fj-tab.is-active {
    color: var(--fj-text);
}

.fj-tabpanel {
    display: none;
}

.fj-tabpanel.is-active {
    display: block;
}

.fj-tabpanel.fj-from-right {
    animation: fj-slide-r 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.fj-tabpanel.fj-from-left {
    animation: fj-slide-l 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes fj-slide-r {
    from { opacity: 0; transform: translateX(26px); }
    to   { opacity: 1; transform: none; }
}

@keyframes fj-slide-l {
    from { opacity: 0; transform: translateX(-26px); }
    to   { opacity: 1; transform: none; }
}

/* ---------- Online-Panel ---------- */
.fj-online-intro {
    color: var(--fj-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 18px;
    text-align: center;
}

.fj-online-intro strong {
    color: var(--fj-text);
    font-weight: 600;
}

.fj-or {
    text-align: center;
    color: var(--fj-muted);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    margin: 16px 0;
}

.fj-code-input {
    width: 100%;
    border: 1px solid var(--fj-line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--fj-text);
    border-radius: 14px;
    padding: 14px;
    font-family: inherit;
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: 0.28em;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.fj-code-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.28em;
}

.fj-code-input:focus {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.fj-online-error {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 90, 90, 0.12);
    border: 1px solid rgba(255, 90, 90, 0.3);
    color: #ffb4b4;
    font-size: 0.85rem;
    text-align: center;
}

/* ---------- Lobby ---------- */
.fj-share {
    text-align: center;
    margin-bottom: 22px;
}

.fj-share-label {
    display: block;
    font-size: 0.78rem;
    color: var(--fj-muted);
    margin-bottom: 10px;
}

.fj-code-hero {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.fj-code-field {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--fj-line);
    background: rgba(255, 255, 255, 0.06);
    color: var(--fj-text);
    border-radius: 14px;
    padding: 14px;
    font-family: inherit;
    font-weight: 800;
    font-size: 1.7rem;
    letter-spacing: 0.22em;
    text-align: center;
    text-transform: uppercase;
    outline: none;
    cursor: pointer;
}

.fj-icon-btn {
    flex: 0 0 54px;
    border: 1px solid var(--fj-line);
    background: var(--fj-btn);
    color: var(--fj-text);
    border-radius: 14px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.fj-icon-btn:hover {
    background: var(--fj-btn-hover);
}

.fj-share-actions {
    display: flex;
    gap: 8px;
}

.fj-share-actions .fj-btn {
    flex: 1 1 0;
}

.fj-lobby-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--fj-text);
}

.fj-lobby-count {
    color: var(--fj-muted);
    font-weight: 600;
}

.fj-lobby-players {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: grid;
    gap: 8px;
}

.fj-lobby-player {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fj-line-soft);
}

.fj-lobby-player.is-me {
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--fj-line);
}

.fj-lobby-dot {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.fj-lobby-player.is-offline .fj-lobby-dot {
    background: #6b6b78;
    box-shadow: none;
}

.fj-lobby-player.is-offline {
    opacity: 0.55;
}

.fj-lobby-name {
    flex: 1 1 auto;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fj-lobby-badge {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--fj-muted);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--fj-line-soft);
    padding: 3px 9px;
    border-radius: 999px;
}

.fj-lobby-wait {
    text-align: center;
    color: var(--fj-muted);
    font-size: 0.85rem;
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#startOnlineBtn {
    width: 100%;
    margin-bottom: 4px;
}

#startOnlineBtn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#leaveLobbyBtn {
    width: 100%;
    margin-top: 6px;
}

/* ---------- Spinner ---------- */
.fj-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--fj-text);
    display: inline-block;
    animation: fj-spin 0.7s linear infinite;
}

@keyframes fj-spin {
    to { transform: rotate(360deg); }
}

/* ---------- Freunde einladen ---------- */
.fj-friend {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fj-line-soft);
}

.fj-friend-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.fj-friend-name {
    flex: 1 1 auto;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fj-friend-invite {
    flex: 0 0 auto;
    border: 1px solid var(--fj-line);
    background: var(--fj-btn);
    color: var(--fj-text);
    border-radius: 10px;
    padding: 8px 14px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s ease;
}

.fj-friend-invite:hover:not(:disabled) {
    background: var(--fj-btn-hover);
}

.fj-friend-invite:disabled {
    cursor: default;
    opacity: 0.9;
}

.fj-friend-invite.is-sent {
    background: rgba(74, 222, 128, 0.16);
    border-color: rgba(74, 222, 128, 0.4);
    color: #b7f5c9;
}

/* ---------- Pick-Timer ---------- */
.fj-timer-pill {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    background: var(--fj-panel);
    border: 1px solid var(--fj-line);
    font-variant-numeric: tabular-nums;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.fj-timer-pill i {
    color: var(--fj-muted);
}

.fj-timer-pill.is-urgent {
    color: #ffd0d0;
    border-color: rgba(255, 90, 90, 0.5);
    background: rgba(255, 90, 90, 0.14);
    animation: fj-pulse 0.7s ease-in-out infinite;
}

.fj-timer-pill.is-urgent i {
    color: #ff8c8c;
}

/* ---------- Online-Warten (Rundenergebnis) ---------- */
.fj-online-wait {
    text-align: center;
    color: var(--fj-muted);
    font-size: 0.88rem;
    margin: 14px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ---------- Online-Finale: Sieger + Rangliste ---------- */
.fj-winner-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    padding: 16px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fj-line);
}

.fj-winner-banner i {
    color: #d8b84a;
}

.fj-winner-banner.is-win {
    background: linear-gradient(180deg, rgba(216, 184, 74, 0.18), rgba(216, 184, 74, 0.06));
    border-color: rgba(216, 184, 74, 0.4);
}

.fj-standings {
    display: grid;
    gap: 8px;
    margin-bottom: 22px;
}

.fj-standing {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--fj-line-soft);
}

.fj-standing.is-me {
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--fj-line);
}

.fj-standing-rank {
    flex: 0 0 32px;
    font-weight: 800;
    font-size: 1rem;
    text-align: center;
}

.fj-standing-name {
    flex: 1 1 auto;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fj-standing-score {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ---------- Online-Finale: Runden-Vergleich ---------- */
.fj-mp-bd-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fj-muted);
    font-weight: 700;
    margin: 0 0 12px;
    text-align: center;
}

.fj-mp-breakdown {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.fj-mp-row {
    display: grid;
    gap: 6px;
    align-items: center;
    min-width: 260px;
}

.fj-mp-head {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--fj-muted);
}

.fj-mp-cell {
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
}

.fj-mp-rowlabel {
    font-weight: 800;
    color: var(--fj-text);
    font-size: 0.82rem;
}

.fj-mp-swatch {
    display: block;
    width: 100%;
    height: 32px;
    border-radius: 8px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
    margin-bottom: 3px;
}

.fj-mp-swatch.fj-mp-empty {
    background: repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.06) 0, rgba(255, 255, 255, 0.06) 5px,
            rgba(255, 255, 255, 0.02) 5px, rgba(255, 255, 255, 0.02) 10px);
}

.fj-mp-pts {
    font-size: 0.72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--fj-muted);
}

.fj-mp-head .fj-mp-swatch {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 440px) {
    .fj-menu-card,
    .fj-result-card,
    .fj-final-card {
        padding: 20px 16px;
    }

    .fj-current-preview {
        height: 80px;
    }

    .fj-code-field {
        font-size: 1.4rem;
        letter-spacing: 0.16em;
    }

    .fj-mp-swatch {
        height: 24px;
    }
}
