* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f0f4ff;
    --text-primary: #1a1a1a;
    --text-secondary: #4a5568;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --slot-bg: #e8f0fe;
    --shadow: rgba(59, 130, 246, 0.2);
    --card-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --slot-bg: #16213e;
    --shadow: rgba(59, 130, 246, 0.4);
    --card-bg: #1a1a2e;
}

[data-theme="oled"] {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #8b95a8;
    --accent: #2563eb;
    --accent-hover: #3b82f6;
    --slot-bg: #0a0a0a;
    --shadow: rgba(37, 99, 235, 0.5);
    --card-bg: #000000;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    transition: background 0.3s, color 0.3s;
}

/* Главное меню */
.main-menu {
    width: 100%;
    max-width: 400px;
}

@media (min-width: 768px) {
    .main-menu {
        max-width: 1200px;
    }
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.menu-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance-display {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent);
    padding: 8px 16px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

.icon-btn {
    background: var(--card-bg);
    border: 2px solid var(--bg-secondary);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow);
    font-size: 20px;
}

.icon-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.icon-btn:active {
    transform: translateY(0);
}

.menu-title {
    font-size: 36px;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 16px;
    text-align: center;
}

.menu-stats {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px var(--shadow);
}

.menu-stats h3 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 18px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-secondary);
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: bold;
    color: var(--accent);
}

/* Анимация появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.menu-games {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .menu-games {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
        margin: 0 auto 20px;
    }
}

.game-card {
    background: var(--card-bg);
    padding: 30px 20px;
    border-radius: 15px;
    box-shadow: 0 4px 12px var(--shadow);
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--bg-secondary);
    text-align: center;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow);
    border-color: var(--accent);
}

.game-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.game-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.game-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Модальное окно статистики */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 20px;
    max-width: 1000px;
    width: 92%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h2 {
    font-size: 24px;
    color: var(--text-primary);
}

.close-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.close-btn:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 32px;
}

.stat-info {
    flex: 1;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

/* Заголовок */
.header {
    width: 100%;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.back-btn {
    background: var(--card-bg);
    border: 2px solid var(--bg-secondary);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 8px var(--shadow);
}

.back-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.back-btn:active {
    transform: translateY(0);
}

.balance-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.balance {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

.add-coins-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    box-shadow: 0 4px 12px var(--shadow);
}

.add-coins-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.1);
}

.add-coins-btn:active {
    transform: scale(0.95);
}

/* Контейнер казино */
.casino-container {
    background: var(--bg-secondary);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    max-width: 400px;
    width: 100%;
}

.slot-machine {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.slot {
    width: 90px;
    height: 120px;
    background: var(--slot-bg);
    border: 3px solid var(--accent);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

.slot-inner {
    transition: transform 0.1s ease-out;
}

.slot.spinning .slot-inner {
    animation: spin 0.1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bet-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bet-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}

.bet-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.bet-btn {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.bet-btn:hover {
    background: var(--accent-hover);
}

.bet-btn:active {
    transform: scale(0.9);
}

.bet-amount {
    font-size: 24px;
    font-weight: bold;
    min-width: 80px;
    text-align: center;
    color: var(--accent);
}

.spin-btn {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 20px;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 6px 20px var(--shadow);
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.spin-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.message {
    text-align: center;
    margin-top: 20px;
    font-size: 18px;
    font-weight: bold;
    min-height: 30px;
    color: var(--accent);
}

.message.win {
    color: #10b981;
    animation: pulse 0.5s ease-in-out;
}

.message.lose {
    color: #ef4444;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.coin-animation {
    position: fixed;
    font-size: 30px;
    pointer-events: none;
    animation: float-up 1s ease-out forwards;
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(1.5);
        opacity: 0;
    }
}

.hidden {
    display: none;
}

/* Рулетка */
.roulette-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
}

.roulette-wheel {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 8px solid var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s;
}

.roulette-wheel::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        #ef4444 0deg 25.7deg,
        #1a1a1a 25.7deg 51.4deg,
        #ef4444 51.4deg 77.1deg,
        #1a1a1a 77.1deg 102.8deg,
        #ef4444 102.8deg 128.5deg,
        #1a1a1a 128.5deg 154.2deg,
        #ef4444 154.2deg 180deg,
        #1a1a1a 180deg 205.7deg,
        #ef4444 205.7deg 231.4deg,
        #1a1a1a 231.4deg 257.1deg,
        #ef4444 257.1deg 282.8deg,
        #1a1a1a 282.8deg 308.5deg,
        #ef4444 308.5deg 334.2deg,
        #1a1a1a 334.2deg 360deg
    );
    animation: rotate-wheel 3s linear infinite;
}

@keyframes rotate-wheel {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.roulette-wheel.spinning::before {
    animation: rotate-wheel 0.1s linear infinite;
}

.roulette-number {
    position: relative;
    z-index: 2;
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.roulette-ball {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    z-index: 3;
}

.roulette-bets {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.roulette-bet-btn {
    padding: 20px;
    border: 3px solid;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.roulette-bet-btn.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #991b1b;
}

.roulette-bet-btn.red:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

.roulette-bet-btn.black {
    background: linear-gradient(135deg, #1a1a1a 0%, #0a0a0a 100%);
    border-color: #404040;
}

.roulette-bet-btn.black:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.roulette-bet-btn.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #047857;
}

.roulette-bet-btn.green:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

.roulette-bet-btn:active {
    transform: translateY(0);
}

.roulette-bet-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.bet-label-text {
    flex: 1;
}

.bet-multiplier {
    font-size: 22px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

/* Мины */
.mines-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--slot-bg);
    border-radius: 12px;
}

.mines-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.mines-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.mine-cell {
    aspect-ratio: 1;
    background: var(--slot-bg);
    border: 2px solid var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.mine-cell:hover:not(.revealed):not(.disabled) {
    background: var(--accent);
    transform: scale(1.05);
}

.mine-cell.revealed {
    background: var(--bg-primary);
    cursor: default;
    border-color: #10b981;
}

.mine-cell.mine {
    background: #ef4444;
    border-color: #dc2626;
}

.mine-cell.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Конфетти */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Уведомления о достижениях */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 3px solid;
    border-image: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6) 1;
    border-radius: 20px;
    padding: 20px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 
        0 20px 60px rgba(59, 130, 246, 0.6),
        0 10px 30px rgba(139, 92, 246, 0.4),
        0 0 40px rgba(59, 130, 246, 0.5);
    z-index: 10000;
    min-width: 320px;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: glow-border 2s ease-in-out infinite;
}

@keyframes glow-border {
    0%, 100% {
        box-shadow: 
            0 20px 60px rgba(59, 130, 246, 0.6),
            0 10px 30px rgba(139, 92, 246, 0.4),
            0 0 40px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 
            0 25px 80px rgba(59, 130, 246, 0.8),
            0 15px 40px rgba(139, 92, 246, 0.6),
            0 0 60px rgba(59, 130, 246, 0.7);
    }
}

.achievement-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.achievement-notification-icon {
    font-size: 64px;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.8));
    animation: notification-icon-bounce 1s ease-in-out infinite;
}

@keyframes notification-icon-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.1); }
}

.achievement-notification-content {
    flex: 1;
}

.achievement-notification-title {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    font-weight: 600;
}

.achievement-notification-name {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 5px;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.achievement-notification-reward {
    font-size: 16px;
    color: #10b981;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.achievement-notification-reward::before {
    content: '🎁';
    font-size: 18px;
}

/* Адаптив для мобильных */
@media (max-width: 480px) {
    .achievement-notification {
        right: 10px;
        left: 10px;
        min-width: auto;
    }
}

/* Индикатор винстрика */
.win-streak-indicator {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border: 3px solid #fbbf24;
    border-radius: 20px;
    padding: 15px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 
        0 20px 60px rgba(239, 68, 68, 0.6),
        0 10px 30px rgba(251, 191, 36, 0.4),
        0 0 40px rgba(239, 68, 68, 0.5);
    z-index: 9999;
    transform: translateX(300px) scale(0.8);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.win-streak-indicator.show {
    transform: translateX(0) scale(1);
    opacity: 1;
    animation: streak-pulse 1.5s ease-in-out infinite;
}

@keyframes streak-pulse {
    0%, 100% {
        box-shadow: 
            0 20px 60px rgba(239, 68, 68, 0.6),
            0 10px 30px rgba(251, 191, 36, 0.4),
            0 0 40px rgba(239, 68, 68, 0.5);
    }
    50% {
        box-shadow: 
            0 25px 80px rgba(239, 68, 68, 0.8),
            0 15px 40px rgba(251, 191, 36, 0.6),
            0 0 60px rgba(239, 68, 68, 0.7);
    }
}

.win-streak-indicator.big {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    border-color: #fbbf24;
    animation: streak-pulse-big 1s ease-in-out infinite;
}

@keyframes streak-pulse-big {
    0%, 100% {
        transform: translateX(0) scale(1);
    }
    50% {
        transform: translateX(0) scale(1.05);
    }
}

.win-streak-indicator.mega {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #fde047;
    animation: streak-mega 0.8s ease-in-out infinite;
}

@keyframes streak-mega {
    0%, 100% {
        transform: translateX(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateX(0) scale(1.08) rotate(-2deg);
    }
    75% {
        transform: translateX(0) scale(1.08) rotate(2deg);
    }
}

.win-streak-flame {
    font-size: 56px;
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.8));
    animation: flame-flicker 0.3s ease-in-out infinite;
}

@keyframes flame-flicker {
    0%, 100% {
        transform: scale(1) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

.win-streak-count {
    font-size: 48px;
    font-weight: 900;
    color: white;
    text-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(251, 191, 36, 0.8);
    line-height: 1;
}

.win-streak-text {
    font-size: 12px;
    font-weight: 800;
    color: #fef3c7;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .win-streak-indicator {
        top: 80px;
        right: 10px;
        padding: 12px 20px;
    }
    
    .win-streak-flame {
        font-size: 42px;
    }
    
    .win-streak-count {
        font-size: 36px;
    }
    
    .win-streak-text {
        font-size: 10px;
    }
}

/* Модальное окно настроек */
.settings-modal {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 30px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-secondary);
}

/* Карточки тем */
.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.theme-card {
    background: var(--bg-secondary);
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow);
}

.theme-card.active {
    border-color: var(--accent);
    box-shadow: 0 4px 15px var(--shadow);
}

.theme-preview {
    width: 100%;
    height: 80px;
    border-radius: 10px;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

.light-preview {
    background: #ffffff;
}

.light-preview .preview-bar {
    background: #f0f4ff;
    height: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.light-preview .preview-content {
    background: #fafafa;
    height: 60px;
    margin: 5px;
    border-radius: 5px;
}

.dark-preview {
    background: #0f0f0f;
}

.dark-preview .preview-bar {
    background: #1a1a2e;
    height: 20px;
    border-bottom: 1px solid #2a2a3e;
}

.dark-preview .preview-content {
    background: #1a1a2e;
    height: 60px;
    margin: 5px;
    border-radius: 5px;
}

.oled-preview {
    background: #000000;
    border: 1px solid #2563eb;
}

.oled-preview .preview-bar {
    background: #0a0a0a;
    height: 20px;
    border-bottom: 1px solid #2563eb;
}

.oled-preview .preview-content {
    background: #000000;
    height: 60px;
    margin: 5px;
    border-radius: 5px;
    border: 1px solid #1a1a1a;
}

.theme-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.theme-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.theme-card.active .theme-check {
    display: flex;
}

/* Карточки языков */
.language-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.language-card {
    background: var(--bg-secondary);
    border: 3px solid transparent;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.language-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--shadow);
}

.language-card.active {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.language-flag {
    font-size: 32px;
}

.language-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.language-check {
    width: 24px;
    height: 24px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.language-card.active .language-check {
    display: flex;
}

@media (max-width: 480px) {
    .theme-options {
        grid-template-columns: 1fr;
    }
    
    .language-options {
        grid-template-columns: 1fr;
    }
}

/* Уровень игрока */
.player-level {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px var(--shadow);
}

.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.level-badge {
    font-size: 18px;
    font-weight: bold;
    color: var(--accent);
}

.level-xp {
    font-size: 14px;
    color: var(--text-secondary);
}

.xp-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.xp-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #8b5cf6 100%);
    transition: width 0.5s ease;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Модальное окно достижений */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    padding: 20px 0;
    max-height: 65vh;
    overflow-y: auto;
}

@media (min-width: 768px) {
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }
}

@media (min-width: 1024px) {
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 35px;
    }
}

/* Скроллбар для сетки достижений */
.achievements-grid::-webkit-scrollbar {
    width: 8px;
}

.achievements-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

.achievements-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.achievements-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

.achievement-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    padding: 25px 20px;
    border-radius: 18px;
    text-align: center;
    position: relative;
    transform-style: preserve-3d;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 8px 15px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.achievement-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0.5;
}

.achievement-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(
        115deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 45%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 55%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.achievement-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 
        0 35px 80px rgba(0, 0, 0, 0.6),
        0 20px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.achievement-card:hover::after {
    transform: translateX(100%);
}

.achievement-card.unlocked {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.3) 0%, 
        rgba(139, 92, 246, 0.3) 50%,
        rgba(236, 72, 153, 0.3) 100%);
    border: 2px solid rgba(59, 130, 246, 0.6);
    animation: glow-pulse 2s ease-in-out infinite;
    box-shadow: 
        0 25px 70px rgba(59, 130, 246, 0.6),
        0 15px 35px rgba(139, 92, 246, 0.4),
        0 5px 15px rgba(236, 72, 153, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

@keyframes glow-pulse {
    0%, 100% {
        box-shadow: 
            0 25px 70px rgba(59, 130, 246, 0.6),
            0 15px 35px rgba(139, 92, 246, 0.4),
            0 5px 15px rgba(236, 72, 153, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 30px 90px rgba(59, 130, 246, 0.8),
            0 20px 50px rgba(139, 92, 246, 0.6),
            0 10px 25px rgba(236, 72, 153, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

.achievement-card.unlocked::before {
    background: linear-gradient(135deg, 
        rgba(59, 130, 246, 0.4), 
        rgba(139, 92, 246, 0.3),
        transparent);
}

.achievement-card.unlocked:hover {
    transform: translateY(-12px) scale(1.05);
    box-shadow: 
        0 40px 100px rgba(59, 130, 246, 0.8),
        0 25px 60px rgba(139, 92, 246, 0.6),
        0 10px 30px rgba(236, 72, 153, 0.5),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);
}

.achievement-card.locked {
    opacity: 0.4;
    filter: grayscale(100%);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.achievement-card.locked:hover {
    transform: translateY(-5px) scale(1.01);
}

/* Иконка достижения */
.achievement-card-icon {
    font-size: 56px;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.4));
    transition: all 0.4s ease;
    display: inline-block;
}

.achievement-card:hover .achievement-card-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.6));
}

.achievement-card.unlocked .achievement-card-icon {
    filter: drop-shadow(0 10px 25px rgba(59, 130, 246, 0.8));
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
    0%, 100% { 
        transform: translateY(0px);
    }
    50% { 
        transform: translateY(-8px);
    }
}

.achievement-card.unlocked:hover .achievement-card-icon {
    filter: drop-shadow(0 15px 35px rgba(59, 130, 246, 1));
    transform: scale(1.15);
}

/* Название достижения */
.achievement-card-name {
    font-size: 16px;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.achievement-card:hover .achievement-card-name {
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.6);
}

.achievement-card.unlocked .achievement-card-name {
    background: linear-gradient(135deg, #60a5fa, #a78bfa, #f472b6);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

/* Описание достижения */
.achievement-card-desc {
    font-size: 12px;
    color: #94a3b8;
    position: relative;
    z-index: 2;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.achievement-card:hover .achievement-card-desc {
    color: #cbd5e1;
}

.achievement-card.unlocked .achievement-card-desc {
    color: #e0e7ff;
}

/* Звездочка для разблокированных */
.achievement-card.unlocked::after {
    content: '✨';
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    z-index: 3;
    animation: sparkle-rotate 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.8));
}

@keyframes sparkle-rotate {
    0%, 100% { 
        transform: rotate(0deg) scale(1);
        opacity: 1;
    }
    50% { 
        transform: rotate(180deg) scale(1.15);
        opacity: 0.8;
    }
}

/* История игр */
.game-history {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid var(--bg-secondary);
}

.game-history h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 18px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-secondary);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-game {
    font-weight: bold;
    color: var(--text-primary);
}

.history-result {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-amount {
    font-weight: bold;
}

.history-amount.win {
    color: #10b981;
}

.history-amount.lose {
    color: #ef4444;
}

.empty-history {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

/* Конфетти */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    pointer-events: none;
    z-index: 9999;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Игра в кости */
.dice-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
}

.dice {
    width: 80px;
    height: 80px;
    background: white;
    border: 3px solid var(--accent);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.3s;
}

.dice.rolling {
    animation: diceRoll 0.5s ease-in-out infinite;
}

@keyframes diceRoll {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(90deg); }
    50% { transform: rotate(180deg); }
    75% { transform: rotate(270deg); }
}

.dice-face {
    font-size: 48px;
}

.dice-prediction {
    margin-bottom: 20px;
}

.prediction-label {
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: var(--text-secondary);
}

.dice-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.dice-bet-btn {
    background: var(--card-bg);
    border: 2px solid var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.dice-bet-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-2px);
}

.dice-bet-btn.selected {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Liquid Glass анимация переключения языка */
.language-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

.language-transition-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(
        circle,
        rgba(59, 130, 246, 0.4) 0%,
        rgba(139, 92, 246, 0.3) 30%,
        rgba(236, 72, 153, 0.2) 60%,
        transparent 100%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    filter: blur(0px);
}

.language-transition-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(59, 130, 246, 0.1) 0%,
        rgba(139, 92, 246, 0.08) 50%,
        rgba(236, 72, 153, 0.1) 100%
    );
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(0px);
}

.language-transition-overlay.active::before {
    width: 300vmax;
    height: 300vmax;
    filter: blur(80px);
}

.language-transition-overlay.active::after {
    opacity: 1;
    backdrop-filter: blur(20px) saturate(180%);
}

.language-transition-overlay.fade-out::before {
    width: 0;
    height: 0;
    filter: blur(0px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.language-transition-overlay.fade-out::after {
    opacity: 0;
    backdrop-filter: blur(0px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Улучшенная анимация для карточек языка */
.language-card {
    position: relative;
    overflow: hidden;
}

.language-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(
        circle,
        rgba(59, 130, 246, 0.3),
        transparent 70%
    );
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.language-card:active::before {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.language-card.active {
    animation: language-select-pulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes language-select-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 6px 15px var(--shadow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 
            0 10px 30px var(--shadow),
            0 0 40px rgba(59, 130, 246, 0.4),
            inset 0 0 20px rgba(59, 130, 246, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 6px 15px var(--shadow);
    }
}

/* Ripple эффект при клике */
.language-card .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Дополнительный liquid эффект для темной темы */
[data-theme="dark"] .language-transition-overlay::before,
[data-theme="oled"] .language-transition-overlay::before {
    background: radial-gradient(
        circle,
        rgba(59, 130, 246, 0.5) 0%,
        rgba(139, 92, 246, 0.4) 30%,
        rgba(236, 72, 153, 0.3) 60%,
        transparent 100%
    );
}

[data-theme="dark"] .language-card .ripple,
[data-theme="oled"] .language-card .ripple {
    background: rgba(59, 130, 246, 0.4);
}