/* ============================================
   PENGUIN PARADISE — Full Stylesheet
   ============================================ */

/* ===== Page Loading Transition ===== */
body { opacity: 0; transition: opacity 0.3s ease; }
body.loaded { opacity: 1; }

/* ----- Reset & Base ----- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #e0f4f7 0%, #b2ebf2 50%, #80deea 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #2c3e50;
    overflow-x: hidden;
}

/* ----- HUD / Header ----- */
#hud {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    margin-top: 8px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.game-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a5276;
}

.coin-display {
    font-size: 1.3rem;
    font-weight: 700;
    color: #d4a017;
    background: rgba(255,215,0,0.15);
    padding: 4px 16px;
    border-radius: 20px;
}

.bond-display {
    font-size: 0.95rem;
    color: #e74c8b;
    background: rgba(231,76,139,0.1);
    padding: 4px 12px;
    border-radius: 20px;
}

.reset-btn {
    background: rgba(231,76,60,0.12);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
}

.reset-btn:hover {
    background: rgba(231,76,60,0.3);
    transform: rotate(-30deg);
}

/* Mute Button */
.hud-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
}

.hud-btn:hover {
    background: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

/* ----- Phase Screens ----- */
.phase {
    display: none;
    width: 100%;
    max-width: 900px;
    margin-top: 16px;
    animation: fadeIn 0.5s ease;
}

.phase.active {
    display: block;
}

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

/* ===== PHASE 1: MINIGAME ===== */
.minigame-container {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
    text-align: center;
}

.minigame-header h2 {
    font-size: 1.5rem;
    color: #1a5276;
    margin-bottom: 4px;
}

.minigame-instructions {
    color: #5d6d7e;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.minigame-stats-row {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* ----- Animated Coin Counter ----- */
.coin-pop {
    animation: coinPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes coinPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); color: #f1c40f; }
    100% { transform: scale(1); }
}

/* ----- Screen Shake ----- */
.canvas-wrapper.shake {
    animation: shake 0.35s ease;
}

@keyframes shake {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-5px, 3px); }
    40% { transform: translate(5px, -3px); }
    60% { transform: translate(-3px, 4px); }
    80% { transform: translate(3px, -4px); }
}

/* Power-up indicator in minigame stats */
.powerup-indicator {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    background: transparent;
    transition: all 0.3s ease;
    min-width: 60px;
    text-align: center;
}

.powerup-indicator.active {
    background: rgba(155, 89, 182, 0.2);
    animation: pulsePowerup 1s ease-in-out infinite;
}

.powerup-indicator.powerup-slow-motion { background: rgba(155, 89, 182, 0.25); color: #9b59b6; }
.powerup-indicator.powerup-magnet { background: rgba(46, 204, 113, 0.25); color: #2ecc71; }
.powerup-indicator.powerup-shield { background: rgba(52, 152, 219, 0.25); color: #3498db; }
.powerup-indicator.powerup-double-coins { background: rgba(255, 215, 0, 0.25); color: #d4a017; }

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

.canvas-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

#gameCanvas {
    display: block;
    background: linear-gradient(180deg, #1a3a5c 0%, #2980b9 40%, #5dade2 70%, #aed6f1 100%);
    cursor: pointer;
}

/* Play button overlay */
.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.play-overlay-content {
    text-align: center;
    animation: float 2s ease-in-out infinite;
}

.play-overlay-icon {
    font-size: 4rem;
    margin-bottom: 8px;
}

.play-overlay-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.play-overlay-sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 8px rgba(0,0,0,0.4);
    margin-top: 4px;
}

.minigame-footer {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.progress-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
}

.progress-track {
    width: 200px;
    height: 10px;
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f1c40f, #e67e22);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
    min-width: 80px;
}

/* ===== PHASE 2: SANCTUARY ===== */
.sanctuary-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 4px;
    max-width: 900px;
    width: 100%;
}

/* --- Left Column --- */
.sanctuary-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Avatar Panel */
.avatar-panel {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 28px 24px 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    position: relative;
}

/* ----- CSS Penguin Art ----- */
.penguin-container {
    position: relative;
    width: 200px;
    height: 240px;
    margin: 0 auto 12px;
    transition: transform 0.3s ease;
}

/* Idle animation: gentle waddle */
.penguin-container.idle-waddle {
    animation: waddle 1.5s ease-in-out infinite;
}

.penguin-container.idle-sit {
    animation: sitBounce 2s ease-in-out infinite;
}

@keyframes waddle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-3deg); }
    75% { transform: rotate(3deg); }
}

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

/* Body */
.penguin-body {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 170px;
    background: linear-gradient(180deg, #2c3e50 0%, #1a252f 100%);
    border-radius: 50% 50% 45% 45%;
    z-index: 1;
    overflow: visible;
}

/* Belly */
.penguin-belly {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 110px;
    background: linear-gradient(180deg, #ffffff, #f0f0f0);
    border-radius: 50% 50% 45% 45%;
}

/* Eyes */
.penguin-eye {
    position: absolute;
    top: 45px;
    width: 14px;
    height: 16px;
    background: #1a1a2e;
    border-radius: 50%;
    z-index: 2;
    transition: all 0.3s ease;
}

.penguin-eye::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    width: 5px;
    height: 5px;
    background: white;
    border-radius: 50%;
}

.left-eye  { left: 42px; }
.right-eye { right: 42px; }

/* Mood: Sad eyes (half-closed) */
.penguin-container.mood-sad .penguin-eye {
    height: 6px;
    top: 50px;
    border-radius: 0 0 8px 8px;
}
.penguin-container.mood-sad .penguin-eye::after { display: none; }

/* Mood: Hungry eyes (crossed/squint) */
.penguin-container.mood-hungry .penguin-eye {
    width: 10px;
    height: 10px;
    top: 48px;
}

/* Mood: Starving (eyes closed, X_X) */
.penguin-container.mood-starving .penguin-eye {
    width: 14px;
    height: 3px;
    top: 50px;
    border-radius: 2px;
    background: #555;
}
.penguin-container.mood-starving .penguin-eye::after { display: none; }

/* Beak */
.penguin-beak {
    position: absolute;
    top: 62px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 14px solid #f39c12;
    z-index: 2;
}

/* Cheeks (rosy when happy) */
.penguin-cheek {
    position: absolute;
    top: 58px;
    width: 16px;
    height: 10px;
    background: rgba(255,150,150,0);
    border-radius: 50%;
    z-index: 2;
    transition: background 0.3s ease;
}

.penguin-container.mood-happy .left-cheek,
.penguin-container.mood-happy .right-cheek {
    background: rgba(255,150,150,0.5);
}

.left-cheek  { left: 28px; }
.right-cheek { right: 28px; }

/* Flippers */
.penguin-flipper {
    position: absolute;
    bottom: 30px;
    width: 30px;
    height: 60px;
    background: #1a252f;
    border-radius: 40%;
    z-index: 0;
    transition: transform 0.3s ease;
}

.penguin-container.mood-happy .left-flipper {
    transform: rotate(-15deg);
}
.penguin-container.mood-happy .right-flipper {
    transform: rotate(15deg);
}

.left-flipper  { left: -18px; transform: rotate(10deg); }
.right-flipper { right: -18px; transform: rotate(-10deg); }

/* Feet */
.penguin-foot {
    position: absolute;
    bottom: 10px;
    width: 24px;
    height: 16px;
    background: #f39c12;
    border-radius: 50% 50% 30% 30%;
    z-index: 0;
}

.left-foot  { left: 42px; }
.right-foot { right: 42px; }

/* Mood Emoji */
.penguin-mood {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 1.8rem;
    z-index: 5;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    animation: float 2s ease-in-out infinite;
}

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

/* Accessory Layer */
.accessory-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

/* Individual accessory styles */
.accessory-bowtie {
    position: absolute;
    top: 28px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid #e74c3c;
    border-right: 16px solid #e74c3c;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-radius: 4px;
}
.accessory-bowtie::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    background: #c0392b;
    border-radius: 50%;
}

.accessory-tophat {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 40px;
    background: #1a1a2e;
    border-radius: 4px 4px 0 0;
}
.accessory-tophat::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: -8px;
    width: 66px;
    height: 8px;
    background: #1a1a2e;
    border-radius: 2px;
}
.accessory-tophat::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 6px;
    background: #e74c3c;
    border-radius: 2px;
}

.accessory-santahat {
    position: absolute;
    top: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 45px solid #e74c3c;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.accessory-santahat::after {
    content: '';
    position: absolute;
    top: 36px;
    left: -16px;
    width: 32px;
    height: 12px;
    background: white;
    border-radius: 50%;
}
.accessory-santahat::before {
    content: '⭐';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
}

.accessory-icecrown {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 35px;
    background: linear-gradient(180deg, #a8e6ff, #7ec8e3);
    clip-path: polygon(0% 100%, 15% 40%, 25% 60%, 35% 20%, 50% 50%, 65% 20%, 75% 60%, 85% 40%, 100% 100%);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(168,230,255,0.6);
}

.accessory-scarf {
    position: absolute;
    top: 48px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 18px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #2ecc71);
    border-radius: 4px;
    z-index: 4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.accessory-scarf::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 10px;
    width: 8px;
    height: 18px;
    background: #e74c3c;
    border-radius: 0 0 4px 4px;
    transform: rotate(5deg);
}
.accessory-scarf::before {
    content: '';
    position: absolute;
    bottom: -14px;
    right: 10px;
    width: 8px;
    height: 18px;
    background: #2ecc71;
    border-radius: 0 0 4px 4px;
    transform: rotate(-5deg);
}

.accessory-partyhat {
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 28px solid transparent;
    border-right: 28px solid transparent;
    border-bottom: 40px solid #9b59b6;
    filter: drop-shadow(0 2px 6px rgba(155,89,182,0.4));
    z-index: 4;
}
.accessory-partyhat::after {
    content: '⭐';
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
}
.accessory-partyhat::before {
    content: '';
    position: absolute;
    top: 30px;
    left: -16px;
    width: 32px;
    height: 10px;
    background: linear-gradient(90deg, #e74c3c, #f1c40f, #3498db, #2ecc71);
    border-radius: 4px;
}

/* Name Tag */
.penguin-name-tag {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a5276;
    margin-top: 4px;
}

.editable-name {
    cursor: pointer;
    transition: color 0.2s ease;
    border-bottom: 2px dashed transparent;
}

.editable-name:hover {
    color: #2980b9;
    border-bottom-color: #3498db;
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: white;
    color: #2c3e50;
    padding: 6px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    z-index: 20;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

.speech-bubble.show {
    transform: translateX(-50%) scale(1);
}

/* Avatar panel needs relative positioning for absolute children */
.avatar-panel {
    position: relative;
}

/* Sleep overlay */
.penguin-container.sleeping .penguin-eye {
    height: 2px;
    top: 52px;
    border-radius: 2px;
    background: #555;
}
.penguin-container.sleeping .penguin-eye::after { display: none; }
.penguin-container.sleeping .penguin-body {
    animation: sleepBreathe 3s ease-in-out infinite;
}

@keyframes sleepBreathe {
    0%, 100% { transform: translateX(-50%) scaleY(1); }
    50% { transform: translateX(-50%) scaleY(1.03); }
}

/* Feeding bounce animation */
.penguin-container.feeding {
    animation: feedBounce 0.4s ease 2;
}

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

/* Stats Bars */
.stats-panel {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.stat-row:last-child { margin-bottom: 0; }

.stat-icon { font-size: 1.1rem; }
.stat-label {
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 70px;
    color: #2c3e50;
}

.stat-bar-bg {
    flex: 1;
    height: 14px;
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.4s ease, background 0.5s ease;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

/* Bar colors by level */
.stat-bar-fill.level-warning {
    background: linear-gradient(90deg, #f1c40f, #f39c12);
}
.stat-bar-fill.level-danger {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
    animation: pulseBar 0.8s ease-in-out infinite;
}

@keyframes pulseBar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.stat-value {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 28px;
    text-align: right;
    color: #2c3e50;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.feed-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.play-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* --- Right Column --- */
.sanctuary-right {
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    min-height: 400px;
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(0,0,0,0.06);
    padding-bottom: 8px;
}

.tab-btn {
    padding: 8px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: #5d6d7e;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(0,0,0,0.04);
}

.tab-btn.active {
    background: rgba(52,152,219,0.15);
    color: #2980b9;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Shop Grid */
.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.shop-item {
    background: white;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    border-color: rgba(52,152,219,0.3);
}

.shop-item-icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.shop-item-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: #2c3e50;
    margin-bottom: 2px;
}

.shop-item-desc {
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.shop-item-cost {
    font-size: 0.85rem;
    font-weight: 700;
    color: #d4a017;
    margin-bottom: 8px;
}

.shop-buy-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-buy-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(46,204,113,0.4);
}

.shop-buy-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.shop-buy-btn.owned {
    background: #95a5a6;
    cursor: default;
}

/* Closet Grid */
.closet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.closet-item {
    background: white;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.closet-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.closet-item.equipped {
    border-color: #2ecc71;
    background: rgba(46,204,113,0.08);
}

.closet-item-icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
}

.closet-item-name {
    font-weight: 600;
    font-size: 0.8rem;
    color: #2c3e50;
}

.closet-equip-label {
    font-size: 0.7rem;
    color: #2ecc71;
    font-weight: 600;
    margin-top: 2px;
}

.closet-empty {
    text-align: center;
    color: #95a5a6;
    font-size: 0.9rem;
    padding: 40px 0;
}

/* ===== CELEBRATION MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalPop 0.4s ease;
}

@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    animation: float 2s ease-in-out infinite;
}

.modal-content h2 {
    font-size: 1.6rem;
    color: #1a5276;
    margin-bottom: 8px;
}

.modal-content p {
    color: #5d6d7e;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.modal-sub {
    font-size: 1rem !important;
    color: #2c3e50 !important;
    margin-bottom: 20px !important;
}

.modal-btn {
    padding: 12px 32px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46,204,113,0.4);
}

/* ----- Particle Effects ----- */
.particle-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFly 0.8s ease-out forwards;
}

@keyframes particleFly {
    0% { opacity: 1; transform: translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0); }
}

/* ----- Toast Notification ----- */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44,62,80,0.95);
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2000;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 1.7s forwards;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

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

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

/* ===== Back Button (game pages) ===== */
.back-btn {
    font-size: 1.2rem !important;
    text-decoration: none;
    margin-right: 8px;
    flex-shrink: 0;
}

.back-btn:hover {
    transform: scale(1.15) !important;
}

/* ===== LANDING PAGE ===== */
body.landing-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px;
}

.landing-header {
    text-align: center;
    padding: 28px 20px 12px;
    width: 100%;
    max-width: 900px;
}

.landing-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 3px 20px rgba(0,0,0,0.2);
    margin-bottom: 4px;
    animation: titleFloat 3s ease-in-out infinite;
}

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

.landing-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: 1fr 1fr;
    gap: 12px 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0 8px;
    flex: 1;
}

.game-grid::-webkit-scrollbar {
    display: none;
}

/* Game Card */
.game-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(12px);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    padding: 12px 14px 10px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 210px;
    scroll-snap-align: start;
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.18);
}

.game-card.featured {
    border-color: rgba(255,215,0,0.4);
    background: rgba(255,255,255,0.15);
}

.game-card.featured:hover {
    border-color: rgba(255,215,0,0.7);
    box-shadow: 0 20px 60px rgba(255,215,0,0.1);
}

.game-card.disabled {
    cursor: default;
    opacity: 0.7;
}

.game-card.disabled:hover {
    transform: none;
    border-color: rgba(255,255,255,0.15);
    box-shadow: none;
}

.game-card-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(46,204,113,0.25);
    color: #2ecc71;
}

.game-card-badge.coming-soon {
    background: rgba(241,196,15,0.2);
    color: #f1c40f;
}

.game-card-icon {
    font-size: 2.2rem;
    line-height: 1;
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.15));
}

.game-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

.game-card-desc {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.75);
    line-height: 1.2;
    margin: 1px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.game-card-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin: 2px 0;
}

.tag {
    font-size: 0.55rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.85);
}

.game-card-stats {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.6);
    margin: 0 0 2px;
}

.play-btn {
    display: inline-block;
    margin-top: 2px;
    padding: 5px 18px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(46,204,113,0.4);
}

.play-btn.disabled {
    background: rgba(255,255,255,0.12);
    cursor: not-allowed;
    box-shadow: none;
    padding: 5px 14px;
    font-size: 0.65rem;
}

.play-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ===== Scroll to Top Button ===== */
.scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    z-index: 100;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scroll-top-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    transform: translateY(-3px);
}

body.night-mode .scroll-top-btn {
    background: rgba(15, 30, 50, 0.6);
    border-color: rgba(100, 150, 200, 0.3);
}

/* Landing Footer */
.landing-footer {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.4);
    font-size: 0.85rem;
    width: 100%;
    max-width: 900px;
}

/* ===== BUBBLE POP ===== */
body.bubble-pop-page {
    background: linear-gradient(135deg, #0c3b5c 0%, #1a6b9a 50%, #2980b9 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#bp-hud {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    margin-top: 8px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.12);
}

.bp-hud-left { display: flex; align-items: center; gap: 8px; }
.bp-hud-center { text-align: center; }
.bp-hud-right { text-align: right; }

.bp-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #a8e6ff;
}

.bp-level-display {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    background: rgba(255,255,255,0.12);
    padding: 4px 16px;
    border-radius: 20px;
}

.bp-score-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
    background: rgba(255,215,0,0.12);
    padding: 4px 16px;
    border-radius: 20px;
}

.bp-reset-btn {
    margin-left: 8px !important;
}

.bp-reset-btn:hover {
    transform: rotate(-30deg) !important;
}

#bp-game-area {
    width: 100%;
    max-width: 900px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.bp-canvas-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 30px rgba(0,0,0,0.25);
}

.bp-canvas-wrapper.shake {
    animation: bpShake 0.3s ease;
}

@keyframes bpShake {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-5px, 3px); }
    40% { transform: translate(5px, -3px); }
    60% { transform: translate(-3px, 4px); }
    80% { transform: translate(3px, -4px); }
}

#bp-canvas {
    display: block;
    cursor: pointer;
    width: 500px;
    height: 550px;
}

/* Overlays — unified frosted glass style */
.bp-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}

.bp-overlay.hidden {
    display: none;
}

.bp-overlay-content {
    text-align: center;
    background: rgba(255,255,255,0.08);
    padding: 36px 48px;
    border-radius: 24px;
    backdrop-filter: blur(4px);
    animation: modalPop 0.4s ease;
}

.bp-overlay-icon {
    font-size: 4rem;
    margin-bottom: 8px;
    animation: float 2s ease-in-out infinite;
}

.bp-overlay-title {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
    margin-bottom: 6px;
}

.bp-overlay-sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 20px;
}

.bp-btn {
    padding: 12px 36px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(46,204,113,0.3);
}

.bp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(46,204,113,0.5);
}

/* Bottom HUD — unified frosted glass */
#bp-bottom-hud {
    width: 100%;
    max-width: 900px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    margin-top: 10px;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.bp-lives {
    font-size: 1.1rem;
    min-width: 80px;
    text-align: center;
}

.bp-progress-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bp-progress-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
    font-weight: 600;
    white-space: nowrap;
}

.bp-progress-track {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    overflow: hidden;
}

.bp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    border-radius: 8px;
    transition: width 0.3s ease;
}

.bp-progress-text {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    min-width: 45px;
    text-align: right;
}

.bp-combo {
    font-size: 0.9rem;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.bp-combo.active {
    color: #ffd700;
    animation: pulsePowerup 0.5s ease-in-out infinite;
}

/* ===== MEMORY MATCH ===== */
body.memory-match-page {
    background: linear-gradient(135deg, #2d1b4e 0%, #4a2c6e 50%, #6c3483 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    user-select: none;
}

#mm-hud {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    margin-top: 8px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.12);
}

.mm-hud-left { display: flex; align-items: center; gap: 8px; }
.mm-hud-center { text-align: center; }
.mm-hud-right { display: flex; align-items: center; gap: 6px; }

.mm-title { font-size: 1.2rem; font-weight: 700; color: #bb8fce; }

.mm-level-display {
    font-size: 0.95rem; font-weight: 700; color: white;
    background: rgba(255,255,255,0.12); padding: 4px 16px; border-radius: 20px;
}

.mm-score-display {
    font-size: 1.1rem; font-weight: 700; color: #ffd700;
    background: rgba(255,215,0,0.12); padding: 4px 16px; border-radius: 20px;
}

.mm-reset-btn { margin-left: 8px !important; }
.mm-reset-btn:hover { transform: rotate(-30deg) !important; }

#mm-game-area {
    width: 100%; max-width: 900px; margin-top: 16px;
    display: flex; flex-direction: column; align-items: center;
}

.mm-board-wrapper {
    position: relative;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 540px;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mm-board {
    display: grid;
    gap: 8px;
    width: 100%;
    justify-items: center;
    align-items: center;
}

/* Card Styles */
.mm-card {
    width: var(--card-size, 72px);
    height: var(--card-size, 72px);
    perspective: 600px;
    cursor: pointer;
    transition: transform 0.15s ease;
}

.mm-card:hover { transform: scale(1.05); }
.mm-card.matched { cursor: default; transform: scale(0.95); opacity: 0.7; pointer-events: none; }

.mm-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.mm-card.flipped .mm-card-inner {
    transform: rotateY(180deg);
}

.mm-card-front, .mm-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--card-size, 72px) * 0.45);
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.mm-card-front {
    background: linear-gradient(135deg, #6c3483, #9b59b6);
    color: rgba(255,255,255,0.4);
    border: 2px solid rgba(255,255,255,0.1);
}

.mm-card-back {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #2c3e50;
    transform: rotateY(180deg);
    border: 2px solid rgba(0,0,0,0.06);
}

.mm-card.matched .mm-card-back {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: rgba(46,204,113,0.3);
}

/* Toast floating score */
.mm-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: #ffd700;
    padding: 8px 20px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    z-index: 20;
    animation: mmToastAnim 1.2s ease-out forwards;
    pointer-events: none;
}

@keyframes mmToastAnim {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    30% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0; transform: translate(-50%, -100%) scale(1); }
}

/* Overlays */
.mm-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10; animation: fadeIn 0.3s ease;
    border-radius: 20px;
}

.mm-overlay.hidden { display: none; }

.mm-overlay-content {
    text-align: center;
    background: rgba(255,255,255,0.08);
    padding: 36px 48px;
    border-radius: 24px;
    backdrop-filter: blur(4px);
    animation: modalPop 0.4s ease;
}

.mm-overlay-icon { font-size: 4rem; margin-bottom: 8px; animation: float 2s ease-in-out infinite; }
.mm-overlay-title { font-size: 1.8rem; font-weight: 800; color: white; text-shadow: 0 2px 20px rgba(0,0,0,0.4); margin-bottom: 6px; }
.mm-overlay-sub { font-size: 0.95rem; color: rgba(255,255,255,0.8); margin-bottom: 20px; }

.mm-btn {
    padding: 12px 36px; border: none; border-radius: 14px;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease; font-family: inherit;
    box-shadow: 0 4px 16px rgba(155,89,182,0.3);
}

.mm-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(155,89,182,0.5); }

/* Bottom HUD */
#mm-bottom-hud {
    width: 100%; max-width: 540px;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px; margin-top: 10px;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.mm-lives { font-size: 1rem; min-width: 72px; text-align: center; }

.mm-stat {
    font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.8);
    text-align: center;
}

.mm-stat-label {
    font-size: 0.65rem; color: rgba(255,255,255,0.4); display: block;
    font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px;
}

.mm-combo { font-size: 0.9rem; font-weight: 700; min-width: 50px; text-align: center; }
.mm-combo.active { color: #ffd700; animation: pulsePowerup 0.5s ease-in-out infinite; }

/* ===== DART DASH ===== */
body.dart-dash-page {
    background: linear-gradient(135deg, #2c1810 0%, #4a2c1e 50%, #5d4037 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    user-select: none;
}

#dd-hud {
    width: 100%; max-width: 900px;
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px; margin-top: 8px;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.dd-hud-left { display: flex; align-items: center; gap: 8px; }
.dd-hud-center { text-align: center; }
.dd-hud-right { display: flex; align-items: center; gap: 6px; }

.dd-title { font-size: 1.2rem; font-weight: 700; color: #e8a87c; }

.dd-level-display {
    font-size: 0.95rem; font-weight: 700; color: white;
    background: rgba(255,255,255,0.12); padding: 4px 16px; border-radius: 20px;
}

.dd-score-display {
    font-size: 1.1rem; font-weight: 700; color: #ffd700;
    background: rgba(255,215,0,0.12); padding: 4px 16px; border-radius: 20px;
}

.dd-reset-btn { margin-left: 8px !important; }
.dd-reset-btn:hover { transform: rotate(-30deg) !important; }

#dd-game-area {
    width: 100%; max-width: 900px; margin-top: 16px;
    display: flex; flex-direction: column; align-items: center;
}

.dd-canvas-wrapper {
    position: relative;
    border-radius: 16px; overflow: hidden;
    box-shadow: 0 4px 30px rgba(0,0,0,0.35);
}

.dd-canvas-wrapper.shake {
    animation: bpShake 0.3s ease;
}

#dd-canvas {
    display: block; cursor: crosshair;
    width: 500px; height: 550px;
}

/* Overlays */
.dd-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    z-index: 10; animation: fadeIn 0.3s ease;
    border-radius: 16px;
}
.dd-overlay.hidden { display: none; }
.dd-overlay-content {
    text-align: center;
    background: rgba(255,255,255,0.08);
    padding: 36px 48px; border-radius: 24px;
    backdrop-filter: blur(4px); animation: modalPop 0.4s ease;
}
.dd-overlay-icon { font-size: 4rem; margin-bottom: 8px; animation: float 2s ease-in-out infinite; }
.dd-overlay-title { font-size: 1.8rem; font-weight: 800; color: white; text-shadow: 0 2px 20px rgba(0,0,0,0.4); margin-bottom: 6px; }
.dd-overlay-sub { font-size: 0.95rem; color: rgba(255,255,255,0.8); margin-bottom: 20px; }

.dd-btn {
    padding: 12px 36px; border: none; border-radius: 14px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: white; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s ease; font-family: inherit;
    box-shadow: 0 4px 16px rgba(230,126,34,0.3);
}
.dd-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(230,126,34,0.5); }

/* Bottom HUD */
#dd-bottom-hud {
    width: 100%; max-width: 540px;
    display: flex; align-items: center; gap: 16px;
    padding: 12px 20px; margin-top: 10px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.12);
}
.dd-lives { font-size: 1rem; min-width: 72px; text-align: center; }
.dd-stat { font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.8); text-align: center; }
.dd-stat-label { font-size: 0.65rem; color: rgba(255,255,255,0.4); display: block; font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.dd-combo { font-size: 0.9rem; font-weight: 700; min-width: 50px; text-align: center; }
.dd-combo.active { color: #ffd700; animation: pulsePowerup 0.5s ease-in-out infinite; }
/* ===== AdSense Placeholders (hidden, ready for activation) ===== */
.hidden-ad {
    display: none;
}

/* When ready to activate, uncomment below and add your AdSense code */
/*
.ad-banner {
    display: block;
    width: 100%;
    max-width: 728px;
    min-height: 90px;
    margin: 12px auto;
    text-align: center;
    overflow: hidden;
}

.ad-banner-top {
    margin-top: 8px;
}

.ad-banner-bottom {
    margin-bottom: 8px;
}
*/

/* ===== Confetti Effect ===== */
.confetti-particle {
    position: absolute;
    pointer-events: none;
    animation: confettiFall 1.5s ease-out forwards;
}

@keyframes confettiFall {
    0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3) rotate(720deg); }
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.75rem;
    color: #7f8c8d;
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}

.stat-card-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
}

/* ===== Achievements Section ===== */
.achievements-section {
    border-top: 2px solid rgba(0,0,0,0.06);
    padding-top: 16px;
}

.achievements-title {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 12px;
    text-align: center;
}

.achievements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.achievement-card.unlocked {
    border-left: 4px solid #2ecc71;
}

.achievement-card.locked {
    border-left: 4px solid #bdc3c7;
    opacity: 0.6;
}

.achievement-icon {
    font-size: 1.5rem;
    min-width: 32px;
    text-align: center;
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #2c3e50;
}

.achievement-desc {
    font-size: 0.75rem;
    color: #7f8c8d;
}

.achievement-check {
    font-size: 1rem;
}

/* ===== Night Mode ===== */
body.night-mode .sanctuary-selector {
    background: rgba(15, 30, 50, 0.5);
}

body.night-mode {
    background: linear-gradient(135deg, #0c1a2b 0%, #1a2a4a 50%, #2a3a5a 100%);
}

body.night-mode #hud {
    background: rgba(15, 30, 50, 0.8);
}

body.night-mode .game-title {
    color: #7ec8e3;
}

body.night-mode .minigame-container,
body.night-mode .avatar-panel,
body.night-mode .stats-panel,
body.night-mode .sanctuary-right {
    background: rgba(15, 30, 50, 0.6);
}

body.night-mode .shop-item,
body.night-mode .closet-item,
body.night-mode .stat-card,
body.night-mode .achievement-card {
    background: rgba(30, 50, 70, 0.8);
}

body.night-mode .shop-item-name,
body.night-mode .closet-item-name,
body.night-mode .stat-card-value,
body.night-mode .achievement-name,
body.night-mode .stat-label,
body.night-mode .progress-label,
body.night-mode .progress-text,
body.night-mode .minigame-stats-row {
    color: #e0e0e0;
}

body.night-mode .shop-item-desc,
body.night-mode .achievement-desc,
body.night-mode .stat-card-label {
    color: #a0a0a0;
}

body.night-mode .minigame-instructions {
    color: #b0b0b0;
}

body.night-mode .tab-btn {
    color: #a0b0c0;
}

body.night-mode .tab-btn.active {
    background: rgba(52, 152, 219, 0.25);
    color: #7ec8e3;
}

body.night-mode .penguin-name-tag {
    color: #7ec8e3;
}

body.night-mode .modal-content {
    background: #1a2a3a;
}

body.night-mode .modal-content h2 {
    color: #7ec8e3;
}

body.night-mode .speech-bubble {
    background: #1a2a3a;
    color: #e0e0e0;
}

body.night-mode .speech-bubble::after {
    border-top-color: #1a2a3a;
}

body.night-mode .hud-btn {
    background: rgba(255,255,255,0.08);
}

body.night-mode .hud-btn:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== Game Carousel ===== */
.carousel-container {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 960px;
    width: 100%;
    padding: 0 4px 8px;
}

.carousel-arrow {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 1.6rem;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
    z-index: 2;
}

.carousel-arrow:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.4);
    transform: scale(1.1);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

body.night-mode .carousel-arrow {
    background: rgba(15, 30, 50, 0.5);
    border-color: rgba(100, 150, 200, 0.2);
}

body.night-mode .carousel-arrow:hover {
    background: rgba(15, 30, 50, 0.8);
    border-color: rgba(100, 150, 200, 0.4);
}

/* ===== Search Bar ===== */
.search-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 14px;
    padding: 0 20px;
}

.search-input {
    width: 100%;
    padding: 10px 18px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.18);
    box-shadow: 0 0 20px rgba(255,255,255,0.06);
}

.search-input::placeholder {
    color: rgba(255,255,255,0.5);
    font-weight: 400;
}

body.night-mode .search-input {
    background: rgba(15, 30, 50, 0.5);
    border-color: rgba(100, 150, 200, 0.2);
}

body.night-mode .search-input:focus {
    border-color: rgba(100, 150, 200, 0.5);
    background: rgba(15, 30, 50, 0.7);
}

/* ===== Sanctuary Selector ===== */
.sanctuary-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 8px auto 16px;
    flex-wrap: wrap;
    max-width: 900px;
    width: 100%;
    padding: 10px 16px;
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(6px);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.sanctuary-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    background: rgba(255,255,255,0.5);
    color: #5d6d7e;
}

.sanctuary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sanctuary-btn.active {
    background: rgba(255,255,255,0.9);
    border-color: #3498db;
    color: #2c3e50;
    box-shadow: 0 2px 8px rgba(52,152,219,0.2);
}

.sanctuary-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.sanctuary-btn.locked:hover {
    transform: none;
    box-shadow: none;
}

.sanctuary-btn .s-btn-name {
    font-size: 0.8rem;
}

body.night-mode .sanctuary-btn {
    background: rgba(30, 50, 70, 0.6);
    color: #a0b0c0;
}

body.night-mode .sanctuary-btn.active {
    background: rgba(30, 50, 70, 0.9);
    border-color: #7ec8e3;
    color: #e0e0e0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    #hud { padding: 10px 16px; flex-wrap: wrap; gap: 8px; justify-content: center; }
    .game-title { font-size: 1rem; }

    .sanctuary-layout {
        grid-template-columns: 1fr;
    }
    
    .sanctuary-selector {
        padding: 8px 12px;
    }
    
    .sanctuary-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .sanctuary-layout {
        grid-template-columns: 1fr;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
        aspect-ratio: 500 / 400;
    }

    .shop-grid, .closet-grid {
        grid-template-columns: 1fr 1fr;
    }

    .minigame-stats-row {
        gap: 12px;
        font-size: 0.85rem;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .shop-grid, .closet-grid {
        grid-template-columns: 1fr;
    }
    .action-buttons {
        flex-direction: column;
    }
}
