:root {
    --bg-color: #111;
    --text-color: #eee;
    --primary-color: #f72585; /* Neon Pink/Red */
    --accent-color: #4cc9f0; /* Neon Blue */
    --success-color: #06d6a0; /* Neon Green */
    --warning-color: #ffd166; /* Neon Yellow */
    --panel-bg: rgba(30, 30, 30, 0.8);
    --border-color: #333;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image: radial-gradient(circle at center, #222 0%, #000 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Teko', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#app {
    width: 100%;
    max-width: 1600px;
    height: 95vh;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    padding: 20px;
}

.screen.active {
    display: flex;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color);
}

.wallet {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--success-color);
}

/* Garage Layout */
.garage-content {
    display: flex;
    gap: 20px;
    flex: 1;
}

.current-sander-panel {
    flex: 1;
}

.shop-panel {
    flex: 2;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.sander-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.sander-card h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.sander-card p {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 15px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

/* Shop */
.shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 10px;
}

.shop-item {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.shop-item.owned {
    opacity: 0.5;
    pointer-events: none;
}

.shop-item h4 {
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.prize {
    font-size: 1.5rem;
    color: var(--success-color);
}

/* Loser Overlay */
#loser-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: 10000;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--warning-color);
    animation: flashLoserBg 0.5s infinite;
}
#loser-overlay.hidden {
    display: none;
    animation: none;
}
.loser-content {
    animation: loserShake 0.4s infinite alternate;
}
.bankrupt-title {
    font-size: 8rem;
    margin-bottom: 20px;
    text-shadow: 4px 4px 0px #000, 0 0 20px red;
}
.loser-content p {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #fff;
}

@keyframes flashLoserBg {
    0% { background: #000; }
    50% { background: #330000; }
    100% { background: #000; }
}
@keyframes loserShake {
    0% { transform: scale(1) rotate(-1deg); }
    100% { transform: scale(1.05) rotate(1deg); }
}

.shop-item .price {
    color: var(--success-color);
    font-weight: bold;
    margin: 10px 0;
}

button {
    cursor: pointer;
    font-family: 'Teko', sans-serif;
    text-transform: uppercase;
    font-size: 1.2rem;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    transition: all 0.2s;
}

.buy-btn {
    background: var(--accent-color);
    color: #000;
    margin-top: auto;
}

.buy-btn:hover {
    background: #fff;
    box-shadow: 0 0 10px var(--accent-color);
}

.primary-btn {
    background: var(--primary-color);
    color: #fff;
    font-size: 1.5rem;
    padding: 10px 20px;
    width: 100%;
}

.primary-btn:hover {
    box-shadow: 0 0 15px var(--primary-color);
}

/* Race Screen */
.race-header {
    text-align: center;
    margin-bottom: 20px;
}

.race-header h2 {
    font-size: 2rem;
    color: var(--primary-color);
}

#race-status {
    font-size: 1.2rem;
    font-weight: bold;
}

.track-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

/* Christmas Tree */
.christmas-tree {
    background: #222;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border: 2px solid #444;
}

.light {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #111;
    border: 2px solid #000;
}

.light.stage.on { background: #fff; box-shadow: 0 0 10px #fff; }
.light.yellow.on { background: var(--warning-color); box-shadow: 0 0 10px var(--warning-color); }
.light.green.on { background: var(--success-color); box-shadow: 0 0 10px var(--success-color); }
.light.red.on { background: var(--primary-color); box-shadow: 0 0 10px var(--primary-color); }

.canvas-wrapper {
    width: 100%;
    background: #333;
    border: 2px solid #555;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

/* Timing Slip Modal */
.modal {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.timing-slip {
    background: #fff;
    color: #000;
    font-family: monospace;
    padding: 20px;
    width: 250px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transform: translateY(-50px);
    animation: slipIn 0.5s forwards ease-out;
}

@keyframes slipIn {
    to { transform: translateY(0); }
}

.timing-slip h3 {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 10px;
    margin-bottom: 15px;
    color: #000;
}

.slip-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.result-msg {
    margin-top: 15px;
    font-weight: bold;
    text-align: center;
    display: block;
    font-size: 1.3rem;
}

.prize {
    border-top: 1px dashed #000;
    padding-top: 10px;
    font-weight: bold;
    margin-bottom: 20px;
}

#btn-back-garage {
    background: #000;
    color: #fff;
}

/* Garage Door Transition */
.garage-door {
    position: fixed;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: #333;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    pointer-events: none;
}
.garage-door.closed {
    top: 0;
    pointer-events: all;
}
.garage-door .panel {
    flex: 1;
    border-bottom: 2px solid #111;
    border-top: 1px solid #555;
    background: repeating-linear-gradient(to bottom, #3a3a3a, #3a3a3a 10px, #333 10px, #333 20px);
}
