/* Football Daily Five
   Look: a centre circle seen through glass. One focus per screen, one accent colour.
   Blur is expensive on cheap phones, so only two things use it: the disc and the panels. */

:root {
  --sky: #b5d3d5;
  --mist: #dfeaea;
  --sand: #eceae0;
  --text: #10242a;
  --mute: #3d535a;
  --accent: #0f5563;
  --on-accent: #fff;
  --bad: #9b2823;
  --pane: rgba(255, 255, 255, .5);
  --glass: rgba(255, 255, 255, .84);
  --solid: #f8faf9;
  --edge: rgba(255, 255, 255, .85);
  --line: rgba(20, 32, 38, .13);
  --chalk: rgba(255, 255, 255, .9);
  --veil: rgba(20, 32, 38, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ring: min(344px, 94vw, 50vh);
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@supports (height: 1dvh) {
  :root { --ring: min(344px, 94vw, 50dvh); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--mist); }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* Stays put while screens change, so moving between them never flashes. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(168deg, var(--sky), var(--mist) 52%, var(--sand));
}
h1, h2, p, ol, ul { margin: 0; padding: 0; }
button { appearance: none; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Focus moves to the main button after an answer; a ring there would only be noise for touch. */
.sheet .btn:focus:not(:focus-visible) { outline: 0; }

.app {
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
}
.ico { display: inline-flex; flex: none; width: 22px; height: 22px; }
.ico svg { display: block; width: 100%; height: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- top bar ---------- */

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 8px 12px 8px 24px; }
.bar > .round { margin-left: -12px; }
.mark { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; }
.mark .ico { color: var(--accent); }
.bar-right { display: flex; align-items: center; }
.round { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; }
.lang { min-height: 44px; padding: 0 10px; font-size: 14px; color: var(--mute); }

/* ---------- buttons ---------- */

.btn {
  width: 100%;
  min-height: 54px;
  padding: 8px 20px;
  border-radius: 27px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 17px;
  font-weight: 650;
  transition: transform .16s ease-out, opacity .2s;
}
.btn:active:not(:disabled), .opt:active:not(:disabled) { transform: scale(.98); }
.btn:disabled:not(.sending) { opacity: .4; }
.quiet { min-height: 44px; padding: 8px 14px; color: var(--mute); font-size: 15px; align-self: center; }
.quiet:disabled { opacity: .5; }
.sending { animation: breathe 1s ease-in-out infinite; }

/* ---------- home and result ---------- */

.home { flex: 1; display: flex; flex-direction: column; padding: 0 24px calc(16px + env(safe-area-inset-bottom)); }
.stage { position: relative; flex: 1; display: grid; place-items: center; min-height: var(--ring); margin: 0 -24px; }
.stage > * { grid-area: 1 / 1; }
.half { width: 100%; height: 2px; background: var(--chalk); }
.ring { width: var(--ring); height: var(--ring); overflow: visible; fill: none; }
.ring .chalk { stroke: var(--chalk); stroke-width: 2; }
.ring .arc { stroke-width: 5; }
.ring .good { stroke: var(--accent); }
.ring .miss { stroke: var(--chalk); }
.disc {
  width: calc(var(--ring) * .77);
  height: calc(var(--ring) * .77);
  padding: 0 28px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: var(--pane);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.title { font-size: 32px; line-height: 1.12; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.title.small { font-size: 24px; line-height: 1.2; }
.score { display: flex; align-items: baseline; line-height: 1; letter-spacing: -.04em; }
.score b { font-size: 96px; font-weight: 720; }
.score span { margin-left: 6px; font-size: 32px; font-weight: 500; letter-spacing: 0; color: var(--mute); }
.sub { margin-top: 10px; font-size: 14px; color: var(--mute); }
.actions { flex: none; min-height: 122px; display: flex; flex-direction: column; gap: 4px; }
.note { font-size: 14px; color: var(--mute); text-align: center; }
.note:not(:empty) { padding-top: 10px; }
textarea.share { width: 100%; min-height: 92px; margin-top: 12px; padding: 12px; border: 1px solid var(--edge); border-radius: 16px; background: var(--solid); color: var(--text); font: 14px/1.4 var(--body); resize: none; }

/* ---------- question ---------- */

.steps { flex: 1; display: flex; gap: 5px; padding-right: 12px; }
.steps i { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.steps .past::after, .steps .now::after { content: ""; position: absolute; inset: 0; border-radius: 2px; background: var(--accent); }
.q { display: flex; flex-direction: column; padding: 20px 24px 24px; }
.qtext { margin-bottom: 26px; font-size: 25px; line-height: 1.28; font-weight: 680; letter-spacing: -.015em; text-wrap: balance; }
.hint { margin: -14px 0 16px; font-size: 15px; color: var(--mute); }
.status:not(.sr):not(:empty) { margin-top: 14px; font-size: 15px; font-weight: 600; color: var(--bad); text-align: center; }

.opts { display: flex; flex-direction: column; gap: 10px; }
.opts.grid { display: grid; grid-template-columns: 1fr 1fr; }
.opts + .btn { margin-top: 20px; }
.opts + .quiet { margin-top: 8px; }
.opt {
  width: 100%;
  min-height: 58px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1.5px solid var(--edge);
  border-radius: 29px;
  background: var(--pane);
  font-size: 17px;
  line-height: 1.22;
  font-weight: 550;
  text-align: center;
  transition: transform .16s ease-out, background-color .24s, border-color .24s, color .24s;
}
.grid .opt { padding: 8px 12px; font-size: 16px; gap: 6px; }
.opt .ico { width: 20px; height: 20px; animation: pop .3s var(--ease); }
.opt.sending, .opt.picked { border-color: var(--accent); }
.opt.right { border-color: var(--accent); color: var(--accent); font-weight: 680; }
.opt.wrong { border-color: var(--bad); color: var(--bad); }
.opt.rest { border-color: transparent; background: transparent; color: var(--mute); }
.order .opt { justify-content: flex-start; text-align: left; padding-left: 13px; }
.order .opt .ico { margin-left: auto; }
.slot { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 16px; font-weight: 650; }
.slot:empty { border-color: var(--line); }
.picked .slot { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }

.clues { list-style: none; margin: -8px 0 24px; display: flex; flex-direction: column; gap: 10px; }
.clues li { color: var(--mute); line-height: 1.4; transition: color .24s; }
.clues .latest { color: var(--text); font-size: 18px; font-weight: 550; }
.clues .new { animation: enter .36s var(--ease); }

/* ---------- panels ---------- */

.veil { position: fixed; inset: 0; z-index: 4; background: var(--veil); animation: fade .24s ease-out; }
.sheet {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 5;
  max-width: 440px;
  max-height: 80vh;
  margin: 0 auto;
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--edge);
  border-radius: 26px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  backdrop-filter: blur(20px) saturate(1.4);
  animation: rise .4s var(--ease);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin: -8px -8px 4px 0; }
.sheet-head h2 { font-size: 20px; font-weight: 680; }
.call { display: flex; align-items: center; justify-content: space-between; font-size: 22px; font-weight: 700; }
.call b { color: var(--accent); animation: pop .36s .16s var(--ease) backwards; }
.why { min-height: 44px; font-size: 15px; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.explain { padding: 10px 0 16px; animation: fade .24s ease-out; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 50px; border-top: 1px solid var(--line); }
.sheet-head + .row { border-top: 0; }
.row b { font-weight: 650; text-align: right; }
.rules { list-style: none; padding-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.foot { padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; }
.foot a { color: inherit; }

/* ---------- motion ---------- */

.enter .title, .enter .score, .enter .sub, .enter .actions { animation: fade .4s ease-out; }
.enter .qtext { animation: enter .4s var(--ease); }
.enter .hint, .enter .clues, .enter .opts, .enter .opts ~ .btn, .enter .opts ~ .quiet { animation: enter .4s .06s var(--ease) backwards; }
.enter .now::after { animation: fill .5s var(--ease); }
.waiting .disc { animation: breathe 1.4s ease-in-out infinite; }
.reveal .arc { animation: fade .3s ease-out backwards; }
.veil.out { opacity: 0; transition: opacity .2s; }
.sheet.out { transform: translateY(110%); transition: transform .22s ease-in; }

@keyframes fade { from { opacity: 0; } }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes rise { from { transform: translateY(110%); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes fill { from { transform: translateX(-100%); } }
@keyframes breathe { 50% { opacity: .6; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .disc, .sheet, .opt:not(.rest) { background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .disc, .sheet { background: var(--solid); }
}

/* small phones (360 x 640 is the MiniPay minimum) */
@media (max-height: 680px) {
  .q { padding-top: 8px; }
  .qtext { margin-bottom: 18px; font-size: 22px; }
  .hint { margin-top: -8px; margin-bottom: 12px; }
  .clues { margin-bottom: 16px; gap: 6px; }
  .clues .latest { font-size: 17px; }
  .opts { gap: 8px; }
  .opt { min-height: 50px; }
  .score b { font-size: 88px; }
  .sheet { padding: 16px 18px 18px; }
}
