/* ==========================================================================
   lerneule.schule – Eulen-Schach: Mobile-First & Kreative Bretter
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

body.chess-page {
    min-height: 100dvh;
    background: linear-gradient(155deg, #fffbeb 0%, #f0f9ff 52%, #ecfdf5 100%);
    color: var(--le-ink, #1e293b);
    font-family: var(--le-font-sans, system-ui, -apple-system, sans-serif);
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    -webkit-tap-highlight-color: transparent;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

.mono {
    font-family: var(--le-font-mono, ui-monospace, monospace);
    font-variant-numeric: tabular-nums;
}

.uppercase {
    text-transform: uppercase;
}

/* ==========================================================================
   OBERE LEISTE
   ========================================================================== */
.top-bar {
    position: relative;
    z-index: 50;
    max-width: 1120px;
    margin: 0 auto 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 8px 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.brand-badge {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.brand-title {
    font-size: 1.18rem;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
}

.pill-action {
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 800;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.24);
    transition: transform 0.12s ease;
}

.pill-action:active {
    transform: scale(0.97);
}

.pill-action.shop-pill {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.24);
}

.icon-action {
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.12s ease;
}

.icon-action:hover {
    background: #f1f5f9;
}

.icon-action:active {
    transform: scale(0.96);
}

/* ==========================================================================
   HAUPT-LAYOUT (Responsive 2-Spalten)
   ========================================================================== */
.chess-layout {
    max-width: 1120px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

@media (min-width: 900px) {
    .chess-layout {
        grid-template-columns: minmax(0, 560px) minmax(290px, 1fr);
        gap: 20px;
    }
}

.board-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* ==========================================================================
   SPIELER-LEISTEN OBEN & UNTEN
   ========================================================================== */
.player-bar {
    position: relative;
    width: 100%;
    max-width: 560px;
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.94);
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.player-bar.is-turn {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.player-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.player-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-avatar svg {
    width: 100%;
    height: 100%;
    display: block;
}

.player-meta {
    min-width: 0;
    flex: 1;
}

.player-name-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
}

.player-name {
    font-size: 0.95rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 0 1 auto;
}

.team-chip {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    flex-shrink: 0;
    white-space: nowrap;
}

.team-chip.dark-team {
    background: #e0e7ff;
    color: #312e81;
}

.captured-row {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
    height: 20px;
    overflow: hidden;
    margin-top: 2px;
}

.cap-piece {
    width: 19px;
    height: 19px;
    display: inline-flex;
    flex-shrink: 0;
}

.cap-piece svg {
    width: 100%;
    height: 100%;
}

.cap-adv {
    font-size: 0.74rem;
    font-weight: 800;
    color: #0284c7;
    margin-left: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.player-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-shrink: 0;
}

.turn-pill {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 5px 10px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    white-space: nowrap;
    min-width: 88px;
    text-align: center;
    transition: opacity 0.15s ease;
}

.turn-pill.is-inactive {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.reaction-bubble {
    position: absolute;
    right: 12px;
    top: -11px;
    z-index: 6;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #f59e0b;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.14);
    white-space: nowrap;
    pointer-events: none;
    animation: popIn 0.2s ease;
}

@keyframes popIn {
    from { transform: scale(0.82); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   SCHACHBRETT (8x8 Responsive Grid)
   ========================================================================== */
.board-frame {
    width: min(94vw, 560px);
    aspect-ratio: 1 / 1;
    padding: 7px;
    border-radius: 20px;
    background: var(--board-border, #2d5336);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

.chess-board {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border-radius: 13px;
    overflow: hidden;
    user-select: none;
    touch-action: manipulation;
}

.sq {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3%;
    transition: filter 0.12s ease;
}

.sq.light {
    background: var(--sq-light, #f4f0dc);
    color: var(--coord-light, #42704c);
}

.sq.dark {
    background: var(--sq-dark, #67a474);
    color: var(--coord-dark, #f4f0dc);
}

#boardFrame[data-board] .sq::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Holzmaserung für Honig-Holz */
#boardFrame[data-board="honig"] .sq.light::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M0 14 Q20 10 42 15 T64 13 M0 34 Q24 39 48 33 T64 36 M0 52 Q18 48 40 53 T64 51' fill='none' stroke='rgba(146,64,14,0.12)' stroke-width='1.8'/%3E%3C/svg%3E");
}
#boardFrame[data-board="honig"] .sq.dark::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M0 16 Q22 12 44 17 T64 15 M0 37 Q26 42 46 35 T64 38 M0 54 Q20 50 42 55 T64 53' fill='none' stroke='rgba(69,26,3,0.18)' stroke-width='1.8'/%3E%3C/svg%3E");
}

/* Wasser-Wellen & Lichtreflexe für Ozean-Welle */
#boardFrame[data-board="ozean"] .sq.light::before {
    background-image:
        radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.55), transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M-4 18 Q12 12 28 18 T68 18 M-4 38 Q12 32 28 38 T68 38 M-4 56 Q12 50 28 56 T68 56' fill='none' stroke='rgba(14,165,233,0.22)' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}
#boardFrame[data-board="ozean"] .sq.dark::before {
    background-image:
        radial-gradient(circle at 70% 25%, rgba(125, 211, 252, 0.28), transparent 58%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M-4 16 Q14 10 30 16 T68 16 M-4 36 Q14 30 30 36 T68 36 M-4 54 Q14 48 30 54 T68 54' fill='none' stroke='rgba(224,247,250,0.34)' stroke-width='1.9' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* Edle Marmor-Adern in Gold & Stein für Gold-Marmor */
#boardFrame[data-board="marmor"] .sq.light::before {
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(226, 232, 240, 0.2)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M-2 54 Q18 42 29 29 T66 10 M10 66 Q28 50 42 40 T66 28' fill='none' stroke='rgba(148,163,184,0.34)' stroke-width='1.6'/%3E%3Cpath d='M2 46 Q20 35 34 22 T64 6' fill='none' stroke='rgba(217,119,6,0.28)' stroke-width='1.2'/%3E%3C/svg%3E");
}
#boardFrame[data-board="marmor"] .sq.dark::before {
    background-image:
        linear-gradient(135deg, rgba(15, 23, 42, 0.25), rgba(148, 163, 184, 0.08)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M-2 50 Q16 38 30 26 T66 8 M16 66 Q32 48 48 38 T66 24' fill='none' stroke='rgba(251,191,36,0.42)' stroke-width='1.5'/%3E%3Cpath d='M-2 22 Q16 14 28 6' fill='none' stroke='rgba(248,250,252,0.18)' stroke-width='1.2'/%3E%3C/svg%3E");
}

/* Facettierter Edelstein-Schliff für Zauber-Kristall */
#boardFrame[data-board="kristall"] .sq.light::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='32,4 60,32 32,60 4,32' fill='none' stroke='rgba(139,92,246,0.22)' stroke-width='1.4'/%3E%3Cpath d='M4 32 L60 32 M32 4 L32 60' stroke='rgba(255,255,255,0.55)' stroke-width='1'/%3E%3Ccircle cx='18' cy='18' r='1.6' fill='rgba(167,139,250,0.45)'/%3E%3C/svg%3E");
}
#boardFrame[data-board="kristall"] .sq.dark::before {
    background-image:
        radial-gradient(circle at 28% 28%, rgba(233, 213, 255, 0.26), transparent 60%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpolygon points='32,5 59,32 32,59 5,32' fill='none' stroke='rgba(245,243,255,0.26)' stroke-width='1.4'/%3E%3Ccircle cx='46' cy='18' r='1.8' fill='rgba(255,255,255,0.55)'/%3E%3Ccircle cx='17' cy='46' r='1.3' fill='rgba(255,255,255,0.4)'/%3E%3C/svg%3E");
}

/* Neon-Leiterbahnen für Cyber-Neon */
#boardFrame[data-board="cyber"] .sq.light::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M0 16 H20 L28 24 H46 M18 64 V44 L28 34' fill='none' stroke='rgba(6,182,212,0.24)' stroke-width='1.5'/%3E%3Ccircle cx='46' cy='24' r='2.2' fill='rgba(6,182,212,0.35)'/%3E%3C/svg%3E");
}
#boardFrame[data-board="cyber"] .sq.dark::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect x='4' y='4' width='56' height='56' rx='3' fill='none' stroke='rgba(45,212,191,0.26)' stroke-width='1.2'/%3E%3Cpath d='M8 20 H24 L32 28 H54 M16 56 V40 L26 30' fill='none' stroke='rgba(103,232,249,0.35)' stroke-width='1.5'/%3E%3Ccircle cx='54' cy='28' r='2.4' fill='rgba(103,232,249,0.55)'/%3E%3C/svg%3E");
}

/* Kopfsteinpflaster & Schleim-Blasen für Monster-Burg */
#boardFrame[data-board="monsterburg"] .sq.light::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M0 21 H64 M0 43 H64 M28 0 V21 M44 21 V43 M18 43 V64' fill='none' stroke='rgba(101,163,13,0.2)' stroke-width='1.4'/%3E%3Ccircle cx='48' cy='12' r='2.6' fill='rgba(168,85,247,0.16)'/%3E%3C/svg%3E");
}
#boardFrame[data-board="monsterburg"] .sq.dark::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M0 21 H64 M0 43 H64 M20 0 V21 M42 21 V43 M26 43 V64' fill='none' stroke='rgba(26,46,5,0.28)' stroke-width='1.5'/%3E%3Ccircle cx='15' cy='32' r='3' fill='rgba(190,242,100,0.28)'/%3E%3Ccircle cx='50' cy='52' r='2.2' fill='rgba(192,132,252,0.32)'/%3E%3C/svg%3E");
}

/* Metall-Nieten & Schaltkreise für Robo-Platine */
#boardFrame[data-board="platine"] .sq.light::before {
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(148, 163, 184, 0.14)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='8' cy='8' r='2' fill='rgba(100,116,139,0.4)'/%3E%3Ccircle cx='56' cy='8' r='2' fill='rgba(100,116,139,0.4)'/%3E%3Ccircle cx='8' cy='56' r='2' fill='rgba(100,116,139,0.4)'/%3E%3Ccircle cx='56' cy='56' r='2' fill='rgba(100,116,139,0.4)'/%3E%3Cpath d='M16 32 H48' stroke='rgba(148,163,184,0.24)' stroke-width='1.2' stroke-dasharray='4 4'/%3E%3C/svg%3E");
}
#boardFrame[data-board="platine"] .sq.dark::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M6 16 H26 L34 24 H56 M10 48 H28 L38 38 H56 M32 6 V18' fill='none' stroke='rgba(251,191,36,0.38)' stroke-width='1.6' stroke-linecap='round'/%3E%3Ccircle cx='56' cy='24' r='2.4' fill='rgba(251,191,36,0.55)'/%3E%3Ccircle cx='56' cy='38' r='2.4' fill='rgba(56,189,248,0.55)'/%3E%3Ccircle cx='32' cy='18' r='2.2' fill='rgba(251,191,36,0.45)'/%3E%3C/svg%3E");
}

/* Mondstein & Sternen-Kosmos für Galaxie-Kosmos */
#boardFrame[data-board="galaxie"] .sq.light::before {
    background-image:
        radial-gradient(circle at 25% 30%, rgba(165, 180, 252, 0.22), transparent 52%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='20' cy='22' r='6' fill='rgba(99,102,241,0.1)' stroke='rgba(99,102,241,0.18)' stroke-width='1.2'/%3E%3Ccircle cx='46' cy='44' r='4.5' fill='rgba(99,102,241,0.1)' stroke='rgba(99,102,241,0.16)' stroke-width='1.1'/%3E%3Ccircle cx='44' cy='16' r='1.5' fill='rgba(99,102,241,0.3)'/%3E%3C/svg%3E");
}
#boardFrame[data-board="galaxie"] .sq.dark::before {
    background-image:
        radial-gradient(circle at 72% 28%, rgba(168, 85, 247, 0.3), transparent 58%),
        radial-gradient(circle at 22% 76%, rgba(56, 189, 248, 0.24), transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Ccircle cx='14' cy='15' r='1.5' fill='rgba(253,224,71,0.75)'/%3E%3Ccircle cx='48' cy='13' r='1.2' fill='rgba(255,255,255,0.8)'/%3E%3Ccircle cx='36' cy='31' r='1.8' fill='rgba(196,181,253,0.75)'/%3E%3Ccircle cx='18' cy='48' r='1.3' fill='rgba(255,255,255,0.72)'/%3E%3Ccircle cx='50' cy='50' r='1.6' fill='rgba(253,224,71,0.68)'/%3E%3Cpath d='M44 26 L46 22 L48 26 L52 28 L48 30 L46 34 L44 30 L40 28 Z' fill='rgba(255,255,255,0.45)'/%3E%3C/svg%3E");
}

/* Sandstein & Vulkan-Lava-Risse für Dino-Vulkan */
#boardFrame[data-board="vulkan"] .sq.light::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M0 18 Q18 14 36 19 T64 17 M0 42 Q22 46 42 40 T64 43' fill='none' stroke='rgba(180,83,9,0.16)' stroke-width='1.5'/%3E%3Ccircle cx='46' cy='28' r='2.2' fill='rgba(217,119,6,0.15)'/%3E%3C/svg%3E");
}
#boardFrame[data-board="vulkan"] .sq.dark::before {
    background-image:
        radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.22), transparent 68%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath d='M8 10 L22 22 L18 36 L34 44 L54 54 M48 8 L38 22 L44 32' fill='none' stroke='rgba(251,146,60,0.48)' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M8 10 L22 22 L18 36 L34 44 L54 54' fill='none' stroke='rgba(254,240,138,0.34)' stroke-width='0.9' stroke-linecap='round'/%3E%3C/svg%3E");
}

.sq.last-move::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(250, 204, 21, 0.34);
    pointer-events: none;
}

.sq.selected {
    box-shadow: inset 0 0 0 4px #0284c7;
    background-image: linear-gradient(rgba(56, 189, 248, 0.25), rgba(56, 189, 248, 0.25));
}

.sq.hint-square {
    box-shadow: inset 0 0 0 4px #a855f7;
    animation: hintPulse 1.1s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.12); }
}

.sq.in-check {
    background: radial-gradient(circle, #ef4444 0%, #dc2626 65%, #991b1b 100%) !important;
}

.sq-coord-file,
.sq-coord-rank {
    position: absolute;
    font-size: clamp(9px, 1.8vw, 11px);
    font-weight: 800;
    opacity: 0.78;
    pointer-events: none;
    line-height: 1;
    z-index: 1;
}

.sq-coord-rank {
    top: 3px;
    left: 4px;
}

.sq-coord-file {
    bottom: 3px;
    right: 4px;
}

.piece-wrap {
    width: 92%;
    height: 92%;
    position: relative;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.26));
    transition: transform 0.14s ease;
    will-change: transform;
}

.sq.has-sliding-piece {
    z-index: 15;
}

.piece-wrap.is-sliding {
    z-index: 25;
}

.sq.selected .piece-wrap {
    transform: translateY(-3px) scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
    .piece-wrap,
    .piece-wrap.is-sliding {
        transition: none !important;
    }
}

.piece-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Zughilfe-Punkte & Schlagringe */
.legal-dot {
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(2, 132, 199, 0.62);
    border: 2px solid rgba(255, 255, 255, 0.85);
    z-index: 3;
    pointer-events: none;
}

.legal-capture {
    position: absolute;
    inset: 7%;
    border-radius: 50%;
    border: 4px solid rgba(225, 29, 72, 0.75);
    z-index: 3;
    pointer-events: none;
}

/* ==========================================================================
   SEITENSPALTE (Status, Reaktionen, Zugliste)
   ========================================================================== */
.side-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.mode-tag {
    font-size: 0.78rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
}

.move-counter {
    font-size: 0.82rem;
    font-weight: 800;
    color: #64748b;
}

.status-message {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.4;
    margin-bottom: 12px;
}

.reaction-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 8px 10px;
    margin-bottom: 12px;
}

.reaction-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
}

.reaction-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.react-btn {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    font-size: 0.8rem;
    font-weight: 800;
}

.react-btn:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

/* Einlade-Banner im laufenden Spiel */
.invite-banner {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #fcd34d;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
}

.invite-banner-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.invite-kicker {
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 4px;
}

.invite-code-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.invite-code {
    font-size: 1.15rem;
    font-weight: 900;
    color: #451a03;
    letter-spacing: 0.04em;
    background: #ffffff;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1.5px solid #f59e0b;
}

.invite-qr svg {
    width: 84px;
    height: 84px;
    border-radius: 10px;
    border: 1.5px solid #f59e0b;
    display: block;
}

.invite-hint {
    margin-top: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #78350f;
}

.invite-link-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.invite-link-input {
    flex: 1;
    min-width: 150px;
    min-height: 38px;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1.5px solid #fcd34d;
    background: #ffffff;
    font-size: 0.76rem;
    color: #451a03;
}

.mini-btn.primary-mini {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

.mini-btn.primary-mini:hover {
    background: #0369a1;
}

.mini-btn {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    font-size: 0.8rem;
    font-weight: 800;
}

.mini-btn:hover {
    background: #f8fafc;
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ctrl-btn {
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    font-size: 0.84rem;
    font-weight: 800;
    transition: background 0.12s ease, transform 0.1s ease;
}

.ctrl-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

.ctrl-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ctrl-btn[aria-pressed="true"] {
    background: #e0f2fe;
    border-color: #38bdf8;
    color: #0369a1;
}

.ctrl-btn.danger {
    color: #be123c;
    border-color: #fecdd3;
    background: #fff1f2;
}

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.history-head h2 {
    font-size: 0.96rem;
    font-weight: 900;
}

.history-sub {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
}

.moves-list {
    max-height: 220px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 5px;
    font-size: 0.84rem;
}

.moves-empty {
    grid-column: 1 / -1;
    color: #64748b;
    font-size: 0.85rem;
}

.move-pair {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4px 8px;
    font-family: var(--le-font-mono, ui-monospace, monospace);
}

.move-num {
    color: #94a3b8;
    font-weight: 700;
    min-width: 22px;
}

/* ==========================================================================
   MODALS (Modus-Wahl, Umwandlung, Spielende)
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(15, 23, 42, 0.56);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    overflow-y: auto;
}

.modal-card {
    width: 100%;
    max-width: 620px;
    max-height: 92dvh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 22px;
    padding: 20px;
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.28);
}

.modal-compact {
    max-width: 440px;
    text-align: center;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.game-pill {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    margin-bottom: 6px;
}

.modal-header h2,
.modal-compact h2 {
    font-size: 1.32rem;
    font-weight: 900;
}

.close-modal-btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    background: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 900;
}

.mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.mode-tab {
    min-height: 44px;
    padding: 8px 6px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    font-size: 0.84rem;
    font-weight: 800;
}

.mode-tab.active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

.tab-intro {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.45;
    margin-bottom: 14px;
}

.bot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.choice-card {
    text-align: left;
    padding: 12px;
    border-radius: 14px;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 86px;
}

.choice-card.active {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.18);
}

.choice-card strong {
    font-size: 0.92rem;
}

.choice-card span {
    font-size: 0.78rem;
    color: #475569;
}

.coin-tag {
    margin-top: auto;
    font-weight: 800;
    color: #b45309 !important;
}

.color-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 0.88rem;
    font-weight: 800;
}

.seg-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.seg-btn {
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 11px;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    font-size: 0.82rem;
    font-weight: 800;
    flex: 1;
}

.seg-group.small .seg-btn {
    min-height: 40px;
    font-size: 0.78rem;
    padding: 4px 8px;
}

.seg-btn.active {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #78350f;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    margin-bottom: 16px;
    font-size: 0.88rem;
    cursor: pointer;
}

.switch-row input {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.primary-cta,
.secondary-cta {
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 0.96rem;
    font-weight: 900;
    transition: transform 0.12s ease;
}

.primary-cta {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.28);
}

.secondary-cta {
    background: #e0f2fe;
    color: #0369a1;
    border: 1.5px solid #7dd3fc;
}

.primary-cta:active,
.secondary-cta:active {
    transform: scale(0.98);
}

/* Online-Profil-Vorschau */
.online-profile-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 16px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    margin-bottom: 14px;
}

.online-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: #fef3c7;
    border: 2px solid #f59e0b;
    flex-shrink: 0;
}

.online-avatar-preview svg {
    width: 100%;
    height: 100%;
    display: block;
}

.online-profile-fields {
    flex: 1;
    min-width: 0;
}

.field-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.name-edit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.guest-name-pill {
    flex: 1;
    min-width: 130px;
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.94rem;
    font-weight: 800;
    color: #0f172a;
}

.direct-invite-box {
    background: linear-gradient(135deg, #fffbeb, #f0f9ff);
    border: 2px solid #0284c7;
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.direct-invite-host {
    display: flex;
    align-items: center;
    gap: 12px;
}

.direct-invite-title {
    display: block;
    font-size: 1.02rem;
    font-weight: 900;
    color: #0f172a;
    margin: 2px 0 4px;
}

.direct-invite-code {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.link-like-btn {
    align-self: center;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0369a1;
    text-decoration: underline;
    padding: 6px 10px;
}

.text-input {
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 11px;
    border: 1.5px solid #cbd5e1;
    font-size: 0.94rem;
    font-weight: 700;
    background: #ffffff;
}

.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 0.74rem;
    color: #64748b;
}

.online-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.online-box {
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.online-box h3 {
    font-size: 0.96rem;
    font-weight: 900;
}

.online-box p {
    font-size: 0.8rem;
    color: #475569;
}

.error-banner {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffe4e6;
    border: 1.5px solid #fda4af;
    color: #9f1239;
    font-size: 0.84rem;
    font-weight: 800;
}

/* Umwandlungs-Dialog */
.promo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.promo-btn {
    min-height: 82px;
    padding: 8px 4px;
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.76rem;
    font-weight: 800;
}

.promo-btn svg {
    width: 44px;
    height: 44px;
}

.promo-btn:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

/* Spielende-Belohnung */
.reward-box {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid #f59e0b;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #78350f;
}

.end-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ==========================================================================
   FIGUREN-SHOP MODAL
   ========================================================================== */
.style-sets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.set-card {
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 12px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.set-card.active {
    border-color: #0284c7;
    background: #f0f9ff;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.16);
}

.set-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.set-card-head strong {
    font-size: 0.94rem;
}

.set-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
}

.set-badge.locked {
    background: #fef3c7;
    color: #92400e;
}

.set-desc {
    font-size: 0.78rem;
    color: #475569;
    line-height: 1.35;
}

.set-preview-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 6px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.set-preview-piece {
    width: 42px;
    height: 42px;
    display: inline-flex;
}

.set-preview-piece svg {
    width: 100%;
    height: 100%;
}

.set-action-btn {
    margin-top: auto;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 11px;
    font-size: 0.84rem;
    font-weight: 800;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
}

.set-action-btn.buy {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #d97706;
    color: #ffffff;
}

.set-action-btn.buy:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.set-action-btn.active-btn {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0369a1;
}

.board-style-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================================
   ONLINE-ANWESENHEIT & VERBINDUNGS-WARNUNGEN
   ========================================================================== */
.presence-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 999px;
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #86efac;
    white-space: nowrap;
}

.presence-pill.offline {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fdba74;
    animation: presencePulse 1.4s ease-in-out infinite;
}

.presence-pill.left {
    background: #f1f5f9;
    color: #475569;
    border-color: #cbd5e1;
    animation: none;
}

@keyframes presencePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.62; }
}

.offline-alert-banner {
    margin: -4px 0 12px;
    padding: 9px 11px;
    border-radius: 12px;
    background: #fff7ed;
    border: 1.5px solid #fb923c;
    color: #9a3412;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.38;
}

.end-presence-note {
    margin: 0 0 12px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.end-presence-note.is-warning {
    background: #fff7ed;
    border-color: #fdba74;
    color: #9a3412;
}

.end-presence-note.is-online {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

/* ==========================================================================
   RUHIGER ÜBERLEGUNGS-TIMER (OHNE ZEITDRUCK) & MOBILE FEINSCHLIFF
   ========================================================================== */
.think-timer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 2px 0 10px;
}

.timer-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 10px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0369a1;
    font-size: 0.78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.timer-chip strong {
    font-weight: 800;
    color: #0c4a6e;
    font-variant-numeric: tabular-nums;
}

.timer-chip.subtle {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.timer-chip.subtle strong {
    color: #1e293b;
}

@media (max-width: 540px) {
    .player-bar {
        padding: 7px 10px;
        min-height: 58px;
        gap: 8px;
    }

    .player-avatar {
        width: 38px;
        height: 38px;
    }

    .player-name {
        font-size: 0.86rem;
    }

    .team-chip {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .hide-xs {
        display: none;
    }

    .presence-pill {
        font-size: 0.64rem;
        padding: 2px 6px;
        flex-shrink: 0;
    }

    .turn-pill {
        font-size: 0.68rem;
        padding: 4px 8px;
        min-width: 72px;
    }

    .cap-piece {
        width: 15px;
        height: 15px;
    }
}

