/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

body {
    background-color: #0b0c10;
    color: #f7ede2;
    font-family: 'Outfit', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Game Shell Container (Full Screen 3D Viewport) */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-color: #0b0c10;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Canvas styling */
#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    cursor: pointer;
}

/* HUD Styling */
#hud {
    position: absolute;
    top: 16px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.hud-item {
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 33, 117, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 90px;
}

.hud-label {
    font-size: 9px;
    font-weight: 800;
    color: rgba(247, 237, 226, 0.5);
    letter-spacing: 1.5px;
    margin-bottom: 2px;
}

.hud-value {
    font-size: 16px;
    font-weight: 800;
    color: #03dac6;
    text-shadow: 0 0 5px rgba(3, 218, 198, 0.3);
}

/* Light Indicator Center */
.hud-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

#light-indicator {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #111;
    border: 4px solid #333;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#light-indicator.light-green {
    border-color: #00ff88;
    background: radial-gradient(circle, #00ff88, #008844);
    box-shadow: 0 0 25px #00ff88, 0 0 5px #00ff88 inset;
}

#light-indicator.light-red {
    border-color: #ff2175;
    background: radial-gradient(circle, #ff2175, #aa0044);
    box-shadow: 0 0 25px #ff2175, 0 0 5px #ff2175 inset;
    animation: lightPulse 0.4s infinite alternate;
}

#light-text {
    font-family: 'Rubik Mono One', sans-serif;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
}

/* Floating Buttons */
.hud-btn {
    position: absolute;
    top: 90px;
    right: 12px;
    z-index: 10;
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 33, 117, 0.2);
    color: #ff2175;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.hud-btn:hover {
    transform: scale(1.1);
    background: #ff2175;
    color: #1a1a1a;
}

/* Screens / Overlays */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(11, 12, 16, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    z-index: 20;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Shapes container */
.shapes-container {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.shape {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #ff2175;
    opacity: 0.85;
}

.shape.circle {
    border-radius: 50%;
}

.shape.triangle {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 26px solid #ff2175;
    border-top: none;
    background: none;
}

.shape.square {
    /* default box */
}

/* Game Title */
.game-title {
    font-family: 'Rubik Mono One', sans-serif;
    font-size: 36px;
    line-height: 1;
    text-align: center;
    color: #f7ede2;
    text-shadow: 0 4px 15px rgba(255, 33, 117, 0.5);
    margin-bottom: 4px;
    letter-spacing: 2px;
}

.game-subtitle {
    font-size: 13px;
    font-weight: 800;
    color: #ff2175;
    margin-bottom: 36px;
    text-align: center;
    letter-spacing: 4px;
}

/* Cards */
.menu-card, .stats-card {
    background: rgba(26, 26, 26, 0.95);
    border: 2px solid rgba(255, 33, 117, 0.3);
    border-radius: 16px;
    padding: 24px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    margin-bottom: 24px;
}

.high-score-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 12px;
    font-size: 13px;
    font-weight: 800;
    color: rgba(247, 237, 226, 0.5);
}

#high-score-val {
    color: #03dac6;
    font-size: 16px;
}

/* Instructions */
.instructions {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.instructions h3 {
    font-size: 11px;
    letter-spacing: 2px;
    color: #ff2175;
    margin-bottom: 4px;
    text-align: center;
}

.instructions p {
    font-size: 12px;
    color: rgba(247, 237, 226, 0.65);
    line-height: 1.4;
}

/* Buttons */
.btn {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    letter-spacing: 1.5px;
}

.primary-btn {
    background: linear-gradient(135deg, #ff2175, #ff5e97);
    color: #fff;
    border-bottom: 4px solid #b90e48;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 33, 117, 0.4);
    filter: brightness(1.1);
}

.primary-btn:active {
    transform: translateY(2px);
    border-bottom: 0px solid transparent;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #f7ede2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Stats */
.stats-card p {
    font-size: 16px;
    color: rgba(247, 237, 226, 0.8);
    display: flex;
    justify-content: space-between;
}

.stat-highlight {
    font-weight: 800;
    color: #ff2175;
}

.text-green {
    color: #00ff88 !important;
    font-family: 'Rubik Mono One', sans-serif;
    text-shadow: 0 4px 15px rgba(0, 255, 136, 0.4);
}

.text-green-glow {
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.text-red {
    color: #ff2175 !important;
    font-family: 'Rubik Mono One', sans-serif;
    text-shadow: 0 4px 15px rgba(255, 33, 117, 0.4);
}

.text-red-glow {
    color: #ff2175;
    text-shadow: 0 0 10px rgba(255, 33, 117, 0.5);
}

.screen-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 20px;
}

/* Animations */
@keyframes lightPulse {
    from {
        box-shadow: 0 0 20px #ff2175, 0 0 5px #ff2175 inset;
    }
    to {
        box-shadow: 0 0 35px #ff2175, 0 0 10px #ff2175 inset;
    }
}
