/* Mini SweeperCreeper: SweeperCreeper's board (felt, indigo tile backs with a thick bottom
   lip, cream dug-out faces, Press Start 2P for the logo and the board's digits only) under
   the kit's glass chrome: the bars, buttons, card and pills are glass over the felt. */
@font-face { font-family: "Press Start 2P"; src: url(press-start-2p.woff2) format("woff2"); font-display: swap; }
:root {
  --bg: #101014; --bg-2: #14141b; --surface: #1e1e27; --surface-2: #26262f; --line: rgba(255, 255, 255, .14);
  --text: #f4efe6; --muted: #c4bcab; --accent: #ffb300; --accent-ink: #1a1200;
  --green: #2fbf71; --red: #e5484d; --cyan: #3fd6de;
  --pix: "Press Start 2P", ui-monospace, monospace;
  --felt-a: #1b432e; --felt-b: #153323; --felt-c: #0e2216;
  --back-a: #33439a; --back-b: #232f6e; --back-line: #0d1230;
  --face: #efe8d4; --face-deep: #d6ccb0; --face-line: #a89d7f;
  --glass-solid: rgba(14, 34, 24, .55);
  --scene: radial-gradient(ellipse 75% 60% at 50% 40%, var(--felt-a), var(--felt-b) 55%, var(--felt-c));
  --cell: 44px; --gap: 4px;
}
.card .contact-hero { padding-top: 34px; }

/* Tokens are little tiles here: a cream face with the build's number in its stack colour. */
.tok { border-radius: 22%; background: linear-gradient(145deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35), 0 0 0 2px #000; }
.tok b { border-radius: 20%; width: 64%; height: 64%; font: 400 11px/1 var(--pix); color: #111; background: var(--face); }
.tok.gold { background: linear-gradient(145deg, #ffd54f, #ffb300); }
.tok.gold b { width: 62%; height: 62%; font-size: 0; color: transparent; background: var(--star) center / contain no-repeat; image-rendering: pixelated; }

/* ---- Header ---- */
.brand { font: 400 14px/1 var(--pix); letter-spacing: 0; gap: 10px; }
.brand-t { display: inline-flex; gap: 0; }
.b-mini { margin-right: .6em; }
.b-sweep { color: var(--accent); }
.b-creep { color: var(--green); }
.eyebrow { color: var(--accent); font-family: var(--sans); }
.browse h2 { font: 400 clamp(17px, 3vw, 26px)/1.45 var(--pix); letter-spacing: 0; }
.bitem h3 { font-weight: 700; }
/* Phones: SweeperCreeper's stacked logo, "Mini" left to screen readers. */
@media (max-width: 560px) {
  .brand { font-size: 10px; gap: 7px; }
  .brand-t { display: grid; line-height: 1.25; }
  .b-mini { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (max-width: 400px) { .bar .app-icon { display: none; } }
/* Under 360px the title is left to screen readers (as in the other games); the logo stays. */
@media (max-width: 359px) { .bar .app-icon { display: block; } }

/* ---- The felt and the board ---- */
.stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 8px max(6px, env(safe-area-inset-right)) 10px max(6px, env(safe-area-inset-left));
  touch-action: manipulation;
}
.status { flex: none; display: flex; gap: 10px; align-items: center; justify-content: center; font: 400 12px/1 var(--pix); color: var(--text); }
.status > span { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 6px 11px; }
.status b { font-weight: 400; }
.lives i { width: 16px; height: 14px; background: var(--heart) center / contain no-repeat; image-rendering: pixelated; }
.lives i.gone { opacity: .22; filter: grayscale(1); }
.mini-tok { width: 14px; height: 14px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 0 2px #000; }
.mini-creep { width: 16px; height: 16px; background: var(--creeper) center / contain no-repeat; image-rendering: pixelated; }
.board-zone {
  flex: none; padding: 4px; border-radius: 20px; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)), rgba(0, 0, 0, .26);
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-rim), 0 20px 44px -18px rgba(0, 0, 0, .75);
}
.board { display: grid; }
.board [role="row"] { display: contents; }
/* The whole pitch is the tap target; the tile is drawn inside it. */
.board [role="gridcell"] { display: block; width: var(--pitch); height: var(--pitch); padding: calc(var(--gap) / 2); cursor: pointer; }
.cell {
  width: 100%; height: 100%; padding: 0; margin: 0; position: relative; display: grid; place-items: center; cursor: pointer;
  border-radius: calc(var(--cell) * .14); font: 400 calc(var(--cell) * .42)/1 var(--pix); color: inherit;
  background: linear-gradient(145deg, var(--back-a), var(--back-b)); border: 2px solid var(--back-line); border-bottom-width: 4px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .14); -webkit-tap-highlight-color: transparent;
}
.cell::after { content: ""; position: absolute; inset: 22%; border: 2px solid rgba(255, 255, 255, .13); border-radius: 20%; pointer-events: none; }
@media (hover: hover) { .cell.covered:hover { filter: brightness(1.25); } }
.cell.covered:active { transform: translateY(2px); border-bottom-width: 2px; }
.cell:focus-visible { outline: 3px solid var(--cyan); outline-offset: 1px; z-index: 2; }
.cell.open {
  cursor: default; overflow: hidden; border: 2px solid var(--face-line);
  background: radial-gradient(ellipse at 50% 38%, var(--face) 0%, var(--face) 48%, var(--face-deep) 100%);
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, .22), inset 0 -1px 0 rgba(255, 255, 255, .55);
  animation: cellPop .24s cubic-bezier(.3, 1.4, .5, 1) backwards; animation-delay: var(--d, 0s);
}
.cell.open::after { display: none; }
.cell.n1 { color: #1660d0; } .cell.n2 { color: #1e7d32; } .cell.n3 { color: #d02f2f; } .cell.n4 { color: #6a1fb5; }
.cell.n5 { color: #a34700; } .cell.n6 { color: #0e7490; } .cell.n7 { color: #ad1457; } .cell.n8 { color: #37474f; }
.cell .num { animation: numPop .3s cubic-bezier(.34, 1.56, .64, 1) backwards; animation-delay: calc(var(--d, 0s) + .09s); }
@keyframes cellPop {
  0% { transform: scale(.55, 1.28); filter: brightness(1.9); }
  40% { transform: scale(1.16, .88); filter: brightness(1.25); }
  72% { transform: scale(.97, 1.04); }
  100% { transform: scale(1); filter: brightness(1); }
}
@keyframes numPop { 0% { transform: scale(0); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* A flag: a pixel pennant on the tile back. */
.cell.flag::before { content: ""; width: 56%; height: 56%; background: var(--flag) center / contain no-repeat; image-rendering: pixelated; animation: plant .15s ease-out; }
@keyframes plant { from { transform: scale(1.6); } }
/* A build glints through its tile once a neighbour is dug out. */
.cell.glint { background: linear-gradient(145deg, #c9a227, #8a6a10); border-color: #3d2e00; }
.cell.glint::after { border-color: rgba(255, 245, 200, .6); animation: glint 1.6s ease-in-out infinite; }
@keyframes glint { 50% { border-color: rgba(255, 255, 255, .95); box-shadow: 0 0 10px rgba(255, 220, 120, .9); } }
.cell.glint.flag { background: linear-gradient(145deg, var(--back-a), var(--back-b)); border-color: var(--back-line); }
.cell.glint.flag::after { animation: none; }
/* A found build: its tile shows the build's token, and its creeper count in a corner. */
.cell.build { background: radial-gradient(ellipse at 50% 38%, #fff8e1, #ffe7a3 60%, #f2c95c); border-color: #b8860b; }
.cell.build .tok { width: 70%; height: 70%; border-radius: 22%; }
.cell.build .tok b { font-size: calc(var(--cell) * .2); }
.cell .corner { position: absolute; right: 3px; bottom: 2px; font: 400 calc(var(--cell) * .2)/1 var(--pix); }
/* A creeper. */
.cell.creeper { background: #3a1416; border: 2px solid var(--red); }
.cell.creeper::before { content: ""; width: 70%; height: 70%; background: var(--creeper) center / contain no-repeat; image-rendering: pixelated; }
.cell.boom { background: var(--red); border-color: #7e1216; animation: boom .45s ease-out; }
@keyframes boom { 0%, 60% { transform: scale(1.18) rotate(-5deg); } 30% { transform: scale(1.24) rotate(6deg); } 100% { transform: scale(1); } }
.cell.shown { animation: mineIn .3s cubic-bezier(.3, 1.4, .5, 1) backwards; animation-delay: var(--d, 0s); }
@keyframes mineIn { 0% { transform: scale(.4); filter: brightness(2.2); } 55% { transform: scale(1.15); } 100% { transform: scale(1); filter: brightness(1); } }
.cell.wrong { background: #6e3b00; }
.board.dying .cell:not(.creeper):not(.build) { filter: grayscale(.85) brightness(.62); transition: filter .45s; }
.stage.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }

/* ---- HUD ---- */
.flag-btn { flex: none; gap: 8px; }
.flag-btn .flag-ico { width: 18px; height: 18px; background: var(--flag) center / contain no-repeat; image-rendering: pixelated; }
.flag-btn[aria-pressed="true"] { background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 55%), var(--accent); color: var(--accent-ink); border-color: rgba(255, 255, 255, .3); }
.tray-empty { font-size: 13px; }
.toast { top: auto; bottom: 14px; }
