body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    text-align: center;
    user-select: none;
    overflow-x: hidden;
    min-height: 100vh;
    animation: backgroundShift 10s ease-in-out infinite alternate;
}

@keyframes backgroundShift {
    0% { background: linear-gradient(135deg, #2c3e50, #3498db); }
    100% { background: linear-gradient(135deg, #34495e, #2980b9); }
}

* {
    box-sizing: border-box;
}

button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Title Screen Styles */
.title-screen {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

.title-background-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

.title-background-effects canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.title-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1000px;
    width: 100%;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.title-header {
    margin-bottom: 30px;
}

.game-title {
    font-size: 4.5em;
    margin: 0 0 15px 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.8), 0 0 30px rgba(243, 156, 18, 0.5);
    animation: titlePulse 3s ease-in-out infinite;
    color: #f39c12; /* Fallback color */
    background: linear-gradient(45deg, #f39c12, #e74c3c, #9b59b6, #3498db);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titlePulse 3s ease-in-out infinite, gradientShift 8s ease-in-out infinite;
}

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

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

.title-tagline {
    margin-bottom: 20px;
}

.game-subtitle {
    font-size: 1.4em;
    margin-bottom: 8px;
    opacity: 0.95;
    animation: subtitleFloat 4s ease-in-out infinite;
    color: #ecf0f1;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.game-description {
    font-size: 1em;
    margin-bottom: 0;
    opacity: 0.8;
    color: #bdc3c7;
    font-style: italic;
    animation: subtitleFloat 4s ease-in-out infinite 0.5s;
}

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

/* Featured Content Styles */
.featured-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 40px 0;
    align-items: start;
}

.character-showcase,
.quick-stats {
    background: rgba(255,255,255,0.08);
    border-radius: 15px;
    padding: 25px;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.character-showcase:hover,
.quick-stats:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border-color: rgba(52, 152, 219, 0.5);
}

.showcase-header,
.stats-header {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.showcase-header h3,
.stats-header h3 {
    color: #3498db;
    margin: 0;
    font-size: 1.3em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Character Showcase Styles */
.character-sprite-container {
    position: relative;
    display: inline-block;
    margin-bottom: 15px;
}

.character-sprite {
    position: relative;
    z-index: 2;
}

.character-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: characterGlow 2s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes characterGlow {
    0% { opacity: 0.3; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(1.1); }
}

/* Quick Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
    border-color: rgba(52, 152, 219, 0.5);
}

.stat-icon {
    font-size: 1.8em;
    min-width: 40px;
    text-align: center;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.stat-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.stat-label {
    font-size: 0.85em;
    color: #bdc3c7;
    margin-bottom: 2px;
    font-weight: 500;
}

.stat-value {
    font-size: 1.2em;
    color: #f39c12;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Legacy character preview (keeping for compatibility) */
.character-preview {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    margin: 30px 0;
    border: 2px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
}

.character-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.character-sprite {
    width: 60px;
    height: 80px;
    background: #e67e22;
    border-radius: 10px;
    position: relative;
    animation: characterBob 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-character-canvas {
    border-radius: 8px;
    animation: characterBob 2s ease-in-out infinite;
}

@keyframes characterBob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-8px) rotate(2deg); }
}

.character-sprite::after {
    content: '🍺';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
    animation: mugSway 1.5s ease-in-out infinite;
}

@keyframes mugSway {
    0%, 100% { transform: rotate(-10deg); }
    50% { transform: rotate(10deg); }
}

.character-info h3 {
    margin: 0 0 10px 0;
    color: #f39c12;
    font-size: 1.4em;
}

.character-info p {
    margin: 5px 0;
    opacity: 0.8;
}

/* Hero Start Button Section */
.primary-actions-hero {
    margin: 40px 0 50px 0;
    text-align: center;
}

.primary-btn-hero {
    background: linear-gradient(135deg, #e74c3c, #c0392b, #e74c3c);
    background-size: 200% 200%;
    border: none;
    color: white;
    padding: 25px 50px;
    font-size: 1.6em;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    box-shadow: 0 12px 35px rgba(231, 76, 60, 0.5);
    animation: heroPulse 2.5s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.primary-btn-hero:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 20px 50px rgba(231, 76, 60, 0.8);
    background-position: 100% 100%;
    border-color: rgba(255, 255, 255, 0.6);
}

.primary-btn-hero .btn-text {
    font-size: 1em;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.primary-btn-hero .btn-subtitle {
    font-size: 0.55em;
    opacity: 0.95;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.primary-btn-hero .btn-icon {
    font-size: 1.2em;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

@keyframes heroPulse {
    0%, 100% { 
        box-shadow: 0 12px 35px rgba(231, 76, 60, 0.5), 0 0 0 0 rgba(231, 76, 60, 0.7);
        background-position: 0% 0%;
    }
    50% { 
        box-shadow: 0 12px 45px rgba(231, 76, 60, 0.8), 0 0 0 10px rgba(231, 76, 60, 0);
        background-position: 100% 100%;
    }
}

/* Menu Sections */
.menu-sections {
    margin: 40px 0;
}

.primary-actions {
    margin-bottom: 40px;
}

.primary-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b, #e74c3c);
    background-size: 200% 200%;
    border: none;
    color: white;
    padding: 20px 40px;
    font-size: 1.4em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    animation: primaryButtonPulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.primary-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(231, 76, 60, 0.6);
    background-position: 100% 100%;
}

.primary-btn .btn-text {
    font-size: 1em;
    margin: 0;
}

.primary-btn .btn-subtitle {
    font-size: 0.6em;
    opacity: 0.9;
    font-weight: normal;
    text-transform: none;
    letter-spacing: 1px;
}

@keyframes primaryButtonPulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
        background-position: 0% 0%;
    }
    50% { 
        box-shadow: 0 8px 35px rgba(231, 76, 60, 0.7);
        background-position: 100% 100%;
    }
}

.secondary-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.action-group {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.action-group:hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-3px);
    border-color: rgba(52, 152, 219, 0.3);
}

.action-group h4 {
    color: #3498db;
    margin: 0 0 15px 0;
    font-size: 1.1em;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(52, 152, 219, 0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.menu-btn {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.8), rgba(41, 128, 185, 0.8));
    border: 1px solid rgba(52, 152, 219, 0.4);
    color: white;
    padding: 12px 20px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px 0;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    background: linear-gradient(135deg, rgba(52, 152, 219, 1), rgba(41, 128, 185, 1));
    border-color: rgba(52, 152, 219, 0.8);
}

.btn-icon {
    font-size: 1.2em;
    display: inline-block;
    min-width: 20px;
    text-align: center;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.character-select-btn {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border: none;
    color: white;
    padding: 15px 25px;
    font-size: 1.1em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.character-select-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.5);
    background: linear-gradient(135deg, #e67e22, #d35400);
}

/* Footer Info */
.footer-info {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    opacity: 0.8;
}

.version-info {
    font-size: 0.9em;
    color: #bdc3c7;
    margin: 5px 0;
    font-weight: 500;
}

.credits {
    font-size: 0.85em;
    color: #95a5a6;
    margin: 5px 0;
    font-style: italic;
}

.title-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    opacity: 0.7;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: #f39c12;
}

.game-ui {
    display: none;
}

.game-ui.active {
    display: block;
}

.game-ui h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 20px;
}

.left-info, .center-info, .right-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.level-info, .streak, .high-score, .coins {
    font-size: 1em;
    font-weight: bold;
}

.power-up-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    animation: pulse 1s infinite;
}

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

.power-up-icon {
    font-size: 2em;
}

.power-up-timer {
    width: 100px;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
    overflow: hidden;
}

.power-up-timer::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    width: var(--timer-width, 100%);
    transition: width 0.1s linear;
}

.ability-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 10px;
    background: rgba(52, 152, 219, 0.2);
    border-radius: 10px;
    border: 2px solid #3498db;
}

.ability-icon {
    font-size: 1.5em;
    color: #3498db;
}

.ability-timer {
    width: 120px;
    height: 8px;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    overflow: hidden;
}

.ability-timer::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    width: var(--ability-timer-width, 0%);
    transition: width 0.1s linear;
}

.ability-text {
    font-size: 0.9em;
    color: #3498db;
    font-weight: bold;
}

.ability-bar.ready {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
}

.ability-bar.ready .ability-icon,
.ability-bar.ready .ability-text {
    color: #2ecc71;
}

.ability-bar.ready .ability-timer::after {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.ability-bar.active {
    background: rgba(241, 196, 15, 0.2);
    border-color: #f1c40f;
    animation: pulse 1s infinite;
}

.ability-bar.active .ability-icon,
.ability-bar.active .ability-text {
    color: #f1c40f;
}

.ability-bar.active .ability-timer::after {
    background: linear-gradient(90deg, #f1c40f, #f39c12);
}

.grog-meter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.grog-bar {
    width: 200px;
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #fff;
}

.grog-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    transition: width 0.3s ease;
    width: 100%;
}

.score {
    font-size: 1.2em;
    font-weight: bold;
}

.stats {
    margin: 20px 0;
    text-align: left;
}

.stats p {
    margin: 5px 0;
}

#newRecord {
    color: #f1c40f;
    font-weight: bold;
    animation: celebration 2s infinite;
}

@keyframes celebration {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.unlocks {
    background: rgba(46, 204, 113, 0.2);
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
    border: 2px solid #2ecc71;
}

.unlocks h3 {
    color: #2ecc71;
    margin-top: 0;
}

#gameCanvas {
    border: 3px solid #fff;
    border-radius: 10px;
    background: #34495e;
    display: block;
    margin: 0 auto;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.controls {
    margin-top: 20px;
    font-size: 1.1em;
}

.controls p {
    margin: 5px 0;
}

.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #e74c3c;
    text-align: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.game-over h2 {
    color: #e74c3c;
    margin-bottom: 20px;
}

.game-over button {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.game-over button:hover {
    background: #c0392b;
}

.game-over button {
    margin: 5px;
}

.pause-menu, .shop, .achievements, .level-complete {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #3498db;
    text-align: center;
    min-width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.shop-item {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-item:hover {
    border-color: #3498db;
    transform: translateY(-2px);
}

.shop-item.owned {
    background: rgba(46, 204, 113, 0.2);
    border-color: #2ecc71;
}

.shop-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item.selected {
    background: rgba(52, 152, 219, 0.3);
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

.character-item {
    text-align: left;
}

.character-item h4 {
    color: #3498db;
    margin: 0 0 10px 0;
}

.character-item p {
    margin: 5px 0;
    font-size: 0.9em;
}

.character-item small {
    color: #95a5a6;
    font-style: italic;
}

.character-visual-container {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

.character-canvas {
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
    transition: transform 0.3s ease;
}

.character-canvas:hover {
    transform: scale(1.1);
}

.achievement-list {
    display: grid;
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    border-left: 4px solid #95a5a6;
}

.achievement.unlocked {
    border-left-color: #f1c40f;
    background: rgba(241, 196, 15, 0.1);
}

.achievement-icon {
    font-size: 2em;
    min-width: 40px;
}

.achievement-text h4 {
    margin: 0;
    color: #ecf0f1;
}

.achievement-text p {
    margin: 5px 0 0 0;
    color: #bdc3c7;
    font-size: 0.9em;
}

/* Character Select Styles */
.character-select {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #f39c12;
    text-align: center;
    min-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.character-card {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.character-card:hover {
    border-color: #3498db;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

.character-card.selected {
    border-color: #f39c12;
    background: rgba(243, 156, 18, 0.2);
}

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

.character-card-sprite {
    width: 50px;
    height: 65px;
    margin: 0 auto 15px;
    border-radius: 10px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-card-sprite .character-canvas {
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.character-card:hover .character-canvas {
    transform: scale(1.05);
}

/* Statistics Styles */
.statistics {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #9b59b6;
    text-align: center;
    min-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}

.stat-card h4 {
    margin: 0 0 10px 0;
    color: #3498db;
}

.stat-card .big-number {
    font-size: 2em;
    font-weight: bold;
    color: #f39c12;
    display: block;
}

/* Daily Challenges Styles */
.daily-challenges {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #e74c3c;
    text-align: center;
    min-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.challenges-list {
    margin: 20px 0;
}

.challenge-item {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    text-align: left;
    border-left: 4px solid #e74c3c;
}

.challenge-item.completed {
    border-left-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.challenge-reward {
    color: #f39c12;
    font-weight: bold;
    float: right;
}

/* Combo System Styles */
.combo-display {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #f39c12, #e67e22);
    padding: 15px 30px;
    border-radius: 25px;
    border: 3px solid #fff;
    animation: comboAppear 0.5s ease-out;
    z-index: 1000;
}

@keyframes comboAppear {
    0% { transform: translateX(-50%) scale(0); }
    100% { transform: translateX(-50%) scale(1); }
}

.combo-text {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.combo-timer {
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    overflow: hidden;
}

.combo-timer::after {
    content: '';
    display: block;
    height: 100%;
    background: #fff;
    width: var(--timer-width, 100%);
    transition: width 0.1s linear;
}

.level-complete {
    border-color: #f1c40f;
    animation: levelComplete 0.5s ease-out;
}

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

/* Particle effects */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: particle 1s linear forwards;
}

@keyframes particle {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-50px);
    }
}

/* Screen shake */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Weather Effects */
.weather-rain::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="rain" x="0" y="0" width="10" height="20" patternUnits="userSpaceOnUse"><line x1="5" y1="0" x2="5" y2="10" stroke="%23ffffff" stroke-width="0.5" opacity="0.6"/></pattern></defs><rect width="100" height="100" fill="url(%23rain)"/></svg>');
    animation: rainFall 0.5s linear infinite;
    pointer-events: none;
    z-index: 100;
}

@keyframes rainFall {
    0% { transform: translateY(-20px); }
    100% { transform: translateY(0); }
}

.weather-fog::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: fogDrift 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 50;
}

@keyframes fogDrift {
    0%, 100% { transform: translateX(-10px); opacity: 0.3; }
    50% { transform: translateX(10px); opacity: 0.1; }
}

/* Settings Menu */
.settings-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #9b59b6;
    text-align: left;
    min-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.settings-section {
    margin: 20px 0;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.settings-section h3 {
    color: #3498db;
    margin: 0 0 15px 0;
}

.setting-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.setting-btn {
    background: linear-gradient(45deg, #3498db, #2980b9);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

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

.setting-btn.danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.setting-btn.danger:hover {
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.setting-item {
    margin: 15px 0;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1.1em;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-item input[type="range"] {
    flex: 1;
    margin-left: 10px;
}

.setting-desc {
    margin: 5px 0 0 28px;
    font-size: 0.9em;
    color: #bdc3c7;
    font-style: italic;
}

/* Help Overlay */
.help-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.95);
    padding: 40px;
    border-radius: 20px;
    border: 3px solid #2ecc71;
    text-align: left;
    min-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 1000;
    backdrop-filter: blur(10px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.help-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.help-section {
    background: rgba(255,255,255,0.05);
    padding: 15px;
    border-radius: 10px;
}

.help-section h3 {
    color: #2ecc71;
    margin: 0 0 10px 0;
    border-bottom: 1px solid rgba(46, 204, 113, 0.3);
    padding-bottom: 5px;
}

.help-section p {
    margin: 8px 0;
    font-size: 0.95em;
    line-height: 1.4;
}

/* Quick Help in Pause Menu */
.quick-help {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.9em;
}

.quick-help p {
    margin: 3px 0;
    color: #bdc3c7;
}

.quick-help strong {
    color: #f39c12;
}

/* Assist Mode Styles */
.assist-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
}

.difficulty-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.difficulty-easy {
    background: rgba(46, 204, 113, 0.9);
    color: white;
}

.difficulty-hard {
    background: rgba(231, 76, 60, 0.9);
    color: white;
}

/* Warning Indicators */
.warning-triangle {
    animation: warningPulse 1s ease-in-out infinite;
}

.warning-diamond {
    animation: warningBlink 0.5s ease-in-out infinite alternate;
}

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

@keyframes warningBlink {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* High Scores Styles */
.high-scores-list {
    margin: 20px 0;
    text-align: left;
}

.high-score-entry {
    display: grid;
    grid-template-columns: 40px 1fr 80px 60px 80px;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9em;
}

.high-score-entry:first-child {
    font-weight: bold;
    color: #f1c40f;
}

.high-score-entry:nth-child(2) {
    color: #ecf0f1;
}

.high-score-entry:nth-child(3) {
    color: #cd7f32;
}

.high-score-entry .rank {
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
}

.high-score-entry .name {
    font-weight: bold;
    color: #3498db;
}

.high-score-entry .score {
    text-align: right;
    font-weight: bold;
}

.high-score-entry .level {
    text-align: center;
    color: #e67e22;
}

.high-score-entry .date {
    text-align: right;
    color: #95a5a6;
    font-size: 0.8em;
}

/* Mobile Touch Controls */
.mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 90%;
    max-width: 600px;
    z-index: 1000;
    pointer-events: none;
}

.dpad {
    position: relative;
    width: 140px;
    height: 140px;
    pointer-events: all;
}

.dpad-btn {
    position: absolute;
    width: 48px;
    height: 48px;
    background: rgba(52, 152, 219, 0.8);
    border: 2px solid #3498db;
    border-radius: 8px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: all 0.2s ease;
    min-width: 48px;
    min-height: 48px;
}

.dpad-btn:active {
    background: rgba(52, 152, 219, 1);
    transform: scale(0.95);
}

.dpad-btn.up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.dpad-btn.down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.dpad-btn.left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.dpad-btn.right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: all;
}

.action-btn {
    width: 64px;
    height: 64px;
    background: rgba(46, 204, 113, 0.8);
    border: 2px solid #2ecc71;
    border-radius: 50%;
    color: white;
    font-size: 26px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    transition: all 0.2s ease;
    min-width: 64px;
    min-height: 64px;
}

.action-btn:active {
    background: rgba(46, 204, 113, 1);
    transform: scale(0.95);
}

.ability-btn {
    background: rgba(241, 196, 15, 0.8);
    border-color: #f1c40f;
}

.pause-btn {
    background: rgba(231, 76, 60, 0.8);
    border-color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .title-content {
        max-width: 95%;
        padding: 15px;
        margin: 10px;
    }
    
    .game-title {
        font-size: 3.5em;
    }
    
    .featured-content {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 30px 0;
    }
    
    .secondary-actions {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .action-group {
        padding: 15px;
    }
    
    .primary-btn {
        min-width: 200px;
        padding: 18px 35px;
        font-size: 1.2em;
    }
    
    .primary-btn-hero {
        min-width: 250px;
        padding: 20px 40px;
        font-size: 1.4em;
        letter-spacing: 2px;
    }
    
    .menu-btn {
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .settings-menu, .help-overlay {
        min-width: 90vw;
        padding: 20px;
    }
    
    .help-content {
        grid-template-columns: 1fr;
    }
    
    .setting-group {
        flex-direction: column;
    }
    
    .high-score-entry {
        grid-template-columns: 30px 1fr 60px 40px;
        gap: 5px;
    }
    
    .high-score-entry .date {
        display: none;
    }
    
    .mobile-controls {
        display: flex !important;
    }
    
    .controls {
        display: none;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
    
    .game-container {
        padding: 10px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }
    
    .left-info, .center-info, .right-info {
        align-items: center;
    }
    
    .grog-bar {
        width: 150px;
    }
    
    .ability-bar {
        padding: 8px;
        margin-bottom: 5px;
    }
    
    .ability-timer {
        width: 80px;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 2.8em;
    }
    
    .secondary-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .action-group {
        padding: 12px;
    }
    
    .primary-btn {
        min-width: 180px;
        padding: 16px 30px;
        font-size: 1.1em;
    }
    
    .primary-btn-hero {
        min-width: 200px;
        padding: 18px 35px;
        font-size: 1.2em;
        letter-spacing: 1.5px;
    }
    
    .menu-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    .btn-icon {
        font-size: 1.1em;
    }
    
    .character-select {
        min-width: 95vw;
        padding: 20px;
    }
    
    .character-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .dpad {
        width: 130px;
        height: 130px;
    }
    
    .dpad-btn {
        width: 50px;
        height: 50px;
        font-size: 18px;
        min-width: 50px;
        min-height: 50px;
    }
    
    .action-btn {
        width: 60px;
        height: 60px;
        font-size: 22px;
        min-width: 60px;
        min-height: 60px;
    }
    
    .footer-info {
        margin-top: 30px;
    }
    
    .version-info,
    .credits {
        font-size: 0.8em;
    }
}