/* ==========================================================================
   Erdélyi Preferánsz — Neon Salon / Cyber-Preferánsz Design System
   NOTE: Strictly additive over app.css. Never overrides card face sizing
         or .playing-card.face img owned by concurrent card work.
   ========================================================================== */

:root {
    --bg-obsidian: #15233d;
    --bg-deep: #1d3154;
    --glass-bg: rgba(24, 41, 72, 0.76);
    --glass-bg-strong: rgba(20, 35, 62, 0.90);
    --glass-border: rgba(0, 229, 255, 0.18);
    --glass-border-hover: rgba(0, 240, 181, 0.48);

    --neon-emerald: #00f0b5;
    --neon-cyan: #00d4ff;
    --neon-crimson: #ff2e63;
    --neon-gold: #ffbe0b;

    --text-primary: #eef6ff;
    --text-secondary: #adc4e4;
    --text-muted: #6983a5;

    --font-display: 'Exo 2', 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Space Grotesk', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;

    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-glass: 0 18px 48px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* ---- Global Base & Scrollbar -------------------------------------------- */
html, body {
    background: var(--bg-obsidian) !important;
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1:focus {
    outline: none;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(5, 9, 20, 0.7); }
::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.25);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 240, 181, 0.45); }

/* ---- Ambient Aurora Backdrop -------------------------------------------- */
.ambient-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(ellipse 85% 65% at 50% -8%, rgba(0, 240, 181, 0.22), transparent 72%),
        radial-gradient(ellipse 75% 55% at 92% 100%, rgba(0, 212, 255, 0.18), transparent 72%),
        linear-gradient(180deg, #14223b 0%, #1d3154 52%, #132038 100%);
}

.ambient-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 35%, transparent 100%);
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: 0.55;
    will-change: transform;
    animation: orbDrift 22s ease-in-out infinite alternate;
}

.ambient-orb.orb-1 {
    width: 520px;
    height: 520px;
    top: -140px;
    left: -100px;
    background: radial-gradient(circle, rgba(0, 240, 181, 0.36), transparent 70%);
}

.ambient-orb.orb-2 {
    width: 480px;
    height: 480px;
    top: 22%;
    right: -130px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.30), transparent 70%);
    animation-delay: -7s;
    animation-duration: 26s;
}

.ambient-orb.orb-3 {
    width: 440px;
    height: 440px;
    bottom: -160px;
    left: 28%;
    background: radial-gradient(circle, rgba(255, 46, 99, 0.22), transparent 70%);
    animation-delay: -13s;
    animation-duration: 30s;
}

@keyframes orbDrift {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(40px, -28px, 0) scale(1.09); }
}

.mud-layout,
.mud-main-content {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

/* ---- Cyber AppBar ------------------------------------------------------- */
.cyber-appbar.mud-appbar {
    background: rgba(17, 30, 54, 0.82) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 229, 255, 0.18);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}

.cyber-appbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 240, 181, 0.6) 30%, rgba(0, 212, 255, 0.65) 70%, transparent 100%);
    pointer-events: none;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.08rem;
    letter-spacing: 0.02em;
    color: var(--text-primary) !important;
}

.brand-emblem {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 240, 181, 0.18), rgba(0, 212, 255, 0.14));
    border: 1px solid rgba(0, 240, 181, 0.55);
    box-shadow: 0 0 18px rgba(0, 240, 181, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.brand:hover .brand-emblem {
    transform: translateY(-1px) scale(1.04);
    border-color: rgba(0, 240, 181, 0.85);
    box-shadow: 0 0 24px rgba(0, 240, 181, 0.52), 0 0 14px rgba(0, 212, 255, 0.32);
}

.brand-crest-icon {
    width: 24px;
    height: 24px;
    display: block;
}

.brand-text {
    background: linear-gradient(95deg, #ffffff 0%, #c6fff0 58%, #7be8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-tag {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    padding: 2px 7px;
    border-radius: 999px;
    color: var(--neon-emerald);
    background: rgba(0, 240, 181, 0.12);
    border: 1px solid rgba(0, 240, 181, 0.35);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-pill.mud-button-root {
    border-radius: 999px;
    padding: 4px 14px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.88rem;
    text-transform: none;
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-pill.mud-button-root:hover {
    border-color: rgba(0, 240, 181, 0.5);
    background: rgba(0, 240, 181, 0.1);
    box-shadow: 0 0 18px rgba(0, 240, 181, 0.22);
    transform: translateY(-1px);
}

/* ---- Glass Surfaces & Typography ---------------------------------------- */
.glass-card.mud-paper {
    position: relative;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-glass) !important;
    color: var(--text-primary);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-card.mud-paper:hover {
    border-color: rgba(0, 229, 255, 0.3);
}

.glass-card-accent.mud-paper {
    border-color: rgba(0, 240, 181, 0.28);
}

.glass-card-accent.mud-paper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--neon-emerald), var(--neon-cyan), transparent);
    opacity: 0.85;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.section-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    display: inline-block;
    margin-bottom: 0.35rem;
}

.section-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.32rem;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin: 0;
}

.muted-copy {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.5;
}

/* ---- Buttons & Inputs --------------------------------------------------- */
.cyber-btn-primary.mud-button-root {
    background: linear-gradient(135deg, #00f0b5 0%, #00c4ff 100%) !important;
    color: #031411 !important;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 240, 181, 0.28);
    transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cyber-btn-primary.mud-button-root:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 240, 181, 0.45), 0 0 22px rgba(0, 212, 255, 0.35);
    filter: brightness(1.06);
}

.cyber-btn-primary.mud-button-root:disabled {
    opacity: 0.45 !important;
    filter: grayscale(0.4);
}

.cyber-btn-secondary.mud-button-root {
    background: linear-gradient(135deg, #ff2e63 0%, #ff5c8a 100%) !important;
    color: #ffffff !important;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: none;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(255, 46, 99, 0.3);
    transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cyber-btn-secondary.mud-button-root:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(255, 46, 99, 0.48);
    filter: brightness(1.07);
}

.cyber-btn-ghost.mud-button-root {
    border: 1px solid rgba(0, 212, 255, 0.32) !important;
    background: rgba(0, 212, 255, 0.07) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-body);
    font-weight: 600;
    text-transform: none;
    border-radius: 11px;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.cyber-btn-ghost.mud-button-root:hover:not(:disabled) {
    border-color: rgba(0, 240, 181, 0.65) !important;
    background: rgba(0, 240, 181, 0.14) !important;
    box-shadow: 0 0 18px rgba(0, 240, 181, 0.22);
}

/* Passz is red and the bid (Belépek / Mondom / Tartom) green, so the two never get mixed up. */
.cyber-btn-pass.mud-button-root {
    background: linear-gradient(135deg, #e0243a 0%, #b3162d 100%) !important;
    color: #ffffff !important;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: none;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(224, 36, 58, 0.32);
    transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cyber-btn-pass.mud-button-root:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(224, 36, 58, 0.5);
    filter: brightness(1.08);
}

.cyber-btn-bid.mud-button-root {
    background: linear-gradient(135deg, #3cf28a 0%, #12c46a 100%) !important;
    color: #03140b !important;
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: none;
    border-radius: 12px;
    box-shadow: 0 8px 22px rgba(18, 196, 106, 0.32);
    transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.cyber-btn-bid.mud-button-root:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(60, 242, 138, 0.48);
    filter: brightness(1.06);
}

/* MudBlazor Dark Input & Table Refinements */
.mud-input-control .mud-input-outlined .mud-input-outlined-border {
    border-color: rgba(0, 212, 255, 0.24) !important;
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mud-input-control .mud-input-outlined:hover .mud-input-outlined-border {
    border-color: rgba(0, 240, 181, 0.5) !important;
}

.mud-input-control .mud-input-outlined.mud-input-focused .mud-input-outlined-border {
    border-color: var(--neon-emerald) !important;
    box-shadow: 0 0 0 3px rgba(0, 240, 181, 0.14);
}

.mud-input-control .mud-input-slot,
.mud-input-control .mud-input-label {
    color: var(--text-primary);
}

.mud-input-helper-text {
    color: var(--text-secondary) !important;
}

.code-input input,
.table-code {
    font-family: var(--font-mono) !important;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-weight: 700;
}

.table-code {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.28);
}

.cyber-table.mud-table,
.cyber-table .mud-table-container {
    background: transparent !important;
    box-shadow: none !important;
}

.cyber-table thead th {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-secondary) !important;
    border-bottom: 1px solid rgba(0, 229, 255, 0.2) !important;
    background: rgba(4, 10, 24, 0.45) !important;
}

.cyber-table tbody tr {
    transition: background 0.16s ease;
}

.cyber-table tbody tr:hover {
    background: rgba(0, 240, 181, 0.08) !important;
}

.cyber-table tbody td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    color: var(--text-primary);
}

.cyber-alert.mud-alert {
    background: rgba(0, 212, 255, 0.09) !important;
    border: 1px solid rgba(0, 212, 255, 0.28);
    border-radius: 12px;
    color: var(--text-primary);
}

/* ---- Home / Lobby ------------------------------------------------------- */
.lobby-shell {
    padding-top: 2rem;
    padding-bottom: 3rem;
}

.hero {
    text-align: center;
    padding: 1.5rem 0 2.2rem;
    position: relative;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 6px 14px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--neon-emerald);
    background: rgba(0, 240, 181, 0.09);
    border: 1px solid rgba(0, 240, 181, 0.34);
    box-shadow: 0 0 24px rgba(0, 240, 181, 0.16);
    margin-bottom: 1.35rem;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-emerald);
    box-shadow: 0 0 10px var(--neon-emerald);
    animation: livePulse 2s ease-in-out infinite;
    display: inline-block;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.8); }
}

.hero-suits {
    display: flex;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 1.25rem;
}

.suit-medallion {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(12, 22, 42, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease, box-shadow 0.25s ease;
    animation: medallionFloat 5s ease-in-out infinite;
}

.suit-medallion:nth-child(2) { animation-delay: -1.2s; }
.suit-medallion:nth-child(3) { animation-delay: -2.4s; }
.suit-medallion:nth-child(4) { animation-delay: -3.6s; }

@keyframes medallionFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.suit-medallion .suit-icon {
    width: 30px;
    height: 30px;
}

.suit-medallion.medallion-zold:hover { border-color: rgba(0, 240, 181, 0.7); box-shadow: 0 0 24px rgba(0, 240, 181, 0.35); transform: translateY(-6px); }
.suit-medallion.medallion-sarga:hover { border-color: rgba(255, 190, 11, 0.75); box-shadow: 0 0 24px rgba(255, 190, 11, 0.35); transform: translateY(-6px); }
.suit-medallion.medallion-piros:hover { border-color: rgba(255, 46, 99, 0.75); box-shadow: 0 0 24px rgba(255, 46, 99, 0.38); transform: translateY(-6px); }
.suit-medallion.medallion-makk:hover { border-color: rgba(244, 162, 97, 0.75); box-shadow: 0 0 24px rgba(244, 162, 97, 0.35); transform: translateY(-6px); }

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.35rem, 5.2vw, 3.85rem);
    line-height: 1.06;
    letter-spacing: -0.025em;
    margin: 0 auto 0.85rem;
    background: linear-gradient(125deg, #ffffff 10%, #8effe3 50%, #3ad7ff 92%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    text-shadow: 0 0 42px rgba(0, 240, 181, 0.16);
}

.hero-subtitle {
    max-width: 640px;
    margin: 0 auto 1.4rem;
    color: var(--text-secondary);
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.55;
}

.hero-metrics {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.metric-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(12, 22, 42, 0.7);
    border: 1px solid rgba(0, 212, 255, 0.16);
}

.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--neon-emerald);
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(0, 240, 181, 0.1);
    border: 1px solid rgba(0, 240, 181, 0.35);
}

.how-it-works-section {
    margin-top: 2.25rem;
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 0.9rem;
}

.step-card {
    position: relative;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    background: rgba(22, 38, 68, 0.76);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 212, 255, 0.16);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.step-card:hover {
    border-color: rgba(0, 240, 181, 0.45);
    transform: translateY(-3px);
}

.step-num {
    font-family: var(--font-mono);
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    background: linear-gradient(135deg, var(--neon-emerald), var(--neon-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.55rem;
}

.step-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.step-body {
    color: var(--text-secondary);
    font-size: 0.87rem;
    line-height: 1.5;
}

/* ---- Waiting Room & Join Terminal --------------------------------------- */
.lobby-terminal {
    padding: 2rem !important;
}

.table-code-hero {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    padding: 4px 14px;
    border-radius: 10px;
    color: var(--neon-emerald);
    background: rgba(0, 240, 181, 0.1);
    border: 1px solid rgba(0, 240, 181, 0.38);
    box-shadow: 0 0 20px rgba(0, 240, 181, 0.18);
}

.seat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0 1.25rem;
}

.seat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 11px;
    background: rgba(6, 12, 26, 0.65);
    border: 1px solid rgba(0, 212, 255, 0.14);
}

.seat-item.is-you {
    border-color: rgba(0, 240, 181, 0.45);
    background: rgba(0, 240, 181, 0.08);
}

.seat-item-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text-primary);
}

.seat-tags {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.seat-tags .mud-chip.mud-chip-color-warning,
.player-tags .mud-chip.mud-chip-color-warning {
    background: rgba(255, 190, 11, 0.2) !important;
    color: #ffe8a3 !important;
    border: 1px solid rgba(255, 190, 11, 0.55);
}

/* ---- Card Aura Layer (Silhouette PNG styling over Claude's app.css) ---- */
.suit-icon {
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.16));
}

.playing-card {
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), filter 0.22s ease, opacity 0.22s ease;
}

.playing-card.face,
.playing-card.back {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.62));
}

.playing-card.medium {
    width: 66px;
    height: 110px;
}

.playing-card.face.playable {
    cursor: pointer;
    box-shadow: none !important;
    transform: translateY(-4px);
    filter:
        drop-shadow(0 0 2.5px #00f0b5)
        drop-shadow(0 0 10px rgba(0, 240, 181, 0.58))
        drop-shadow(0 10px 18px rgba(0, 0, 0, 0.65));
}

.playing-card.face.playable:hover {
    transform: translateY(-16px) scale(1.05);
    filter:
        drop-shadow(0 0 3.5px #8effe3)
        drop-shadow(0 0 16px rgba(0, 240, 181, 0.85))
        drop-shadow(0 18px 26px rgba(0, 0, 0, 0.75));
}

.playing-card.face.selected {
    box-shadow: none !important;
    transform: translateY(-20px) scale(1.05);
    filter:
        drop-shadow(0 0 3.5px #ff2e63)
        drop-shadow(0 0 16px rgba(255, 46, 99, 0.88))
        drop-shadow(0 18px 28px rgba(0, 0, 0, 0.75));
}

.playing-card.face.winner {
    box-shadow: none !important;
    filter:
        drop-shadow(0 0 3.5px #ffbe0b)
        drop-shadow(0 0 18px rgba(255, 190, 11, 0.92))
        drop-shadow(0 14px 24px rgba(0, 0, 0, 0.72));
}

.playing-card.face.dimmed {
    opacity: 0.46;
    filter: brightness(0.72) saturate(0.7) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.card-talon-badge {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    padding: 1px 6px;
    border-radius: 999px;
    color: #04151c;
    background: linear-gradient(135deg, #00f0b5, #00d4ff);
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.55);
    pointer-events: none;
}

/* ---- Game Arena --------------------------------------------------------- */
.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 365px;
    gap: 14px;
    padding: 14px;
    min-height: calc(100vh - 52px);
}

.felt {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 70% at 50% 48%, rgba(24, 148, 120, 0.42) 0%, rgba(16, 94, 82, 0.92) 45%, rgba(15, 60, 72, 0.95) 78%, rgba(15, 38, 58, 0.97) 100%);
    border-radius: 26px;
    border: 2px solid rgba(0, 240, 181, 0.3);
    box-shadow:
        0 0 0 1px rgba(0, 212, 255, 0.18),
        0 20px 48px rgba(5, 12, 26, 0.48),
        inset 0 0 55px rgba(4, 12, 24, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 14px 18px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--text-primary);
    min-height: 670px;
}

.felt::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0, 240, 181, 0.09) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%);
    pointer-events: none;
}

.felt::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(560px, 78%);
    aspect-ratio: 16 / 9;
    transform: translate(-50%, -52%);
    border-radius: 999px;
    border: 1px dashed rgba(0, 240, 181, 0.18);
    box-shadow: 0 0 60px rgba(0, 240, 181, 0.06), inset 0 0 40px rgba(0, 212, 255, 0.05);
    pointer-events: none;
}

.felt > * {
    position: relative;
    z-index: 1;
}

/* ---- Felt Top HUD Bar & Last Trick Popover ------------------------------ */
.felt-hud {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    z-index: 20;
}

.felt-hud-left { justify-self: start; }
.felt-hud-center {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}
.felt-hud-right { justify-self: end; }

.hud-pill {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--neon-cyan);
    background: rgba(6, 14, 30, 0.72);
    border: 1px solid rgba(0, 212, 255, 0.25);
    padding: 5px 12px;
    border-radius: 999px;
    backdrop-filter: blur(10px);
    display: inline-block;
}

.last-trick-anchor {
    position: relative;
}

.hud-last-trick-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(6, 14, 30, 0.78);
    border: 1px solid rgba(0, 212, 255, 0.28);
    padding: 5px 12px;
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hud-last-trick-btn:hover,
.hud-last-trick-btn.active {
    border-color: rgba(0, 240, 181, 0.65);
    background: rgba(0, 240, 181, 0.14);
    box-shadow: 0 0 18px rgba(0, 240, 181, 0.28);
}

.hud-last-winner {
    color: var(--neon-gold);
}

.last-trick-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 40;
    min-width: 240px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(7, 15, 31, 0.94);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(0, 229, 255, 0.35);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72), 0 0 24px rgba(0, 212, 255, 0.18);
    animation: popoverFade 0.18s ease-out;
}

@keyframes popoverFade {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.last-trick-popover-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--neon-gold);
    margin-bottom: 10px;
}

.last-trick-popover-cards {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.popover-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.72rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.popover-close:hover {
    color: #fff;
    border-color: rgba(255, 46, 99, 0.55);
}

.opponents {
    display: flex;
    justify-content: space-around;
    gap: 16px;
    flex-wrap: wrap;
}

.table-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 0;
    min-height: 255px;
}

.contract-chip.mud-chip {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.94rem;
    background: linear-gradient(135deg, rgba(255, 190, 11, 0.22), rgba(255, 140, 0, 0.18)) !important;
    border: 1px solid rgba(255, 190, 11, 0.55) !important;
    color: #ffe8a3 !important;
    box-shadow: 0 0 22px rgba(255, 190, 11, 0.22);
}

.double-chip.mud-chip {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.78rem;
    background: rgba(255, 46, 99, 0.2) !important;
    border: 1px solid rgba(255, 46, 99, 0.55) !important;
    color: #ffc2d4 !important;
}

/* ---- Talon Showcase (Talon & Kontra phases only) ------------------------ */
.talon-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 18px;
    background: rgba(6, 14, 30, 0.78);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(0, 212, 255, 0.36);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.52), 0 0 26px rgba(0, 212, 255, 0.16);
    animation: talonReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes talonReveal {
    from { opacity: 0; transform: translateY(-10px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.talon-showcase-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.talon-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--neon-cyan);
}

.talon-declarer {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.talon-showcase-cards {
    display: flex;
    gap: 14px;
    align-items: center;
}

/* ---- Deal Summary Toast ------------------------------------------------- */
.deal-summary-card {
    max-width: min(520px, 92%);
    padding: 12px 16px;
    border-radius: 16px;
    background: rgba(7, 16, 34, 0.88);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 240, 181, 0.42);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.58), 0 0 28px rgba(0, 240, 181, 0.18);
    text-align: center;
    animation: talonReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.deal-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.deal-summary-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.96rem;
    color: var(--text-primary);
}

.deal-summary-deltas {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.delta-pill {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
}

.delta-good {
    color: var(--neon-emerald);
    background: rgba(0, 240, 181, 0.14);
    border: 1px solid rgba(0, 240, 181, 0.4);
}

.delta-bad {
    color: #ff9cb6;
    background: rgba(255, 46, 99, 0.16);
    border: 1px solid rgba(255, 46, 99, 0.45);
}

/* ---- Directional Trick Compass & Sweep Animations ----------------------- */
.trick-compass {
    position: relative;
    width: 360px;
    height: 245px;
    margin: 0 auto;
    transition: transform 0.48s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease;
}

.compass-ring-watermark {
    position: absolute;
    inset: 22px 46px;
    border-radius: 50%;
    border: 1px dashed rgba(0, 240, 181, 0.16);
    background: radial-gradient(circle, rgba(0, 240, 181, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.compass-slot {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: opacity 0.22s ease, transform 0.25s ease;
}

.compass-slot.slot-left {
    left: 28px;
    top: 50%;
    transform: translateY(-54%) rotate(-6deg);
    animation: flyFromLeft 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

.compass-slot.slot-right {
    right: 28px;
    top: 50%;
    transform: translateY(-54%) rotate(6deg);
    animation: flyFromRight 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

.compass-slot.slot-top {
    left: 50%;
    top: 6px;
    transform: translateX(-50%);
    animation: flyFromTop 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

.compass-slot.slot-south {
    left: 50%;
    bottom: 6px;
    transform: translateX(-50%);
    animation: flyFromSouth 0.32s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

@keyframes flyFromLeft {
    from { opacity: 0; transform: translate(-120px, -110%) scale(0.76) rotate(-18deg); }
    to { opacity: 1; transform: translate(0, -54%) scale(1) rotate(-6deg); }
}

@keyframes flyFromRight {
    from { opacity: 0; transform: translate(120px, -110%) scale(0.76) rotate(18deg); }
    to { opacity: 1; transform: translate(0, -54%) scale(1) rotate(6deg); }
}

@keyframes flyFromTop {
    from { opacity: 0; transform: translate(-50%, -90px) scale(0.76); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

@keyframes flyFromSouth {
    from { opacity: 0; transform: translate(-50%, 95px) scale(0.84); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.compass-slot.is-loser {
    opacity: 0.72;
}

.compass-slot.is-winner .trick-name {
    border-color: rgba(255, 190, 11, 0.78);
    background: rgba(34, 24, 5, 0.92);
    color: #ffe8a3;
    box-shadow: 0 0 14px rgba(255, 190, 11, 0.38);
}

.trick-compass.sweeping.sweep-to-south {
    animation: sweepToSouth 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.trick-compass.sweeping.sweep-to-left {
    animation: sweepToLeft 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.trick-compass.sweeping.sweep-to-right {
    animation: sweepToRight 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.trick-compass.sweeping.sweep-to-top {
    animation: sweepToTop 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes sweepToSouth {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(0, 185px) scale(0.26); }
}

@keyframes sweepToLeft {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(-210px, -155px) scale(0.26); }
}

@keyframes sweepToRight {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(210px, -155px) scale(0.26); }
}

@keyframes sweepToTop {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(0, -185px) scale(0.26); }
}

.trick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.trick-name {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(6, 13, 27, 0.84);
    border: 1px solid rgba(0, 212, 255, 0.28);
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

.trick-order {
    color: var(--neon-cyan);
    margin-right: 2px;
}

.status-line {
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(6, 14, 30, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 181, 0.28);
    padding: 7px 18px;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-height: 1.5em;
    text-align: center;
}

.status-line.status-winner {
    border-color: rgba(255, 190, 11, 0.75);
    background: linear-gradient(135deg, rgba(32, 23, 6, 0.92), rgba(14, 20, 36, 0.92));
    color: #ffe8a3;
    box-shadow: 0 0 28px rgba(255, 190, 11, 0.35), 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: popoverFade 0.22s ease-out;
}

.my-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.hand {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 20px;
}

.action-panel {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 16px;
    border: 1px solid rgba(0, 240, 181, 0.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 24px rgba(0, 240, 181, 0.16);
}

/* ---- Player Badges (HUD Pods & Speech Bubbles) ------------------------- */
.player-badge {
    position: relative;
    background: rgba(14, 28, 50, 0.76);
    backdrop-filter: blur(14px);
    border-radius: 16px;
    padding: 10px 14px;
    min-width: 206px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.42);
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.player-badge.compact {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    min-width: auto;
    padding: 7px 14px;
    border-radius: 999px;
}

.player-badge.compact .player-header {
    margin-bottom: 0;
}

.player-badge.compact .player-tags {
    margin-bottom: 0;
    min-height: 0;
}

.player-badge.to-act {
    border-color: var(--neon-gold);
    box-shadow:
        0 0 0 1px rgba(255, 190, 11, 0.5),
        0 0 24px rgba(255, 190, 11, 0.4),
        0 10px 28px rgba(0, 0, 0, 0.5);
    animation: activeTurnPulse 2.4s ease-in-out infinite;
}

.player-badge.won-trick {
    border-color: var(--neon-gold);
    animation: wonTrickGlow 0.9s ease-out;
}

@keyframes wonTrickGlow {
    0% { transform: scale(1); box-shadow: 0 0 0 2px #ffbe0b, 0 0 36px rgba(255, 190, 11, 0.85); }
    50% { transform: scale(1.04); box-shadow: 0 0 0 3px #ffe8a3, 0 0 42px rgba(255, 190, 11, 0.95); }
    100% { transform: scale(1); }
}

@keyframes activeTurnPulse {
    0%, 100% { box-shadow: 0 0 0 1px rgba(255, 190, 11, 0.5), 0 0 22px rgba(255, 190, 11, 0.36); }
    50% { box-shadow: 0 0 0 2px rgba(255, 190, 11, 0.78), 0 0 32px rgba(255, 190, 11, 0.58); }
}

.call-bubble {
    position: absolute;
    left: 50%;
    bottom: -14px;
    transform: translateX(-50%);
    z-index: 15;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    white-space: nowrap;
    padding: 3px 10px;
    border-radius: 999px;
    color: #03151c;
    background: linear-gradient(135deg, #00f0b5, #38e2ff);
    box-shadow: 0 6px 18px rgba(0, 212, 255, 0.42);
    animation: bubblePop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.player-badge.compact .call-bubble {
    bottom: auto;
    top: -16px;
}

@keyframes bubblePop {
    from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.84); }
    to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.player-badge.sits-out {
    opacity: 0.48;
    filter: saturate(0.6);
}

.player-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 4px;
}

.player-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(147, 172, 203, 0.45);
    flex-shrink: 0;
}

.player-badge.to-act .player-dot {
    background: var(--neon-gold);
    box-shadow: 0 0 10px var(--neon-gold);
}

.player-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.04rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.you-tag {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 999px;
    color: var(--neon-emerald);
    background: rgba(0, 240, 181, 0.14);
    border: 1px solid rgba(0, 240, 181, 0.35);
}

.player-tags {
    min-height: 6px;
    margin-bottom: 6px;
}

.player-tags .mud-chip {
    margin: 2px 4px 2px 0;
    height: 21px;
    font-size: 0.72rem;
    font-weight: 600;
}

.player-tags .mud-chip.mud-chip-color-default {
    background: rgba(255, 255, 255, 0.12) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.player-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stat-pill {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 8px;
}

.stat-pill b {
    color: var(--text-primary);
}

.card-fan {
    display: flex;
    margin-top: 8px;
}

.card-fan .playing-card {
    margin-right: -28px;
}

.side-last-trick {
    display: flex;
    justify-content: space-around;
    gap: 8px;
    flex-wrap: wrap;
    padding: 8px;
    border-radius: 12px;
    background: rgba(4, 10, 22, 0.55);
    border: 1px solid rgba(0, 212, 255, 0.14);
}

.talon-note {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: 8px;
    background: rgba(0, 212, 255, 0.08);
    border: 1px solid rgba(0, 212, 255, 0.22);
}

.talon-note b {
    color: var(--neon-cyan);
}

/* ---- Side Panel --------------------------------------------------------- */
.side-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.side-panel .me-row td {
    background: rgba(0, 240, 181, 0.11) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.side-panel .me-row td:first-child {
    box-shadow: inset 3px 0 0 var(--neon-emerald);
}

.calls-feed {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.call-line {
    font-size: 0.86rem;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

.call-line b {
    color: var(--neon-cyan);
}

.score-history-wrap {
    max-height: 290px;
    overflow-y: auto;
    margin-top: 6px;
}

.score-history td,
.score-history th {
    font-family: var(--font-mono);
    font-size: 0.76rem !important;
    padding: 4px 6px !important;
}

.settlement {
    max-width: 680px;
    width: min(94vw, 680px);
}

/* ---- Rules Page --------------------------------------------------------- */
.rules-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.rules-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.75rem, 3.6vw, 2.5rem);
    background: linear-gradient(125deg, #ffffff 10%, #8effe3 55%, #3ad7ff 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin: 0;
}

.rule-card {
    padding: 1.4rem 1.5rem !important;
    margin-bottom: 1rem;
}

.rule-card-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

.rule-index {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 7px;
    color: var(--neon-emerald);
    background: rgba(0, 240, 181, 0.12);
    border: 1px solid rgba(0, 240, 181, 0.3);
}

.rule-heading {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--text-primary);
    margin: 0;
}

.rule-body {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.96rem;
}

.rule-body b {
    color: var(--text-primary);
}

.rules-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.rules-toc a {
    font-size: 0.82rem;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--neon-emerald);
    border: 1px solid rgba(0, 240, 181, 0.3);
    text-decoration: none;
}

.rules .rule-card {
    scroll-margin-top: 80px;
}

.rule-subheading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin: 1rem 0 0.4rem;
}

.rule-list,
.rule-steps {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.96rem;
    padding-left: 1.3rem;
    margin: 0 0 0.6rem;
}

.rule-list li,
.rule-steps li {
    margin-bottom: 0.35rem;
}

.rule-list b,
.rule-steps b,
.rule-terms dt {
    color: var(--text-primary);
}

.rule-terms {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.45rem 1rem;
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.5;
}

.rule-terms dt {
    font-weight: 700;
}

.rule-terms dd {
    margin: 0;
    color: var(--text-secondary);
}

.rule-table-wrap {
    overflow-x: auto;
    margin-bottom: 0.6rem;
}

.button-guide {
    display: grid;
    gap: 0.6rem;
    margin: 0.6rem 0 0.8rem;
}

.button-guide-row {
    display: grid;
    grid-template-columns: minmax(150px, max-content) 1fr;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.94rem;
}

.guide-btn {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
}

.guide-btn-outlined {
    border: 1px solid currentColor;
}

@media (max-width: 640px) {
    .rule-card {
        padding: 1.1rem 1rem !important;
    }

    .rule-terms {
        grid-template-columns: 1fr;
        gap: 0.1rem;
    }

    .rule-terms dd {
        margin-bottom: 0.5rem;
    }

    .button-guide-row {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}

/* ---- End-of-Deal Celebration Modal -------------------------------------- */
.round-result-modal {
    width: min(94vw, 600px);
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: resultModalEnter 0.42s cubic-bezier(0.18, 0.9, 0.28, 1.06);
}

@keyframes resultModalEnter {
    0% { opacity: 0; transform: translateY(22px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.result-crest {
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: crestPop 0.52s cubic-bezier(0.2, 1.15, 0.3, 1);
}

@keyframes crestPop {
    0% { opacity: 0; transform: scale(0.4) rotate(-18deg); }
    65% { transform: scale(1.1) rotate(4deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

.result-crest-rays {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.25);
    animation: spinRays 12s linear infinite;
}

@keyframes spinRays {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.result-crest.made {
    background: radial-gradient(circle, rgba(255, 190, 11, 0.34), rgba(0, 240, 181, 0.16));
    border: 2px solid rgba(255, 190, 11, 0.72);
    box-shadow: 0 0 34px rgba(255, 190, 11, 0.42), 0 0 18px rgba(0, 240, 181, 0.25);
}

.result-crest.made .result-crest-rays {
    border-color: rgba(255, 190, 11, 0.48);
}

.result-crest.failed {
    background: radial-gradient(circle, rgba(255, 46, 99, 0.34), rgba(255, 190, 11, 0.12));
    border: 2px solid rgba(255, 46, 99, 0.72);
    box-shadow: 0 0 32px rgba(255, 46, 99, 0.42);
}

.result-crest.failed .result-crest-rays {
    border-color: rgba(255, 46, 99, 0.45);
}

.result-crest.all-pass {
    background: radial-gradient(circle, rgba(0, 212, 255, 0.32), rgba(0, 240, 181, 0.12));
    border: 2px solid rgba(0, 212, 255, 0.7);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.35);
}

.result-crest-icon {
    font-size: 2rem;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.result-top-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.result-points-badge {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
}

.result-points-badge.is-made {
    color: #031510;
    background: linear-gradient(135deg, #00f0b5, #ffbe0b);
    box-shadow: 0 0 18px rgba(0, 240, 181, 0.35);
}

.result-points-badge.is-failed {
    color: #ffe8ef;
    background: rgba(255, 46, 99, 0.28);
    border: 1px solid rgba(255, 46, 99, 0.65);
    box-shadow: 0 0 16px rgba(255, 46, 99, 0.3);
}

.result-points-badge.pass-badge {
    color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.16);
    border: 1px solid rgba(0, 212, 255, 0.48);
}

.result-headline {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(1.35rem, 3vw, 1.85rem);
    color: var(--text-primary);
    margin: 0.15rem 0 0.5rem;
}

.result-contract-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.mod-pill {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    color: var(--neon-cyan);
    background: rgba(0, 212, 255, 0.12);
    border: 1px solid rgba(0, 212, 255, 0.35);
}

.mod-pill.mod-kontra {
    color: #ffc2d4;
    background: rgba(255, 46, 99, 0.2);
    border-color: rgba(255, 46, 99, 0.5);
}

.result-subheadline {
    color: var(--text-secondary);
    font-size: 0.94rem;
    margin: 0 0 1rem;
}

.result-players {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.result-player-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 13px;
    background: rgba(7, 15, 31, 0.72);
    border: 1px solid rgba(0, 212, 255, 0.16);
}

.result-player-row.is-you {
    border-color: rgba(0, 240, 181, 0.45);
    background: rgba(0, 240, 181, 0.08);
}

.result-player-row.is-declarer {
    box-shadow: inset 3px 0 0 var(--neon-gold);
}

.result-player-row.sat-out {
    opacity: 0.6;
}

.rp-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.rp-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.rp-roles {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.rp-role {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.08);
}

.rp-role.rp-declarer {
    color: #ffe8a3;
    background: rgba(255, 190, 11, 0.2);
}

.rp-role.rp-kontra {
    color: #ffc2d4;
    background: rgba(255, 46, 99, 0.22);
}

.rp-tricks {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.rp-right {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.delta-neutral {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.cellar-pill {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    color: #ffe8a3;
    background: rgba(255, 190, 11, 0.16);
    border: 1px solid rgba(255, 190, 11, 0.45);
}

.rp-total {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.rp-total b {
    color: var(--text-primary);
}

.ready-roster {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.ready-pill {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    padding: 4px 11px;
    border-radius: 999px;
}

.ready-pill.is-ready {
    color: var(--neon-emerald);
    background: rgba(0, 240, 181, 0.14);
    border: 1px solid rgba(0, 240, 181, 0.45);
}

.ready-pill.waiting {
    color: #ffe8a3;
    background: rgba(255, 190, 11, 0.14);
    border: 1px solid rgba(255, 190, 11, 0.42);
}

/* ---- Mobile & Tablet ---------------------------------------------------- */
@media (max-width: 1024px) {
    .game-layout {
        grid-template-columns: 1fr;
        padding: 8px;
    }

    .how-it-works-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .felt {
        min-height: auto;
        border-radius: 18px;
        padding: 10px;
    }

    .felt-hud {
        display: flex !important;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 4px 8px;
    }

    .felt-hud-left,
    .felt-hud-center,
    .felt-hud-right {
        justify-self: center;
    }

    .last-trick-popover {
        right: 50%;
        transform: translateX(50%);
    }

    .trick-compass {
        width: 260px;
        height: 160px;
    }

    .opponents .player-badge .player-tags {
        gap: 4px;
    }

    .compass-ring-watermark {
        inset: 14px 26px;
    }

    .compass-slot.slot-left {
        left: 6px;
    }

    .compass-slot.slot-right {
        right: 6px;
    }

    .player-badge {
        min-width: 145px;
        padding: 8px 10px;
    }

    /* Phone: opponents side by side, their card backs hidden (the count is in the tags), so your hand fits. */
    .opponents {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .opponents .player-badge {
        min-width: 0;
        flex: 1 1 0;
    }

    .opponents .card-fan {
        display: none;
    }

    .player-badge.compact {
        border-radius: 14px;
        gap: 6px;
        padding: 6px 10px;
    }

    .hand {
        gap: 4px;
    }

    .how-it-works-grid {
        grid-template-columns: 1fr;
    }

    .brand-tag {
        display: none;
    }

    .brand {
        gap: 0.4rem;
        font-size: 0.86rem;
    }

    .brand-emblem {
        width: 28px;
        height: 28px;
    }

    .brand-crest-icon {
        width: 20px;
        height: 20px;
    }

    .brand-text {
        white-space: nowrap;
    }

    .nav-pill.mud-button-root {
        padding: 3px 8px;
        font-size: 0.75rem;
    }

    .lobby-terminal {
        padding: 1.25rem !important;
    }

    .round-result-modal {
        padding: 1.25rem !important;
    }

    .result-player-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .rp-right {
        justify-content: flex-start;
    }
}

/* ---- Reduced Motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ambient-orb,
    .suit-medallion,
    .live-dot,
    .player-badge.to-act,
    .player-badge.won-trick,
    .call-bubble,
    .talon-showcase,
    .deal-summary-card,
    .compass-slot,
    .trick-compass.sweeping,
    .round-result-modal,
    .result-crest,
    .result-crest-rays {
        animation: none !important;
    }
}

/* ---- Blazor Errors ------------------------------------------------------ */
#blazor-error-ui {
    background: rgba(45, 10, 22, 0.94) !important;
    color: #ffe3eb !important;
    border-top: 1px solid rgba(255, 46, 99, 0.55);
    backdrop-filter: blur(12px);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.55);
}

#blazor-error-ui .reload {
    color: var(--neon-emerald);
    font-weight: 700;
    margin-left: 0.5rem;
}

/* Visszadobás: kept apart from the other buttons, so it is not hit by accident. */
.throwback-zone {
    display: flex;
    justify-content: center;
    margin: 18px 0 6px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 90, 110, 0.35);
}

.throwback-confirm {
    text-align: center;
    max-width: 420px;
}

/* ---- Stable table layout --------------------------------------------------------------------------------------
   Nothing on the table may change height while the cards come and the turn moves on: every area keeps a fixed
   place (HUD, badges, the stage of the trick or talon, the status line, the action bar, the hand), and the things
   that come and go (turn flag, throw-back question) float above the flow instead of pushing it. */
.felt {
    justify-content: flex-start;
    gap: 14px;
}

.felt-hud {
    min-height: 40px;
}

.turn-flag {
    position: absolute;
    top: -11px;
    right: 12px;
    z-index: 16;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 9px;
    border-radius: 999px;
    color: #03151c;
    background: linear-gradient(135deg, #00f0b5, #7dffd8);
    box-shadow: 0 4px 14px rgba(0, 240, 181, 0.45);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.turn-flag.on {
    visibility: visible;
    opacity: 1;
}

.player-badge.compact .turn-flag {
    top: -12px;
    right: 18px;
}

.player-tags {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    height: 25px;
    min-height: 25px;
}

.player-badge.compact .player-tags {
    height: 25px;
    min-height: 25px;
    align-items: center;
}

.player-tags .mud-chip {
    flex: 0 0 auto;
}

.card-fan {
    height: 70px;
}

.table-center {
    min-height: 0;
    justify-content: flex-start;
    gap: 10px;
    padding: 4px 0;
}

.center-stage {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-line {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(2 * 1.3em + 14px);
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    border-radius: 22px;
}

/* The trick: whole cards, never see-through; the losers are only darker. */
.compass-slot .playing-card,
.compass-slot .playing-card:disabled {
    opacity: 1;
}

.compass-slot.is-loser {
    opacity: 1;
}

.compass-slot.is-loser .playing-card.face {
    filter: brightness(0.78) saturate(0.85) drop-shadow(0 8px 16px rgba(0, 0, 0, 0.62));
}

/* The dealer sitting out sees the three who play in a row, under their badges. */
.compass-slot.slot-mid {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -54%);
    animation: flyFromMid 0.34s cubic-bezier(0.2, 0.9, 0.25, 1) backwards;
}

@keyframes flyFromMid {
    from { opacity: 0; transform: translate(-50%, -110%) scale(0.76); }
    to { opacity: 1; transform: translate(-50%, -54%) scale(1); }
}

.trick-compass.sweeping.sweep-to-mid {
    animation: sweepToTop 0.65s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.action-slot {
    position: relative;
    width: 100%;
    height: auto; /* grows with a wrapped panel; a wide screen gives it a fixed room below, where the panel scrolls down */
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-panel {
    flex-wrap: wrap; /* a row that scrolled sideways while centred cut its first buttons (Passz, the bid) off */
    max-width: 100%;
    row-gap: 6px;
    padding: 8px 14px;
}

.action-panel > * {
    flex: 0 0 auto;
}

.action-panel .mud-button-root {
    white-space: nowrap;
}

/* Licit: the bid and Passz are one group, the game declarations another. By default the groups dissolve into the
   panel's one wrapping row (bid and Passz still first); only a phone makes them boxes of their own. */
.action-panel > .action-core,
.action-panel > .action-games {
    display: contents;
}

/* Phone: the bid and Passz are the first row, the game declarations the rows under it. */
@media (max-width: 640px) {
    .action-panel > .action-core,
    .action-panel > .action-games {
        flex: 0 1 auto;
        min-width: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 6px 8px;
    }

    .action-panel > .action-games {
        flex-basis: 100%;
    }

    .action-panel > .action-divider {
        display: none;
    }
}

.action-label {
    margin-right: 2px;
    white-space: nowrap; /* inside .action-games it is no direct child of the panel any more */
    flex: 0 0 auto;
}

.action-divider {
    width: 1px;
    align-self: stretch;
    margin: 0 4px;
    background: rgba(0, 240, 181, 0.35);
}

.throwback-divider {
    background: rgba(255, 90, 110, 0.55);
    margin: 0 10px;
}

.throwback-zone {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    width: min(440px, 94vw);
    margin: 0;
    padding: 12px 14px;
    border-top: none;
    border-radius: 16px;
    background: rgba(32, 8, 16, 0.95);
    border: 1px solid rgba(255, 90, 110, 0.55);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}

.hand {
    min-height: 160px;
    align-content: flex-start;
}

@media (max-width: 960px) {
    .hand {
        min-height: 224px; /* two rows of 60 × 100 cards */
    }
}

@media (max-width: 640px) {
    .felt {
        gap: 8px;
    }

    .felt-hud {
        min-height: 66px; /* two rows: phase and contract, then double rounds, last trick and close */
        align-content: center;
    }

    .card-fan {
        height: 0;
    }

    .player-tags .mud-chip {
        height: 19px;
        font-size: 0.64rem;
        margin: 1px 3px 1px 0;
    }

    .player-tags .mud-chip .mud-chip-content {
        padding: 0 6px;
    }

    .center-stage {
        height: 172px;
    }

    .trick-compass {
        height: 168px;
    }

    .status-line {
        font-size: 0.84rem;
        height: calc(3 * 1.3em + 12px);
        padding: 6px 14px;
        border-radius: 16px;
    }

    .player-badge.compact {
        flex-wrap: nowrap;
        gap: 6px;
        max-width: 100%;
    }
}

/* The dealer sitting out takes as little room as possible: only his name and that he sits out. */
.opponents .player-badge.sits-out {
    flex: 0 1 auto;
}

.opponents .player-badge.sits-out .player-stats,
.opponents .player-badge.sits-out .card-fan {
    display: none;
}

@media (max-width: 640px) {
    .opponents {
        flex-wrap: nowrap !important;
    }

    .opponents .player-badge {
        min-width: 0;
        overflow: visible;
    }

    .opponents .player-badge.sits-out {
        max-width: 92px;
    }

    .opponents .player-badge.sits-out .player-tags .mud-chip:first-child {
        display: none; /* "osztó": with four players the one who sits out is always the dealer */
    }
}

/* The felt never grows wider than the screen because of a long row inside it (the action bar scrolls instead). */
.game-layout > .felt,
.game-layout > .side-panel {
    min-width: 0;
}

@media (max-width: 1024px) {
    .game-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Phone HUD: always two rows of the same height, whatever appears in it during the deal. */
@media (max-width: 640px) {
    .felt-hud {
        display: grid !important;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: 30px 30px;
        gap: 4px 8px;
        height: 64px;
        min-height: 64px;
        align-items: center;
    }

    .felt-hud-left {
        grid-row: 1;
        grid-column: 1;
        justify-self: start;
    }

    .felt-hud-center {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        min-width: 0;
        overflow: hidden;
    }

    .felt-hud-right {
        grid-row: 2;
        grid-column: 1 / span 2;
        justify-self: stretch;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .felt-hud .hud-pill {
        font-size: 0.68rem;
        padding: 3px 8px;
        white-space: nowrap;
    }

    .felt-hud .contract-chip.mud-chip,
    .felt-hud .double-chip.mud-chip {
        height: 24px;
        font-size: 0.72rem;
        margin: 0;
        white-space: nowrap;
    }

    .felt-hud .hud-last-trick-btn {
        font-size: 0.7rem;
        padding: 3px 9px;
        white-space: nowrap;
    }

    .felt-hud-right > .mud-button-root {
        font-size: 0.68rem;
        padding: 2px 6px;
        min-width: 0;
    }
}

@media (max-width: 640px) {
    /* Your own badge stays one line, also as the dealer sitting out. */
    .player-badge.compact .player-stats {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .player-badge.compact .stat-pill {
        padding: 2px 6px;
        font-size: 0.72rem;
    }

    .player-badge.compact.sits-out .player-tags .mud-chip:first-child {
        display: none;
    }
}

/* The dealer sitting out: the three cards in a row use the full width. */
.trick-compass.row-of-three {
    width: min(100%, 420px);
}

@media (max-width: 640px) {
    .trick-compass.row-of-three {
        width: 100%;
    }

    .trick-compass.row-of-three .trick-name {
        font-size: 0.62rem;
        padding: 1px 6px;
        max-width: 98px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .trick-compass.row-of-three .compass-slot.slot-left,
    .trick-compass.row-of-three .compass-slot.slot-right {
        transform: translateY(-54%);
    }

    /* HUD on a phone: row 1 the deal and the game, row 2 the double rounds, the last trick and closing. */
    .felt-hud-center {
        display: contents;
    }

    .felt-hud .contract-chip.mud-chip {
        grid-row: 1;
        grid-column: 2;
        justify-self: end;
        max-width: 100%;
        overflow: hidden;
    }

    .felt-hud .double-chip.mud-chip {
        grid-row: 2;
        grid-column: 1;
        justify-self: start;
    }

    .felt-hud-right {
        grid-row: 2;
        grid-column: 2;
        justify-self: end;
        justify-content: flex-end;
    }

    .felt-hud .hud-label {
        display: none;
    }
}

@media (max-width: 640px) {
    .felt-hud-right > .mud-button-root {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .felt-hud-right .last-trick-anchor {
        flex: 0 0 auto;
    }
}

/* Desktop: the HUD is one row of fixed height; the hand keeps room for two rows (ten or twelve cards wrap). */
@media (min-width: 641px) {
    .felt-hud {
        height: 40px;
    }

    .felt-hud-right {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 8px;
    }

    .felt-hud-right > .mud-button-root {
        white-space: nowrap;
    }
}

@media (min-width: 961px) {
    .hand {
        min-height: 308px; /* two rows of 84 × 140 cards */
    }
}

.hud-last-trick-btn {
    white-space: nowrap;
}

/* Desktop: the action bar has room for two rows and wraps instead of scrolling; the room is the same in every phase. */
@media (min-width: 641px) {
    .action-slot {
        height: 104px;
    }

    .action-panel {
        flex-wrap: wrap;
        white-space: normal;
        overflow-x: hidden;
        overflow-y: auto; /* a third row on a narrow screen scrolls instead of being cut off */
        max-height: 104px;
        row-gap: 6px;
        padding: 8px 14px;
    }
}

.cellar-table th,
.cellar-table td {
    padding: 4px 6px !important;
    font-size: 0.78rem;
}

.cellar-table th:first-child {
    white-space: nowrap;
}

/* Prefi: the declarer's red tricks in the contract chip ("piros fogás: 4/6"); tabular digits keep its width. */
.contract-chip .counted-tricks {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding-left: 6px;
    border-left: 1px solid rgba(255, 190, 11, 0.45);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* On a phone the chip has room for the game and the count only; the declarer's badge says "vállaló" anyway. */
@media (max-width: 640px) {
    .contract-chip .counted-tricks .counted-label,
    .contract-chip.has-counted .chip-declarer { display: none; }
    .contract-chip .counted-tricks { margin-left: 2px; padding-left: 4px; gap: 2px; }
}

/* Footer: year, what the site is, links to the rules and the FAQ. */
.site-footer {
    padding: 24px 16px 32px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--mud-palette-text-secondary);
}
.site-footer a { color: inherit; text-decoration: underline; }
