/* Doomsday game — dark navy, lime/orange accents to match the win screen. */
:root {
  --g-bg: #17181f;
  --g-card: #1f2130;
  --g-line: #2b2e40;
  --g-text: #e8eaf2;
  --g-dim: #9aa0b4;
  --g-faint: #5d6377;
  --g-green: #7ed321;
  --g-lime: #84cc16;
  --g-orange: #f5a623;
  --g-red: #ef4444;
  --g-pink: #e35d7c;
  --g-gold: #eab308;
}

body.game-body { background: var(--g-bg); }
body.game-body::before {
  background:
    radial-gradient(900px 380px at 50% -120px, rgba(126, 211, 33, 0.07), transparent 65%),
    radial-gradient(1000px 500px at 90% 110%, rgba(245, 166, 35, 0.05), transparent 60%);
}

.game-wrap { max-width: 720px; margin: 0 auto; padding: 26px 18px 90px; position: relative; z-index: 1; }

/* nav tweak on game page */
body.game-body .nav { border-bottom-color: var(--g-line); }
body.game-body .nav .links a.active { background: rgba(126, 211, 33, 0.14); }

/* ---- HUD ---- */
.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 14px;
}
.hud .cell {
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
}
.hud .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--g-faint); }
.hud .v { font-size: 20px; font-weight: 700; color: var(--g-text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.hud .v.pos { color: var(--g-green); }
.hud .v.neg { color: var(--g-red); }
.hud .v .mult { color: var(--g-orange); font-size: 14px; margin-left: 4px; }
.hud .v.heat-on { color: var(--g-red); animation: heatpulse 0.9s ease-in-out infinite; }
@keyframes heatpulse { 50% { opacity: 0.55; } }

/* ---- difficulty ---- */
.diffrow { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.pill {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--g-dim);
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.pill:hover { color: var(--g-text); border-color: #3a3e55; }
.pill.active { color: #101600; background: var(--g-lime); border-color: var(--g-lime); }
.pill.daily { color: var(--g-orange); border-color: rgba(245, 166, 35, 0.5); }
.pill.daily.active { color: #1a1200; background: var(--g-orange); border-color: var(--g-orange); }
.pill[disabled] { opacity: 0.4; pointer-events: none; }

/* ---- play area ---- */
.play {
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: 16px;
  padding: 30px 26px;
  text-align: center;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}
.play .date-q {
  font-size: clamp(26px, 5.5vw, 40px);
  font-weight: 800;
  color: var(--g-text);
  letter-spacing: 0.01em;
}
.play .date-sub { color: var(--g-faint); font-size: 14px; }
.play .timer { font-size: 15px; color: var(--g-dim); font-variant-numeric: tabular-nums; margin: 6px 0 2px; }

.weekgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 560px) { .weekgrid { grid-template-columns: repeat(2, 1fr); } }
.daybtn {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 700;
  padding: 13px 6px;
  border-radius: 10px;
  border: 1px solid var(--g-line);
  background: #262938;
  color: var(--g-text);
  cursor: pointer;
  transition: transform 0.05s ease, background 0.12s ease, border-color 0.12s ease;
}
.daybtn:hover { background: #2d3143; border-color: #3d425c; }
.daybtn:active { transform: scale(0.97); }
.daybtn .knum { color: var(--g-faint); font-size: 11px; margin-right: 6px; }
.daybtn.wrong-flash { background: rgba(239, 68, 68, 0.25); border-color: var(--g-red); animation: shake 0.3s ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.hintrow { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.hintbtn {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--g-dim);
  background: transparent;
  border: 1px dashed var(--g-line);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
}
.hintbtn:hover { color: var(--g-text); border-color: #3d425c; }
.hintbtn[disabled] { opacity: 0.35; pointer-events: none; }
.hintbtn .cost { color: var(--g-orange); }

.hintbox {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--g-dim);
  background: rgba(126, 211, 33, 0.06);
  border: 1px solid rgba(126, 211, 33, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  display: none;
}
.hintbox.show { display: block; }

/* ---- result (win screen clone) ---- */
.result { display: none; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.result.show { display: flex; }
.result .verdict { font-size: clamp(34px, 7vw, 46px); font-weight: 800; letter-spacing: 0.01em; }
.result .verdict.ok { color: var(--g-green); }
.result .verdict.bad { color: var(--g-red); }
.result .was { color: var(--g-text); font-size: 17px; margin-top: 6px; }
.result .badge {
  display: inline-block;
  background: var(--g-orange);
  color: #171207;
  font-size: 24px;
  font-weight: 800;
  border-radius: 10px;
  padding: 8px 26px;
  margin: 10px 0 4px;
}
.result .secs { color: var(--g-faint); font-size: 14.5px; margin-bottom: 10px; }
.result .earnline { color: var(--g-dim); font-size: 14px; }
.result .earnline b { color: var(--g-green); }
.result .earnline b.neg { color: var(--g-red); }

.achv-card {
  width: 100%;
  max-width: 480px;
  background: var(--g-card);
  border: 1px solid var(--g-line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 12px;
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.achv-card.green { border-color: rgba(126, 211, 33, 0.45); }
.achv-card.pink { border-color: rgba(227, 93, 124, 0.55); }
.achv-card.gold { border-color: rgba(234, 179, 8, 0.55); }
.achv-card .t { font-weight: 800; font-size: 16px; }
.achv-card.green .t { color: var(--g-green); }
.achv-card.pink .t { color: var(--g-pink); }
.achv-card.gold .t { color: var(--g-gold); }
.achv-card .b { color: var(--g-dim); font-size: 13.5px; margin-top: 3px; line-height: 1.5; }
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.result .actions { margin-top: 18px; display: flex; gap: 10px; }
.result .playagain {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  background: var(--g-lime);
  color: #101600;
  border: 0;
  border-radius: 8px;
  padding: 12px 34px;
  cursor: pointer;
}
.result .playagain:hover { background: #93d92b; }
.result .howbtn {
  font-family: var(--mono);
  font-size: 14px;
  background: transparent;
  color: var(--g-dim);
  border: 1px solid var(--g-line);
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
}
.result .howbtn:hover { color: var(--g-text); border-color: #3d425c; }

.how {
  display: none;
  width: 100%;
  max-width: 480px;
  text-align: left;
  background: #14151d;
  border: 1px solid var(--g-line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--g-dim);
}
.how.show { display: block; }
.how .step { margin: 6px 0; }
.how .step b { color: var(--g-text); }

/* toast for penalties */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: #26202a;
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f3b4b4;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  z-index: 99;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  max-width: 90vw;
  text-align: center;
}
.toast.show { opacity: 1; }

/* records strip */
.records { margin-top: 18px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; color: var(--g-faint); font-size: 12.5px; }
.records b { color: var(--g-dim); }

/* ---- phones ---- */
@media (max-width: 560px) {
  .game-wrap { padding: 16px 12px 64px; }

  .hud { gap: 6px; margin: 12px 0 10px; }
  .hud .cell { padding: 8px 4px; border-radius: 8px; }
  .hud .k { font-size: 9.5px; letter-spacing: 0.04em; }
  .hud .v { font-size: 17px; }
  .hud .v .mult { font-size: 12px; margin-left: 2px; }

  .diffrow { gap: 6px; margin: 10px 0; }
  /* these were 30px tall — under the comfortable touch target */
  .pill { font-size: 12px; padding: 9px 13px; min-height: 38px; }

  .play { padding: 20px 14px; min-height: 300px; border-radius: 12px; }
  .play .date-sub { font-size: 13px; }
  .play .timer { font-size: 14px; }

  .weekgrid { gap: 8px; margin-top: 14px; }
  .daybtn { font-size: 13.5px; padding: 12px 4px; }
  .daybtn .knum { margin-right: 4px; }

  .hintrow { gap: 6px; margin-top: 14px; }
  .hintbtn { font-size: 11.5px; padding: 9px 10px; min-height: 34px; }

  .result .was { font-size: 15.5px; }
  .result .badge { font-size: 21px; padding: 7px 20px; }
  .result .secs { font-size: 13.5px; }
  .result .earnline { font-size: 13px; }
  /* side by side these two overflow a 375px screen */
  .result .actions { flex-direction: column; align-items: stretch; width: 100%; gap: 8px; }
  .result .playagain { padding: 13px 20px; }
  .result .howbtn { padding: 11px 18px; }
  .achv-card { padding: 13px 15px; }

  .records { gap: 10px; font-size: 11.5px; }
}
