/* Wordmark font: drop the "THE MOMENT" font file into fonts/ as TheMoment.otf (or install it).
   Until then it falls back to Arial Narrow. */
@font-face {
  font-family: "The Moment";
  src: local("The Moment"), local("TheMoment"), local("THE MOMENT"),
       url("fonts/TheMoment.woff2") format("woff2"),
       url("fonts/TheMoment.otf") format("opentype"),
       url("fonts/TheMoment.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #000;
  --surface: #0a0a0a;
  --line: #262626;
  --line-strong: #404040;
  --text: #fff;
  --muted: #8a8a8a;
  --dim: #5c5c5c;
  --wordmark: "The Moment", "Arial Narrow", "Helvetica Neue Condensed", Arial, sans-serif;
  --body: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0 auto;
  max-width: 1080px;
  padding: 0 16px 64px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
}
h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
button { font: inherit; color: inherit; }

/* ---------- masthead ---------- */
.masthead { text-align: center; padding: 56px 0 28px; }
.wordmark {
  font-family: var(--wordmark);
  font-weight: 400;
  font-size: clamp(64px, 14vw, 132px);
  line-height: .9;
  letter-spacing: -.01em;
  text-transform: lowercase;
  margin: 0;
}
.date { margin-top: 14px; color: var(--muted); font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.summary { display: flex; justify-content: center; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 26px; color: var(--muted); font-size: 14px; }
.summary b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sep { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.progress { max-width: 360px; height: 2px; background: var(--line); margin: 18px auto 0; }
.bar { height: 100%; width: 0; background: var(--text); transition: width .4s; }
.actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; background: transparent; color: var(--text); border: 1px solid var(--line-strong);
  padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--text); }
.btn.solid { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.solid:hover { background: #d9d9d9; border-color: #d9d9d9; }
.btn.sm { padding: 6px 13px; font-size: 13px; }
.btn.bare { border-color: transparent; color: var(--muted); padding-inline: 8px; }
.btn.bare:hover { color: var(--text); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.link { background: none; border: none; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: 13px; padding: 0; }
.link:hover { color: var(--text); }

/* ---------- tabs + filters ---------- */
.tabs { display: flex; justify-content: center; gap: 28px; border-bottom: 1px solid var(--line); margin-top: 12px; }
.tab { background: none; border: none; color: var(--muted); padding: 12px 2px; cursor: pointer; font-size: 14px; border-bottom: 1px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }
.search { position: relative; max-width: 420px; margin: 22px auto 0; }
.search svg { position: absolute; left: 14px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 10px 16px 10px 40px; font: inherit; font-size: 14px;
}
.search input::placeholder { color: var(--dim); }
.search input:focus { outline: none; border-color: var(--text); }
.search input::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }

.request { max-width: 520px; margin: 40px auto 0; display: flex; flex-direction: column; gap: 14px; }
.request[hidden] { display: none; }
.request h2 { font-family: var(--wordmark); font-weight: 400; font-size: 44px; line-height: 1; text-align: center; }
.request > p { text-align: center; }
.request form { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.request label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.request input {
  background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 11px 12px; font: inherit; font-size: 14.5px;
}
.request input:focus { outline: none; border-color: var(--text); }
.request input::placeholder, .request textarea::placeholder { color: var(--dim); }
.request textarea { font-family: inherit; font-size: 14.5px; background: transparent; }
.request .btn.solid { align-self: flex-start; }
.req-msg { font-size: 14px; min-height: 20px; }
.req-list { margin-top: 28px; border-top: 1px solid var(--line); }
.req-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.req-item a { color: var(--muted); font-size: 12.5px; word-break: break-all; }
.req-status { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.chips { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 18px 0 24px; }
.hint { text-align: center; color: var(--muted); font-size: 13.5px; margin: -8px 0 22px; }
.hint[hidden] { display: none; }
.hint .link { font-size: inherit; color: var(--text); }

/* every button and control is lowercase; game names and captions keep their capitalization */
.btn, .tab, .chip, .link, .corner, .toast-action { text-transform: lowercase; }
.chip { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); padding: 0 1px 1px 0; }
.card { position: relative; background: var(--bg); border: 1px solid var(--line); margin: 0 -1px -1px 0; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-height: 196px; }
.card-top { padding-right: 30px; }
.corner {
  position: absolute; top: 12px; right: 12px; z-index: 1;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--dim);
  font-size: 18px; font-weight: 300; line-height: 1; cursor: pointer; transition: color .15s, border-color .15s;
}
.corner:hover { color: var(--text); border-color: var(--line-strong); }
.card.done .logo, .card.done .titles, .card.done .desc { opacity: .45; }
.card-top { display: flex; align-items: center; gap: 14px; }
.logo { width: 48px; height: 48px; border-radius: 11px; object-fit: cover; flex: none; background: #fff; }
.titles { flex: 1; min-width: 0; }
.titles h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; margin-top: 2px; }
.pin { background: none; border: none; cursor: pointer; padding: 6px; color: var(--dim); font-size: 13px; }
.pin:hover { color: var(--text); }
.pin.on { color: var(--text); }
.desc { color: var(--muted); font-size: 13.5px; }
.status { font-size: 13.5px; min-height: 20px; font-variant-numeric: tabular-nums; color: var(--muted); }
.result { color: var(--text); font-weight: 600; }
.result::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--text); border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.running { color: var(--text); }
.running::before { content: ""; display: inline-block; width: 7px; height: 7px; border: 1px solid var(--text); border-radius: 50%; margin-right: 8px; vertical-align: 0; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.tag { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.card-actions { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.empty { grid-column: 1 / -1; text-align: center; padding: 56px 16px; color: var(--muted); background: var(--bg); }

/* ---------- dialogs ---------- */
dialog { border: 1px solid var(--line-strong); border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .75); }
#shareDlg { width: min(820px, calc(100vw - 32px)); }
.dlg { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
textarea { width: 100%; font: 13.5px/1.45 ui-monospace, Menlo, monospace; background: var(--bg); color: var(--text); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--text); }
.detect { min-height: 20px; font-size: 14px; }
.row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.row.left { justify-content: flex-start; }
.label { color: var(--muted); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }

.kv { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.kv div { padding: 12px 8px; text-align: center; border-right: 1px solid var(--line); }
.kv div:last-child { border-right: none; }
.kv b { display: block; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv span { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dot { width: 20px; height: 20px; border-radius: 4px; border: 1px solid var(--line-strong); }
.dot.hit { background: var(--text); border-color: var(--text); }
.dot.miss { background: repeating-linear-gradient(45deg, var(--line-strong) 0 2px, transparent 2px 5px); }
.similar { display: flex; flex-direction: column; border: 1px solid var(--line); }
.similar-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.similar-item:last-child { border-bottom: none; }
.similar-item .logo { width: 32px; height: 32px; border-radius: 8px; }
.similar-item .grow { flex: 1; min-width: 0; }
pre.raw { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0; white-space: pre-wrap; font-size: 13px; max-height: 180px; overflow: auto; }

.share-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.share-wrap img { width: 100%; border: 1px solid var(--line); border-radius: 12px; display: block; }

#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 16px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 10; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-action { background: none; border: none; color: var(--bg); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; margin-left: 12px; padding: 0; cursor: pointer; }

.complete { text-align: center; padding: 6px 0 4px; }
.complete .label { text-transform: none; letter-spacing: .04em; font-size: 13px; }
.complete h2 { font-family: var(--wordmark); font-weight: 400; font-size: 44px; line-height: 1; margin: 2px 0 8px; }

@media (max-width: 640px) {
  .masthead { padding-top: 40px; }
  .share-wrap { grid-template-columns: 1fr; }
  .kv { grid-template-columns: repeat(2, 1fr); }
  .kv div:nth-child(2) { border-right: none; }
  .kv div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .grid { grid-template-columns: 1fr; }
}
