/* Fixed Fiesta tokens from Memento More v1.2.1 app/appearance.py. */
:root {
  color-scheme: dark;
  --background: #12171B; --surface: #202930; --text: #F7F8F8; --muted: #C7D2D2;
  --accent: #00B2A9; --on-accent: #071A1C; --border: #7E9194; --focus: #FFB547;
  --pink: #EF426F; --orange: #FF8200; --silver: #C4CED4;
  --gold: var(--focus);
  font: 16px/1.42 system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--background); }
h1, h2, p { margin: 0; }
h2 { font-size: 1.125rem; line-height: 1.2; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .52; cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.footer-link { color: var(--accent); background: transparent; border: 0; padding: 0 .2rem; font: inherit; text-decoration: underline; }
footer { color: var(--muted); font-size: .7rem; text-align: center; }
.setup { max-width: 36rem; margin: 0 auto; padding: 1.25rem 1rem; }
.brand { margin-bottom: 1rem; }
.brand h1, .game-header h1 { letter-spacing: -.055em; line-height: 1; }
.brand h1 { font-size: clamp(2.65rem, 10vw, 4rem); }
.brand h1 span, .game-header h1 span { color: var(--accent); }
.kicker { color: var(--accent); font-size: .72rem; font-weight: 820; letter-spacing: .13em; }
.brand .kicker { display: block; margin-bottom: .38rem; }
.stack { display: grid; gap: .76rem; }
.panel { border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); padding: .9rem; }
.panel p, dialog p:not(.error) { color: var(--muted); }
label { display: grid; gap: .25rem; color: var(--muted); min-width: 0; font-size: .86rem; }
input, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: .55rem .65rem; color: var(--text);
  background: var(--background); border: 1px solid var(--border); border-radius: .55rem; font-size: 1rem;
}
textarea { resize: vertical; }
.primary, .secondary, .remove, .bonus-action {
  min-height: 44px; border: 1px solid var(--border); border-radius: .65rem; padding: .5rem .75rem;
  color: var(--text); background: var(--surface); font-weight: 750;
}
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.setup > footer { margin-top: 1rem; }
.input-row { display: grid; gap: .42rem; align-items: end; }
.category-row { grid-template-columns: minmax(0,1fr) minmax(4.7rem,6rem) 44px; }
.player-row { grid-template-columns: minmax(0,1fr) 44px; }
.player-row label { grid-column: 1; }
.player-row button { grid-row: 2; grid-column: 2; }
.remove { padding: .15rem; font-size: 1.35rem; }
.optional { color: var(--muted); font-size: .72rem; margin-left: .35rem; font-weight: 550; }
.bonus-panel h2, .gold-text { color: var(--gold); }
dialog {
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 1.05rem;
  width: min(calc(100% - 1.75rem), 31rem); max-height: calc(100dvh - 2rem); padding: 1rem; overflow: auto;
}
dialog::backdrop { background: #12171Bdb; }
dialog h2 { margin-bottom: .7rem; }
dialog .overview, dialog label { margin: .65rem 0; overflow-wrap: anywhere; }
dialog ul { margin: 0; padding-left: 1.1rem; }
.goal-preview { font-weight: 800; }
.dialog-actions { display: flex; gap: .5rem; justify-content: end; flex-wrap: wrap; margin-top: .7rem; }
.error { color: var(--focus); }
.error:empty, .copy-message:empty { display: none; }

.dashboard {
  height: 100dvh; max-width: 32rem; margin: 0 auto;
  padding: max(.6rem, env(safe-area-inset-top)) max(.8rem, env(safe-area-inset-right)) max(.45rem, env(safe-area-inset-bottom)) max(.8rem, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: clamp(.3rem, 1.1dvh, .7rem);
}
.game-header { display: flex; align-items: baseline; justify-content: space-between; gap: .45rem; }
.game-header h1 { font-size: clamp(1.55rem, 7vw, 2.2rem); white-space: nowrap; }
#member { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gauge {
  position: relative; flex: 1 1 auto; min-height: 9rem; max-height: 17.5rem; width: 100%;
  border: 1px solid var(--border); border-radius: 1.15rem;
  color: var(--text); background: var(--surface); overflow: hidden;
}
.gauge .kicker { position: absolute; top: .42rem; inset-inline: 0; }
.gauge svg { position: absolute; width: 100%; height: calc(100% - 2.05rem); inset: .95rem 0 auto; }
.gauge path { fill: none; stroke-width: 10; }
.track { stroke: var(--border); }
.ink0 { --ink: var(--accent); } .ink1 { --ink: var(--pink); } .ink2 { --ink: var(--orange); }
.gold { --ink: var(--gold); }
.segment { stroke: var(--ink); }
.invisible { visibility: hidden; }
.gauge-score { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); display: grid; line-height: 1.05; }
.gauge-score strong { font-size: clamp(2rem, 9vw, 3.5rem); font-variant-numeric: tabular-nums; }
.gauge-score span, .gauge-hint { color: var(--muted); font-size: .73rem; white-space: nowrap; }
.gauge-hint { position: absolute; bottom: .32rem; inset-inline: 0; }
#tracker { display: grid; gap: .38rem; }
.track-row {
  display: grid; grid-template-columns: minmax(0,1fr) 44px minmax(2.4rem,auto) 44px; gap: .27rem;
  align-items: center; min-height: 48px; border: 1px solid var(--border); border-radius: .8rem;
  background: var(--surface); padding: .12rem .25rem .12rem .5rem;
}
.track-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 720; }
.track-label::before { content: ""; display: inline-block; width: .62rem; height: .62rem; margin: 0 .3rem .02rem 0; background: var(--ink); border-radius: 50%; }
.track-row button { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: .58rem; font-size: 1.35rem; line-height: 1; touch-action: manipulation; }
.minus { color: var(--text); background: var(--background); }
.plus { color: var(--on-accent); background: var(--accent); border-color: var(--accent) !important; }
.count { text-align: center; font-weight: 790; font-variant-numeric: tabular-nums; }
.bonus-card { display: flex; align-items: center; justify-content: space-between; gap: .5rem; border: 1px solid var(--gold); border-radius: .8rem; padding: .18rem .3rem .18rem .55rem; background: var(--surface); }
.bonus-blurb { min-width: 0; display: grid; }
.bonus-label, .bonus-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bonus-label { color: var(--gold); font-weight: 760; }
.bonus-note, .sync { font-size: .72rem; color: var(--muted); }
.bonus-action { border-color: var(--gold); color: var(--gold); }
.sync { min-height: 1em; text-align: center; }
.celebration { position: fixed; inset: 0; display: grid; place-items: start center; padding-top: 13dvh; pointer-events: none; z-index: 3; }
.celebration-message { z-index: 1; display: grid; text-align: center; max-width: 88vw; border: 2px solid var(--accent); border-radius: .9rem; padding: .7rem 1rem; color: var(--text); background: var(--background); }
.celebration-message strong { font-size: 1.55rem; }
.event-claim .celebration-message { border-color: var(--gold); }
.event-undo .celebration-message { border-color: var(--pink); }
.confetti {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--accent) 2px, transparent 3px), radial-gradient(circle, var(--pink) 3px, transparent 4px), radial-gradient(circle, var(--orange) 2px, transparent 3px);
  background-size: 52px 67px, 75px 48px, 39px 84px;
  animation: confetti 2.7s ease-in both;
}
.event-claim .confetti { background-image: radial-gradient(circle, var(--gold) 3px, transparent 4px), radial-gradient(circle, var(--orange) 2px, transparent 3px); }
.event-undo .confetti { animation-direction: reverse; }
@keyframes confetti { 0% { opacity: 0; transform: translateY(-25%); } 23% { opacity: .8; } 100% { opacity: 0; transform: translateY(38%); } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
@media (max-height: 480px) { .gauge { min-height: 7.75rem; } .dashboard { gap: .25rem; } }

/* Keep the gameplay viewport fixed; long final results scroll inside their panel. */
.game-header h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#game-nav { flex: none; padding: .22rem .45rem; }
#final-results { min-height: 0; overflow: auto; }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.game-entry { margin-block: .45rem; }
