:root {
  --bg: #f5f6f1;
  --card: #ffffff;
  --ink: #141813;
  --muted: #6c7268;
  --line: #e1e4db;
  --lcd: #c7f0d8;
  --lcd-ink: #43523d;
  --olive: #1b2218;
  --r: 10px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px 40px; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; height: 76px; border-bottom: 1px solid var(--line); }
.logo { font-weight: 800; font-size: 30px; letter-spacing: -0.04em; text-decoration: none; }
.logo i { font-style: normal; color: var(--lcd-ink); }
nav { display: flex; align-items: center; gap: 18px; }
.link { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 14px; }
.link:hover { color: var(--ink); }
.icon-link { display: inline-flex; color: var(--ink); }
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; font-weight: 500;
}
.btn-outline:hover { border-color: #c9cdc2; }
.btn-outline.small { height: 34px; padding: 0 12px; font-size: 13px; }

/* coin banner */
.coin {
  margin-top: 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px;
  padding: 18px 20px; border-radius: 14px; background: var(--olive); color: #eef4ec;
  box-shadow: inset 0 0 0 1px rgba(199, 240, 216, 0.08);
}
.coin-pfp { width: 72px; height: 72px; border-radius: 12px; display: block; }
.coin-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.coin-stat { font-size: 14px; font-weight: 500; color: #a9c2ae; letter-spacing: 0; }
.ca-row {
  margin-top: 10px; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 6px 6px 6px 12px; border: 1px dashed rgba(199, 240, 216, 0.35); border-radius: 8px;
}
.ca-label { font-size: 12px; font-weight: 600; color: #a9c2ae; }
.ca { font: 500 14px var(--mono); color: var(--lcd); overflow-wrap: anywhere; flex: 1; min-width: 0; user-select: all; }
.copy {
  flex: none; height: 30px; padding: 0 12px; border-radius: 6px; border: 0;
  background: rgba(199, 240, 216, 0.14); color: var(--lcd); font-size: 13px; font-weight: 600;
}
.copy:hover { background: rgba(199, 240, 216, 0.24); }
.coin-actions { display: flex; flex-direction: column; gap: 8px; }
.btn-lcd, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 18px;
  border-radius: var(--r); font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.btn-lcd { background: var(--lcd); color: var(--olive); }
.btn-lcd:hover { background: #d9f7e5; }
.btn-ghost { border: 1px solid rgba(199, 240, 216, 0.3); color: #dfeee2; }
.btn-ghost:hover { border-color: rgba(199, 240, 216, 0.6); }

/* lede */
.lede { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 26px 0 18px; border-bottom: 1px solid var(--line); }
.lede h1 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.how2 { display: none; margin-left: 14px; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.free { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0; }
.play { padding: 22px 28px 26px 0; border-right: 1px solid var(--line); min-width: 0; }
.k { font-size: 12px; font-weight: 500; color: var(--muted); }
.sub { color: var(--muted); font-size: 13px; margin: 2px 0 0; }
.stats { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.stats .right { text-align: right; }
.pool { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pool-sym { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.timer { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* the LCD in its bezel */
.screen {
  padding: 14px; border-radius: 18px;
  background: linear-gradient(180deg, #3a3f3a, #252925);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2);
}
.lcd {
  border-radius: 8px; overflow: hidden; line-height: 0; display: flex; justify-content: center;
  background: #b4dec6; box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  touch-action: none;
}
.lcd canvas { display: block; image-rendering: pixelated; }

.controls { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 16px; }
.keypad { display: none; grid-template-columns: repeat(3, 64px); gap: 8px; }
.keypad button {
  height: 46px; border-radius: 14px 14px 18px 18px; border: 1px solid var(--line); background: var(--card);
  font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 2px 0 #d7dbd0; -webkit-tap-highlight-color: transparent; user-select: none;
}
.keypad button small { font-size: 10px; color: var(--muted); }
.keypad button.dim { color: #b5bab0; }
.keypad button:active, .keypad button.on { transform: translateY(2px); box-shadow: none; background: #eef1ea; }
.play-side { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.btn-play {
  height: 46px; padding: 0 22px; border-radius: var(--r); border: 0; background: var(--ink); color: #fff;
  font-weight: 600; font-size: 15px;
}
.btn-play:hover { background: #2a3028; }
.btn-play:disabled { opacity: 0.5; cursor: default; }
.mute { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 6px 0; }
.status { margin: 16px 0 0; font-weight: 500; }
.status.bad { color: #9b2c1f; }
.hint { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.mine { display: flex; gap: 28px; margin-top: 18px; font-size: 13px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.mine b { color: var(--ink); margin-left: 8px; font-weight: 600; }
.note { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* leaderboard */
.board { padding: 22px 0 22px 26px; min-width: 0; }
.board-head { display: flex; align-items: center; justify-content: space-between; }
.board-head h2 { display: inline; margin: 0 10px 0 0; font-size: 20px; letter-spacing: -0.02em; }
.board .sub { margin: 8px 0 14px; }
.rows-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rows { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
.rows li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.addr { font: 500 13px var(--mono); }
.rows li .w { display: flex; gap: 14px; color: var(--ink); }
.rows li .n { color: var(--muted); width: 18px; }
.rows li b { font-weight: 600; }
.rows li.me { background: linear-gradient(90deg, rgba(199, 240, 216, 0.55), transparent); }
.rows li.cut { border-bottom: 1px dashed var(--lcd-ink); }
.rows li.inel .w { color: var(--muted); }
.rows li .tag { font-size: 10px; color: var(--muted); }
.rows .empty { color: var(--muted); font-family: Inter, sans-serif; justify-content: center; padding: 28px 0; }
.cutoff { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--muted); margin: 12px 0 0; }
.cutoff i { width: 6px; height: 6px; border-radius: 50%; background: var(--lcd-ink); }

/* past rounds */
.past { border-top: 1px solid var(--line); padding-top: 22px; }
.past h2 { font-size: 18px; margin: 0 0 12px; letter-spacing: -0.02em; }
.past-round { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); margin-bottom: 10px; }
.past-round summary { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; cursor: pointer; list-style: none; font-size: 14px; }
.past-round summary::-webkit-details-marker { display: none; }
.past-round summary span:last-child { font-size: 13px; color: var(--muted); }
.past-round ol { margin: 0; padding: 0 14px 12px; list-style: none; font-size: 13px; font-variant-numeric: tabular-nums; }
.past-round li { display: flex; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--line); }

footer { margin-top: 36px; color: var(--muted); font-size: 12px; max-width: 760px; }

/* dialogs */
dialog { border: 0; border-radius: 14px; padding: 22px 24px; max-width: 520px; width: calc(100% - 32px); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
dialog::backdrop { background: rgba(20, 24, 19, 0.45); }
dialog p { font-size: 14px; color: #3d433b; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h3 { margin: 0; font-size: 18px; }
.x { background: none; border: 0; font-size: 24px; line-height: 1; color: var(--muted); }
.wallet-list { display: grid; gap: 8px; margin: 16px 0 8px; }
.wallet-list button, .wallet-list a {
  display: flex; align-items: center; justify-content: space-between; height: 48px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); font-weight: 600; text-decoration: none;
}
.wallet-list button:hover, .wallet-list a:hover { border-color: #c9cdc2; }
.wallet-list span { color: var(--muted); font-weight: 400; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; transition: 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (pointer: coarse), (max-width: 760px) {
  .keypad { display: grid; }
  .hint { display: none; }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .play { padding-right: 0; border-right: 0; }
  .board { padding-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .wrap { padding: 0 16px 32px; }
  .top { height: 64px; }
  .logo { font-size: 26px; }
  nav { gap: 12px; }
  #howBtn { display: none; }
  .how2 { display: inline; }
  .coin { grid-template-columns: auto 1fr; gap: 14px; padding: 16px; }
  .coin-pfp { width: 56px; height: 56px; }
  .coin-title { font-size: 18px; }
  .ca-row { grid-column: 1 / -1; margin-top: 0; }
  .coin-main { display: contents; }
  .coin-actions { grid-column: 1 / -1; flex-direction: row; }
  .coin-actions a { flex: 1; }
  .lede { flex-direction: column; gap: 4px; padding-top: 20px; }
  .lede h1 { font-size: 20px; }
  .screen { padding: 9px; border-radius: 14px; }
  .controls { flex-direction: column; align-items: stretch; }
  .keypad { grid-template-columns: repeat(3, 1fr); width: 100%; max-width: 300px; margin: 0 auto; }
  .play-side { margin-left: 0; justify-content: space-between; }
  .btn-play { flex: 1; }
  .timer { font-size: 20px; }
  .pool { font-size: 26px; }
}
