* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    overflow: hidden;
    background: #2E2A25;
    font-family: 'Crimson Pro', serif;
    color: #FFF8E7;
    user-select: none;
}

#scene-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
}

#scene-container canvas {
    display: block;
}

/* ─── Start Screen ─── */
#start-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #FFBF00 0%, #708238 50%, #4a5a20 100%);
    background-size: 400% 400%;
    animation: bgShift 8s ease infinite;
}

@keyframes bgShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.start-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
}

.title {
    font-family: 'Pacifico', cursive;
    font-size: clamp(3rem, 8vw, 5rem);
    color: #FFF8E7;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    margin-bottom: 0.25em;
    line-height: 1.2;
}

.olive-emoji {
    display: inline-block;
    animation: wobble 2s ease-in-out infinite;
}

@keyframes wobble {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 200;
    color: #FFF8E7cc;
    margin-bottom: 2rem;
    font-style: italic;
}

.difficulty-selector {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.diff-btn {
    background: rgba(255,248,231,0.15);
    border: 2px solid rgba(255,248,231,0.3);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    color: #FFF8E7;
    font-family: 'Crimson Pro', serif;
    backdrop-filter: blur(4px);
}

.diff-btn:hover {
    background: rgba(255,248,231,0.25);
    border-color: #FFF8E7;
}

.diff-btn.selected {
    background: rgba(255,248,231,0.3);
    border-color: #FFBF00;
    box-shadow: 0 0 20px rgba(255,191,0,0.3);
}

.diff-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
}

.diff-size {
    display: block;
    font-size: 0.8rem;
    font-weight: 200;
    opacity: 0.7;
}

#start-btn {
    background: #708238;
    border: none;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    cursor: pointer;
    font-family: 'Pacifico', cursive;
    font-size: 1.5rem;
    color: #FFF8E7;
    position: relative;
    transition: all 0.3s;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3), inset 0 -4px 10px rgba(0,0,0,0.2), inset 0 4px 10px rgba(255,255,255,0.1);
    margin-bottom: 1.5rem;
}

#start-btn::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #C1272D;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateY(-20px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

#start-btn .btn-inner {
    position: relative;
    z-index: 1;
    top: 10px;
}

#start-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4), inset 0 -4px 10px rgba(0,0,0,0.2), inset 0 4px 10px rgba(255,255,255,0.15);
}

.controls-hint {
    font-size: 0.85rem;
    opacity: 0.6;
    font-weight: 200;
    margin-top: 0.5rem;
}

.mobile-hint {
    display: none;
}

/* ─── HUD ─── */
#hud {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10;
}

#minimap {
    position: absolute;
    top: 16px;
    left: 16px;
    border-radius: 10px;
    border: 2px solid rgba(255,248,231,0.4);
    background: rgba(46,42,37,0.8);
    backdrop-filter: blur(4px);
}

#timer {
    position: absolute;
    top: 16px;
    right: 16px;
    font-family: 'Crimson Pro', serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: #FFBF00;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    background: rgba(46,42,37,0.7);
    padding: 6px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,191,0,0.3);
}

#olive-counter {
    position: absolute;
    top: 70px;
    right: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #708238;
    background: rgba(46,42,37,0.7);
    padding: 4px 14px;
    border-radius: 8px;
    border: 1px solid rgba(112,130,56,0.3);
}

#compass {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Crimson Pro', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFF8E7;
    background: rgba(46,42,37,0.7);
    padding: 4px 14px;
    border-radius: 8px;
    letter-spacing: 2px;
}

#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: rgba(255,248,231,0.4);
    font-weight: 200;
}

/* ─── Touch Controls ─── */
#touch-controls {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 15;
    pointer-events: none;
}

#joystick-zone {
    position: absolute;
    bottom: 30px;
    left: 30px;
    width: 130px;
    height: 130px;
    pointer-events: auto;
}

#joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,248,231,0.15);
    border: 2px solid rgba(255,248,231,0.3);
    position: relative;
}

#joystick-knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255,191,0,0.5);
    border: 2px solid rgba(255,191,0,0.7);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: none;
}

#look-zone {
    position: absolute;
    top: 0; right: 0;
    width: 50%;
    height: 100%;
    pointer-events: auto;
}

/* ─── Victory ─── */
#victory-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(46,42,37,0.92);
    backdrop-filter: blur(8px);
}

#confetti-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.victory-content {
    text-align: center;
    z-index: 1;
    position: relative;
    padding: 2rem;
    animation: fadeUp 0.6s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.victory-title {
    font-family: 'Pacifico', cursive;
    font-size: clamp(2rem, 6vw, 3.5rem);
    color: #FFBF00;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.victory-quip {
    font-size: 1.2rem;
    font-weight: 200;
    color: #FFF8E7aa;
    margin-bottom: 2rem;
    font-style: italic;
}

.victory-stats {
    display: flex;
    gap: 3rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 200;
    color: #FFF8E7aa;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 900;
    color: #FFBF00;
}

.victory-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.victory-btn {
    padding: 0.75rem 2rem;
    border-radius: 30px;
    border: 2px solid rgba(255,248,231,0.3);
    background: rgba(255,248,231,0.1);
    color: #FFF8E7;
    font-family: 'Crimson Pro', serif;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.victory-btn:hover {
    background: rgba(255,248,231,0.2);
    border-color: #FFF8E7;
}

.victory-btn.accent {
    background: #708238;
    border-color: #708238;
}

.victory-btn.accent:hover {
    background: #8a9c48;
}

/* ─── Footer ─── */
#footer {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: rgba(255,248,231,0.3);
    z-index: 5;
    white-space: nowrap;
}

#footer a {
    color: rgba(255,191,0,0.5);
    text-decoration: none;
}

#footer a:hover {
    color: #FFBF00;
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .mobile-hint { display: block; }
    .controls-hint:not(.mobile-hint) { display: none; }
    #minimap { width: 100px; height: 100px; }
}

@media (pointer: coarse) {
    .mobile-hint { display: block; }
    .controls-hint:not(.mobile-hint) { display: none; }
}