/* Ludo Board Styling - 15x15 Exact Grid & Corner Layout */

:root {
    --board-size: min(96vw, calc(100svh - 196px), calc(100vh - 196px), 480px);
}

#game-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 4px 6px;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    user-select: none;
    touch-action: none;
    box-sizing: border-box;
}

#game-screen.active {
    display: flex;
}

/* Status / Turn Banner — Hidden (No longer needed, back button is in header) */
.turn-banner {
    display: none !important;
}

.turn-player-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

#turn-status-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    flex: 1;
}

.turn-color-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 2px solid #fff;
    flex-shrink: 0;
}

/* Main Game Area containing Top Players, Board, and Bottom Players */
.game-board-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: min(96vw, max(var(--board-size, 360px), 430px));
    max-width: 470px;
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Players Rows surrounding the Board — Roomy, comfortable, prominent */
.players-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 68px;
    min-height: 68px;
    max-height: 68px;
    padding: 0;
    flex-shrink: 0;
    box-sizing: border-box;
}

.players-row.top-row {
    margin-bottom: 4px;
}

.players-row.bottom-row {
    margin-top: 4px;
}

/* Corner Player Pod Item — Taller, wider, yellow rayline border accent */
.player-dock-item {
    background: linear-gradient(135deg, rgba(21, 36, 69, 0.95), rgba(13, 24, 46, 0.98));
    border: 2px solid rgba(255, 215, 0, 0.38);
    border-radius: 14px;
    padding: 3px 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1 1 49%;
    min-width: 0;
    height: 68px;
    min-height: 68px;
    max-height: 68px;
    position: relative;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.15s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    overflow: visible;
    box-sizing: border-box;
}

/* Give active player dock extra breathing room when paired with an empty slot in 2P/3P */
.player-dock-item.inactive-slot {
    flex: 0 1 38%;
}

/* Right-side corner items reverse flow: Dice | Info | Avatar */
.player-dock-item.corner-top-right,
.player-dock-item.corner-bottom-right {
    flex-direction: row-reverse;
    text-align: right;
}

.player-dock-item.active-turn {
    border-color: #ffd700;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.75), inset 0 0 10px rgba(245, 166, 35, 0.28);
    background: linear-gradient(135deg, rgba(52, 42, 14, 0.98), rgba(21, 36, 69, 0.98));
}

.player-dock-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.player-dock-avatar.red { border-color: var(--red); background: rgba(229, 57, 53, 0.3); }
.player-dock-avatar.green { border-color: var(--green); background: rgba(67, 160, 71, 0.3); }
.player-dock-avatar.yellow { border-color: var(--yellow); background: rgba(251, 192, 45, 0.3); }
.player-dock-avatar.blue { border-color: var(--blue); background: rgba(30, 136, 229, 0.3); }

/* Live Voice Speaking Indicator Ring on Player Avatar (No Layout Shift) */
.player-dock-avatar.speaking {
    border-color: #00e676 !important;
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.55), 0 0 14px rgba(0, 230, 118, 0.95) !important;
}

/* Dedicated Row inside Player Dock for Voice / Mute Pill */
.player-dock-voice-row {
    display: flex;
    align-items: center;
    min-width: 0;
    margin-top: 2px;
    overflow: visible;
}

.player-dock-item.corner-top-right .player-dock-voice-row,
.player-dock-item.corner-bottom-right .player-dock-voice-row {
    justify-content: flex-end;
}

/* Per-Dock Voice Mic / Speaker Mute Pill Button */
.dock-voice-btn {
    height: 19px;
    min-height: 19px;
    padding: 0 7px;
    border-radius: 10px;
    border: 1.2px solid rgba(255, 255, 255, 0.45);
    background: rgba(15, 28, 55, 0.95);
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    box-sizing: border-box;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.dock-voice-btn.voice-on {
    background: linear-gradient(135deg, #00c853, #009624);
    border-color: #69f0ae;
    color: #ffffff;
    box-shadow: 0 1px 8px rgba(0, 230, 118, 0.55);
}

.dock-voice-btn.voice-hear {
    background: linear-gradient(135deg, #1e88e5, #1565c0);
    border-color: #90caf9;
    color: #ffffff;
    box-shadow: 0 1px 6px rgba(30, 136, 229, 0.45);
}

.dock-voice-btn.voice-muted {
    background: linear-gradient(135deg, #d32f2f, #9a0007);
    border-color: #ff8a80;
    color: #ffffff;
}

.header-voice-btn.mic-active {
    background: linear-gradient(135deg, #00c853, #009624) !important;
    border-color: #69f0ae !important;
    box-shadow: 0 0 10px rgba(0, 230, 118, 0.65);
}

.header-voice-btn.spk-muted {
    background: rgba(229, 57, 53, 0.35) !important;
    border-color: #ef5350 !important;
}

.player-dock-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.player-dock-name-row {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.player-dock-name {
    font-size: 12px;
    font-weight: 800;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.player-dock-item.corner-top-right .player-dock-name,
.player-dock-item.corner-bottom-right .player-dock-name {
    text-align: right;
}

.player-dock-status {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.15;
    margin-top: 1px;
}

/* User's Own Dock Highlighting */
.player-dock-item.is-me {
    border-color: rgba(255, 215, 0, 0.65);
    background: linear-gradient(135deg, rgba(30, 48, 88, 0.95), rgba(16, 28, 55, 0.95));
    box-shadow: 0 3px 12px rgba(255, 215, 0, 0.25);
}

.player-dock-item.is-me.active-turn {
    border-color: #00e676;
    box-shadow: 0 0 20px rgba(0, 230, 118, 0.65), inset 0 0 10px rgba(0, 230, 118, 0.25);
}

/* Player Dock when finished (Rank 1, 2, or 3 achieved while match continues) */
.player-dock-item.dock-finished {
    border-color: #ffd700;
    background: linear-gradient(135deg, rgba(55, 45, 12, 0.98), rgba(20, 32, 60, 0.98));
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.45);
}

.player-dock-item.dock-finished.corner-top-left,
.player-dock-item.dock-finished.corner-bottom-left {
    border-left: 3.5px solid #ffd700;
}

.player-dock-item.dock-finished.corner-top-right,
.player-dock-item.dock-finished.corner-bottom-right {
    border-right: 3.5px solid #ffd700;
}

.player-dock-item.dock-finished .dice-container {
    pointer-events: none;
    background: rgba(255, 215, 0, 0.16);
    border-color: rgba(255, 215, 0, 0.55);
}

.player-dock-item.dock-finished .dice-cube {
    display: none !important;
}

.player-dock-item.dock-finished .dice-roll-prompt {
    display: none !important;
}

.player-dock-item.dock-finished .dice-container::after {
    content: '🏆';
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    animation: trophyBounce 1.5s infinite alternate ease-in-out;
}

@keyframes trophyBounce {
    0% { transform: scale(0.92); }
    100% { transform: scale(1.12); filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.9)); }
}

.dock-rank-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
    max-width: 100%;
}

.dock-rank-tag.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ff8f00);
    color: #0b1528;
    border: 1px solid #ffe082;
}

.dock-rank-tag.rank-2 {
    background: linear-gradient(135deg, #e0e0e0, #9e9e9e);
    color: #1a1a1a;
    border: 1px solid #f5f5f5;
}

.dock-rank-tag.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #8d5524);
    color: #fff;
    border: 1px solid #d7ccc8;
}

.dock-rank-tag.rank-4 {
    background: rgba(255, 255, 255, 0.15);
    color: #cfd8dc;
}

.player-dock-item.inactive-slot {
    opacity: 0.22 !important;
    pointer-events: none !important;
    filter: grayscale(0.85);
}

.player-you-badge {
    background: linear-gradient(135deg, #ffd700, #ff9800);
    color: #0b1528;
    font-size: 8px;
    font-weight: 900;
    padding: 1px 4px;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
    letter-spacing: 0.4px;
    animation: badgePulse 2s infinite ease-in-out;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.25); box-shadow: 0 0 12px rgba(255, 215, 0, 0.95); }
}

/* Floating Dice Prompt when it's your turn */
.dice-roll-prompt {
    display: none;
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #00e676, #00c853);
    color: #081d0f;
    font-size: 9.5px;
    font-weight: 900;
    padding: 1.5px 7px;
    border-radius: 10px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 230, 118, 0.6);
    animation: promptBounce 0.9s infinite alternate ease-in-out;
    z-index: 10;
    pointer-events: none;
}

.player-dock-item.corner-top-right .dice-roll-prompt,
.player-dock-item.corner-bottom-right .dice-roll-prompt {
    left: 50%;
    transform: translateX(-50%);
}

.dice-container.can-roll .dice-roll-prompt {
    display: block;
}

@keyframes promptBounce {
    from { transform: translateX(-50%) translateY(0); }
    to { transform: translateX(-50%) translateY(-5px); }
}

/* Star mark on pawns belonging to the player */
.token-pawn.is-mine .pawn-head::after {
    content: '★';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #fff;
    text-shadow: 0 0 3px #000;
}

/* Matchmaking Radar & Slots */
.matchmaking-radar-wrapper {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.matchmaking-radar-core {
    font-size: 32px;
    z-index: 2;
    animation: radarCorePulse 1.2s infinite ease-in-out;
}

.matchmaking-radar-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #ffd700;
    opacity: 0;
    animation: radarWave 2s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
}

.matchmaking-radar-ring.delay-1 {
    animation-delay: 1s;
}

@keyframes radarWave {
    0% { transform: scale(0.3); opacity: 0.9; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes radarCorePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 10px #ffd700); }
}

.mm-slots-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 14px 0;
}

.mm-slot-card {
    flex: 1;
    max-width: 125px;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
}

.mm-slot-card.filled {
    border-style: solid;
    border-color: rgba(255, 215, 0, 0.6);
    background: rgba(255, 215, 0, 0.08);
}

.mm-slot-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 15px;
    border: 2px solid #fff;
}

.mm-slot-avatar.searching {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    font-size: 14px;
}

.mm-slot-name {
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mm-slot-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 4px;
}

/* Turn Banner Dynamic States */
.turn-banner.my-turn {
    background: linear-gradient(135deg, rgba(16, 68, 38, 0.96), rgba(10, 48, 26, 0.96));
    border-color: #00e676;
    box-shadow: 0 0 14px rgba(0, 230, 118, 0.35), inset 0 0 8px rgba(0, 230, 118, 0.18);
}

.turn-banner.bonus-turn {
    background: linear-gradient(135deg, rgba(80, 50, 10, 0.96), rgba(50, 30, 5, 0.96));
    border-color: #ffd700;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
}

/* Board Outer Frame — 100% Fixed Square, Authentic Ludo King Crisp Frame */
.board-wrapper {
    position: relative;
    width: var(--board-size, min(95vw, 440px));
    height: var(--board-size, min(95vw, 440px));
    aspect-ratio: 1 / 1;
    background: #ffffff;
    border: 2.5px solid #222222;
    border-radius: 4px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
    overflow: visible;
    flex-shrink: 0;
    transform: rotate(var(--board-rot, 0deg)) translateZ(0);
    -webkit-transform: rotate(var(--board-rot, 0deg)) translateZ(0);
    transform-origin: 50% 50%;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 15x15 Grid */
.ludo-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    width: 100%;
    height: 100%;
    position: relative;
    background-color: #333333;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Base Yards (6x6 cells) — Exact 1-Cell (16.6667%) Solid Color Frame around 4x4 White Square */
.yard-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16.6667%;
    border: 1px solid #2b2b2b;
}

.yard-box.red {
    grid-row: 1 / 7;
    grid-column: 1 / 7;
    background: #ED1C24;
}

.yard-box.green {
    grid-row: 1 / 7;
    grid-column: 10 / 16;
    background: #009A44;
}

.yard-box.yellow {
    grid-row: 10 / 16;
    grid-column: 10 / 16;
    background: #FFDE00;
}

.yard-box.blue {
    grid-row: 10 / 16;
    grid-column: 1 / 7;
    background: #0971B2;
}

.btn-game, .dice-container, .token-pawn, .icon-btn, .menu-card {
    touch-action: manipulation;
}

/* Inner Yard 4x4 Crisp White Square */
.yard-inner-circle {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border-radius: 0px;
    border: 1.5px solid #4a4a4a;
    box-shadow: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    padding: 10%;
    gap: 12%;
}

/* 4 Solid Colored Circles inside each White Yard Box */
.yard-pedestal {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.yard-pedestal.red {
    background-color: #ED1C24;
    border: 1.5px solid #7A1216;
}

.yard-pedestal.green {
    background-color: #009A44;
    border: 1.5px solid #005524;
}

.yard-pedestal.yellow {
    background-color: #FFDE00;
    border: 1.5px solid #998500;
}

.yard-pedestal.blue {
    background-color: #1DA1F2;
    border: 1.5px solid #095D94;
}

/* Center Winning Home (3x3 cells) with 4 Clean Triangles meeting at exact center */
.center-home-box {
    grid-row: 7 / 10;
    grid-column: 7 / 10;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
    transform: translateZ(0);
}

.center-home-svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Individual Grid Cells */
.grid-cell {
    border: 0.75px solid #383838;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: #ffffff;
}

/* Solid Colored Start & Home Stretch Squares (Exact Ludo King Colors) */
.grid-cell.start-red,
.grid-cell.home-red {
    background: #ED1C24 !important;
}

.grid-cell.start-green,
.grid-cell.home-green {
    background: #009A44 !important;
}

.grid-cell.start-yellow,
.grid-cell.home-yellow {
    background: #FFDE00 !important;
}

.grid-cell.start-blue,
.grid-cell.home-blue {
    background: #24A8F8 !important;
}

/* Safe Star SVG & Home-Stretch Entry Arrow SVG */
.safe-star-svg {
    width: 82%;
    height: 82%;
    display: block;
    pointer-events: none;
}

.entry-arrow-svg {
    width: 66%;
    height: 66%;
    display: block;
    pointer-events: none;
}

/* ============================================================== */
/* AUTHENTIC LUDO KING TEARDROP PIN GOTI + MAROON TARGET RING     */
/* ============================================================== */

.tokens-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
}

.token-pawn {
    position: absolute;
    width: 8.8%;
    height: 10.4%;
    /* Anchor at (50%, 71%) so the maroon base ring sits dead-center on cell/pedestal */
    transform: translate(-50%, -71%) rotate(var(--pawn-rot, 0deg)) translateZ(0);
    transform-origin: 50% 71%;
    transition: left 0.135s cubic-bezier(0.25, 1, 0.5, 1), top 0.135s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: left, top;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
    z-index: 20;
}

.pawn-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pawn-shadow {
    position: absolute;
    bottom: 6%;
    width: 74%;
    height: 24%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 75%);
    z-index: 1;
    transition: transform 0.18s, opacity 0.18s;
}

.pawn-piece {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.ludo-pin-svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* Playable Token: Floating Levitation & Radiant Ray Light */
.token-pawn.playable {
    z-index: 50 !important;
}

/* Radiant Ray Ring on the ground beneath the pawn's base ring */
.token-pawn.playable::before {
    content: '';
    position: absolute;
    top: 71%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 125%;
    height: 75%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 235, 59, 0.95) 0%, rgba(255, 193, 7, 0.65) 48%, rgba(255, 152, 0, 0) 75%);
    box-shadow: 0 0 14px 4px rgba(255, 215, 0, 0.9);
    animation: rayRingPulse 0.8s infinite alternate ease-in-out;
    pointer-events: none;
    z-index: 0;
}

/* Sleek Black pointer arrow bouncing above playable pawn at point/roll time */
.token-pawn.playable::after {
    content: '';
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 11px solid #111111;
    filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    animation: arrowBounce 0.55s infinite alternate ease-in-out;
    pointer-events: none;
    z-index: 10;
}

/* Board Shake Disabled */
.board-wrapper.screen-shake {
    animation: none !important;
}

@keyframes rayRingPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.85);
        opacity: 0.7;
        box-shadow: 0 0 10px 3px rgba(255, 215, 0, 0.6);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 1;
        box-shadow: 0 0 24px 8px rgba(255, 215, 0, 0.95);
    }
}

@keyframes arrowBounce {
    from { transform: translateX(-50%) translateY(0); }
    to { transform: translateX(-50%) translateY(-6px); }
}

.token-pawn.playable .pawn-piece {
    animation: pawnLevitate 0.65s infinite ease-in-out alternate;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 1)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.token-pawn.playable .pawn-shadow {
    animation: shadowScale 0.65s infinite ease-in-out alternate;
}

@keyframes pawnLevitate {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.12); }
}

@keyframes shadowScale {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(0.5); opacity: 0.2; }
}

/* Hopping Jump Animation (Smooth 0.19s hop matching step speed) */
.token-pawn.hopping .pawn-piece {
    animation: pawnHopJump 0.19s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

.token-pawn.hopping .pawn-shadow {
    animation: pawnHopShadow 0.19s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

@keyframes pawnHopJump {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.22); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes pawnHopShadow {
    0% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(0.4); opacity: 0.15; }
    100% { transform: scale(1); opacity: 0.6; }
}

/* Captured Retreating Token Animation (Smooth Backstep synced to Goti Cut Audio) */
.token-pawn.retreating {
    z-index: 99 !important;
    transition: left var(--retreat-step-ms, 260ms) linear, top var(--retreat-step-ms, 260ms) linear !important;
}

.token-pawn.retreating .pawn-piece {
    animation: pawnRetreatWobble 0.28s infinite alternate ease-in-out !important;
    filter: drop-shadow(0 0 12px rgba(255, 23, 68, 0.95)) drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8)) !important;
}

.token-pawn.retreating .pawn-shadow {
    animation: pawnRetreatShadow 0.28s infinite alternate ease-in-out !important;
}

@keyframes pawnRetreatWobble {
    0% { transform: translateY(-9px) rotate(-10deg) scale(0.96, 1.08); }
    100% { transform: translateY(0px) rotate(10deg) scale(1.08, 0.94); }
}

@keyframes pawnRetreatShadow {
    0% { transform: scale(0.65); opacity: 0.25; }
    100% { transform: scale(1.1); opacity: 0.75; }
}

/* Comical bubble following retreating goti */
.token-pawn.retreating::after {
    content: '😿 BACK!' !important;
    position: absolute !important;
    top: -26px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: linear-gradient(135deg, #ff1744, #d50000) !important;
    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    padding: 2px 6px !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    width: auto !important;
    height: auto !important;
    white-space: nowrap !important;
    box-shadow: 0 2px 10px rgba(255, 23, 68, 0.85) !important;
    animation: ghopBubblePulse 0.35s infinite alternate ease-in-out !important;
    pointer-events: none !important;
    z-index: 105 !important;
}

@keyframes ghopBubblePulse {
    0% { transform: translateX(-50%) scale(0.95) rotate(-3deg); }
    100% { transform: translateX(-50%) scale(1.10) rotate(3deg); }
}

/* Finished Tokens in Home Center */
.token-pawn.home-finished {
    z-index: 25 !important;
}

.token-pawn.home-finished .pawn-container {
    transform: scale(0.85);
}

.token-pawn.home-finished .pawn-piece {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.9)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

/* ======================================================== */
/* Color Selection Chips (Vs Bot, Online, Quick Match)      */
/* ======================================================== */
.color-picker-section {
    margin: 12px 0 16px;
    background: rgba(11, 22, 45, 0.7);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.color-picker-title {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--gold-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.color-picker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.color-chip {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 7px 4px 6px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid transparent;
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.color-chip:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.color-chip:active {
    transform: scale(0.95);
}

.color-chip.active {
    transform: translateY(-3px) scale(1.05);
    border-color: #ffd700;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.55), inset 0 0 8px rgba(255, 215, 0, 0.2);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.22), rgba(20, 35, 65, 0.8));
}

.color-chip.active::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ffd700;
    color: #0b1528;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.chip-goti {
    font-size: 24px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s;
}

.color-chip.active .chip-goti {
    transform: scale(1.12);
}

.chip-name {
    font-size: 10.5px;
    font-weight: 700;
    color: #e0e0e0;
    letter-spacing: 0.3px;
}

.color-chip.active .chip-name {
    color: #ffd700;
}

