/* ========================================
   SATSANG JOURNEY - Path to Akshardham
   Lightweight CSS Game Styles
   ======================================== */

:root {
    --saffron: #f97316;
    --saffron-light: #ffedd5;
    --saffron-dark: #c2410c;
    --gold: #fbbf24;
    --gold-light: #fef3c7;
    --green: #22c55e;
    --green-light: #dcfce7;
    --red: #ef4444;
    --red-light: #fee2e2;
    --purple: #a855f7;
    --blue: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #fef3c7 0%, #ffedd5 50%, #fed7aa 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Generic hidden class */
.hidden {
    display: none !important;
}

/* ========================================
   SCREENS
   ======================================== */

.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

/* ========================================
   START SCREEN
   ======================================== */

#start-screen {
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.start-container {
    background: white;
    border-radius: 32px;
    padding: 40px 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    text-align: center;
    position: relative;
}

/* Home button on start screen */
.start-home-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--gray-100);
    border-radius: 20px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.start-home-btn:hover {
    background: var(--saffron-light);
    color: var(--saffron-dark);
    transform: translateY(-1px);
}

.start-header {
    margin-bottom: 32px;
    padding-top: 20px;
}

.om-symbol {
    font-size: 48px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

.start-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.subtitle {
    color: var(--saffron);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.token-selection {
    margin-bottom: 24px;
}

.token-selection h3 {
    font-size: 12px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.token-options {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.token-btn {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 2px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-btn:hover {
    border-color: var(--saffron);
    transform: translateY(-2px);
}

.token-btn.selected {
    border-color: var(--saffron);
    background: var(--saffron-light);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* BAPS Tilak Chandlo (matching main app) */
.tilak-chandlo {
    display: inline-block;
    position: relative;
    width: 20px;
    height: 28px;
    vertical-align: middle;
}

.tilak-chandlo .tilak {
    position: absolute;
    width: 18px;
    height: 26px;
    border: 4px solid #d4a44c; /* Sandalwood/chandan color */
    border-top: none;
    border-radius: 0 0 50% 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
}

.tilak-chandlo .chandlo {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #c41e3a; /* Kumkum red */
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -20%);
}

/* Small tilak for markers and HUD */
.tilak-chandlo.small {
    width: 14px;
    height: 20px;
}

.tilak-chandlo.small .tilak {
    width: 12px;
    height: 18px;
    border-width: 3px;
}

.tilak-chandlo.small .chandlo {
    width: 5px;
    height: 5px;
}

/* Large tilak for om-symbol */
.om-symbol .tilak-chandlo {
    width: 32px;
    height: 44px;
}

.om-symbol .tilak-chandlo .tilak {
    width: 30px;
    height: 42px;
    border-width: 6px;
}

.om-symbol .tilak-chandlo .chandlo {
    width: 12px;
    height: 12px;
}

.name-input-container {
    margin-bottom: 24px;
}

.name-input-container input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 16px;
    font-size: 16px;
    font-family: inherit;
    text-align: center;
    transition: all 0.2s ease;
}

.name-input-container input:focus {
    outline: none;
    border-color: var(--saffron);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

.primary-btn {
    width: 100%;
    padding: 18px 32px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-dark) 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.4);
}

.primary-btn:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 20px;
}

.start-footer {
    margin-top: 24px;
    color: var(--gray-500);
    font-size: 13px;
}

/* ========================================
   MODE SELECTION & GROUP PLAY
   ======================================== */

.mode-selection {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    background: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.mode-btn:hover {
    border-color: var(--saffron);
}

.mode-btn.selected {
    border-color: var(--saffron);
    background: var(--saffron-light);
}

.mode-icon {
    font-size: 24px;
}

.mode-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600);
}

.mode-hint {
    font-size: 10px;
    color: var(--gray-400);
    font-weight: 500;
}

.group-options {
    background: var(--gray-50);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.group-options.hidden {
    display: none !important;
}

/* Game Mode Info Box */
.game-mode-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.game-mode-info .info-icon {
    font-size: 24px;
}

.game-mode-info p {
    font-size: 13px;
    color: #92400e;
    margin: 0;
    line-height: 1.4;
}

/* Add Players Section */
.add-players-section h4 {
    font-size: 14px;
    color: var(--gray-700);
    margin: 0 0 12px 0;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.player-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

.player-token-select {
    width: 50px;
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    background: white;
}

.player-entry .player-name-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.player-entry .player-name-input:focus {
    outline: none;
    border-color: var(--saffron);
}

.remove-player-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: #fee2e2;
    color: #dc2626;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.remove-player-btn:hover {
    background: #fecaca;
}

.host-badge {
    font-size: 11px;
    background: var(--saffron-light);
    color: var(--saffron-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.add-player-btn {
    width: 100%;
    padding: 12px;
    border: 2px dashed var(--gray-300);
    border-radius: 10px;
    background: transparent;
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-player-btn:hover:not(:disabled) {
    border-color: var(--saffron);
    color: var(--saffron);
    background: var(--saffron-light);
}

.add-player-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Old group tabs - kept for compatibility */
.group-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.group-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: var(--gray-200);
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.group-tab.active {
    background: var(--saffron);
    color: white;
}

.group-panel {
    text-align: center;
}

.group-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 12px;
}

.secondary-btn {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid var(--saffron);
    border-radius: 12px;
    background: white;
    color: var(--saffron);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    background: var(--saffron-light);
}

.room-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: white;
    padding: 16px;
    border-radius: 12px;
    margin-top: 16px;
    border: 2px dashed var(--saffron);
}

.room-code-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
}

.room-code {
    font-size: 24px;
    font-weight: 800;
    color: var(--saffron);
    letter-spacing: 4px;
    font-family: 'Courier New', monospace;
}

.copy-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--gray-100);
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--saffron-light);
}

.room-players {
    margin-top: 16px;
}

.players-label {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.player-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.player-item .player-token {
    font-size: 18px;
}

.player-item .player-name {
    font-weight: 600;
    color: var(--gray-700);
}

.host-badge {
    font-size: 12px;
}

.room-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    text-align: center;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.room-input:focus {
    outline: none;
    border-color: var(--saffron);
}

.join-status {
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 12px;
}

.join-status.error {
    background: var(--red-light);
    color: var(--red);
}

.join-status.success {
    background: var(--green-light);
    color: var(--green);
}

/* ========================================
   GAME SCREEN
   ======================================== */

#game-screen {
    flex-direction: column;
    padding: 16px;
    gap: 16px;
}

/* HUD */
.game-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
}

.hud-left, .hud-right {
    background: white;
    border-radius: 20px;
    padding: 8px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Home Button */
.home-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.home-btn:hover {
    background: var(--saffron-light);
    transform: scale(1.1);
}

.home-btn:active {
    transform: scale(0.95);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-token {
    font-size: 24px;
}

.player-name {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 14px;
}

.hud-center {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tile-display {
    background: white;
    border-radius: 16px;
    padding: 8px 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.tile-label {
    font-size: 10px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

.tile-number {
    font-size: 28px;
    font-weight: 800;
    color: var(--saffron);
}

/* Timer Display */
.timer-display {
    background: white;
    border-radius: 12px;
    padding: 6px 14px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.timer-icon {
    font-size: 14px;
}

.timer-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-800);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.timer-display.timer-warning {
    background: #fef3c7;
    animation: timer-pulse 1s infinite;
}

.timer-display.timer-warning .timer-value {
    color: #d97706;
}

.timer-display.timer-critical {
    background: #fee2e2;
    animation: timer-pulse 0.5s infinite;
}

.timer-display.timer-critical .timer-value {
    color: #dc2626;
}

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

.score-display {
    text-align: right;
}

.score-label {
    font-size: 10px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
}

.score-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--gold);
}

/* Turn Badge */
.turn-badge {
    display: none;
    background: var(--saffron);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    margin-left: 6px;
    animation: pulse-badge 1.5s infinite;
}

.turn-badge.visible {
    display: inline-block;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Players Bar - Multiplayer Mode */
.players-bar {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
    overflow-x: auto;
    justify-content: center;
}

.players-bar.hidden {
    display: none;
}

.mp-player {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--gray-100);
    border-radius: 12px;
    min-width: 100px;
    transition: all 0.3s ease;
    position: relative;
}

.mp-player.active {
    background: linear-gradient(135deg, var(--saffron-light), #fff7ed);
    box-shadow: 0 0 0 2px var(--saffron);
}

.mp-player.active .turn-indicator {
    opacity: 1;
}

.turn-indicator {
    position: absolute;
    left: -4px;
    color: var(--saffron);
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: bounce-arrow 0.8s infinite;
}

@keyframes bounce-arrow {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(3px); }
}

.mp-emoji {
    font-size: 20px;
}

.mp-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mp-name {
    font-weight: 600;
    font-size: 12px;
    color: var(--gray-800);
    white-space: nowrap;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-stats {
    display: flex;
    gap: 8px;
    font-size: 10px;
    color: var(--gray-500);
}

.mp-tile {
    color: var(--saffron);
    font-weight: 600;
}

.mp-rajipo {
    color: var(--gold);
    font-weight: 600;
}

/* Board Container */
.board-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    padding: 10px;
}

.board-wrapper {
    position: relative;
    transform: rotateX(20deg) scale(0.95);
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.board-wrapper:hover {
    transform: rotateX(15deg) scale(0.97);
}

/* SVG Connections Layer */
.connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.ladder-line {
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
    animation: ladderGlow 2s ease-in-out infinite;
}

.ladder-rung {
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.4));
}

.snake-line {
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.5));
    animation: snakePulse 3s ease-in-out infinite;
}

.snake-head {
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.8));
    animation: snakeHeadBob 1s ease-in-out infinite;
}

@keyframes ladderGlow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6)); }
    50% { filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.9)); }
}

@keyframes snakePulse {
    0%, 100% { stroke-width: 8; opacity: 0.8; }
    50% { stroke-width: 10; opacity: 1; }
}

@keyframes snakeHeadBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* Game Board */
.game-board {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    padding: 6px;
    border-radius: 20px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

/* Tiles */
.tile {
    width: 38px;
    height: 38px;
    background: linear-gradient(145deg, #ffffff 0%, #f1f5f9 100%);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    cursor: default;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tile:nth-child(odd) {
    background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
}

.tile-num {
    font-size: 9px;
    font-weight: 700;
    color: var(--gray-400);
    position: absolute;
    top: 2px;
    left: 4px;
}

.tile-special {
    font-size: 16px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.tile-label {
    font-size: 5px;
    font-weight: 800;
    color: var(--gray-500);
    letter-spacing: 0.5px;
    position: absolute;
    bottom: 2px;
}

.tile-arrow {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 6px;
    font-weight: 700;
    padding: 1px 3px;
    border-radius: 4px;
}

/* Special Tiles */
.tile-start {
    background: linear-gradient(145deg, #dcfce7 0%, #bbf7d0 100%) !important;
    box-shadow: 
        0 2px 8px rgba(34, 197, 94, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tile-goal {
    background: linear-gradient(145deg, #fef3c7 0%, #fde68a 100%) !important;
    box-shadow: 
        0 0 20px rgba(251, 191, 36, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    animation: goalPulse 2s ease-in-out infinite;
}

@keyframes goalPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.8); }
    50% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.8); }
}

.tile-ladder-start {
    background: linear-gradient(145deg, #dbeafe 0%, #bfdbfe 100%) !important;
    box-shadow: 
        0 0 12px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tile-ladder-start .tile-arrow {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.tile-ladder-end {
    background: linear-gradient(145deg, #fef9c3 0%, #fef08a 100%) !important;
}

.tile-snake-start {
    background: linear-gradient(145deg, #fee2e2 0%, #fecaca 100%) !important;
    box-shadow: 
        0 0 12px rgba(239, 68, 68, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.tile-snake-start .tile-arrow {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: white;
}

.tile-snake-end {
    background: linear-gradient(145deg, #fef2f2 0%, #fee2e2 100%) !important;
}

/* 3D Player Marker */
.player-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 20;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.player-glow {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(251, 191, 36, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: playerGlow 1.5s ease-in-out infinite;
}

.player-shadow {
    position: absolute;
    width: 30px;
    height: 10px;
    top: 100%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
}

.player-body {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 50%, #fed7aa 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(251, 191, 36, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
    animation: playerBounce 0.6s ease-in-out infinite;
}

.player-emoji {
    font-size: 24px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.player-pulse {
    position: absolute;
    width: 40px;
    height: 40px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(251, 191, 36, 0.6);
    border-radius: 50%;
    animation: playerPulseRing 1.5s ease-out infinite;
}

@keyframes playerGlow {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

@keyframes playerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes playerPulseRing {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Multiplayer markers container */
#mp-markers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
}

#mp-markers .mp-marker .player-body {
    width: 30px;
    height: 30px;
}

#mp-markers .mp-marker .player-emoji {
    font-size: 16px;
}

#mp-markers .mp-marker .player-glow {
    width: 35px;
    height: 35px;
}

#mp-markers .mp-marker .player-shadow {
    width: 20px;
    height: 6px;
}

/* Game Message */
.game-message {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    animation: slideDown 0.3s ease;
}

.game-message.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    pointer-events: none;
}

.message-icon {
    font-size: 20px;
}

.message-text {
    font-weight: 600;
    color: var(--gray-800);
}

/* Dice Container */
.dice-container {
    display: flex;
    justify-content: center;
    padding: 15px 20px 25px;
}

.roll-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 40px;
    border: none;
    border-radius: 60px;
    background: linear-gradient(145deg, var(--gray-800) 0%, var(--gray-900) 100%);
    color: white;
    font-size: 18px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.roll-btn:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.roll-btn:active:not(:disabled) {
    transform: translateY(0);
}

.roll-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dice {
    font-size: 36px;
    font-weight: bold;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
    border-radius: 10px;
    color: #1a1a1a;
    box-shadow: 
        0 4px 12px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.9),
        inset 0 -2px 4px rgba(0,0,0,0.1);
    will-change: transform;
}

.dice.rolling {
    animation: none; /* JS handles animation now */
}

/* Legend Toggle */
.legend-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.legend-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.legend-btn:hover {
    transform: scale(1.1);
}

/* ========================================
   MODALS
   ======================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    color: #333;
    transform: scale(1.1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--gray-200);
}

/* Quiz Modal */
.quiz-content {
    overflow: hidden;
}

.quiz-header {
    background: linear-gradient(135deg, var(--saffron-light) 0%, white 100%);
    padding: 24px;
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}

.quiz-badge {
    display: inline-block;
    background: white;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    color: var(--saffron);
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.quiz-header h2 {
    font-size: 18px;
    color: var(--gray-800);
}

.quiz-body {
    padding: 24px;
}

.quiz-question {
    font-size: 15px;
    color: var(--gray-700);
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-family: inherit;
}

.quiz-option:hover:not(:disabled) {
    border-color: var(--saffron);
    background: var(--saffron-light);
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-option.correct {
    border-color: var(--green);
    background: var(--green-light);
}

.quiz-option.wrong {
    border-color: var(--red);
    background: var(--red-light);
}

.option-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--gray-600);
    flex-shrink: 0;
}

.option-text {
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.4;
}

.quiz-feedback {
    margin-top: 16px;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quiz-feedback.correct {
    background: var(--green-light);
    color: var(--green);
}

.quiz-feedback.wrong {
    background: var(--red-light);
    color: var(--red);
}

.feedback-icon {
    font-size: 20px;
    font-weight: bold;
}

.feedback-text {
    font-weight: 700;
}

/* Special Modal */
.special-content {
    padding: 40px 32px;
    text-align: center;
}

.special-content.ladder {
    background: linear-gradient(135deg, #dbeafe 0%, white 100%);
}

.special-content.snake {
    background: linear-gradient(135deg, var(--red-light) 0%, white 100%);
}

.special-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 0.6s ease infinite;
}

.special-content h2 {
    font-size: 28px;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.special-content p {
    color: var(--gray-600);
    font-size: 15px;
    margin-bottom: 24px;
}

.special-movement {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 24px;
    font-weight: 800;
}

.special-movement span:first-child,
.special-movement span:last-child {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.movement-arrow {
    color: var(--saffron);
    animation: arrowBounce 0.5s ease infinite;
}

.ladder .movement-arrow {
    color: var(--blue);
}

.snake .movement-arrow {
    color: var(--red);
}

/* Legend Modal */
.legend-content {
    padding: 24px;
}

.legend-content h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 22px;
    color: var(--gray-800);
}

.legend-section {
    margin-bottom: 24px;
}

.legend-section h3 {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.legend-section p {
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.6;
}

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

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--gray-50);
}

.legend-item.ladder {
    background: #dbeafe;
}

.legend-item.snake {
    background: var(--red-light);
}

.legend-emoji {
    font-size: 20px;
}

.legend-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

/* ========================================
   VICTORY SCREEN
   ======================================== */

#victory-screen {
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fff7ed 100%);
    position: relative;
    overflow: hidden;
}

.victory-container {
    text-align: center;
    z-index: 1;
}

.victory-temple {
    font-size: 80px;
    margin-bottom: 16px;
    animation: float 2s ease-in-out infinite;
}

.victory-container h1 {
    font-size: 48px;
    font-weight: 800;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.victory-subtitle {
    font-size: 18px;
    color: var(--saffron);
    font-weight: 600;
    margin-bottom: 32px;
}

.victory-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    padding: 20px 24px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    min-width: 100px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--saffron);
    display: block;
}

.stat-label {
    font-size: 11px;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.victory-quote {
    background: white;
    padding: 20px 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.victory-quote p {
    font-size: 18px;
    color: var(--gray-700);
    font-style: italic;
    margin-bottom: 8px;
}

.victory-quote span {
    font-size: 13px;
    color: var(--gray-500);
}

.victory-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 300px;
    margin: 0 auto;
}

.secondary-btn {
    width: 100%;
    padding: 16px 32px;
    border: 2px solid var(--gray-300);
    border-radius: 16px;
    background: white;
    color: var(--gray-700);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.secondary-btn:hover {
    border-color: var(--gray-400);
    background: var(--gray-50);
}

/* Confetti */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-in-out infinite;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }
    50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.8); }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes diceRoll {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ========================================
   RESPONSIVE - Mobile First
   ======================================== */

/* Base mobile styles (default) */
@media (max-width: 480px) {
    .start-container {
        padding: 28px 20px;
        border-radius: 24px;
    }
    
    .om-symbol {
        font-size: 36px;
    }
    
    .start-header h1 {
        font-size: 22px;
    }
    
    .token-btn {
        width: 44px;
        height: 44px;
        font-size: 22px;
        border-radius: 12px;
    }
    
    .mode-selection {
        gap: 8px;
    }
    
    .mode-btn {
        padding: 10px 12px;
    }
    
    .mode-icon {
        font-size: 20px;
    }
    
    .mode-name {
        font-size: 10px;
    }
    
    .group-options {
        padding: 16px;
    }
    
    /* Game Board - Mobile optimized */
    .game-board {
        gap: 2px;
        padding: 4px;
        border-radius: 12px;
    }
    
    .tile {
        width: calc((100vw - 60px) / 10);
        height: calc((100vw - 60px) / 10);
        max-width: 32px;
        max-height: 32px;
        border-radius: 4px;
    }
    
    .tile-num {
        font-size: 7px;
        top: 1px;
        left: 2px;
    }
    
    .tile-special {
        font-size: 11px;
    }
    
    .tile-label {
        font-size: 4px;
    }
    
    .tile-arrow {
        font-size: 5px;
        padding: 0 2px;
    }
    
    /* Player marker mobile */
    .player-body {
        width: 28px;
        height: 28px;
    }
    
    .player-emoji {
        font-size: 16px;
    }
    
    .player-glow {
        width: 36px;
        height: 36px;
    }
    
    .player-pulse {
        width: 28px;
        height: 28px;
    }
    
    /* Board perspective */
    .board-wrapper {
        transform: rotateX(12deg) scale(1);
    }
    
    .board-container {
        padding: 5px;
    }
    
    /* Dice mobile */
    .roll-btn {
        padding: 14px 28px;
        font-size: 15px;
        gap: 12px;
    }
    
    .dice {
        font-size: 36px;
    }
    
    /* HUD mobile */
    .game-hud {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .hud-left, .hud-right {
        padding: 6px 10px;
    }
    
    .player-token {
        font-size: 18px;
    }
    
    .player-name {
        font-size: 12px;
    }
    
    .tile-number {
        font-size: 22px;
    }
    
    .score-value {
        font-size: 16px;
    }
    
    /* Victory mobile */
    .victory-container h1 {
        font-size: 32px;
    }
    
    .victory-temple {
        font-size: 56px;
    }
    
    .stat-card {
        padding: 12px 14px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .legend-items {
        grid-template-columns: 1fr;
    }
    
    /* Quiz modal mobile */
    .quiz-content {
        padding: 20px;
    }
    
    .quiz-question {
        font-size: 14px;
    }
    
    .quiz-option {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .tile {
        width: calc((100vw - 50px) / 10);
        height: calc((100vw - 50px) / 10);
        max-width: 28px;
        max-height: 28px;
    }
    
    .tile-num {
        font-size: 6px;
    }
    
    .tile-special {
        font-size: 9px;
    }
    
    .tile-arrow {
        display: none; /* Hide on very small screens */
    }
    
    .player-body {
        width: 24px;
        height: 24px;
    }
    
    .player-emoji {
        font-size: 14px;
    }
    
    .dice {
        font-size: 32px;
    }
    
    .roll-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Tablet and larger */
@media (min-width: 768px) {
    .tile {
        width: 48px;
        height: 48px;
    }
    
    .tile-num {
        font-size: 11px;
    }
    
    .tile-special {
        font-size: 20px;
    }
    
    .tile-arrow {
        font-size: 8px;
    }
    
    .player-body {
        width: 44px;
        height: 44px;
    }
    
    .player-emoji {
        font-size: 26px;
    }
    
    .game-board {
        gap: 4px;
        padding: 8px;
        border-radius: 20px;
    }
    
    .dice {
        font-size: 52px;
    }
    
    .roll-btn {
        padding: 20px 48px;
        font-size: 18px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .tile {
        width: 56px;
        height: 56px;
    }
    
    .tile-num {
        font-size: 12px;
    }
    
    .tile-special {
        font-size: 24px;
    }
    
    .player-body {
        width: 48px;
        height: 48px;
    }
    
    .player-emoji {
        font-size: 28px;
    }
}
