/* Devil's Club brand: grey card background, red accent, black bar, Oswald + Jost */
:root {
  --bg: #E5E5E5;
  --card: #FFFFFF;
  --ink: #111111;
  --ink-2: #4A4F5C;
  --ink-3: #7A8090;
  --line: #D4D4D8;
  --red: #D00027;
  --red-deep: #8E001B;
  --gold: #E8B33A;
  --ice: #6E8FB8;
  --green: #1E8A4C;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Jost", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3, .oswald { font-family: "Oswald", "Arial Narrow", sans-serif; letter-spacing: .01em; }
a { color: inherit; }

/* ---------- black brand bar ---------- */
.bar {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  gap: 12px;
}
.bar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.bar .brand img { width: 34px; height: 34px; filter: invert(1); }
.bar .brand span { font-family: "Oswald", sans-serif; font-weight: 600; font-size: 18px; }
.bar nav { display: flex; gap: 6px; }
.bar nav a {
  text-decoration: none; font-family: "Oswald", sans-serif; font-size: 15px;
  padding: 6px 12px; border-radius: 999px; color: #d8d8dc;
}
.bar nav a.on, .bar nav a:hover { background: var(--red); color: #fff; }

main { width: 100%; max-width: 560px; margin: 0 auto; padding: 18px 16px 32px; flex: 1; }

.title { text-align: center; margin: 6px 0 2px; font-size: 40px; line-height: 1; font-weight: 700; }
.title em { color: var(--red); font-style: normal; }
.sub { text-align: center; color: var(--ink-2); margin: 6px 0 18px; font-size: 15px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

/* ---------- guess input + suggestions ---------- */
.guess-box { position: relative; }
.guess-box input {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--ink); background: #fff; outline: none;
}
.guess-box input:focus { border-color: var(--red); }
.guess-box input:disabled { background: #f1f1f3; border-color: var(--line); }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 10;
  background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
  list-style: none; margin: 0; padding: 6px; max-height: min(320px, 42vh); overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.suggest li {
  padding: 11px 12px; border-radius: 8px; cursor: pointer; display: flex;
  justify-content: space-between; gap: 8px; align-items: baseline;
}
.suggest li.on, .suggest li:hover { background: #F3E3E6; }
.suggest li b { color: var(--red); font-weight: 600; }
.suggest li small { color: var(--ink-3); white-space: nowrap; }
.suggest .empty { color: var(--ink-3); cursor: default; }
.suggest .empty:hover { background: none; }

.meta { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 14px; margin: 10px 2px 0; }

/* ---------- guess rows ---------- */
.rows { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.row {
  background: var(--card); border-radius: 12px; padding: 10px 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  animation: pop .25s ease-out;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.row .name { font-weight: 600; font-size: 17px; }
.row .info { color: var(--ink-3); font-size: 13px; }
.row .heat { grid-row: span 2; text-align: right; }
.row .heat .n { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 26px; line-height: 1; }
.row .heat .lab { font-family: "Oswald", sans-serif; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.row .meter { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: #EDEDEF; overflow: hidden; margin-top: 6px; }
.row .meter i { display: block; height: 100%; border-radius: 6px; }
.row.win { background: var(--ink); color: #fff; }
.row.win .info { color: #c9c9cf; }

/* ---------- result panel ---------- */
.result { text-align: center; margin-top: 16px; }
.result h2 { margin: 0 0 4px; font-size: 30px; }
.result .answer { font-size: 22px; font-weight: 600; margin: 4px 0 2px; }
.result .info { color: var(--ink-2); font-size: 14px; }
.btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.btn {
  font-family: "Oswald", sans-serif; font-size: 16px; letter-spacing: .02em; border: 0; cursor: pointer;
  padding: 11px 18px; border-radius: 999px; background: var(--ink); color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn.red { background: var(--red); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.next { margin-top: 14px; color: var(--ink-2); font-size: 14px; }
.next b { font-family: "Oswald", sans-serif; font-size: 18px; color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 8px 4px; text-align: center; }
.stats b { display: block; font-family: "Oswald", sans-serif; font-size: 22px; }
.stats span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; }

.how { margin-top: 20px; color: var(--ink-2); font-size: 14px; }
.how h3 { color: var(--ink); margin: 0 0 6px; font-size: 18px; }
.how ol { padding-left: 20px; margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.legend span { font-size: 12px; padding: 3px 9px; border-radius: 999px; color: #fff; font-family: "Oswald", sans-serif; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none;
}
.toast.on { opacity: 1; }

footer.bar { justify-content: center; font-size: 13px; color: #bdbdc4; }
footer.bar a { color: #fff; font-weight: 600; text-decoration: none; }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact .logo { width: 120px; height: 120px; margin: 8px auto 6px; display: block; }
.contact .handle { font-family: "Oswald", sans-serif; font-size: 30px; font-weight: 700; margin: 4px 0; }
.contact p { color: var(--ink-2); margin: 6px auto; max-width: 420px; }
.x-btn { font-size: 18px; padding: 14px 26px; margin-top: 12px; }
.x-btn svg { width: 20px; height: 20px; fill: currentColor; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; text-align: left; }
.tiles .card h3 { margin: 0 0 4px; font-size: 17px; }
.tiles .card p { margin: 0; font-size: 14px; }

@media (max-width: 420px) {
  .title { font-size: 34px; }
  .bar .brand span { display: none; }
  .tiles { grid-template-columns: 1fr; }
}

/* phones: thumb-sized targets, no double-tap zoom, room for the home bar */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }
  .guess-box input { scroll-margin-top: 12px; }
  .suggest li { padding: 13px 12px; }
  .btn { touch-action: manipulation; }
  footer.bar { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
