/* Minute Cryptic-style structure — chunky ink outlines, hard offset shadows,
   pastel pills, rounded cards — on our own butter-yellow palette. */
:root {
  --field: #c5ecd6;
  --card: #ffffff;
  --card-tint: #eafbf1;
  --ink: #1d2b23;
  --mut: #7d968a;
  --accent: #ffd9a0;
  --good: #8fdd8f;
  --radius: 16px;
  --border: 2.5px solid var(--ink);
  --shadow: 0 4px 0 var(--ink);
  --shadow-sm: 0 3px 0 var(--ink);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--field);
  color: var(--ink);
  font-family: "Quicksand", -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
}

.serif-i { font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 700; }

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 20px 80px; }

/* ---------- header ---------- */
.masthead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.brand {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 900;
  font-size: 27px;
  letter-spacing: -0.02em;
  background: var(--accent);
  border: var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 2px 16px 5px;
}
.streak-pill {
  font-weight: 700;
  font-size: 14px;
  background: var(--card);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  padding: 7px 16px;
}

/* ---------- today card ---------- */
.today-card {
  background: var(--card-tint);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 24px 20px 22px;
  margin-bottom: 30px;
}
.today-card h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.today-card p { color: var(--mut); font-weight: 600; font-size: 14px; margin-top: 6px; }

/* ---------- sections ---------- */
.section-label {
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 16px;
  margin: 26px 2px 12px;
}

.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.game-card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 16px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.06s ease;
  text-align: left;
  font: inherit;
  color: inherit;
}
.game-card:hover { transform: translateY(-2px); }
.game-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.game-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.game-head { display: flex; align-items: center; gap: 10px; }
/* clean colored squircle avatar with the logo tucked in the bottom-right corner */
.game-ava {
  width: 34px; height: 34px; flex: none;
  border: 2px solid var(--ink);
  border-radius: 10px;
  position: relative;
}
.logo-badge {
  position: absolute; right: -5px; bottom: -5px;
  width: 17px; height: 17px;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  padding: 2px;
}
.logo-badge img { width: 100%; height: 100%; object-fit: contain; }
.game-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.01em; }
.game-src { font-size: 11.5px; font-weight: 700; color: var(--mut); }
.game-blurb { font-size: 12.5px; color: var(--mut); font-weight: 600; margin-top: 4px; }

.game-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.game-times {
  font-family: "Chivo Mono", monospace;
  font-size: 11.5px; font-weight: 500; color: var(--mut);
  font-variant-numeric: tabular-nums;
}
.game-times b { color: var(--ink); font-weight: 700; }

.badge-done {
  font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 700;
  font-size: 12.5px;
  background: var(--good);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.badge-clear {
  font-family: "Quicksand", sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
}
.badge-clear:hover { opacity: 1; }

/* ---------- pill buttons ---------- */
.pill {
  font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 700;
  font-size: 15px;
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  padding: 6px 22px 8px;
  cursor: pointer;
  background: var(--card);
  color: var(--ink);
  transition: transform 0.06s ease;
}
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: translateY(2px); box-shadow: none; }
.pill-accent { background: var(--accent); }
.pill-good { background: var(--good); }
.pill-sm { font-size: 13px; padding: 4px 16px 6px; box-shadow: 0 2.5px 0 var(--ink); }

/* ---------- play view ---------- */
.play-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1080px; margin: 0 auto; padding: 14px 20px;
}
.play-title { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 17px; }
.play-src { font-size: 11.5px; color: var(--mut); font-weight: 700; }
.back-btn {
  font-size: 18px; font-weight: 700; line-height: 1;
  background: var(--card); border: var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 6px 12px 8px; cursor: pointer; color: var(--ink);
}
.back-btn:active { transform: translateY(2px); box-shadow: none; }
.timer {
  font-family: "Chivo Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 21px;
  background: var(--card); border: var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 5px 16px 7px;
}
.timer .tenth { font-size: 14px; color: var(--mut); }

.stage { max-width: 1080px; margin: 4px auto 0; padding: 0 20px 28px; }
.stage-frame {
  width: 100%; height: calc(100vh - 128px); min-height: 480px;
  background: var(--card);
  border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stage-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

.external-note {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; height: 100%; text-align: center; padding: 24px;
}
.external-note h2 { font-size: 22px; font-weight: 700; }
.external-note p { color: var(--mut); font-weight: 600; font-size: 14.5px; max-width: 46ch; }
.external-ava {
  width: 60px; height: 60px; border: 2.5px solid var(--ink); border-radius: 16px;
  position: relative; margin-bottom: 6px;
}
.external-ava .logo-badge { width: 28px; height: 28px; right: -7px; bottom: -7px; }

/* ---------- filed modal ---------- */
.filed-overlay {
  position: fixed; inset: 0; background: rgba(41, 32, 24, 0.4);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.filed-card {
  background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center;
  padding: 28px 36px 24px; max-width: 340px; width: calc(100% - 48px);
}
.filed-card h2 { font-family: "Fraunces", Georgia, serif; font-style: italic; font-size: 19px; }
.filed-card.pb h2 { background: var(--accent); border-radius: 10px; padding: 2px 10px 4px; display: inline-block; }
.filed-streak { font-weight: 700; font-size: 13.5px; margin-bottom: 16px; }

/* ---------- did-you-finish popup ---------- */
.ask-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.ask-actions .pill { width: 100%; }
.ask-sub { color: var(--mut); font-weight: 600; font-size: 13.5px; margin-top: 6px; }
.big-time {
  font-family: "Chivo Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 42px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 2px;
}
.filed-note { color: var(--mut); font-weight: 600; font-size: 13.5px; margin-bottom: 18px; }

@media (prefers-reduced-motion: no-preference) {
  .filed-card { animation: filed-in 0.2s cubic-bezier(0.2, 0.9, 0.3, 1.25); }
  @keyframes filed-in {
    from { transform: translateY(12px) scale(0.96); opacity: 0; }
    to { transform: none; opacity: 1; }
  }
}

/* ---------- search ---------- */
.search-input {
  width: 100%; font: inherit; font-size: 15px; font-weight: 600;
  background: var(--card); color: var(--ink);
  border: var(--border); border-radius: 12px; box-shadow: var(--shadow-sm);
  padding: 11px 16px; margin-bottom: 6px; outline: none;
}
.search-input::placeholder { color: var(--mut); font-weight: 600; }
.search-input:focus { box-shadow: 0 0 0 3px var(--accent); }
.no-results {
  grid-column: 1 / -1;
  background: var(--card-tint); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  font-weight: 600; font-size: 13.5px; color: var(--mut); text-align: center;
}

/* ---------- most popular strip ---------- */
.featured-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr);
  gap: 12px; overflow-x: auto;
  /* top/bottom padding so the hover lift + offset shadow aren't clipped */
  padding: 6px 2px 12px; margin-bottom: 4px;
  scrollbar-width: thin;
}
.feat-card {
  background: var(--card);
  border: var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 12px 13px; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  text-align: center; font: inherit; color: inherit; transition: transform 0.06s ease;
}
.feat-card:hover { transform: translateY(-2px); }
.feat-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.feat-card .game-ava { width: 46px; height: 46px; border-radius: 13px; }
.feat-card .logo-badge { width: 22px; height: 22px; right: -6px; bottom: -6px; }
.feat-rank {
  position: absolute; top: 8px; left: 10px;
  font-family: "Chivo Mono", monospace; font-size: 11px; font-weight: 700; color: var(--mut);
}
.feat-name { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.feat-src { font-size: 10.5px; font-weight: 700; color: var(--mut); }
.feat-done {
  font-size: 12px; font-weight: 800; color: #1a7d3c;
  background: var(--good); border: 2px solid var(--ink); border-radius: 999px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
}

/* ---------- decks ---------- */
.decks-head { display: flex; align-items: center; justify-content: space-between; }
.decks-empty {
  background: var(--card-tint); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
  font-weight: 600; font-size: 13.5px; color: var(--mut);
}
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.deck-card {
  background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 15px 16px 13px; cursor: pointer;
  display: flex; flex-direction: column; gap: 9px;
  text-align: left; font: inherit; color: inherit; transition: transform 0.06s ease;
}
.deck-card:hover { transform: translateY(-2px); }
.deck-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.deck-name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.deck-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.deck-dots.center { justify-content: center; margin: 14px 0; }
.deck-dot { width: 17px; height: 17px; border: 1.5px solid var(--ink); border-radius: 5px; }
.deck-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.deck-meta { font-family: "Chivo Mono", monospace; font-size: 11px; color: var(--mut); }
.deck-meta b { color: var(--ink); font-weight: 700; }

/* ---------- deck builder ---------- */
.builder-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.builder-title { font-size: 22px; font-weight: 700; }
.deck-name-input {
  width: 100%; font: inherit; font-size: 17px; font-weight: 700;
  background: var(--card); border: var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 11px 15px; color: var(--ink);
  outline: none;
}
.deck-name-input:focus { box-shadow: 0 0 0 3px var(--accent); }
.deck-error { color: #c0392b; font-weight: 700; font-size: 13px; min-height: 18px; margin: 6px 2px 0; }
.builder-pick-head { display: flex; align-items: baseline; justify-content: space-between; }
.deck-count { font-family: "Chivo Mono", monospace; font-size: 12px; font-weight: 700; color: var(--mut); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.pick-tile {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: var(--border); border-radius: 12px;
  box-shadow: var(--shadow-sm); padding: 10px 12px; cursor: pointer;
  font: inherit; color: inherit; text-align: left; transition: transform 0.06s ease;
}
.pick-tile:active { transform: translateY(2px); box-shadow: none; }
.pick-tile.on { background: var(--good); }
.pick-name { font-size: 13.5px; font-weight: 700; }
.builder-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }

/* ---------- deck detail ---------- */
.detail-meta { font-family: "Chivo Mono", monospace; font-size: 13px; color: var(--mut); margin: -8px 2px 18px; }
.detail-meta b { color: var(--ink); }
.detail-list {
  background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px;
}
.detail-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1.5px dashed var(--field); }
.detail-row:last-child { border-bottom: 0; }
.detail-num { font-family: "Chivo Mono", monospace; font-weight: 700; font-size: 13px; color: var(--mut); width: 16px; }
.detail-main { flex: 1; display: flex; flex-direction: column; }
.detail-name { font-weight: 700; font-size: 15px; }
.detail-src { font-size: 11.5px; font-weight: 700; color: var(--mut); }
.detail-split { font-family: "Chivo Mono", monospace; font-weight: 700; font-size: 13px; }
.start-run { width: 100%; font-size: 17px; padding: 12px 22px; margin-bottom: 14px; }
.detail-actions { display: flex; gap: 12px; }
.detail-actions .pill { flex: 1; }

/* ---------- deck run ---------- */
.run-tag { font-family: "Chivo Mono", monospace; font-size: 11px; font-weight: 700; color: var(--mut); }

.result-wrap { display: flex; justify-content: center; }
.result-card {
  background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center;
  padding: 28px 32px 24px; max-width: 440px; width: 100%; margin-top: 10px;
}
.result-label, .verdict {
  font-family: "Fraunces", Georgia, serif; font-style: italic; font-weight: 700; font-size: 17px;
}
.result-card.pb .result-label { background: var(--accent); border-radius: 10px; padding: 2px 12px 4px; display: inline-block; }
.verdict.win { color: #1a7d3c; }
.verdict.lose { color: #b04a2f; }
.challenge-title { font-size: 26px; font-weight: 700; margin: 6px 0; letter-spacing: -0.01em; }
.splits { margin: 18px 0 16px; border-top: 2px dashed var(--field); }
.split-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px; border-bottom: 1.5px dashed var(--field);
}
.split-name { font-weight: 700; font-size: 13.5px; }
.split-time { font-family: "Chivo Mono", monospace; font-size: 13px; font-weight: 700; }
.share-link-box {
  font-family: "Chivo Mono", monospace; font-size: 10.5px; color: var(--mut);
  background: var(--card-tint); border: 1.5px solid var(--field); border-radius: 8px;
  padding: 8px 10px; word-break: break-all; text-align: left; margin-bottom: 6px;
}

@media (max-width: 560px) {
  .brand { font-size: 22px; }
  .timer { font-size: 17px; }
  .builder-actions { flex-direction: column-reverse; }
  .builder-actions .pill { width: 100%; }
}
