:root {
    --bg-color: #F5F5F5;
    --primary-color: #4C533B;
    --secondary-color: #8B956D;
    --accent-color: #1F1F1F;
    --text-color: #1F1F1F;
    --border-width: 4px;
}

body {
    background-color: var(--bg-color);
    color: var(--primary-color);
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    text-transform: uppercase;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}


/* CRT Overlay Effects - Removed */
.crt-overlay, .scanlines {
    display: none;
}

#app {
    position: relative;
    z-index: 1;
    width: 95vw;
    max-width: 1200px;
    text-align: center;
}

.alley-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: .4rem;
    margin-top: .4rem;
}

.ascii-alley {
    font-family: 'Press Start 2P', monospace;
    line-height: 1.7;
    text-align: center;
    display: inline-block;
    font-size: 0.4rem;
    color: var(--primary-color);
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
}

.screen.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scrollUp {
    from { transform: translateY(100vh); }
    to { transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 1s ease-in forwards;
}

.scroll-up-animation {
    animation: scrollUp 1.7s ease-out forwards;
}

.splash-btn-title {
    font-size: 1.5rem;
    color: var(--bg-color);
    -webkit-text-stroke: 1px var(--primary-color);
    padding: 1rem 2rem;
}

.title-container {
    background: var(--accent-color);
    border: var(--border-width) solid var(--primary-color);
    padding: .7rem 1rem 1rem .7rem;
    box-shadow: 8px 8px 0px var(--secondary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
    text-align: center;
    animation: pulse-shadow 2s infinite ease-in-out;
    position: relative;
    width: 100%;
    max-width: 370px;
    box-sizing: border-box;
}

@keyframes pulse-shadow {
    0%, 100% { box-shadow: 8px 8px 0px var(--secondary-color); }
    50% { box-shadow: 12px 12px 0px var(--primary-color); }
}

.marquee-title {
    position: relative;
    display: inline-block;
    z-index: 2;
    margin: 0;
}

.title {
    font-size: 3rem;
    color: var(--bg-color);
    margin-bottom: 0;
    line-height: 0.8;
    text-align: center;
    padding-top: 0;
    -webkit-text-stroke: 1px var(--primary-color);
}

.champion-title {
    font-size: 1.8rem;
    margin-top: 1rem;
}

#rank-top {
    color: var(--bg-color);
    margin-bottom: 0.5rem;
}

.game-over-image {
    display: block;
    width: 40%;
    height: auto;
    margin: 0 auto;
}

#game-over-screen .title {
    line-height: 1.3;
}

.title .subtitle {
    font-size: 1.9rem;
    color: var(--secondary-color);
    -webkit-text-stroke: .5px var(--bg-color);
}

.title-overlay {
    padding-top: 10%;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: stretch;
    z-index: 2;
    pointer-events: none;
}

.title-image {
    display: block;
    width: 56%;
    height: auto;
    margin: 4.5rem auto 0 auto;
    position: relative;
    z-index: 1;
}

.setup-container {
    background: var(--secondary-color);
    border: var(--border-width) solid var(--accent-color);
    padding: .8rem;
    box-shadow: 8px 8px 0px var(--primary-color);
    display: inline-block;
    width: 100%;
    max-width: 380px;
    box-sizing: border-box;
}

.input-group {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    font-size: .8rem;
}

.arcade-number-input {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    font-size: 1.4rem;
    color: var(--accent-color);
}

.arcade-number-input button {
    background: var(--primary-color);
    border: none;
    font-family: 'Press Start 2P';
    font-size: .9rem;
    color: var(--bg-color);
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    box-shadow: 2px 2px 0 var(--accent-color);
}

.name-input-group {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: .6rem;
}

.retro-input {
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    font-family: 'Press Start 2P';
    text-align: center;
    padding: 0.5rem;
    text-transform: uppercase;
}

.retro-btn {
    background: var(--accent-color);
    color: var(--bg-color);
    border: none;
    font-family: 'Press Start 2P';
    padding: 0.8rem 2rem;
    cursor: pointer;
    margin-top: 0.7rem;
    box-shadow: 4px 4px 0px var(--primary-color);
    transition: transform 0.1s;
}

.restart-btn {
    padding: 0.5rem 1rem;
    font-size: 0.6rem;
    margin-top: 1rem;
}

.retro-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--primary-color);
}

/* Game Screen */
.game-info-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: .6rem;
    margin-bottom: 1rem;
}

#restart-game-btn {
    margin-bottom: 1rem;
    margin-top: 0;
}

#restart-game-btn:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0px var(--primary-color);
}

.game-header {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: .5rem;
    font-size: 1.2rem;
    color: var(--accent-color);
}

.scoreboard-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1rem;
}

#scoreboard {
    width: 100%;
    max-width: 100vw;
    border-collapse: collapse;
    border: var(--border-width) solid var(--accent-color);
    background: var(--bg-color);
}

#scoreboard th, #scoreboard td {
    border: 2px solid var(--accent-color);
    padding: 10px;
    text-align: center;
    font-size: 0.7rem;
    color: var(--accent-color);
}

@media (max-width: 600px) {
    #scoreboard th, #scoreboard td {
        padding: 5px;
        font-size: 0.5rem;
    }
}

#scoreboard th {
    background: var(--secondary-color);
    color: var(--accent-color);
}

.current-frame {
    border: 4px solid var(--accent-color) !important;
    box-shadow: 0 0 10px var(--secondary-color);
}

.input-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#current-turn-display {
    font-size: .8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.prompt {
    font-size: .8rem;
    text-align: center;
    line-height: 1.4;
    color: var(--accent-color);
}

.ball-count {
    animation: blink 1s infinite;
    font-size: 1rem;
}

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

.arcade-keypad {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    background: var(--secondary-color);
    padding: 8px;
    border: var(--border-width) solid var(--accent-color);
    box-shadow: 0 8px 0 var(--primary-color);
}

.key {
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    font-family: 'Press Start 2P';
    font-size: 0.8rem;
    padding: 0.8rem 0.5rem;
    cursor: pointer;
    box-shadow: 4px 4px 0 var(--accent-color);
    transition: all 0.1s;
}

.key:disabled {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
    cursor: not-allowed;
}