/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(45deg, #1a1a2e, #16213e, #0f3460);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#gameboy-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Enhanced Screen Transitions */
.screen {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transform: translateY(0);
}

.screen.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.fade-in {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading Screen Styles */
#loading-screen {
    background: #000;
    color: #00ff00;
}

#loading-screen .gameboy-screen {
    width: 600px;
    height: 400px;
    background: #000;
    border: 4px solid #00ff00;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#loading-screen .screen-content {
    text-align: center;
    width: 100%;
    padding: 40px;
}

#loading-screen .title {
    font-size: 48px;
    font-weight: bold;
    color: #00ff00;
    margin-bottom: 40px;
    letter-spacing: 4px;
    animation: titleGlow 2s ease-in-out infinite alternate; /* Tambahkan ini */
}

/* Tambahkan keyframe ini */
@keyframes titleGlow {
    from {
        text-shadow: 0 0 10px #00ff00;
    }
    to {
        text-shadow: 0 0 20px #00ff00, 0 0 30px #00ff00;
    }
}

#loading-screen .loading-text {
    font-size: 24px;
    color: #00ff00;
    margin-bottom: 30px;
    text-align: left;
    padding-left: 20px;
    animation: blink 1s infinite;
    transition: opacity 0.3s ease; /* Tambahkan ini */
}

.progress-bar {
    width: 80%;
    height: 30px;
    background: #333;
    border: 2px solid #00ff00;
    margin: 0 auto 30px;
    position: relative;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #00ff00;
    width: 38%;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Tambahkan efek shine */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #000;
    font-weight: bold;
    font-size: 16px;
}

#loading-screen .smile-text {
    font-size: 32px;
    color: #ffff00;
    font-weight: bold;
    margin-top: 20px;
}

/* Main Screen Entry Animation */
#main-screen.screen-entering {
    animation: mainScreenEnter 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes mainScreenEnter {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(30px);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.02) translateY(-5px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Loading completion animation */
.loading-complete {
    animation: loadingSuccess 0.8s ease-in-out forwards;
}

@keyframes loadingSuccess {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        filter: brightness(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Main Gameboy Styles */
.gameboy-body {
    width: 400px;
    height: 600px;
    background: linear-gradient(145deg, #e8e8e8, #d0d0d0);
    border-radius: 20px 20px 40px 40px;
    padding: 20px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.8),
        inset 0 -2px 4px rgba(0,0,0,0.2);
    position: relative;
}

.gameboy-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 12px;
    color: #666;
}

.power-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.power-dot {
    width: 8px;
    height: 8px;
    background: #ff4444;
    border-radius: 50%;
}

.brand-text {
    font-weight: bold;
    font-size: 14px;
}

.gameboy-screen {
    width: 100%;
    height: 200px;
    background: #2d5016;
    border: 8px solid #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Gameboy elements staggered entry */
.gameboy-screen {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.active .gameboy-screen {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.menu-buttons {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.active .menu-buttons {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.4s;
}

.controls {
    opacity: 0;
    transform: translateY(40px);
    transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.active .controls {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

.bottom-controls {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.active .bottom-controls {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.8s;
}

.gameboy-screen .screen-content {
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.birthday-title {
    color: #9bbc0f;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #9bbc0f;
}

.start-text {
    color: #ffff00;
    font-size: 16px;
    margin-bottom: 20px;
}

.screen-info {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #666;
}

.battery {
    display: flex;
    align-items: center;
    gap: 3px;
}

.battery-dot {
    width: 4px;
    height: 4px;
    background: #ff4444;
    border-radius: 50%;
}


/* Menu Buttons - Fixed Tetris Button */
.menu-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 30px;
}

.menu-btn {
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-transform: uppercase; /* Ensure consistent text formatting */
    letter-spacing: 0.5px; /* Better letter spacing */
}

.menu-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.menu-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.message-btn {
    background: linear-gradient(145deg, #4a90e2, #357abd);
    color: white;
}

.message-btn:hover {
    background: linear-gradient(145deg, #357abd, #2968a3);
}

.gallery-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
}

.gallery-btn:hover {
    background: linear-gradient(145deg, #c0392b, #a93226);
}

.music-btn {
    background: linear-gradient(145deg, #9b59b6, #8e44ad);
    color: white;
}

.music-btn:hover {
    background: linear-gradient(145deg, #8e44ad, #7d3c98);
}

.tetris-btn {
    background: linear-gradient(145deg, #27ae60, #229954);
    color: white;
}

.tetris-btn:hover {
    background: linear-gradient(145deg, #229954, #1e8449);
}

/* Ensure all buttons have consistent focus states */
.menu-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}


/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dpad {
    width: 80px;
    height: 80px;
    position: relative;
}

.dpad-center {
    width: 100%;
    height: 100%;
    background: #333;
    position: relative;
    border-radius: 8px;
}

.dpad-center div {
    position: absolute;
    background: #555;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.dpad-center div:hover {
    background: #666;
}

.dpad-up, .dpad-down {
    width: 30px;
    height: 25px;
    left: 50%;
    transform: translateX(-50%);
}

.dpad-up {
    top: 0;
    border-radius: 8px 8px 0 0;
}

.dpad-down {
    bottom: 0;
    border-radius: 0 0 8px 8px;
}

.dpad-left, .dpad-right {
    width: 25px;
    height: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.dpad-left {
    left: 0;
    border-radius: 8px 0 0 8px;
}

.dpad-right {
    right: 0;
    border-radius: 0 8px 8px 0;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.action-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    font-family: inherit;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

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

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

.b-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
}

.a-btn {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
    color: white;
}

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

.control-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background: #666;
    color: white;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: #777;
    transform: translateY(-1px);
}

.speaker-grille {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: 
        radial-gradient(circle at 25% 25%, #333 2px, transparent 2px),
        radial-gradient(circle at 75% 25%, #333 2px, transparent 2px),
        radial-gradient(circle at 25% 75%, #333 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, #333 2px, transparent 2px),
        radial-gradient(circle at 50% 50%, #333 2px, transparent 2px);
    background-size: 8px 8px;
}

/* Page Container Styles */
.page-container {
    width: 400px;
    height: 600px;
    background: linear-gradient(145deg, #7b68ee, #6a5acd);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 4px solid #ffd700;
}

.page-screen {
    width: 100%;
    height: 480px;
    background: #2d5016;
    border: 4px solid #1a1a1a;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.page-header {
    background: #1a1a1a;
    color: #9bbc0f;
    padding: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.page-controls {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

.page-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.continue-btn {
    order: 2; /* Right side */
}

.back-btn {
    order: 1; /* Left side */
}

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

/* Message Page Styles - Fixed Layout */
.message-content {
    height: calc(100% - 80px); /* Adjusted to match other pages */
    overflow-y: auto;
    padding: 15px;
    background: #2d5016;
    color: #9bbc0f;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 4px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.message-content::-webkit-scrollbar {
    width: 4px;
}

.message-content::-webkit-scrollbar-track {
    background: #1a1a2e;
}

.message-content::-webkit-scrollbar-thumb {
    background: #9bbc0f;
    border-radius: 2px;
}

.typing-cursor {
    animation: blink 1s infinite;
}

/* Skip button positioned consistently with other pages */
.skip-btn {
    display: block;
    margin: 0 auto 8px auto;
    padding: 6px 12px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.skip-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.skip-btn:active {
    transform: scale(0.95);
}

/* Remove the problematic overrides */
#message-screen .page-screen {
    height: 480px; /* Same as other pages */
}

/* Ensure consistent structure */
#message-screen .page-container {
    width: 400px;
    height: 600px;
    /* Same as other pages */
}

/* Gallery Page Styles */
.gallery-content {
    padding: 15px;
    height: calc(100% - 60px);
    display: flex;
    flex-direction: column;
}

.photobox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #666;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.photobox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.photobox-dot.red {
    background: #ff4444;
}

.photobox-dot.green {
    background: #44ff44;
}

.photobox-title {
    color: #ffff00;
    font-size: 12px;
    font-weight: bold;
}

.photobox-progress {
    background: #333;
    border-radius: 4px;
    margin-bottom: 15px;
    padding: 8px;
    color: #9bbc0f;
    font-size: 11px;
    text-align: center;
    min-height: 20px;
    flex-shrink: 0;
}

.photo-display {
    background: #1a1a2e;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    max-height: 300px;
}

/* Custom scrollbar for photo display */
.photo-display::-webkit-scrollbar {
    width: 6px;
}

.photo-display::-webkit-scrollbar-track {
    background: #333;
    border-radius: 3px;
}

.photo-display::-webkit-scrollbar-thumb {
    background: #9bbc0f;
    border-radius: 3px;
}

.photo-display::-webkit-scrollbar-thumb:hover {
    background: #a0cc0f;
}

.photo-placeholder {
    text-align: center;
    color: #9bbc0f;
    font-size: 12px;
    margin-top: 50px;
}

/* Photo Strip Styles - Vertical Scrollable */
.photo-strip {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    min-height: 100%;
    position: relative;
    overflow: hidden; /* Prevent content from spilling out */
}

.photo-strip-header {
    text-align: center;
    color: #333;
    font-size: 12px;
    font-weight: bold;
    padding: 15px 10px 10px 10px;
    border-bottom: 2px solid #ccc;
    background: #ffffff;
    flex-shrink: 0; /* Prevent header from shrinking */
    position: relative;
    z-index: 2;
}

.photo-frames-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    padding: 15px;
    overflow-y: auto; /* Make only the frames container scrollable */
    overflow-x: hidden;
    max-height: 220px; /* Limit height to enable scrolling */
}

/* Custom scrollbar for frames container */
.photo-frames-container::-webkit-scrollbar {
    width: 5px;
}

.photo-frames-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.photo-frames-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.photo-frames-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.photo-frame {
    width: 100%;
    height: 150px;
    background: #f0f0f0;
    border: 3px solid #333;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.photo-frame.filled {
    background: none; /* Remove gradient for image display */
    color: white;
    transform: scale(1.02);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.photo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
    transition: opacity 0.3s ease;
}

.photo-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    padding: 10px 6px 6px 6px; /* Increased padding for larger frame */
    border-radius: 0 0 3px 3px;
}

.photo-content {
    color: #333;
    font-size: 11px;
    text-align: center;
    padding: 5px;
    font-weight: bold;
    line-height: 1.2;
}

.photo-frame.filled .photo-overlay .photo-content {
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    font-size: 10px;
    text-align: center;
    font-weight: bold;
    line-height: 1.2;
}

.photo-strip-footer {
    text-align: center;
    color: #666;
    font-size: 10px;
    font-weight: bold;
    background: #ffffff;
    padding: 8px;
    border-top: 2px solid #ccc;
    flex-shrink: 0; /* Prevent footer from shrinking */
    position: relative;
    z-index: 1;
}

.photobox-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: auto;
    padding-top: 10px;
    flex-shrink: 0;
}

.photo-btn {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.photo-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.photo-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* Loading state for images */
.photo-image:not([complete]) {
    opacity: 0.5;
}

.photo-frame .photo-content {
    color: #333;
    font-size: 12px;
    text-align: center;
    padding: 5px;
    font-weight: bold;
    line-height: 1.2;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #9bbc0f;
    font-size: 10px;
    opacity: 0.7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}


/* Music Page Styles - Updated for Spotify */
.music-content {
    padding: 15px;
    height: calc(100% - 60px);
    overflow-y: auto;
}

.spotify-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
}

.spotify-header {
    text-align: center;
    margin-bottom: 10px;
}

.spotify-logo {
    color: #1db954;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.playlist-title {
    color: #9bbc0f;
    font-size: 14px;
    font-weight: bold;
}

.spotify-embed-container {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    border: 2px solid #9bbc0f;
}

.spotify-embed-container iframe {
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.playlist-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.playlist-btn {
    padding: 6px 12px;
    background: #333;
    color: #9bbc0f;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    transition: all 0.2s ease;
    border: 1px solid #9bbc0f;
}

.playlist-btn:hover {
    background: #9bbc0f;
    color: #333;
    transform: translateY(-1px);
}

.playlist-btn.active {
    background: #1db954;
    color: white;
    border-color: #1db954;
}

.music-info {
    text-align: center;
    margin-top: auto;
}

.current-playlist {
    color: #ffff00;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 5px;
}

.playlist-description {
    color: #9bbc0f;
    font-size: 10px;
    line-height: 1.4;
}


/* Tetris Page Styles - Much Larger Display */
#tetris-screen .page-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    padding: 0;
}

.tetris-header {
    background: #1a1a1a;
    color: #9bbc0f;
    padding: 4px 15px; /* Minimal header padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 1px solid #333;
}

.tetris-title {
    font-size: 15px; /* Very small title */
    font-weight: bold;
}

.tetris-stats {
    display: flex;
    gap: 6px;
    font-size: 8px; /* Very small stats */
}

.stat {
    color: #9bbc0f;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.tetris-game {
    background: #2d5016;
    flex: 1; /* Take most available space */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px; /* Minimal padding */
    overflow: hidden;
    min-height: 0;
}

#tetris-canvas {
    border: 2px solid #9bbc0f;
    border-radius: 4px;
    background: #0f0f0f;
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.tetris-controls {
    display: flex;
    justify-content: center;
    gap: 4px; /* Minimal gap */
    padding: 4px 15px; /* Minimal padding */
    background: #1a1a1a;
    flex-shrink: 0;
    border-top: 1px solid #333;
}

.tetris-btn:hover {
    background: #357abd;
    transform: translateY(-1px);
}

.tetris-btn:active {
    transform: translateY(1px);
}

/* Minimize page controls */
#tetris-screen .page-controls {
    margin-top: 0;
    padding: 4px 20px; /* Minimal padding */
}

#tetris-screen .page-btn {
    padding: 4px 10px; /* Very small buttons */
    font-size: 9px; /* Small font */
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #2d5016;
    border: 4px solid #ffff00;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.game-over-text {
    color: #ff4444;
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.final-message-title {
    color: #ffff00;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 20px;
}

.final-message-text {
    color: #9bbc0f;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.final-message-text p {
    margin-bottom: 8px;
}

.love-text {
    color: #ff69b4;
    font-size: 18px;
    font-weight: bold;
    margin-top: 15px !important;
}

.modal-btn {
    padding: 12px 24px;
    background: #4a90e2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 16px;
}

.modal-btn:hover {
    background: #357abd;
}

/* Responsive Design */
@media (max-width: 480px) {
    .gameboy-body,
    .page-container {
        width: 90vw;
        height: 80vh;
        max-width: 400px;
    }
    
    #loading-screen .gameboy-screen {
        width: 90vw;
        height: 60vh;
        max-width: 600px;
    }
    
    #loading-screen .title {
        font-size: 32px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
}

/* Animations */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.loading-text {
    animation: blink 1s infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 10px currentColor; }
    50% { text-shadow: 0 0 20px currentColor, 0 0 30px currentColor; }
}

.birthday-title {
    animation: glow 2s ease-in-out infinite;
}

