* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}
body {
    background-color: #0d0d11;
    color: #fff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Screen Management */
.screen {
    display: none !important;
    width: 100vw;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
}
.screen.active {
    display: flex !important;
}

/* Title Screen */
#title-screen {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #1a1a2e 0%, #0f0f1b 100%);
}
.title-container {
    text-align: center;
    margin-bottom: 40px;
}
.main-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: #00f0ff;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
}
.author-tag {
    font-size: 0.8rem;
    color: #aaaaaa;
    font-weight: normal;
}
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 220px;
}
.btn {
    background: #16213e;
    color: #fff;
    border: 2px solid #0f3460;
    padding: 12px 24px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}
.btn:hover {
    background: #e94560;
    border-color: #e94560;
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
    transform: translateY(-2px);
}

/* Minecraft-style Scoreboard UI */
.mc-scoreboard {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid #555;
    padding: 12px 16px;
    min-width: 200px;
    font-family: 'Courier New', Courier, monospace;
    box-shadow: 4px 4px 0px #000;
}
.mc-scoreboard-header {
    color: #ffff55;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #555;
    padding-bottom: 6px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.mc-scoreboard-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.95rem;
}
.mc-scoreboard-label {
    color: #ffffff;
}
.mc-scoreboard-value {
    color: #ff5555;
    font-weight: bold;
}

/* Game Screen Layout */
#game-screen {
    display: none;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px;
    gap: 15px;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 95vh;
    justify-content: flex-start;
}

.panel-box {
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid #334155;
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.panel-title {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 4px;
    font-weight: bold;
}

#next-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 80vh;
    overflow-y: auto;
}

canvas {
    background-color: #000;
    border: 2px solid #334155;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

/* Screen Shake and Effects */
.shake {
    animation: shake 0.2s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shake {
    10%, 90% { transform: translate3d(-2px, 0, 0); }
    20%, 80% { transform: translate3d(4px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); }
    40%, 60% { transform: translate3d(8px, 0, 0); }
}

.flash {
    animation: flash-animation 0.3s ease-out;
}
@keyframes flash-animation {
    0% { background-color: rgba(255, 255, 255, 0.8); }
    100% { background-color: transparent; }
}

/* Popups */
#effect-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.popup-text {
    font-size: 4rem;
    font-weight: 900;
    color: #fff200;
    text-shadow: 0 0 20px #ff0055, 0 0 40px #ff0055;
    animation: popup-anim 1s forwards;
    position: absolute;
}

@keyframes popup-anim {
    0% { transform: scale(0.2); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

.gold-glow {
    box-shadow: 0 0 25px #ffd700 !important;
    border-color: #ffd700 !important;
}