:root {
    --bg: #ffffff;
    --text: #111111;
    --dim: #999999;
    --rule: #e0e0e0;
    --accent: #ff3333;
}

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

html, body {
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

hr {
    border: none;
    border-top: 1px solid var(--rule);
    width: 100%;
}

.screen {
    display: none;
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.screen.active {
    display: flex;
}

/* Title */
.title-block {
    text-align: center;
    width: min(80%, 320px);
}

.title-block h1 {
    font-size: clamp(2rem, 10vw, 3.5rem);
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
}

.title-block hr {
    margin-bottom: 1rem;
}

.desc {
    color: var(--text);
    line-height: 1.6;
}

.meta {
    color: var(--dim);
    margin-top: 0.5rem;
    font-size: 11px;
}

/* Buttons */
button {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 0.8rem 2rem;
    background: var(--text);
    color: var(--bg);
    border: none;
    cursor: pointer;
    margin-top: 2rem;
}

button:active {
    background: var(--accent);
}

#replay-btn {
    background: transparent;
    color: var(--dim);
    border: 1px solid var(--rule);
}

#replay-btn:active {
    color: var(--text);
    border-color: var(--text);
}

/* Proof canvas (hidden, used for sharing only) */
#proof-canvas {
    display: none;
}

/* Countdown */
#countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(4rem, 20vw, 7rem);
    font-weight: 700;
    z-index: 10;
    background: var(--bg);
    color: var(--text);
}

#countdown.hidden {
    display: none;
}

/* Game */
#game-screen {
    cursor: crosshair;
}

#game-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    font-size: 11px;
    color: var(--dim);
    letter-spacing: 0.1em;
    z-index: 50;
    border-bottom: 1px solid var(--rule);
    background: var(--bg);
}

#game-hud.hidden {
    display: none;
}

#target-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
}

#target-dot.hidden {
    opacity: 0;
    pointer-events: none;
}

#tap-area {
    position: absolute;
    inset: 0;
}

/* Reveal */
#reveal-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
}

#reveal-overlay.hidden {
    display: none;
}

#crosshair-center {
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

#crosshair-tap {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--text);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

#distance-line {
    position: absolute;
    height: 1px;
    background: var(--text);
    transform-origin: left center;
}

#distance-label {
    position: absolute;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent);
    transform: translate(-50%, -50%);
}

/* Disruption */
#disruption-screen {
    background: var(--bg);
}

#disruption-animation {
    width: 100%;
    height: 100%;
    background: var(--bg);
    animation: disrupt 0.6s ease-in-out;
}

@keyframes disrupt {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

/* Results */
.result-block {
    width: min(80%, 320px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--dim);
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
}

.result-block hr {
    margin: 1rem 0;
}

.rounds-detail {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.5rem 0;
}

.round-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--rule);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #ffffff;
}

.round-dot.good { background: #22c55e; }
.round-dot.ok { background: #eab308; }
.round-dot.bad { background: var(--accent); }

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
}

.result-key {
    color: var(--dim);
    font-size: 11px;
    letter-spacing: 0.1em;
}

.result-val {
    font-weight: 700;
    font-size: 24px;
}

.unit {
    color: var(--dim);
    font-weight: 400;
    font-size: 13px;
    margin-left: 2px;
}

.comment {
    font-size: 12px;
    color: var(--dim);
    font-style: italic;
    margin-top: 1.5rem;
    text-align: center;
    line-height: 1.6;
}


.result-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 2rem;
}
