:root {
  --bg: #0a0a0a;
  --panel: #151515;
  --yellow: #ffee00;
  --red: #f44336;
  --green: #2e7d32;
  --text: #fff8d6;
  --muted: #b8aa6a;
  --line: rgba(255, 238, 0, 0.22);
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background: var(--bg);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0 auto;
  max-width: 480px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 80% 0%, rgba(255, 238, 0, 0.18), transparent 42%),
    radial-gradient(circle at 10% 30%, rgba(244, 67, 54, 0.12), transparent 40%),
    var(--bg);
  touch-action: manipulation;
  overflow-x: hidden;
}
header {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px 6px;
}
.mark { width: 48px; height: 48px; border-radius: 12px; }
header strong { display: block; }
header span { color: var(--yellow); font-size: 13px; }
nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 8px 10px;
}
nav button, .primary, #pauseBtn, #againBtn, #homeBtn, #resumeBtn {
  border: 0;
  min-height: 42px;
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}
nav button.on, .primary { background: var(--yellow); color: #111; font-weight: 700; }
main { padding: 8px 14px 24px; }
.hero { text-align: center; padding: 18px 8px; }
.hero img { width: 120px; height: 120px; object-fit: contain; }
.hero h1 { margin: 8px 0 4px; color: var(--yellow); }
.stat { color: var(--muted); }
.primary { width: 100%; max-width: 280px; margin: 12px auto; display: block; }
.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}
#pauseBtn { padding: 0 12px; min-height: 34px; background: var(--red); }
.play {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  touch-action: none;
  user-select: none;
}
#game {
  width: 100%;
  display: block;
  border-radius: 16px;
  background: #111;
  box-shadow: inset 0 0 0 2px var(--yellow);
  touch-action: none;
}
.pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 360px;
  margin: 10px auto 0;
}
.pad button {
  border: 0;
  min-height: 52px;
  border-radius: 14px;
  font-size: 22px;
  background: var(--panel);
  color: var(--yellow);
  box-shadow: inset 0 0 0 1px var(--line);
}
.hint { text-align: center; color: var(--muted); font-size: 12px; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.72);
  padding: 20px;
}
.overlay[hidden] { display: none !important; }
.sheet {
  width: min(100%, 320px);
  background: var(--panel);
  border-radius: 18px;
  padding: 18px;
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid;
  gap: 8px;
}
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile {
  background: var(--panel);
  border-radius: 14px;
  padding: 12px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.tile img { width: 40px; height: 40px; object-fit: contain; }
.tile small { display: block; color: var(--muted); }
.tile b { font-size: 22px; color: var(--yellow); }
.rules { padding-left: 18px; color: var(--muted); line-height: 1.5; }
.icons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
  margin-top: 12px;
}
.icons img { width: 56px; height: 56px; object-fit: contain; }
.icons figcaption { font-size: 11px; color: var(--muted); }
.switch { display: flex; gap: 8px; align-items: center; margin: 12px 0; }
.muted { color: var(--muted); font-size: 13px; }
