:root {
  --bg: #07160d;
  --ink: #f4fbf6;
  --muted: #b9d6c3;
  --lime: #d7ff3f;
  --lime-ink: #0b2a19;
  --glass: rgba(6, 22, 13, 0.72);
  --line: rgba(255, 255, 255, 0.16);
  --warn: #ff5fa0;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg);
  overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none;
}
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; cursor: pointer; border: 0; touch-action: manipulation; }

#pitch { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.shade { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, rgba(7, 22, 13, 0.25), rgba(7, 22, 13, 0.75) 75%); }
#ui { position: relative; z-index: 2; height: 100%; max-width: 480px; margin: 0 auto; }
.screen { position: absolute; inset: 0; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.hidden { display: none !important; }

/* ---------- menu ---------- */
.home { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px; }
.brand { text-align: center; margin: 5vh 0 2vh; }
.brand h1 { font-family: 'Archivo Black', sans-serif; font-size: 64px; margin: 0; line-height: 1; letter-spacing: -0.02em; text-shadow: 0 6px 30px rgba(0,0,0,0.6); }
.brand h1 span { color: var(--lime); }
.brand p { color: var(--muted); font-size: 16px; line-height: 1.45; margin: 12px 0 0; }
.mode { text-align: left; background: var(--glass); color: var(--ink); border: 1px solid var(--line); border-radius: 22px; padding: 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: rise 0.5s ease both; }
.mode:nth-of-type(2) { animation-delay: 0.08s; }
.mode .t { font-family: 'Archivo Black', sans-serif; font-size: 24px; }
.mode .d { color: var(--muted); font-size: 14px; font-weight: 500; grid-column: 1; }
.mode .b { grid-row: 1 / 3; grid-column: 2; align-self: center; color: var(--lime); font-weight: 800; font-size: 14px; text-align: right; }
.mode:active { transform: scale(0.98); }
.how { background: var(--glass); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; color: var(--muted); font-size: 14px; line-height: 1.5; backdrop-filter: blur(6px); }
.how summary { color: var(--ink); font-weight: 800; cursor: pointer; }
.tiers { display: grid; gap: 6px; margin-top: 8px; }
.tier { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; }
.tier i { width: 18px; height: 18px; border-radius: 5px; display: block; }
.tier b { color: var(--ink); }
.sound { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 16px; background: var(--glass); color: var(--ink); border-radius: 999px; width: 42px; height: 42px; font-size: 18px; border: 1px solid var(--line); }

/* ---------- HUD ---------- */
.hud { display: flex; flex-direction: column; gap: 8px; }
.squares { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.squares span { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,0.08); border: 1px solid var(--line); transition: background 0.3s, transform 0.3s; }
.squares span.now { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(215,255,63,0.3); }
.squares span.pop { animation: pop 0.5s ease; }
.squares.big span { width: 38px; height: 38px; border-radius: 10px; }
.hudrow { display: flex; justify-content: space-between; align-items: center; }
.score { font-family: 'Archivo Black', sans-serif; font-size: 30px; text-shadow: 0 3px 16px rgba(0,0,0,0.6); }
.score::after { content: ' stig'; font-family: Inter, sans-serif; font-size: 14px; color: var(--muted); font-weight: 700; }
.cards { font-size: 22px; letter-spacing: 2px; }

/* ---------- prompt card ---------- */
.card { margin-top: auto; margin-bottom: auto; background: var(--glass); border: 1px solid var(--line); border-radius: 26px; padding: 18px;
  display: flex; flex-direction: column; gap: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.card.enter { animation: cardIn 0.45s cubic-bezier(.2,.9,.3,1.2) both; }
.card.shake { animation: shake 0.4s ease; }
.meta { display: flex; justify-content: space-between; align-items: center; }
.diff { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,0.1); }
.diff[data-d="Auðvelt"] { color: #7dffa6; } .diff[data-d="Miðlungs"] { color: var(--lime); }
.diff[data-d="Erfitt"] { color: #ffb24a; } .diff[data-d="Mjög erfitt"] { color: var(--warn); }
.num { color: var(--muted); font-weight: 700; font-size: 13px; }
.prompt { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.prompt .lead { color: var(--muted); font-weight: 800; font-size: 15px; }
.prompt .cond { font-family: 'Archivo Black', sans-serif; font-size: 23px; line-height: 1.15; }
.clock { position: relative; width: 78px; height: 78px; align-self: center; }
.clock svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.clock circle { fill: none; stroke-width: 8; }
.clock .track { stroke: rgba(255,255,255,0.12); }
.clock .ring { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: 0; transition: stroke 0.3s; }
.clock span { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'Archivo Black', sans-serif; font-size: 26px; }
.clock.hurry .ring { stroke: var(--warn); }
.clock.hurry span { color: var(--warn); animation: beat 1s ease infinite; }
#answer { width: 100%; font: inherit; font-size: 20px; font-weight: 800; padding: 15px 16px; border-radius: 16px; border: 2px solid var(--line); background: rgba(0,0,0,0.35); color: var(--ink); outline: none; }
#answer:focus { border-color: var(--lime); }
.btns { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 10px; }
.pass { background: rgba(255,255,255,0.1); color: var(--ink); border-radius: 16px; padding: 15px; font-weight: 800; font-size: 17px; }
.shoot { background: var(--lime); color: var(--lime-ink); border-radius: 16px; padding: 15px; font-weight: 800; font-size: 19px; box-shadow: 0 6px 0 #9fc22a; }
.shoot:active { transform: translateY(3px); box-shadow: 0 3px 0 #9fc22a; }
button:disabled { opacity: 0.4; }
.msg { min-height: 22px; margin: 0; text-align: center; font-weight: 800; color: var(--warn); }

/* ---------- overlays ---------- */
.ready { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.ready span { font-family: 'Archivo Black', sans-serif; font-size: 140px; color: var(--lime); text-shadow: 0 10px 50px rgba(0,0,0,0.6); animation: count 1s ease both; }
.var { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.35); }
.screenbox { background: #0d1117; border: 3px solid #3a4250; border-radius: 18px; padding: 22px 34px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 0 0 6px rgba(255,255,255,0.05), 0 30px 80px rgba(0,0,0,0.6); animation: rise 0.25s ease both; }
.vt { font-family: 'Archivo Black', sans-serif; font-size: 44px; letter-spacing: 0.1em; color: #fff; }
.vs { color: var(--muted); font-weight: 700; }
.bars { display: flex; gap: 6px; height: 26px; align-items: flex-end; }
.bars i { width: 8px; background: var(--lime); border-radius: 3px; animation: bar 0.9s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: 0.15s; } .bars i:nth-child(3) { animation-delay: 0.3s; } .bars i:nth-child(4) { animation-delay: 0.45s; }
.goal { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 24px; }
.gname { font-family: 'Archivo Black', sans-serif; font-size: 54px; line-height: 1; text-shadow: 0 8px 40px rgba(0,0,0,0.7); animation: slam 0.6s cubic-bezier(.2,1.4,.4,1) both; }
.gpts { font-family: 'Archivo Black', sans-serif; font-size: 40px; color: var(--lime); animation: rise 0.4s 0.25s ease both; }
.gline { font-weight: 800; color: var(--ink); animation: rise 0.4s 0.35s ease both; }
.gplayer { color: var(--muted); font-weight: 700; animation: rise 0.4s 0.45s ease both; }
.gtap { margin-top: 26px; color: var(--muted); font-size: 13px; opacity: 0.8; animation: rise 0.4s 1s ease both; }

/* ---------- report ---------- */
#report { align-items: center; text-align: center; }
.rk { margin: 4vh 0 0; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; }
.rscore { margin: 0; font-family: 'Archivo Black', sans-serif; font-size: 84px; line-height: 1; color: var(--lime); text-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.rsub { margin: 0; color: var(--muted); font-weight: 700; }
.rlist { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.rrow { background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; display: grid; grid-template-columns: 14px 1fr auto; gap: 2px 10px; text-align: left; align-items: center; backdrop-filter: blur(6px); animation: rise 0.4s ease both; }
.rrow i { width: 14px; height: 14px; border-radius: 4px; grid-row: 1 / 3; }
.rrow .q { color: var(--muted); font-size: 12px; font-weight: 700; }
.rrow .a { font-weight: 800; }
.rrow .p { grid-row: 1 / 3; grid-column: 3; font-family: 'Archivo Black', sans-serif; font-size: 20px; }
.rbtns { width: 100%; display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 6px; }
.ghost { background: rgba(255,255,255,0.1); color: var(--ink); border-radius: 16px; padding: 15px; font-weight: 800; font-size: 17px; border: 1px solid var(--line); }
.link { background: none; color: var(--muted); font-weight: 700; text-decoration: underline; padding: 8px; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--lime); color: var(--lime-ink); font-weight: 800; padding: 12px 18px; border-radius: 999px; z-index: 9; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-10px); } 40% { transform: translateX(9px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes beat { 50% { transform: scale(1.15); } }
@keyframes count { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 100% { transform: scale(0.8); opacity: 0; } }
@keyframes slam { from { transform: scale(2.4) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bar { 0%, 100% { height: 6px; } 50% { height: 26px; } }
