:root {
    /* Game specific */
    --gb-body: #c0c0c0;
    --gb-screen-border: #777;
    --gb-screen-bg: #9bbc0f;
    --gb-pixel-dark: #0f380f;
    --gb-pixel-light: #9bbc0f;
    --gb-pixel-med: #8bac0f;
    --gb-pixel-shadow: #306230;
    --gb-btn-a: #a91836;
    --gb-btn-b: #a91836;
    --gb-dpad: #333;
    --gb-select-start: #666;
}

[data-theme="dark"] {
    --gb-body: #4a4a4a;
    --gb-screen-border: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Courier New', Courier, monospace;
    /* Background and color handled by shared.css */
}

.container {
    /* Inherits flex column and 100vh from shared.css */
    align-items: center;
}

/* Game Boy Styling */
.game-boy {
    margin: auto;
    /* Center in container */
    background-color: var(--gb-body);
    width: 320px;
    height: 540px;
    border-radius: 10px 10px 40px 10px;
    padding: 20px;
    box-shadow:
        -5px 5px 15px rgba(0, 0, 0, 0.2),
        inset 2px 2px 5px rgba(255, 255, 255, 0.4),
        inset -2px -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.screen-border {
    background-color: var(--gb-screen-border);
    width: 100%;
    height: 240px;
    border-radius: 10px 10px 30px 10px;
    padding: 20px 30px;
    position: relative;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.power-led {
    width: 8px;
    height: 8px;
    background-color: #b11;
    border-radius: 50%;
    position: absolute;
    top: 40%;
    left: 10px;
    box-shadow: 0 0 2px #f00;
    opacity: 0.8;
}

.screen-glass {
    background-color: #8b9bb4;
    width: 100%;
    height: 100%;
    border: 2px solid #555;
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    background-color: var(--gb-screen-bg);
    width: 90%;
    height: 90%;
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.2);
    display: flex;
    padding: 2px;
    image-rendering: pixelated;
}

.game-area {
    border-right: 2px solid var(--gb-pixel-dark);
    padding-right: 2px;
}

#tetris {
    width: 120px;
    /* Scaled down for GB look */
    height: 160px;
    display: block;
}

.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-left: 4px;
    font-family: 'Press Start 2P', monospace;
    /* Need a pixel font ideally */
    font-size: 8px;
    color: var(--gb-pixel-dark);
}

.score-box,
.level-box,
.next-box {
    margin-bottom: 8px;
}

.label {
    font-weight: bold;
    margin-bottom: 2px;
}

#next {
    width: 40px;
    height: 40px;
}

.brand {
    color: #b0b0b0;
    font-style: italic;
    font-weight: bold;
    font-size: 12px;
    margin-top: 5px;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
    display: flex;
    gap: 5px;
}

.brand .model {
    font-family: sans-serif;
    font-style: normal;
    font-size: 14px;
}

.controls {
    width: 100%;
    height: 180px;
    margin-top: 20px;
    position: relative;
}

.d-pad {
    position: absolute;
    top: 40px;
    left: 20px;
    width: 90px;
    height: 90px;
}

.d-pad .up,
.d-pad .down,
.d-pad .left,
.d-pad .right,
.d-pad .center {
    background-color: var(--gb-dpad);
    position: absolute;
    border-radius: 3px;
    box-shadow:
        2px 2px 0 rgba(0, 0, 0, 0.2),
        inset 1px 1px 2px rgba(255, 255, 255, 0.2);
}

.d-pad .center {
    width: 30px;
    height: 30px;
    top: 30px;
    left: 30px;
    z-index: 1;
    box-shadow: none;
}

.d-pad .up {
    width: 30px;
    height: 30px;
    top: 0;
    left: 30px;
}

.d-pad .down {
    width: 30px;
    height: 30px;
    bottom: 0;
    left: 30px;
}

.d-pad .left {
    width: 30px;
    height: 30px;
    top: 30px;
    left: 0;
}

.d-pad .right {
    width: 30px;
    height: 30px;
    top: 30px;
    right: 0;
}

.d-pad div:active {
    transform: scale(0.95);
}

.action-buttons {
    position: absolute;
    top: 50px;
    right: 20px;
    display: flex;
    gap: 15px;
    transform: rotate(-15deg);
}

.btn-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.btn-a,
.btn-b {
    width: 35px;
    height: 35px;
    background-color: var(--gb-btn-a);
    border-radius: 50%;
    box-shadow:
        2px 2px 0 rgba(0, 0, 0, 0.2),
        inset -1px -1px 2px rgba(0, 0, 0, 0.3),
        inset 1px 1px 2px rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.btn-a:active,
.btn-b:active {
    transform: scale(0.95);
    box-shadow: inset 1px 1px 5px rgba(0, 0, 0, 0.5);
}

.btn-group .label {
    font-family: sans-serif;
    font-weight: bold;
    color: var(--gb-dpad);
    font-size: 12px;
}

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

.btn-select,
.btn-start {
    width: 40px;
    height: 12px;
    background-color: var(--gb-select-start);
    border-radius: 6px;
    transform: rotate(-15deg);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.btn-select:active,
.btn-start:active {
    transform: rotate(-15deg) scale(0.95);
}

.speaker {
    position: absolute;
    bottom: 20px;
    right: 20px;
    transform: rotate(-15deg);
}

.speaker .slot {
    width: 60px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
    border-radius: 2px;
    box-shadow: inset 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.instructions {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-color);
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 400px) {
    .game-boy {
        transform: scale(0.9);
    }
}