/* Sexopoly Game Styles - LovePlay.io Design System 2025 */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Utility classes */
.hidden { display: none !important; }

/* CSS Variables - Design System */
:root {
    --background: #09090b;
    --foreground: #fafafa;
    --card: #18181b;
    --card-foreground: #fafafa;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --ring: #f43f5e;
    --rose: #f43f5e;
    --teal: #14b8a6;
    --orange: #f97316;
    --amber: #fbbf24;
    --radius: 0.75rem;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Dot pattern background - Design System 2025 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.025;
    background-image: radial-gradient(circle, #ffffff 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: 0;
}

/* Text Gradient */
.text-gradient {
    background: linear-gradient(135deg, var(--rose), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================ */
/* GAME HEADER - Design System 2025 */
/* ============================================ */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.back-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--secondary);
    color: var(--muted-foreground);
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.back-link:hover {
    background: var(--card);
    color: var(--foreground);
}

.back-link svg {
    width: 20px;
    height: 20px;
}

.header-logo {
    font-size: 1.125rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--rose), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    cursor: pointer;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

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

/* Premium Bar */
.premium-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

.premium-bar.visible {
    display: flex;
}

.premium-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.premium-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, var(--amber), #f59e0b);
    color: #000;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.625rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
}

.premium-badge svg {
    width: 12px;
    height: 12px;
}

.timer-display {
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--rose), #ec4899, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: timerPulse 2s ease-in-out infinite;
}

@keyframes timerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

.timer-label {
    font-size: 0.6875rem;
    color: var(--muted-foreground);
}

.premium-cta {
    background: linear-gradient(135deg, var(--rose), var(--orange));
    color: white;
    border: none;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.6875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.premium-cta:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.3);
}

/* Main Content */
.main-wrapper {
    flex: 1;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 70px 0 0 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
    gap: 0;
}

.game-container {
    display: flex;
    gap: 0;
    width: 100%;
    height: 100%;
    align-items: stretch;
    position: relative;
}


/* Board Container - 3D Perspective - адаптивный */
.board-3d-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    min-width: 0;
    padding: 20px;
    position: relative;
}

/* 3D Board Grid - АДАПТИВНЫЙ размер */
.board-3d {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    grid-template-rows: repeat(11, 1fr);
    gap: 0;
    /* АДАПТИВНЫЙ размер: учитываем ширину панели (360px) + padding (40px) */
    width: min(calc(100vw - 400px), calc(100vh - 100px), 72vmin);
    height: min(calc(100vw - 400px), calc(100vh - 100px), 72vmin);
    max-width: 950px;
    max-height: 950px;
    min-width: 280px;
    min-height: 280px;
    /* Оптимизированный угол для лучшей видимости всех углов, включая дальние ячейки */
    transform: translateY(-12vh) rotateX(48deg) rotateZ(-42deg) scale(1.0);
    transform-style: preserve-3d;
    position: relative;
}

/* Center gradient animation - disabled for transparent center */
.board-3d::before {
    content: '';
    grid-column: 2 / 11;
    grid-row: 2 / 11;
    background: transparent;
    pointer-events: none;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    33% { background-position: 50% 100%; }
    66% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Cell Styles */
.cell-3d {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.8));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(14px, 2vw, 20px);
    transform: translateZ(10px);
    position: relative;
}

.cell-3d.corner {
    background: rgba(31, 41, 55, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    font-size: clamp(24px, 3vw, 36px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* START icon in 3D corner cell - адаптивный размер */
.start-icon-3d {
    width: clamp(35px, 5vw, 55px);
    height: clamp(35px, 5vw, 55px);
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    image-rendering: auto;
}

/* Cell icons in 3D cells - адаптивный размер */
.cell-icon-3d {
    width: clamp(30px, 4.5vw, 50px);
    height: clamp(30px, 4.5vw, 50px);
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    image-rendering: auto;
}

/* Cell position highlighting */
/* Player 1 = СИНИЙ (мужчина), Player 2 = РОЗОВАЯ (женщина) */
.cell-3d.player1-here {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.2), rgba(78, 205, 196, 0.1));
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.4);
    border: 1px solid rgba(78, 205, 196, 0.5);
}

.cell-3d.player2-here {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.2), rgba(255, 107, 157, 0.1));
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
    border: 1px solid rgba(255, 107, 157, 0.5);
}

.cell-3d.both-players {
    background: linear-gradient(135deg,
        rgba(78, 205, 196, 0.25) 0%,
        rgba(78, 205, 196, 0.25) 48%,
        rgba(255, 107, 157, 0.25) 52%,
        rgba(255, 107, 157, 0.25) 100%);
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.3), 0 0 20px rgba(255, 107, 157, 0.3);
    border: 2px solid transparent;
    border-image: linear-gradient(135deg, rgba(78, 205, 196, 0.6), rgba(255, 107, 157, 0.6)) 1;
}

.cell-3d.empty {
    background: transparent;
    border: none;
}

/* Player tokens on 3D board - адаптивный размер */
.player-token-3d {
    position: absolute;
    width: clamp(12px, 1.5vw, 18px);
    height: clamp(12px, 1.5vw, 18px);
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5), 0 0 20px currentColor;
    z-index: 10;
    animation: pulse 2s ease-in-out infinite;
    transition: all 0.3s ease-in-out;
}

/* Player 1 = СИНИЙ, Player 2 = РОЗОВАЯ */
.player-token-3d.p1 {
    background: #4ecdc4;
    color: #4ecdc4;
    top: 20%;
    left: 20%;
}

.player-token-3d.p2 {
    background: #ff6b9d;
    color: #ff6b9d;
    top: 60%;
    left: 60%;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Cell grid positioning - see full file for all 40 positions */
.cell-3d:nth-child(1) { grid-column: 11; grid-row: 11; }
.cell-3d:nth-child(2) { grid-column: 10; grid-row: 11; }
.cell-3d:nth-child(3) { grid-column: 9; grid-row: 11; }
.cell-3d:nth-child(4) { grid-column: 8; grid-row: 11; }
.cell-3d:nth-child(5) { grid-column: 7; grid-row: 11; }
.cell-3d:nth-child(6) { grid-column: 6; grid-row: 11; }
.cell-3d:nth-child(7) { grid-column: 5; grid-row: 11; }
.cell-3d:nth-child(8) { grid-column: 4; grid-row: 11; }
.cell-3d:nth-child(9) { grid-column: 3; grid-row: 11; }
.cell-3d:nth-child(10) { grid-column: 2; grid-row: 11; }
.cell-3d:nth-child(11) { grid-column: 1; grid-row: 11; }

.cell-3d:nth-child(12) { grid-column: 1; grid-row: 10; }
.cell-3d:nth-child(13) { grid-column: 1; grid-row: 9; }
.cell-3d:nth-child(14) { grid-column: 1; grid-row: 8; }
.cell-3d:nth-child(15) { grid-column: 1; grid-row: 7; }
.cell-3d:nth-child(16) { grid-column: 1; grid-row: 6; }
.cell-3d:nth-child(17) { grid-column: 1; grid-row: 5; }
.cell-3d:nth-child(18) { grid-column: 1; grid-row: 4; }
.cell-3d:nth-child(19) { grid-column: 1; grid-row: 3; }
.cell-3d:nth-child(20) { grid-column: 1; grid-row: 2; }
.cell-3d:nth-child(21) { grid-column: 1; grid-row: 1; }

.cell-3d:nth-child(22) { grid-column: 2; grid-row: 1; }
.cell-3d:nth-child(23) { grid-column: 3; grid-row: 1; }
.cell-3d:nth-child(24) { grid-column: 4; grid-row: 1; }
.cell-3d:nth-child(25) { grid-column: 5; grid-row: 1; }
.cell-3d:nth-child(26) { grid-column: 6; grid-row: 1; }
.cell-3d:nth-child(27) { grid-column: 7; grid-row: 1; }
.cell-3d:nth-child(28) { grid-column: 8; grid-row: 1; }
.cell-3d:nth-child(29) { grid-column: 9; grid-row: 1; }
.cell-3d:nth-child(30) { grid-column: 10; grid-row: 1; }
.cell-3d:nth-child(31) { grid-column: 11; grid-row: 1; }

.cell-3d:nth-child(32) { grid-column: 11; grid-row: 2; }
.cell-3d:nth-child(33) { grid-column: 11; grid-row: 3; }
.cell-3d:nth-child(34) { grid-column: 11; grid-row: 4; }
.cell-3d:nth-child(35) { grid-column: 11; grid-row: 5; }
.cell-3d:nth-child(36) { grid-column: 11; grid-row: 6; }
.cell-3d:nth-child(37) { grid-column: 11; grid-row: 7; }
.cell-3d:nth-child(38) { grid-column: 11; grid-row: 8; }
.cell-3d:nth-child(39) { grid-column: 11; grid-row: 9; }
.cell-3d:nth-child(40) { grid-column: 11; grid-row: 10; }

/* 3D Dice Styles - адаптивный размер */
.die-scene {
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    perspective: 900px;
}

.die-3d {
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0s linear;
}

.die-face {
    position: absolute;
    width: clamp(60px, 8vw, 80px);
    height: clamp(60px, 8vw, 80px);
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: bold;
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
    backface-visibility: visible;
}

/* Blue dice faces */
.die-3d.blue .face-1 { background-image: url('../../../../images/b1.png'); transform: rotateY(0deg) translateZ(40px); }
.die-3d.blue .face-2 { background-image: url('../../../../images/b2.png'); transform: rotateY(90deg) translateZ(40px); }
.die-3d.blue .face-3 { background-image: url('../../../../images/b3.png'); transform: rotateX(90deg) translateZ(40px); }
.die-3d.blue .face-4 { background-image: url('../../../../images/b4.png'); transform: rotateX(-90deg) translateZ(40px); }
.die-3d.blue .face-5 { background-image: url('../../../../images/b5.png'); transform: rotateY(-90deg) translateZ(40px); }
.die-3d.blue .face-6 { background-image: url('../../../../images/b6.png'); transform: rotateY(180deg) translateZ(40px); }

/* Pink dice faces */
.die-3d.pink .face-1 { background-image: url('../../../../images/r1.png'); transform: rotateY(0deg) translateZ(40px); }
.die-3d.pink .face-2 { background-image: url('../../../../images/r2.png'); transform: rotateY(90deg) translateZ(40px); }
.die-3d.pink .face-3 { background-image: url('../../../../images/r3.png'); transform: rotateX(90deg) translateZ(40px); }
.die-3d.pink .face-4 { background-image: url('../../../../images/r4.png'); transform: rotateX(-90deg) translateZ(40px); }
.die-3d.pink .face-5 { background-image: url('../../../../images/r5.png'); transform: rotateY(-90deg) translateZ(40px); }
.die-3d.pink .face-6 { background-image: url('../../../../images/r6.png'); transform: rotateY(180deg) translateZ(40px); }

/* ============================================ */
/* SIDE PANEL - Design System 2025 */
/* ============================================ */
.side-panel {
    width: 340px;
    flex-shrink: 0;
    background: var(--background);
    border-left: 1px solid var(--border);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: calc(100vh - 70px);
    overflow-y: auto;
    position: sticky;
    top: 70px;
    right: 0;
}

.side-panel::-webkit-scrollbar {
    width: 4px;
}

.side-panel::-webkit-scrollbar-track {
    background: transparent;
}

.side-panel::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.side-panel::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

.section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--muted-foreground);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* ============================================ */
/* PLAYER CARDS - Design System 2025 */
/* ============================================ */
.players-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.player-card {
    background: var(--card);
    padding: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

/* Player 1 = teal glow */
.player-card:nth-child(2).active {
    border-color: var(--teal);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.2), inset 0 0 20px rgba(20, 184, 166, 0.05);
}

/* Player 2 = rose glow */
.player-card:nth-child(3).active {
    border-color: var(--rose);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.2), inset 0 0 20px rgba(244, 63, 94, 0.05);
}

.player-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.player-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-icon svg {
    width: 24px;
    height: 24px;
}

.player-icon.male svg {
    color: #60a5fa;
}

.player-icon.female svg {
    color: #f472b6;
}

.player-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--foreground);
}

/* Gradient names for players */
.player-card:nth-child(2) .player-name {
    background: linear-gradient(135deg, var(--teal), #0d9488);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-card:nth-child(3) .player-name {
    background: linear-gradient(135deg, var(--rose), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glowing name for active player */
.player-card:nth-child(2).active .player-name {
    filter: drop-shadow(0 0 8px rgba(20, 184, 166, 0.6));
}

.player-card:nth-child(3).active .player-name {
    filter: drop-shadow(0 0 8px rgba(244, 63, 94, 0.6));
}

.player-balance {
    font-size: 1.125rem;
    color: var(--amber);
    font-weight: 700;
}

.player-position {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Dice Container */
.dice-container {
    margin: 15px 0;
}

.dice-row-desktop {
    display: flex;
    gap: 30px;
    justify-content: center;
}

/* ============================================ */
/* ROLL BUTTON - Design System 2025 */
/* ============================================ */
.btn-3d {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    color: white;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 0.9375rem;
    transition: all 0.2s;
    min-height: 48px;
}

.btn-3d svg.roll-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.btn-3d .roll-text {
    flex: 1;
}

/* Player 1 = teal gradient */
.btn-3d.player1-turn {
    background: linear-gradient(135deg, var(--teal), #0d9488);
}

.btn-3d.player1-turn:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(20, 184, 166, 0.4);
    transform: translateY(-1px);
}

/* Player 2 = rose gradient */
.btn-3d.player2-turn {
    background: linear-gradient(135deg, var(--rose), var(--orange));
}

.btn-3d.player2-turn:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.4);
    transform: translateY(-1px);
}

.btn-3d:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ============================================ */
/* GAME LOG - Design System 2025 */
/* ============================================ */
.game-log-section {
    display: flex;
    flex-direction: column;
    min-height: 150px;
    flex: 1 1 auto;
}

.game-log {
    overflow-y: auto;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
    flex: 1 1 auto;
    max-height: none;
}

.game-log::-webkit-scrollbar {
    width: 4px;
}

.game-log::-webkit-scrollbar-track {
    background: transparent;
}

.game-log::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

.game-log::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

.log-entry {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--muted-foreground);
    padding: 0.5rem 0.625rem;
    margin-bottom: 0.375rem;
    background: var(--secondary);
    border-radius: calc(var(--radius) / 2);
    border-left: 2px solid var(--border);
}

/* Player 1 = teal */
.log-entry.player1 {
    border-left-color: var(--teal);
}

/* Player 2 = rose */
.log-entry.player2 {
    border-left-color: var(--rose);
}

/* Welcome message - amber */
.log-entry.welcome {
    border-left-color: var(--amber);
    background: rgba(251, 191, 36, 0.05);
}

/* Mobile Layout Container */
.main-content-mobile {
    display: none;
    position: relative;
    z-index: 1;
}

/* Force mobile layout - добавляется через JS для touch устройств */
body.force-mobile .game-container {
    display: none !important;
}

body.force-mobile .main-content-mobile {
    display: flex !important;
    flex: 1;
    flex-direction: column;
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
}

body.force-mobile .main-wrapper {
    padding: 0;
    overflow: visible;
}

/* Mobile Styles - применяются только если ширина экрана < 768px ИЛИ force-mobile класс */
@media (max-width: 768px) {
    /* Remove padding from wrapper on mobile */
    .main-wrapper {
        padding: 0;
        overflow: visible;
    }

    /* Hide desktop */
    .game-container {
        display: none !important;
    }

    /* Show mobile */
    .main-content-mobile {
        display: flex !important;
        flex: 1;
        flex-direction: column;
        padding: 0;
        justify-content: flex-start;
        align-items: stretch;
        overflow-y: auto;
    }

    /* Mobile players bar - Design System 2025 */
    .players-bar {
        display: flex;
        gap: 0.75rem;
        padding: 0.75rem 1rem 0;
    }

    .player-mini {
        flex: 1;
        background: var(--card);
        border: 2px solid var(--border);
        padding: 0.75rem 1rem;
        border-radius: var(--radius);
        text-align: center;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        gap: 0.375rem;
    }

    .player-mini-name {
        font-size: 0.875rem;
        font-weight: 700;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
    }

    .player-mini-icon {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    /* Player 1 icon and name - teal gradient */
    .player-mini:nth-child(1) .player-mini-icon {
        color: var(--teal);
    }

    .player-mini:nth-child(1) .player-mini-text {
        background: linear-gradient(135deg, var(--teal), #0d9488);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* Player 2 icon and name - rose gradient */
    .player-mini:nth-child(2) .player-mini-icon {
        color: var(--rose);
    }

    .player-mini:nth-child(2) .player-mini-text {
        background: linear-gradient(135deg, var(--rose), var(--orange));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .player-mini-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 700;
    }

    .player-mini-balance {
        font-size: 1rem;
        font-weight: 700;
        background: linear-gradient(135deg, #fef3c7, #fbbf24, #f59e0b);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* Player 1 = teal glow when active */
    .player-mini:nth-child(1).active {
        border-color: var(--teal);
        box-shadow: 0 0 20px rgba(20, 184, 166, 0.3), inset 0 0 15px rgba(20, 184, 166, 0.1);
    }

    .player-mini:nth-child(1).active .player-mini-text {
        filter: drop-shadow(0 0 6px rgba(20, 184, 166, 0.6));
    }

    /* Player 2 = rose glow when active */
    .player-mini:nth-child(2).active {
        border-color: var(--rose);
        box-shadow: 0 0 20px rgba(244, 63, 94, 0.3), inset 0 0 15px rgba(244, 63, 94, 0.1);
    }

    .player-mini:nth-child(2).active .player-mini-text {
        filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.6));
    }

    /* Mobile board container */
    .board-container {
        position: relative;
        width: 100%;
        margin: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        padding: 10px;
    }

    .board-grid {
        display: grid;
        grid-template-columns: repeat(11, 1fr);
        grid-template-rows: repeat(11, 1fr);
        gap: 3px;
        aspect-ratio: 1;
    }

    /* Mobile dice row */
    .dice-row {
        display: flex;
        gap: 15px;
    }

    .cell-icon {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        position: relative;
    }

    .cell-icon.corner {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        font-size: 20px;
    }

    /* START icon in mobile corner cell */
    .start-icon-mobile {
        width: 24px;
        height: 24px;
        object-fit: contain;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
        image-rendering: auto;
    }

    /* Cell icons in mobile cells */
    .cell-icon-mobile {
        width: 26px;
        height: 26px;
        object-fit: contain;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
        image-rendering: auto;
    }

    /* Mobile cell highlighting - Player 1 = СИНИЙ, Player 2 = РОЗОВАЯ */
    .cell-icon.player1-here {
        background: linear-gradient(135deg, rgba(78, 205, 196, 0.25), rgba(78, 205, 196, 0.15));
        border-color: rgba(78, 205, 196, 0.5);
        box-shadow: 0 0 15px rgba(78, 205, 196, 0.5);
    }

    .cell-icon.player2-here {
        background: linear-gradient(135deg, rgba(255, 107, 157, 0.25), rgba(255, 107, 157, 0.15));
        border-color: rgba(255, 107, 157, 0.5);
        box-shadow: 0 0 15px rgba(255, 107, 157, 0.5);
    }

    .cell-icon.both-players {
        background: linear-gradient(135deg,
            rgba(78, 205, 196, 0.3) 0%,
            rgba(78, 205, 196, 0.3) 48%,
            rgba(255, 107, 157, 0.3) 52%,
            rgba(255, 107, 157, 0.3) 100%);
        box-shadow: 0 0 12px rgba(78, 205, 196, 0.4), 0 0 12px rgba(255, 107, 157, 0.4);
        border: 2px solid transparent;
        border-image: linear-gradient(135deg, rgba(78, 205, 196, 0.7), rgba(255, 107, 157, 0.7)) 1;
    }

    /* Mobile grid positioning - all 40 cells */
    .cell-icon:nth-child(1) { grid-column: 11; grid-row: 11; }
    .cell-icon:nth-child(2) { grid-column: 10; grid-row: 11; }
    .cell-icon:nth-child(3) { grid-column: 9; grid-row: 11; }
    .cell-icon:nth-child(4) { grid-column: 8; grid-row: 11; }
    .cell-icon:nth-child(5) { grid-column: 7; grid-row: 11; }
    .cell-icon:nth-child(6) { grid-column: 6; grid-row: 11; }
    .cell-icon:nth-child(7) { grid-column: 5; grid-row: 11; }
    .cell-icon:nth-child(8) { grid-column: 4; grid-row: 11; }
    .cell-icon:nth-child(9) { grid-column: 3; grid-row: 11; }
    .cell-icon:nth-child(10) { grid-column: 2; grid-row: 11; }
    .cell-icon:nth-child(11) { grid-column: 1; grid-row: 11; }

    .cell-icon:nth-child(12) { grid-column: 1; grid-row: 10; }
    .cell-icon:nth-child(13) { grid-column: 1; grid-row: 9; }
    .cell-icon:nth-child(14) { grid-column: 1; grid-row: 8; }
    .cell-icon:nth-child(15) { grid-column: 1; grid-row: 7; }
    .cell-icon:nth-child(16) { grid-column: 1; grid-row: 6; }
    .cell-icon:nth-child(17) { grid-column: 1; grid-row: 5; }
    .cell-icon:nth-child(18) { grid-column: 1; grid-row: 4; }
    .cell-icon:nth-child(19) { grid-column: 1; grid-row: 3; }
    .cell-icon:nth-child(20) { grid-column: 1; grid-row: 2; }
    .cell-icon:nth-child(21) { grid-column: 1; grid-row: 1; }

    .cell-icon:nth-child(22) { grid-column: 2; grid-row: 1; }
    .cell-icon:nth-child(23) { grid-column: 3; grid-row: 1; }
    .cell-icon:nth-child(24) { grid-column: 4; grid-row: 1; }
    .cell-icon:nth-child(25) { grid-column: 5; grid-row: 1; }
    .cell-icon:nth-child(26) { grid-column: 6; grid-row: 1; }
    .cell-icon:nth-child(27) { grid-column: 7; grid-row: 1; }
    .cell-icon:nth-child(28) { grid-column: 8; grid-row: 1; }
    .cell-icon:nth-child(29) { grid-column: 9; grid-row: 1; }
    .cell-icon:nth-child(30) { grid-column: 10; grid-row: 1; }
    .cell-icon:nth-child(31) { grid-column: 11; grid-row: 1; }

    .cell-icon:nth-child(32) { grid-column: 11; grid-row: 2; }
    .cell-icon:nth-child(33) { grid-column: 11; grid-row: 3; }
    .cell-icon:nth-child(34) { grid-column: 11; grid-row: 4; }
    .cell-icon:nth-child(35) { grid-column: 11; grid-row: 5; }
    .cell-icon:nth-child(36) { grid-column: 11; grid-row: 6; }
    .cell-icon:nth-child(37) { grid-column: 11; grid-row: 7; }
    .cell-icon:nth-child(38) { grid-column: 11; grid-row: 8; }
    .cell-icon:nth-child(39) { grid-column: 11; grid-row: 9; }
    .cell-icon:nth-child(40) { grid-column: 11; grid-row: 10; }

    /* Mobile player tokens */
    .player-token {
        position: absolute;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        border: 2px solid white;
        z-index: 10;
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.5), 0 0 12px currentColor;
        animation: pulse 2s ease-in-out infinite;
        transition: all 0.3s ease-in-out;
    }

    /* Player 1 = СИНИЙ, Player 2 = РОЗОВАЯ */
    .player-token.p1 {
        background: #4ecdc4;
        color: #4ecdc4;
        top: 5px;
        left: 5px;
    }

    .player-token.p2 {
        background: #ff6b9d;
        color: #ff6b9d;
        top: 20px;
        left: 20px;
    }

    /* Mobile dice controls */
    .center-controls {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        background: transparent;
        backdrop-filter: none;
        padding: 15px;
        border-radius: 0;
        border: none;
    }

    .center-controls .die-scene {
        width: 75px;
        height: 75px;
        perspective: 900px;
    }

    .center-controls .die-face {
        width: 75px;
        height: 75px;
    }

    /* Mobile dice transforms */
    .center-controls .die-3d.blue .face-1 { transform: rotateY(0deg) translateZ(37.5px); }
    .center-controls .die-3d.blue .face-2 { transform: rotateY(90deg) translateZ(37.5px); }
    .center-controls .die-3d.blue .face-3 { transform: rotateX(90deg) translateZ(37.5px); }
    .center-controls .die-3d.blue .face-4 { transform: rotateX(-90deg) translateZ(37.5px); }
    .center-controls .die-3d.blue .face-5 { transform: rotateY(-90deg) translateZ(37.5px); }
    .center-controls .die-3d.blue .face-6 { transform: rotateY(180deg) translateZ(37.5px); }

    .center-controls .die-3d.pink .face-1 { transform: rotateY(0deg) translateZ(37.5px); }
    .center-controls .die-3d.pink .face-2 { transform: rotateY(90deg) translateZ(37.5px); }
    .center-controls .die-3d.pink .face-3 { transform: rotateX(90deg) translateZ(37.5px); }
    .center-controls .die-3d.pink .face-4 { transform: rotateX(-90deg) translateZ(37.5px); }
    .center-controls .die-3d.pink .face-5 { transform: rotateY(-90deg) translateZ(37.5px); }
    .center-controls .die-3d.pink .face-6 { transform: rotateY(180deg) translateZ(37.5px); }

    /* Mobile roll button - Design System 2025 */
    .roll-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        border: none;
        padding: 0.75rem 1rem;
        border-radius: var(--radius);
        color: white;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
        font-size: 0.8125rem;
        min-width: 160px;
    }

    .roll-btn svg.roll-icon {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }

    .roll-btn .roll-text {
        white-space: nowrap;
    }

    /* Player 1 = teal gradient */
    .roll-btn.player1-turn {
        background: linear-gradient(135deg, var(--teal), #0d9488);
    }

    .roll-btn.player1-turn:hover:not(:disabled) {
        box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
        transform: translateY(-1px);
    }

    /* Player 2 = rose gradient */
    .roll-btn.player2-turn {
        background: linear-gradient(135deg, var(--rose), var(--orange));
    }

    .roll-btn.player2-turn:hover:not(:disabled) {
        box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
        transform: translateY(-1px);
    }

    .roll-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
    }
}

/* Property Ownership Visualization */
.cell-3d.owned-p1,
.cell-icon.owned-p1 {
    border: 3px solid #60a5fa !important;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.5), inset 0 0 10px rgba(96, 165, 250, 0.3);
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(37, 99, 235, 0.2)) !important;
}

.cell-3d.owned-p2,
.cell-icon.owned-p2 {
    border: 3px solid #f472b6 !important;
    box-shadow: 0 0 15px rgba(244, 114, 182, 0.5), inset 0 0 10px rgba(244, 114, 182, 0.3);
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.2), rgba(219, 39, 119, 0.2)) !important;
}

/* Property Upgrade Levels */
.cell-3d.level-1::after,
.cell-icon.level-1::after {
    content: '⭐';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    z-index: 10;
}

.cell-3d.level-2::after,
.cell-icon.level-2::after {
    content: '⭐⭐';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    z-index: 10;
}

.cell-3d.level-3::after,
.cell-icon.level-3::after {
    content: '⭐⭐⭐';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 8px;
    z-index: 10;
    color: #fbbf24;
    text-shadow: 0 0 5px rgba(251, 191, 36, 0.8);
}

/* Modal animations */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Notification animations */
@keyframes notificationSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes notificationSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Pulse animation for timers */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Адаптация для очень больших экранов (1920px+) */
@media (min-width: 1920px) {
    .board-3d {
        max-width: 1100px;
        max-height: 1100px;
        transform: translateY(-10vh) rotateX(48deg) rotateZ(-42deg) scale(1.05);
    }

    .side-panel {
        width: 400px;
    }

    .log-entry {
        font-size: 14px;
        padding: 8px 10px;
    }
}

/* Адаптация для больших планшетов (iPad Pro и аналоги: 1024px-1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .side-panel {
        width: 320px;
    }

    .board-3d {
        width: min(calc(100vw - 360px), calc(100vh - 90px), 68vmin);
        height: min(calc(100vw - 360px), calc(100vh - 90px), 68vmin);
        min-width: 300px;
        min-height: 300px;
        max-width: 850px;
        max-height: 850px;
        transform: translateY(-8vh) rotateX(48deg) rotateZ(-42deg) scale(1.0);
    }

    .cell-icon-3d {
        width: clamp(28px, 4vw, 45px);
        height: clamp(28px, 4vw, 45px);
    }

    .start-icon-3d {
        width: clamp(32px, 4.5vw, 50px);
        height: clamp(32px, 4.5vw, 50px);
    }

    .board-3d-container {
        padding: 10px;
    }

    .log-entry {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* Адаптация для средних планшетов (iPad Air и аналоги: 820px-1023px) */
@media (min-width: 820px) and (max-width: 1023px) {
    .side-panel {
        width: 290px;
    }

    .board-3d {
        width: min(calc(100vw - 330px), calc(100vh - 85px), 64vmin);
        height: min(calc(100vw - 330px), calc(100vh - 85px), 64vmin);
        min-width: 280px;
        min-height: 280px;
        max-width: 680px;
        max-height: 680px;
        transform: translateY(-7vh) rotateX(48deg) rotateZ(-42deg) scale(0.98);
    }

    .cell-icon-3d {
        width: clamp(22px, 3.5vw, 38px);
        height: clamp(22px, 3.5vw, 38px);
    }

    .start-icon-3d {
        width: clamp(26px, 4vw, 42px);
        height: clamp(26px, 4vw, 42px);
    }

    .board-3d-container {
        padding: 8px;
    }

    .player-token-3d {
        width: clamp(10px, 1.2vw, 14px);
        height: clamp(10px, 1.2vw, 14px);
    }

    .log-entry {
        font-size: 11px;
        padding: 5px 7px;
    }
}

/* Адаптация для малых планшетов (769px-819px) */
@media (min-width: 769px) and (max-width: 819px) {
    .side-panel {
        width: 270px;
    }

    .board-3d {
        width: min(calc(100vw - 310px), calc(100vh - 80px), 60vmin);
        height: min(calc(100vw - 310px), calc(100vh - 80px), 60vmin);
        min-width: 260px;
        min-height: 260px;
        max-width: 620px;
        max-height: 620px;
        transform: translateY(-6vh) rotateX(48deg) rotateZ(-42deg) scale(0.98);
    }

    .cell-icon-3d {
        width: clamp(20px, 3.2vw, 34px);
        height: clamp(20px, 3.2vw, 34px);
    }

    .start-icon-3d {
        width: clamp(24px, 3.8vw, 38px);
        height: clamp(24px, 3.8vw, 38px);
    }

    .board-3d-container {
        padding: 6px;
    }

    .player-token-3d {
        width: clamp(9px, 1.1vw, 13px);
        height: clamp(9px, 1.1vw, 13px);
    }

    .die-scene {
        width: clamp(55px, 7vw, 70px);
        height: clamp(55px, 7vw, 70px);
    }

    .die-3d {
        width: clamp(55px, 7vw, 70px);
        height: clamp(55px, 7vw, 70px);
    }

    .die-face {
        width: clamp(55px, 7vw, 70px);
        height: clamp(55px, 7vw, 70px);
    }

    .log-entry {
        font-size: 11px;
        padding: 5px 7px;
    }
}

/* Mobile responsive adjustments for levels - slightly larger for better visibility */
@media (max-width: 768px) {
    .cell-3d.level-1::after,
    .cell-icon.level-1::after {
        font-size: 10px;
        top: 1px;
        right: 1px;
    }

    .cell-3d.level-2::after,
    .cell-icon.level-2::after {
        font-size: 8px;
        top: 1px;
        right: 1px;
    }

    .cell-3d.level-3::after,
    .cell-icon.level-3::after {
        font-size: 7px;
        top: 1px;
        right: 1px;
        color: #fbbf24;
        text-shadow: 0 0 3px rgba(251, 191, 36, 0.8);
    }
}
