:root {
    --red:       #b6322e;
    --red-hover: #9a2a26;
    --gray:      #414141;
    --bg:        #111111;
    --card:      #1e1e1e;
    --card-alt:  #252525;
    --text:      #ffffff;
    --muted:     #888888;
    --green:     #4caf50;
    --orange:    #ff9800;
    --radius:    16px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ── Header / Logo ─────────────────────────────────────────────────────────── */

header {
    background: var(--bg);
    padding: 1.25rem 1.25rem 0;
}

header img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Main ──────────────────────────────────────────────────────────────────── */

main {
    flex: 1;
    padding: 0.75rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* ── Count Card ────────────────────────────────────────────────────────────── */

.count-card {
    background: var(--card);
    border: 2px solid var(--red);
    border-radius: var(--radius);
    padding: 2rem 1.5rem 1.75rem;
    text-align: center;
}

#count {
    font-size: clamp(5rem, 22vw, 7rem);
    font-weight: 900;
    color: var(--red);
    line-height: 1;
    display: block;
    transition: transform 0.15s ease;
}

#count.pop {
    animation: pop 0.3s ease;
}

@keyframes pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

#count-label {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 1rem;
    letter-spacing: 0.02em;
}

/* ── Status Card ───────────────────────────────────────────────────────────── */

.status-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: center;
    text-align: center;
}

.location-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.location-info::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    flex-shrink: 0;
}

.location-info.status-within::before  { background: var(--green); }
.location-info.status-outside::before { background: var(--orange); }
.location-info.status-denied::before  { background: var(--red); }

.location-info.status-within  { color: var(--green); }
.location-info.status-outside { color: var(--orange); }
.location-info.status-denied  { color: var(--red); }

.spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--muted);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

#status-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    min-height: 1.4em;
}

/* ── Button ────────────────────────────────────────────────────────────────── */

.btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform 0.1s ease, opacity 0.15s ease, background 0.15s ease;
    outline: none;
}

.btn:active { transform: scale(0.96); }

.btn:disabled,
.btn.loading {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.btn-checkin {
    background: var(--red);
    color: #ffffff;
}

.btn-checkin:hover:not(:disabled) { background: var(--red-hover); }

.btn-checkout {
    background: var(--gray);
    color: #ffffff;
}

.btn-checkout:hover:not(:disabled) { background: #525252; }

/* ── Footer ────────────────────────────────────────────────────────────────── */

footer {
    padding: 1rem 1.25rem 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.78rem;
}

footer a {
    color: var(--muted);
    text-decoration: none;
}

footer a:hover { color: var(--text); }
