:root {
    --gameboy-color: #00a2ff;
    --gameboy-shadow: rgba(0, 162, 255, 0.5);
    --screen-color: #9bbc0f;
    --text-color: #0f380f;
    --button-color: #c82424;
    --mercari-red: #ff0033;
    
    /* Dark mode colors */
    --dark-screen-color: #0f380f;
    --dark-text-color: #9bbc0f;
}

body {
    background-color: #121212;
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    position: relative;
    flex-direction: column;
    padding: 20px 0;
    overflow-x: hidden;
    color: white;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

.site-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    animation: floatEffect 6s ease-in-out infinite;
}

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

.site-title {
    font-size: 3.5rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: var(--gameboy-color);
    text-shadow: 0 0 10px var(--gameboy-shadow);
    letter-spacing: 2px;
}

.site-subtitle {
    font-size: 1.2rem;
    color: #ccc;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.gameboy {
    width: 320px;
    height: 520px;
    background-color: var(--gameboy-color);
    border-radius: 12px 12px 70px 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3), 0 0 15px var(--gameboy-shadow);
    padding: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    margin-bottom: 35px; /* Added space below the GameBoy */
}

/* Banner style */
.corner-banner {
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    overflow: hidden;
    z-index: 20;
}

.corner-banner-content {
    position: absolute;
    top: 20px;
    right: -35px;
    transform: rotate(45deg);
    background-color: #1a344a;
    color: white;
    text-align: center;
    padding: 8px 0;
    width: 170px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    font-weight: bold;
    font-size: 12px;
}

.heart {
    color: #ff4d4d;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

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

.gameboy-logo {
    position: absolute;
    top: 220px;
    width: 80%;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    display: flex;
    justify-content: center;
}

.gameboy-logo span {
    margin: 0 1px;
    line-height: 1;
}

.g-letter { color: #5768D5; }
.a-letter { color: #5768D5; }
.m-letter { color: #5768D5; }
.e-letter { color: #5768D5; }

.b-letter { color: #5768D5; }
.o-letter { color: #5768D5; }
.y-letter { color: #5768D5; }

.c-letter { color: #D82800; }
.o2-letter { color: #FF8E00; }
.l-letter { color: #00C832; }
.o3-letter { color: #0050C8; }
.r-letter { color: #C800C8; }

.screen-area {
    background-color: #444;
    width: 280px;
    height: 220px;
    border-radius: 10px 10px 40px 10px;
    padding: 10px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.power-indicator {
    width: 8px;
    height: 8px;
    background-color: #f00;
    border-radius: 50%;
    position: absolute;
    top: 35px;
    left: 60px;
    box-shadow: 0 0 5px 2px rgba(255,0,0,0.5);
    animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
    0% { box-shadow: 0 0 5px 2px rgba(255,0,0,0.5); opacity: 0.8; }
    100% { box-shadow: 0 0 10px 3px rgba(255,0,0,0.8); opacity: 1; }
}

.screen {
    width: 240px;
    height: 160px;
    border: 4px solid #333;
    position: relative;
    overflow: hidden;
    background-color: var(--screen-color);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

.screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 50%);
    pointer-events: none;
    z-index: 2;
}

.screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.05),
        rgba(0,0,0,0.05) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 3;
    opacity: 0.3;
}

.shop-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    z-index: 1;
}

/* Featured Games Display */
.featured-games-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    z-index: 1;
    padding-top: 10px;
}

/* Pong Game Display Styles */
.pong-game-display {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-weight: bold;
    z-index: 1;
    padding-top: 5px;
}

.pong-title {
    font-size: 16px;
    margin-bottom: 5px;
    text-shadow: 1px 1px 0 #79a024;
    letter-spacing: 1px;
}

.game-controls {
    font-size: 8px;
    margin-top: 5px;
    background-color: rgba(15, 56, 15, 0.15);
    padding: 3px 6px;
    border-radius: 3px;
    text-align: center;
}

.keyboard-controls {
    font-size: 7px;
    margin-top: 2px;
    background-color: rgba(15, 56, 15, 0.15);
    padding: 3px 6px;
    border-radius: 3px;
    text-align: center;
    line-height: 1.3;
}

/* Dark mode support for pong */
.screen.dark-mode .pong-game-display {
    color: var(--dark-text-color);
}

.screen.dark-mode .pong-title {
    text-shadow: 1px 1px 0 #0a1f0a;
}

.screen.dark-mode .game-controls {
    background-color: rgba(155, 188, 15, 0.15);
}

#pongCanvas {
    background-color: transparent;
}

.featured-title {
    font-size: 16px;
    margin-bottom: 8px;
    text-shadow: 1px 1px 0 #79a024;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(15, 56, 15, 0.4);
    padding-bottom: 3px;
    width: 90%;
    text-align: center;
}

.game-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    overflow: hidden;
}

.game-item {
    margin-bottom: 5px;
    padding: 3px 10px;
    transition: background-color 0.2s;
    display: none;
    flex-direction: column;
}

.game-item.active {
    display: flex;
    background-color: rgba(15, 56, 15, 0.2);
}

.game-name {
    font-size: 14px;
    margin-bottom: 2px;
}

.game-subtitle {
    font-size: 10px;
    opacity: 0.8;
}

.navigation-help {
    font-size: 8px;
    margin-top: 10px;
    background-color: rgba(15, 56, 15, 0.15);
    padding: 3px 6px;
    border-radius: 3px;
}

.pixel-text {
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    padding: 3px 6px;
    background-color: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.shop-title {
    font-size: 20px;
    margin-bottom: 15px;
    text-shadow: 1px 1px 0 #79a024;
    animation: blink 3s infinite;
    letter-spacing: 1px;
}

.shop-subtitle {
    font-size: 12px;
    margin-bottom: 5px;
    background-color: rgba(255,255,255,0.15);
    padding: 2px 5px;
    border-radius: 3px;
}

.pixel-character {
    font-size: 24px;
    margin: 10px 0;
    animation: bounce 2s infinite;
    text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.shop-now-prompt {
    font-size: 8px;
    margin-top: 15px;
    background-color: rgba(15, 56, 15, 0.25);
    padding: 2px 5px;
    border-radius: 3px;
    animation: blink 1s infinite;
    font-weight: bold;
    position: absolute;
    bottom: 25px;
}

@keyframes blink {
    0%, 100% { opacity: 1; text-shadow: 1px 1px 0 #79a024, 0 0 5px rgba(121, 160, 36, 0.5); }
    50% { opacity: a0.7; text-shadow: 1px 1px 0 #79a024; }
}

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

.controls {
    width: 280px;
    height: 220px;
    position: relative;
}

.dpad {
    width: 100px;
    height: 100px;
    position: absolute;
    top: 10px;
    left: 10px;
}

.dpad-btn {
    width: 30px;
    height: 30px;
    background-color: #333;
    position: absolute;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}

.dpad-btn:hover {
    background-color: #444;
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.up {
    top: 0;
    left: 35px;
    border-radius: 5px 5px 0 0;
}

.right {
    top: 35px;
    right: 0;
    border-radius: 0 5px 5px 0;
}

.down {
    bottom: 0;
    left: 35px;
    border-radius: 0 0 5px 5px;
}

.left {
    top: 35px;
    left: 0;
    border-radius: 5px 0 0 5px;
}

.center {
    width: 30px;
    height: 30px;
    background-color: #444;
    position: absolute;
    top: 35px;
    left: 35px;
    box-shadow: inset 0 0 3px rgba(0,0,0,0.3);
}

.action-buttons {
    position: absolute;
    top: 25px;
    right: 10px;
}

.round-btn {
    width: 40px;
    height: 40px;
    background-color: var(--button-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    position: absolute;
    text-decoration: none;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    transition: transform 0.1s, box-shadow 0.1s, background-color 0.2s;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

.round-btn:hover {
    background-color: #e02a2a;
    transform: translateY(2px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

#a {
    right: 0;
    top: 0;
}

#b {
    right: 50px;
    top: 20px;
}

.menu-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
}

.menu-btn {
    width: 40px;
    height: 12px;
    background-color: #333;
    border-radius: 10px;
    transform: rotate(-25deg);
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.menu-btn:hover {
    background-color: #444;
    transform: rotate(-25deg) translateY(2px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.menu-btn:after {
    content: attr(data-label);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    color: #333;
    white-space: nowrap;
    text-shadow: 0 0 1px rgba(255,255,255,0.3);
    font-weight: bold;
}

.speaker {
    position: absolute;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
}

.speaker-line {
    width: 40px;
    height: 3px;
    background-color: #333;
    margin: 4px 0;
    border-radius: 2px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.nintendo-logo {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-color);
    text-shadow: 0 1px 0 rgba(255,255,255,0.2);
    letter-spacing: 1px;
}

.site-footer {
    margin-top: 30px;
    text-align: center;
    color: var(--gameboy-color);
    font-size: 14px;
    padding: 15px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    backdrop-filter: blur(5px);
    width: 100%;
    max-width: 350px;
    z-index: 1;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s, box-shadow 0.3s;
    clear: both; /* Ensure it stays below all content */
}

@media (min-width: 900px) {
    .site-footer {
        flex-basis: 100%; /* Full width in the flex layout */
    }
}

.site-footer:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.site-footer a {
    color: var(--gameboy-color);
    text-decoration: none;
    font-weight: bold;
    transition: text-shadow 0.3s, color 0.3s;
    padding: 2px 5px;
    border-radius: 4px;
}

.site-footer a:hover {
    color: white;
    text-shadow: 0 0 8px var(--gameboy-shadow);
    background-color: rgba(0, 162, 255, 0.2);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.contact-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--gameboy-color);
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 101;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.contact-button:hover {
    background-color: #0088d1;
    transform: translateY(-3px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4);
}

.gameboy-buttons button, .gameboy-buttons a {
    cursor: pointer;
}

/* Testimonial Box Styles */
.testimonials-container {
    width: 100%;
    max-width: 350px;
    margin: 30px auto 0;
    display: flex;
    justify-content: center;
    z-index: 1;
}

/* Desktop layout */
@media (min-width: 1200px) {
    .game-container {
        position: relative;
    }
    
    .testimonials-container {
        position: absolute;
        top: 0;
        right: -400px;
        height: 520px;
        margin: 0;
        display: flex;
        align-items: center;
    }
}

/* Medium screens */
@media (max-width: 1199px) {
    .testimonials-container {
        width: 100%;
        max-width: 350px;
        margin: 30px auto 0;
        display: flex;
        justify-content: center;
        position: static;
        height: auto;
    }
}

/* Testimonial Box Styles */
.testimonials-container {
    width: 100%;
    max-width: 350px;
    margin: 30px auto 0;
    display: flex;
    justify-content: center;
    z-index: 1;
}

.testimonial-box {
    width: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(0, 162, 255, 0.3);
    transition: transform 0.3s ease;
    position: relative;
}

.testimonial-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 162, 255, 0.5);
}

.testimonial-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    position: relative;
}

.testimonial-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--gameboy-color);
    text-shadow: 0 0 8px var(--gameboy-shadow);
}

.stars-container {
    display: flex;
    align-items: center;
    position: relative;
}

.review-count-badge {
    background: var(--mercari-red);
    color: white;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    box-shadow: 0 2px 10px rgba(255, 0, 51, 0.5);
    animation: zoomBadge 2s infinite alternate;
    z-index: 10;
    border: 1px solid rgba(0, 0, 0, 0.2);
    margin-right: 12px;
}

.testimonial-stars {
    color: #ffcc00;
    font-size: 18px;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(255, 204, 0, 0.5);
}

@keyframes zoomBadge {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.2);
    }
}

.testimonial-content {
    position: relative;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.testimonial-text {
    position: absolute;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 16px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    font-style: italic;
    padding-bottom: 25px;
}

.review-date {
    position: absolute;
    bottom: 0;
    right: 5px;
    font-size: 11px;
    color: #aaa;
    font-style: normal;
    font-weight: normal;
    opacity: 0.8;
}

.testimonial-text.active {
    opacity: 1;
    transform: translateY(0);
}

.testimonial-mercari-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #ccc;
    font-size: 12px;
}

.mercari-logo {
    background-color: var(--mercari-red);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Dark mode styles */
.screen.dark-mode {
    background-color: var(--dark-screen-color);
}

.screen.dark-mode .shop-display,
.screen.dark-mode .featured-games-display {
    color: var(--dark-text-color);
}

.screen.dark-mode .shop-title,
.screen.dark-mode .featured-title {
    text-shadow: 1px 1px 0 #0a1f0a;
}

.screen.dark-mode .game-item.active {
    background-color: rgba(155, 188, 15, 0.2);
}

.screen.dark-mode .navigation-help,
.screen.dark-mode .shop-now-prompt,
.screen.dark-mode .pixel-text,
.screen.dark-mode .shop-subtitle {
    background-color: rgba(155, 188, 15, 0.15);
}

/* Start button animation styles */
.startup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--screen-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.startup-overlay.active {
    opacity: 1;
}

.loading-bar-container {
    width: 80%;
    height: 10px;
    background-color: rgba(15, 56, 15, 0.3);
    border: 2px solid var(--text-color);
    margin-bottom: 20px;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background-color: var(--text-color);
    transition: width 2s ease-in-out;
}

.startup-text {
    font-size: 16px;
    color: var(--text-color);
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease-out;
}

.startup-text.active {
    opacity: 1;
    transform: scale(1.2);
}

.game-logo {
    font-size: 12px;
    margin-bottom: 20px;
    color: var(--text-color);
    opacity: 0;
    transition: opacity 1s ease;
}

.game-logo.active {
    opacity: 1;
}

.nintendo-text {
    font-size: 8px;
    color: var(--text-color);
    opacity: 0;
    margin-top: 10px;
    letter-spacing: 1px;
    transition: opacity.1s ease;
}

.nintendo-text.active {
    opacity: 0.7;
}

.screen.dark-mode .startup-overlay {
    background-color: var(--dark-screen-color);
}

.screen.dark-mode .startup-text,
.screen.dark-mode .game-logo,
.screen.dark-mode .nintendo-text {
    color: var(--dark-text-color);
}

.screen.dark-mode .loading-bar-container {
    background-color: rgba(155, 188, 15, 0.2);
    border-color: var(--dark-text-color);
}

.screen.dark-mode .loading-bar {
    background-color: var(--dark-text-color);
}

/* Simple Keyboard Controls Bar Styles */
.keyboard-controls-bar {
    width: 100%;
    max-width: 360px;
    margin: -10px auto 2px; 
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 5px;
    padding: 4px 8px;
    text-align: center;
    z-index: 1;
    overflow-x: auto;
}

.controls-text {
    color: #bbb;
    font-size: 10px;
    white-space: nowrap;
    font-family: Arial, sans-serif;
}

/* Media queries for responsiveness */
@media (max-width: 480px) {
    .site-title {
        font-size: 2.5rem;
    }
    
    .site-subtitle {
        font-size: 1rem;
    }
    
    .gameboy {
        transform: scale(0.9);
        margin-top: -20px;
    }
    
    .site-footer {
        max-width: 300px;
        font-size: 12px;
    }
    
    .contact-button {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 6px 10px;
    }
    
    .gameboy-logo {
        font-size: 14px;
    }
    
    .corner-banner {
        width: 100px;
        height: 100px;
    }
    
    .corner-banner-content {
        top: 20px;
        right: -30px;
        width: 150px;
        font-size: 10px;
        padding: 6px 0;
    }
    
    .testimonials-container {
        max-width: 300px;
    }
    
    .testimonial-title {
        font-size: 16px;
    }
    
    .testimonial-stars {
        font-size: 16px;
    }
    
    .testimonial-text {
        font-size: 14px;
    }
    
    .keyboard-controls-bar {
        max-width: 300px;
        padding: 6px 10px;
    }
    
    .controls-text {
        font-size: 10px;
    }
    
    .made-by {
        font-size: 9px;
    }
}

/* For larger screens, keep keyboard controls bar underneath gameboy */
@media (min-width: 1200px) {
    .keyboard-controls-bar {
        margin-top: -15px; 
        max-width: 360px;
    }
}
