/* Self-hosted fonts (SIL Open Font License, see fonts/LICENSE-*.txt) */
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('fonts/lato-latin-400-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Lato';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/lato-latin-700-normal.woff2') format('woff2');
}
@font-face {
    font-family: 'Playfair Display';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/playfair-display-latin-700-normal.woff2') format('woff2');
}

:root {
    --teal-bg: #0b3d4f;
    --teal-deep: #08303e;
    --gold-text: #c4a35a;
    --beige-card: #f5f1e8;
    --dark-text: #333333;
}

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

html, body { height: 100%; }

body {
    font-family: 'Lato', sans-serif;
    background: var(--teal-bg);
    color: var(--gold-text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
    -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--beige-card); outline-offset: 3px; }

.brand {
    text-align: center;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 18px 0 8px;
    opacity: 0.85;
}
.brand-dot { opacity: 0.6; }

.stage {
    flex: 1;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    padding: 8px 0;
}

.card {
    background: var(--beige-card);
    color: var(--dark-text);
    border: 2px solid var(--gold-text);
    border-radius: 18px;
    padding: 36px 26px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.card.fresh { animation: rise 0.45s ease-out; }
@keyframes rise {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.prompt {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 5.2vw, 1.9rem);
    line-height: 1.35;
    text-align: center;
    color: var(--teal-bg);
}

.timer {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}
.time {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 15vw, 4.4rem);
    line-height: 1;
    color: var(--gold-text);
    font-variant-numeric: tabular-nums;
}
.timer-hint {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    color: var(--beige-card);
    opacity: 0.7;
}
.timer.paused .time { opacity: 0.5; }
.timer.done .time { color: var(--beige-card); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }

.progress {
    height: 4px;
    border-radius: 2px;
    background: rgba(245, 241, 232, 0.2);
    overflow: hidden;
    margin-top: -12px;
}
.progress-fill {
    height: 100%;
    width: 100%;
    background: var(--gold-text);
    transition: width 0.25s linear;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.btn {
    flex: 0 1 220px;
    background: var(--gold-text);
    color: var(--teal-bg);
    border: none;
    border-radius: 30px;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.98); }

.vote {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: 50%;
    border: 2px solid rgba(196, 163, 90, 0.55);
    background: var(--teal-deep);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    filter: grayscale(0.6);
    transition: transform 0.15s, background 0.15s, filter 0.15s;
}
.vote:hover { filter: none; }
.vote[aria-pressed="true"] {
    background: var(--beige-card);
    border-color: var(--gold-text);
    filter: none;
    transform: scale(1.08);
}

.footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 14px 0 18px;
    font-size: 0.8rem;
    color: var(--beige-card);
    opacity: 0.75;
}
.footer a, .link-btn { color: inherit; }
.link-btn {
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
}

@media (max-height: 620px) {
    .card { min-height: 160px; padding: 24px 20px; }
    .stage { gap: 16px; }
    .brand { padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .card.fresh, .timer.done .time { animation: none; }
    .progress-fill { transition: none; }
}

.consent-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    max-width: 560px;
    margin: 0 auto;
    padding: 14px 16px;
    background: var(--beige-card);
    color: var(--dark-text);
    border: 2px solid var(--gold-text);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    line-height: 1.4;
}
.consent-banner p { margin: 0; flex: 1 1 260px; }
.consent-banner a { color: var(--teal-bg); font-weight: bold; }
.consent-buttons { display: flex; gap: 8px; margin-left: auto; }
.consent-btn {
    background: var(--teal-bg);
    color: var(--gold-text);
    border: 1px solid var(--gold-text);
    border-radius: 20px;
    padding: 8px 18px;
    font-family: 'Lato', sans-serif;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
}
.consent-btn:hover, .consent-btn:focus-visible { background: #0f4c62; }

/* ---- Privacy page ---- */
body.privacy-page {
    display: block;
    overflow: auto;
    height: auto;
    min-height: 100vh;
}
.privacy-content {
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 16px calc(40px + env(safe-area-inset-bottom));
    color: var(--beige-card);
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
}
.privacy-content h1, .privacy-content h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold-text);
}
.privacy-content h1 { font-size: 2.2rem; margin-bottom: 0.5em; }
.privacy-content h2 { font-size: 1.3rem; margin: 1.6em 0 0.4em; }
.privacy-content a { color: var(--gold-text); }
.privacy-content code { color: var(--gold-text); }
.privacy-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.privacy-back { margin-top: 2em; }
.privacy-content p { margin: 0 0 0.8em; }
.privacy-content ul { margin: 0 0 0.8em; padding-left: 1.4em; }
.privacy-content li { margin-bottom: 0.3em; }
