/* Stack Tower Game - CSS */
/* 2026 UI/UX Trends: Glassmorphism, Dark Mode First, Microinteractions */

:root {
    --primary: #3498db;
    --primary-dark: #2980b9;
    --secondary: #e74c3c;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e91e63;
    --dark-bg: #1a1a2e;
    --dark-card: #16213e;
    --dark-border: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #b0bec5;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode overrides */
[data-theme="light"] {
    --dark-bg: #f0f2f8;
    --dark-card: #e4e6f0;
    --dark-border: #c0c8e0;
    --text-primary: #1a1a2e;
    --text-secondary: #4a5068;
    --glass-bg: rgba(52, 152, 219, 0.06);
    --glass-border: rgba(52, 152, 219, 0.15);
}
[data-theme="light"] body {
    background: var(--dark-bg);
    color: var(--text-primary);
}
[data-theme="light"] .app-loader {
    background: var(--dark-bg);
}
[data-theme="light"] .stats-card {
    background: rgba(52, 152, 219, 0.05);
    border-color: rgba(52, 152, 219, 0.12);
}
[data-theme="light"] .game-card {
    background: rgba(52, 152, 219, 0.04);
    border-color: rgba(52, 152, 219, 0.1);
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.05);
}
[data-theme="light"] .badge {
    background: rgba(52, 152, 219, 0.08);
    border-color: rgba(52, 152, 219, 0.15);
}
[data-theme="light"] .skin-card {
    background: rgba(52, 152, 219, 0.04);
    border-color: rgba(52, 152, 219, 0.1);
}
[data-theme="light"] .skin-card.selected {
    border-color: var(--primary);
    background: rgba(52, 152, 219, 0.1);
}
[data-theme="light"] .powerup-btn {
    background: rgba(52, 152, 219, 0.06);
    border-color: rgba(52, 152, 219, 0.15);
}
[data-theme="light"] .overlay {
    background: rgba(240, 242, 248, 0.9);
}
[data-theme="light"] .modal {
    background: rgba(228, 230, 240, 0.95);
    border-color: rgba(52, 152, 219, 0.15);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .recommend-card {
    background: rgba(52, 152, 219, 0.04);
    border-color: rgba(52, 152, 219, 0.1);
}
[data-theme="light"] .lang-btn {
    background: rgba(52, 152, 219, 0.08);
    color: var(--text-primary);
    border-color: rgba(52, 152, 219, 0.18);
}
[data-theme="light"] .lang-menu {
    background: rgba(240, 242, 248, 0.95);
    border-color: rgba(52, 152, 219, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .lang-option {
    color: #4a5068;
}
[data-theme="light"] .lang-option:hover {
    background: rgba(52, 152, 219, 0.1);
    color: var(--text-primary);
}
[data-theme="light"] .lang-option.active {
    background: rgba(52, 152, 219, 0.15);
    color: var(--text-primary);
}
[data-theme="light"] .loader-spinner {
    border-color: rgba(52, 152, 219, 0.12);
    border-top-color: var(--primary);
}
/* Light mode: back/home link visibility */
[data-theme="light"] .back-link,
[data-theme="light"] .home-link {
    color: var(--text-secondary);
}
[data-theme="light"] .back-link:hover,
[data-theme="light"] .home-link:hover {
    color: var(--primary);
}
/* Light mode: tap hint text */
[data-theme="light"] .tap-hint {
    color: var(--text-secondary);
}
/* Light mode: rec-card hover state */
[data-theme="light"] .rec-card:hover,
[data-theme="light"] .rec-card:active {
    background: rgba(52, 152, 219, 0.1);
}

/* === Theme Toggle === */
.theme-toggle {
    position: fixed;
    top: 12px;
    right: 108px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
}
.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle:active { transform: scale(0.95); }
[data-theme="light"] .theme-toggle {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: var(--text-primary, #1a1a2e);
}

/* Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-btn {
    background: rgba(249,115,22,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(249,115,22,0.4);
    color: #fff;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(249,115,22,0.5);
    transform: scale(1.05);
}

.lang-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: rgba(15,10,5,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(249,115,22,0.3);
    border-radius: 12px;
    padding: 8px;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.lang-menu.hidden {
    display: none;
}

.lang-option {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    color: #f0e0d0;
    transition: background 0.2s;
}

.lang-option:hover {
    background: rgba(249,115,22,0.2);
}

.lang-option.active {
    background: rgba(249,115,22,0.3);
    font-weight: 600;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 터치 최적화 */
button, a, input, [role="button"], [role="link"] {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

input[type="text"], textarea {
    -webkit-user-select: text;
    user-select: text;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loader-emoji {
    font-size: 48px;
    animation: loader-bounce 1s ease-in-out infinite;
}
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}
.loader-text {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    font-weight: 500;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}
@keyframes loader-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* App Container */
.app {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Screens */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 100;
}

/* Main Screen */
.main-container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    text-align: center;
    animation: slideIn 0.6s ease;
}

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

.title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--danger));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 500;
}

/* Stats Card */
.stats-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    animation: popIn 0.6s ease 0.1s both;
}

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

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

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

/* Badges Container */
.badges-container {
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(212, 172, 13, 0.1), rgba(57, 255, 20, 0.05));
    border: 1px solid rgba(212, 172, 13, 0.2);
    border-radius: 1.5rem;
    animation: popIn 0.6s ease 0.2s both;
}

.current-badge {
    text-align: center;
}

.badge-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.badge-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffd700;
}

/* Button Groups */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: popIn 0.6s ease 0.3s both;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 8px 16px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-tertiary {
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-tertiary:hover {
    border-color: var(--success);
    color: var(--success);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
}

.btn-text:hover {
    color: var(--primary);
}

/* Game Screen */
.game-header {
    position: absolute;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.game-info {
    display: flex;
    gap: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
}

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

.info-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Canvas */
.game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: manipulation;
    cursor: pointer;
}

/* Ad Containers */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    position: relative;
    z-index: 5;
}

.ad-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0.5rem;
}

.ad-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0.5rem;
}

.ad-game-over {
    width: 100%;
    max-width: 320px;
    height: 250px;
    margin: 2rem 0;
    border-radius: 1rem;
}

/* Power Up Container */
.powerup-container {
    position: absolute;
    bottom: 80px;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 10;
}

.powerup-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 0.6rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.powerup-btn:hover:not(:disabled) {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.powerup-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.powerup-icon {
    font-size: 1.5rem;
    display: block;
}

.powerup-label {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Game Over Screen */
.game-over-container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    text-align: center;
    animation: slideIn 0.6s ease;
}

.game-over-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--danger);
}

.result-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
}

.result-item {
    display: flex;
    flex-direction: column;
}

.result-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--success);
}

.countdown {
    padding: 1rem;
    background: rgba(244, 67, 54, 0.1);
    border: 1px solid rgba(244, 67, 54, 0.3);
    border-radius: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.result-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Skin Screen */
.skin-container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
}

.skin-title {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.skin-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.skin-card {
    aspect-ratio: 1;
    padding: 1rem;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: 1rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.skin-card:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.skin-card.selected {
    border-color: var(--success);
    background: rgba(46, 204, 113, 0.1);
}

.skin-card.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.skin-preview {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.skin-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.skin-unlock {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.skin-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
}

/* Leaderboard Screen */
.leaderboard-container {
    width: 100%;
    max-width: 480px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
}

.leaderboard-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.leaderboard-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    font-weight: 600;
}

.tab-btn.active {
    color: var(--primary);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.badges-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.badge-item {
    padding: 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    text-align: center;
    transition: var(--transition);
}

.badge-item.unlocked {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.05);
}

.badge-item:hover {
    transform: translateY(-2px);
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.badge-item-name {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.badge-item-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.stat-card {
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    text-align: center;
}

.stat-big-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.5rem;
}

/* Responsive Design */
@media (max-width: 600px) {
    .title {
        font-size: 2.5rem;
    }

    .main-container {
        padding: 1rem;
    }

    .stats-card {
        gap: 0.5rem;
        padding: 1rem;
    }

    .result-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .skin-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .powerup-container {
        bottom: 70px;
        right: 0.5rem;
    }

    .powerup-btn {
        width: 45px;
        height: 45px;
        font-size: 0.55rem;
    }

    .game-header {
        top: 0.5rem;
        left: 0.5rem;
        right: 0.5rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (prefers-contrast: more) {
    .glass-bg {
        background: rgba(255, 255, 255, 0.15);
    }

    .btn-primary {
        box-shadow: 0 0 0 2px var(--dark-bg), 0 0 0 4px var(--primary);
    }
}

/* Color Contrast */
@media (color-gamut: srgb) {
    .title {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    }
}

/* Touch Targets (44px minimum) */
.btn {
    min-height: 44px;
    min-width: 44px;
}

.powerup-btn {
    min-height: 50px;
    min-width: 50px;
}

/* Tap Hint */
.tap-hint {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
    animation: tapPulse 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes tapPulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-8px); }
}

/* HUD Combo Text */
.hud-combo {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px currentColor;
    pointer-events: none;
    z-index: 10;
    animation: comboFlash 0.5s ease;
}

@keyframes comboFlash {
    0% { transform: scale(1.5); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.hidden {
    display: none !important;
}

/* Game screen canvas fills parent */
#gameScreen {
    position: relative;
    flex-direction: column;
}

#gameScreen .game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Print Styles */
@media print {
    .screen {
        position: static;
        opacity: 1 !important;
        page-break-after: always;
    }
}

/* === RECOMMENDATIONS === */
.recommendations-section { margin-top: 24px; padding: 0 4px; }
.rec-title { font-size: 15px; font-weight: 700; color: var(--text-secondary); margin-bottom: 12px; text-align: center; letter-spacing: 0.5px; }
.rec-grid { display: flex; flex-direction: column; gap: 10px; }
.rec-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: 16px; text-decoration: none; color: var(--text-primary); transition: var(--transition); }
.rec-card:hover, .rec-card:active { background: rgba(255,255,255,0.1); border-color: var(--primary); transform: translateY(-1px); }
.rec-icon { font-size: 28px; flex-shrink: 0; width: 40px; text-align: center; }
.rec-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rec-name { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-desc { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Game Footer & Back Link */
.game-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
}

.back-link, .home-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,0.4);
    text-decoration: none;
    font-size: 13px;
    padding: 12px 0;
    transition: color 0.2s;
}

.back-link:hover, .home-link:hover {
    color: rgba(255,255,255,0.7);
}

/* === DOPAMINE ENHANCEMENT EFFECTS === */

/* Combo milestone floating text animations */
@keyframes comboPulse {
    0% { transform: scale(0.5) translateY(0); opacity: 1; }
    50% { transform: scale(1.1); }
    100% { transform: scale(0.3) translateY(-80px); opacity: 0; }
}

@keyframes goldBurst {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

/* Screen shake for perfect placements */
@keyframes screenShake {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-4px, -4px); }
    20% { transform: translate(4px, 4px); }
    30% { transform: translate(-3px, 3px); }
    40% { transform: translate(3px, -3px); }
    50% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    70% { transform: translate(-1px, 1px); }
    80% { transform: translate(1px, -1px); }
    90% { transform: translate(0, 0); }
}

.app.shake { animation: screenShake 0.15s ease; }

/* Enhanced glow effect for perfect blocks */
@keyframes perfectGlow {
    0%, 100% { filter: drop-shadow(0 0 8px #2ecc71); }
    50% { filter: drop-shadow(0 0 20px #2ecc71) drop-shadow(0 0 30px #2ecc71); }
}

/* Particle effects styling support */
canvas { filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3)); }

/* === Accessibility Improvements === */
button:focus-visible,a:focus-visible,input:focus-visible,[role="button"]:focus-visible{outline:3px solid #2ecc71;outline-offset:2px;}
button,a[href],input[type="button"],input[type="submit"],[role="button"]{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;}
.skip-link{position:absolute;top:-40px;left:0;background:#2ecc71;color:white;padding:8px;text-decoration:none;z-index:100;}
.skip-link:focus{top:0;}
[role="dialog"]{z-index:1000;}
@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important;}}
/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark, var(--bg-primary, var(--background, #0f0f23)));
}

::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 5px;
    border: 2px solid var(--bg-dark, var(--bg-primary, var(--background, #0f0f23)));
}

::-webkit-scrollbar-thumb:hover {
    background: #fa8f44;
    opacity: 0.8;
}

/* Selection Color */
::selection {
    background: #f97316;
    color: white;
}

::-moz-selection {
    background: #f97316;
    color: white;
}

@media (prefers-contrast: more){button{border:2px solid #2ecc71;}}
.rec-card:focus-visible{outline:3px solid #2ecc71;outline-offset:4px;}
