/* Cosmoderm Hydra Drop - page styles */
:root {
  color-scheme: light;
  --ink: #15324a;
  --ink-soft: #4d6a80;
  --paper: #f3faf8;
  --panel: #ffffff;
  --line: #cfe6e1;
  --aqua: #3fb7c9;
  --aqua-deep: #1f7f94;
  --mint: #bfe9dd;
  --blush: #f07a8c;
  --blush-deep: #c75567;
  --gold: #f2b544;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #d9f3ee 0%, transparent 60%), var(--paper);
  color: var(--ink); font-family: var(--body); font-size: 15px;
  padding: 20px 16px 28px;
}
a { color: var(--aqua-deep); }
.wrap { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }

.top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
h1 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 5vw, 42px); line-height: 1; margin: 0; letter-spacing: -0.01em; }
h1 .brand { color: var(--aqua); }
.tag { color: var(--ink-soft); margin: 6px 0 0; max-width: 60ch; }
.contest {
  margin: 0; padding: 10px 14px; border-radius: 14px; background: #fff7e4; border: 1px solid #f4dca2;
  color: #6b4f12; font-weight: 700; display: flex; align-items: flex-start; gap: 10px;
}
.soundbtn {
  font: 700 13px var(--body); color: var(--ink); background: var(--panel); border: 2px solid var(--line);
  box-shadow: none; border-radius: 999px; padding: 6px 12px;
}
.soundbtn:active { transform: none; box-shadow: none; }
.soundbtn[aria-pressed="true"] { color: var(--ink-soft); background: #eef3f2; }
.contest::before { content: "🏆"; }
.contest.closed { background: #f1f4f6; border-color: #dbe3e8; color: var(--ink-soft); }
.contest.closed::before { content: "⏳"; }

.stage { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 780px) { .stage { grid-template-columns: 1fr; } }

.game {
  position: relative; width: 100%; max-width: 420px; aspect-ratio: 2 / 3; margin: 0 auto;
  border-radius: 22px; overflow: hidden; background: #8fd6e2;
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -18px rgba(21, 50, 74, .45);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
canvas { display: block; width: 100%; height: 100%; cursor: pointer; }
#cv:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  gap: 12px; padding: 18px 14px; text-align: center; background: rgba(21, 50, 74, .35); overflow-y: auto;
}
.card {
  background: var(--panel); border-radius: 18px; padding: 18px 16px 16px; width: min(340px, 100%);
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 12px 30px -12px rgba(21,50,74,.5);
  user-select: text; -webkit-user-select: text;
}
.card h2 { font-family: var(--display); font-weight: 800; font-size: 26px; margin: 0; line-height: 1.05; }
.card p { margin: 0; color: var(--ink-soft); line-height: 1.4; }
.lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); text-align: left; font-weight: 700; }
.lblnote { text-transform: none; letter-spacing: 0; font-weight: 500; }
input[type=text], input[type=tel] {
  font: 600 17px var(--body); color: var(--ink); padding: 10px 12px; border-radius: 12px;
  border: 2px solid var(--line); background: #fbfefd; width: 100%; margin-top: -4px;
}
input[type=text]:focus, input[type=tel]:focus { outline: none; border-color: var(--aqua); }
input.bad { border-color: var(--blush); }
.check { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 13.5px; line-height: 1.35; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: var(--aqua-deep); }
.err { color: #b8314a !important; font-weight: 700; font-size: 14px; text-align: left; }

/* buttons inside the game / terms / admin boxes only (the 25 Years page around the game has its own) */
:where(.wrap) button {
  font: 800 18px var(--display); border: 0; border-radius: 14px; padding: 10px 16px; cursor: pointer;
  background: var(--blush); color: #fff; box-shadow: 0 4px 0 var(--blush-deep); transition: transform .08s;
}
:where(.wrap) button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blush-deep); }
:where(.wrap) button:disabled { opacity: .6; cursor: wait; }
:where(.wrap) button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
:where(.wrap) button.ghost { background: transparent; color: var(--ink-soft); box-shadow: none; font: 700 14px var(--body); padding: 6px; }
:where(.wrap) button.ghost:active { transform: none; }
.hint { font-size: 13px; color: var(--ink-soft); }
kbd { font-family: var(--mono); font-size: 12px; background: #eef6f4; border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }

.chars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; margin-top: -4px; }
.charbtn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 5px;
  background: #f3faf8; color: var(--ink); border: 2px solid var(--line); border-radius: 12px; box-shadow: none;
  font: 700 10.5px var(--body); line-height: 1.1; cursor: pointer;
}
.charbtn:active { transform: none; box-shadow: none; }
.charbtn img { width: 38px; height: 38px; }
.charbtn[aria-checked="true"] { border-color: var(--aqua); background: #e3f6f8; box-shadow: 0 0 0 2px rgba(63,183,201,.25); }
.chars.muted .charbtn { opacity: .45; }
.facebox { text-align: left; }
.facebox summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--aqua-deep); }
.facerow { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.faceprev {
  width: 52px; height: 52px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, #fff, #9fe3ef 50%, #2ea3bb);
  background-size: cover; background-position: center; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--aqua-deep);
}
.facectl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.facectl input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filebtn { font: 700 14px var(--body); color: var(--ink); background: #eef8f6; border: 2px solid var(--line); border-radius: 12px; padding: 7px 12px; cursor: pointer; }
.filebtn:hover { border-color: var(--aqua); }
.facectl input[type=file]:focus-visible + .filebtn { outline: 3px solid var(--gold); outline-offset: 2px; }

.overhead { display: flex; flex-direction: column; gap: 2px; }
.overrank { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--aqua); font-weight: 800; }
.card p.deathline { color: var(--ink); font-weight: 700; font-style: italic; }
.scoreline { display: flex; justify-content: center; gap: 22px; }
.scoreline div { display: flex; flex-direction: column; align-items: center; min-width: 60px; }
.scoreline b { font-family: var(--mono); font-size: 30px; font-variant-numeric: tabular-nums; color: var(--ink); }
.scoreline span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.card p.runfacts { font-size: 13px; }
.newbest { color: var(--blush-deep) !important; font-weight: 800; }
.overrow { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

aside { display: flex; flex-direction: column; gap: 16px; }
.board { background: var(--panel); border-radius: 20px; padding: 16px 18px 12px; border: 1px solid var(--line); }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.board h3 { font-family: var(--display); font-weight: 800; font-size: 22px; margin: 0 0 4px; }
.status { font-size: 12px; color: var(--ink-soft); }
.status.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3cc47c; margin-right: 6px; vertical-align: 1px; }
ol#list { list-style: none; margin: 0; padding: 0; }
li.row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid #eaf3f1; }
li.row:first-child { border-top: 0; }
li.row.me { background: #eaf8fa; border-radius: 10px; }
.rank { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); text-align: center; }
.rank.r1, .rank.r2, .rank.r3 { color: #fff; border-radius: 50%; width: 28px; height: 28px; display: grid; place-items: center; margin: 0 auto; }
.rank.r1 { background: var(--gold); } .rank.r2 { background: #b9c7d1; } .rank.r3 { background: #d99a6c; }
.who-text { display: flex; flex-direction: column; min-width: 0; }
.pname { font-weight: 800; overflow-wrap: anywhere; }
.ptitle { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.pscore { font-family: var(--mono); font-size: 18px; font-variant-numeric: tabular-nums; }
.empty { color: var(--ink-soft); padding: 12px 4px; list-style: none; }
.boardnote { font-size: 12.5px; color: var(--ink-soft); margin: 8px 4px 2px; }
.boardnote:empty { display: none; }

.how { font-size: 14px; color: var(--ink-soft); line-height: 1.5; margin: 0 0 10px; }
.how b { color: var(--ink); }
.legend { display: flex; flex-direction: column; gap: 4px; padding-bottom: 14px; }
.chips { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; }
.chips li { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; }
.chips i { font-style: normal; font: 800 10px var(--display); color: #fff; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); flex: none; }
.chips small { display: block; font-weight: 500; color: var(--ink-soft); font-size: 12px; }
.powers { list-style: none; margin: 4px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.powers li { display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; font-size: 13.5px; line-height: 1.35; color: var(--ink-soft); }
.powers img { width: 42px; height: 64px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(21,50,74,.18)); }
.powers b { color: var(--ink); display: block; font-size: 14px; }
.powers em { font-style: normal; font-weight: 800; font-size: 11px; letter-spacing: .06em; }
.subh { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 800; margin: 6px 0 4px; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 14px; margin: 0; padding: 0; list-style: none; }
.rules li { font-size: 14px; line-height: 1.4; color: var(--ink-soft); }
.rules b { color: var(--ink); display: block; }

.foot { display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center; font-size: 13px; color: var(--ink-soft); padding-top: 6px; }

/* the terms / privacy pages */
.doc { max-width: 760px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px clamp(16px, 4vw, 34px) 26px; line-height: 1.6; }
.doc h1 { font-size: clamp(26px, 5vw, 34px); margin-bottom: 4px; }
.doc h2 { font-family: var(--display); font-size: 21px; margin: 22px 0 4px; }
.doc .sub { color: var(--ink-soft); margin: 0 0 14px; }
.doc li { margin-bottom: 6px; }
.doc .todo { background: #fff3c4; padding: 0 4px; border-radius: 4px; }
.back { display: inline-block; margin-bottom: 12px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { :where(.wrap) button { transition: none; } }
@media (pointer: coarse) { .hint.keys { display: none; } }
/* phones: the sign-up card has to fit inside the game box */
@media (max-width: 480px) {
  body { padding: 14px 12px 22px; }
  .overlay { padding: 10px 8px; }
  .card { padding: 12px; gap: 7px; }
  .card h2 { font-size: 22px; }
  .lblnote.opt { display: none; }
  .lblnote { font-size: 11px; }
  input[type=text], input[type=tel] { padding: 8px 10px; font-size: 16px; }
  .charbtn { padding: 4px 2px 3px; font-size: 10px; }
  .charbtn img { width: 30px; height: 30px; }
  .check { font-size: 12.5px; }
  .check input { width: 17px; height: 17px; }
  .scoreline { gap: 14px; }
  .scoreline b { font-size: 26px; }
  .contest { font-size: 14px; padding: 8px 12px; }
}
