/* ============ GENERAL ============ */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: Arial, sans-serif;
    color: #fff;
    background: #0f0f0f;
    overflow: hidden;
}

/* ============ MENU PAGE ============ */
.menu-page {
    text-align: center;
    padding: 60px 40px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0a0a0a 100%);
    overflow-y: auto;
}

h1 {
    margin-bottom: 40px;
    font-size: 42px;
    color: #92ffd3;
    text-shadow: 0 0 15px #000000, 0 0 25px #00ffaa;
    letter-spacing: 1px;
}

h2 {
    margin-bottom: 40px;
    font-size: 48px;
    color: #000000;
    letter-spacing: 10px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
    max-width: 1000px;
    width: 90%;
    margin: 0 auto;
}

.game-box {
    background: linear-gradient(145deg, #1e1e1e, #292929);
    border-radius: 16px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid #222;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
}

.game-box:hover {
    border-color: #00ff99;
    background: linear-gradient(145deg, #292929, #1e1e1e);
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 255, 153, 0.25);
}

.game-box img {
    width: 140px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 255, 153, 0.15);
}

.game-title {
    font-size: 20px;
    margin-top: 15px;
    font-weight: bold;
    color: #eee;
    text-shadow: 0 0 5px rgba(0, 255, 153, 0.3);
}

/* ============ EMULATOR PAGE ============ */
.emulator-page {
    background: #303030;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    position: relative;
}

#emulator-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#content {
    width: 100%;
    height: 100%;
    display: flex;
}

#canvasWrapper {
    width: 100%;
    height: 100%;
    flex: 1;
}

#controlBar_volumeSlider,
#controlBar_alertMessage,
#debugControlBar_gameSpeedSlider,
#gameGenieDialog {
    display: none;
}

/* ============ BACK BUTTON ============ */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #00ff99;
    border: none;
    color: #000;
    font-size: 16px;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10000;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 255, 153, 0.5);
}

.back-button:hover {
    background: #00cc77;
    box-shadow: 0 0 20px rgba(0, 255, 153, 0.8);
}

/* Ensure emulator canvas centers and fills screen */
.wrapper, #canvasWrapper, #content {
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ============ TOP HEADER ============ */
.top-header {
    width: 100%;
    background: #00ff99;
    color: #000;
    padding: 15px 0;
    text-align: center;
    font-weight: bold;
    font-size: 28px;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(0, 255, 153, 0.3);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 200px;
    height: calc(100vh - 70px);
    background: #1a1a1a;
    border-right: 2px solid #00ff99;
    padding-top: 20px;
    box-shadow: 4px 0 15px rgba(0, 255, 153, 0.2);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin: 10px 0;
}

.sidebar a {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    transition: 0.2s;
    font-size: 16px;
}

.sidebar a:hover {
    color: #00ff99;
    background: #222;
}

/* ============ MAIN CONTENT AREA ============ */
.main-content {
    margin-left: 120px; /* space for decorative bar */
    margin-top: 0px;
    padding: 0px;
    width: calc(100% - 120px);
    overflow-y: auto;
    height: calc(100vh - 90px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
	background: transparent; /* removes any solid color */
}

/* Improve scrollbar look */
.main-content::-webkit-scrollbar {
    width: 8px;
}
.main-content::-webkit-scrollbar-thumb {
    background-color: #00ff99;
    border-radius: 10px;
}


/* ============ LEFT HEADER TEXT (STATIC) ============ */
.left-header {
    position: fixed;
    top: 120px;
    left: 0;
    width: 100px;
    text-align: center;
    color: #000;
    font-weight: bold;
    font-size: 18px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    letter-spacing: 5px;
    z-index: 2;
}


/* ============ GAME GRID ============ */
/* Game grid container */
.game-grid {
    display: grid;
    grid-template-columns: repeat(7, 200px); /* 7 fixed-width columns */
    gap: 20px;
    justify-content: center; /* center the entire grid horizontally */
    align-items: stretch;    /* stretch boxes in each row to match tallest */
    padding: 20px;
}

/* Game boxes */
.game-box {
    display: flex;
    flex-direction: column;
    align-items: center;   /* center content horizontally */
    text-decoration: none; /* remove underline */
    color: #fff;
    font-size: 12px;
    width: 200px;          /* fixed width */
    box-sizing: border-box;
}

/* Thumbnail image */
.game-box img {
    width: 150px;          /* updated image width */
    height: auto;
    border: 2px solid #00ff99;
    border-radius: 6px;
}

/* Game title */
.game-title {
    margin-top: 8px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    word-wrap: break-word;
}




.game-box:hover {
    border-color: #00ff99;
    background: linear-gradient(145deg, #292929, #1e1e1e);
    transform: translateY(-6px) scale(1.05);
    box-shadow: 0 12px 30px rgba(0, 255, 153, 0.25);
}

/* ============ GAME GRID ============ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr); /* 6 games per row */
    gap: 30px;
    max-width: 1000px;
    width: 100%;
}


/* Search bar inside the top header */
#search-bar {
    position: absolute;
    top: 12px;   /* adjust to center vertically */
    right: 20px;
    padding: 15px 20px;
    font-size: 16px;
    border-radius: 100px;
    border: 2px solid #00ff99;
    background: #222;
    color: #fff;
    outline: none;
    z-index: 1001;
}

#search-bar::placeholder {
    color: #aaa;
}

.top-header h1 {
    font-family: 'Press Start 2P', cursive; /* 8-bit arcade font */
    font-size: 24px;          /* adjust to taste */
    margin: 0;
    padding-top: 20px;
    color: #92ffd3;              /* header color */
    text-align: center;
    
    /* Make it pixelated instead of smooth */
    image-rendering: pixelated;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
}

.request_button {
    display: inline-block;
    writing-mode: vertical-rl;   /* vertical text */
    transform: rotate(360deg);   /* flip so text reads bottom-to-top */
    color: limegreen;            /* adjust color */
    text-decoration: none;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    transition: color 0.2s ease;
	top: 80px;
    font-size: 40px;
/*    color: #000000;   */
    letter-spacing: 5px;
}

.request_button:hover {
    color: orange; /* optional hover effect */
}

.back-button {
    position: fixed;
    top: 10px;
    left: 10px;
    background: #00ff99;
    color: #000;
    font-weight: bold;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,255,153,0.5);
    z-index: 10000;
    transition: 0.2s;
}