body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #fcfcfc;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- HUD --- */
#score-container {
    position: absolute;
    top: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 100;
    pointer-events: none;
}

#score-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    text-shadow: 2px 2px 0px rgba(255, 255, 255, 0.5);
}

.coin-icon {
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #ffd700, #f39c12);
    border-radius: 50%;
    border: 3px solid #000;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.2);
    position: relative;
}

.coin-icon::after {
    content: '$';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    color: #b76e00;
}

/* --- Overlays --- */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 20;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #f1c40f;
    text-shadow: 2px 2px #d35400;
    text-transform: uppercase;
}

p {
    font-size: 18px;
    margin-bottom: 25px;
    color: #ecf0f1;
    line-height: 1.5;
}

/* --- Buttons --- */
button {
    padding: 15px 40px;
    font-size: 18px;
    font-weight: bold;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 0 #27ae60;
    transition: all 0.1s ease;
    text-transform: uppercase;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

button:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #27ae60;
}

button:disabled {
    background-color: #95a5a6;
    box-shadow: 0 4px 0 #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

/* --- Specific UI Elements --- */
#timer {
    margin: 15px 0;
    font-size: 24px;
    color: #e74c3c;
    font-weight: bold;
}

#claim-btn {
    background-color: #f39c12;
    box-shadow: 0 4px 0 #d35400;
}

#claim-btn:active {
    box-shadow: 0 0 0 #d35400;
}

/* --- Redemption Screen --- */
#redemption-screen {
    background: #2c3e50;
}

#qr-container {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    color: #333;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.qr-box {
    width: 200px;
    height: 200px;
    background: #ecf0f1;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px dashed #bdc3c7;
    margin: 10px auto;
}

#redemption-timer {
    font-size: 28px;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 15px;
    font-family: monospace;
}

.warning-text {
    color: #f39c12;
    font-size: 14px;
    max-width: 300px;
    margin-top: 15px;
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 5px;
}

/* Mobile Responsiveness improvements */
@media (max-width: 600px) {
    h1 {
        font-size: 28px;
    }

    p {
        font-size: 16px;
    }

    button {
        padding: 12px 30px;
        font-size: 16px;
    }

    .coin-icon {
        width: 25px;
        height: 25px;
    }

    #score-text {
        font-size: 20px;
    }
}

/* --- Venue Screen --- */
#venue-screen {
    background: radial-gradient(circle at top, #1e272e, #0f171e);
}

.venue-list-container {
    width: 100%;
    max-width: 400px;
    max-height: 55vh;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.venue-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.venue-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.venue-card:hover, .venue-card:active {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(241, 196, 15, 0.5);
    box-shadow: 0 8px 20px rgba(241, 196, 15, 0.15);
}

.venue-card:hover::before, .venue-card:active::before {
    opacity: 1;
}

.venue-name {
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    letter-spacing: 0.5px;
}

.venue-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 5px;
}

.venue-meta::before {
    content: '📍';
}

/* Beautiful loading spinner */
.loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #f1c40f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Small Back link/button */
.back-link {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-decoration: underline;
    margin-top: 15px;
    transition: color 0.2s ease;
}
.back-link:hover {
    color: #f1c40f;
}