/* MemoryLeak Daily – shared look for the hub and every Daily game.
   Studio rules: square corners, 3px black outlines, hard offset shadows, flat colour, Rubik. */
:root {
  --paper: #FAF7F0; --beige: #EFE7D3; --slate: #4C5966; --slate-dark: #2C343D; --ink: #1E2328; --ink-soft: #4A4F55;
  --sunny: #FFC845; --sky: #3DA5F4; --coral: #FF6B57; --grape: #7A5CFF; --glow: #80FF84; --slime-dark: #1D6831;
  --accent: var(--sunny);
  --border: 3px solid #000; --shadow: 5px 5px 0 #000; --shadow-sm: 3px 3px 0 #000;
  --font: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); font: 400 1rem/1.45 var(--font);
  padding-bottom: env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }
canvas.sprite { image-rendering: pixelated; display: block; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.01em; margin: 0; line-height: 1.08; }
a { color: inherit; }

/* ---- Daily header ---- */
.daily-head {
  display: flex; align-items: center; gap: 12px; padding: 6px max(16px, env(safe-area-inset-left));
  background: var(--accent); border-bottom: var(--border);
}
.daily-brand { display: flex; align-items: center; gap: 10px; color: #000; text-decoration: none; min-width: 0; }
.daily-brand canvas { flex: none; }
.daily-brand b { font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.daily-brand small { display: block; font-weight: 500; font-size: .8rem; line-height: 1.1; }
.head-buttons { margin-left: auto; display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; padding: 0; font: 700 1.05rem/1 var(--font); color: #000;
  background: #fff; border: var(--border); border-radius: 0; box-shadow: var(--shadow-sm); cursor: pointer;
}
.icon-btn:active { transform: translate(3px, 3px); box-shadow: none; }

main { flex: 1; width: 100%; max-width: 920px; margin: 0 auto; padding: 20px 16px 28px; }
.screen { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.kicker { margin: 0 0 6px; font-weight: 700; color: var(--ink-soft); font-size: .95rem; }
.fine { margin: 10px 0 0; font-size: .9rem; color: var(--ink-soft); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em; min-height: 48px; padding: .6em 1.2em;
  font: 700 1.05rem/1.1 var(--font); color: #000; text-decoration: none; text-align: center;
  background: #fff; border: var(--border); border-radius: 0; box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform .08s, box-shadow .08s;
}
.btn.primary { background: var(--accent); font-size: 1.15rem; }
.btn.small { min-height: 44px; padding: .5em .9em; font-size: .95rem; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn:focus-visible, .icon-btn:focus-visible, .link:focus-visible, .daily-brand:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.link { background: none; border: 0; padding: 4px 2px; font: 500 .95rem var(--font); color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.status { min-height: 1.4em; margin: 8px 0 0; font-weight: 500; color: var(--slime-dark); }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; }
.stats div { padding: 8px 6px; text-align: center; background: #fff; border: var(--border); }
.stats dt { font-size: .8rem; font-weight: 500; color: var(--ink-soft); }
.stats dd { margin: 0; font-weight: 800; font-size: 1.5rem; line-height: 1.1; }
.spread { display: grid; gap: 4px; margin-top: 12px; }
.spread div { display: grid; grid-template-columns: 1.4em 1fr; gap: 6px; align-items: center; font-weight: 700; font-size: .85rem; }
.spread span { display: block; height: 18px; min-width: 22px; padding: 0 5px; text-align: right; line-height: 15px;
  background: var(--beige); border: 2px solid #000; font-size: .75rem; }
.spread .mine span { background: var(--accent); }

.foot { padding: 14px 16px; text-align: center; font-size: .85rem; color: var(--ink-soft); background: var(--beige); border-top: var(--border); }
.foot a { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .btn { transition: none; }
}

/* ---- Short screens (phones held sideways: as little as 700x260, under the 39px arcade bar) ---- */
@media (max-height: 480px) and (min-width: 500px) {
  .daily-head { padding-top: 3px; padding-bottom: 3px; }
  .daily-brand b { font-size: 1rem; }
  .daily-brand small { display: inline; margin-left: 6px; }
  .icon-btn { width: 32px; height: 32px; font-size: .9rem; box-shadow: 2px 2px 0 #000; }
  main { padding: 8px 16px 12px; }
  .btn { min-height: 42px; }
  .btn.primary { font-size: 1.05rem; }
  .foot { padding: 8px 16px; }
}
