:root {
  --ink: #101318;
  --paper: #f2e9d6;
  --acid: #b6f23c;
  --portal: #39e66d;
  --cyan: #32d5dc;
  --yellow: #f4da55;
  --purple: #7654a8;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 20%, #363160 0 1px, transparent 2px),
    radial-gradient(circle at 82% 42%, #63528e 0 1px, transparent 2px),
    #16152b;
  background-size: 43px 43px, 61px 61px, auto;
  font-family: "DM Mono", monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  opacity: 0.26;
  background: repeating-linear-gradient(
    103deg,
    transparent 0 78px,
    rgba(255, 255, 255, 0.08) 79px 80px
  );
}

.stars::before,
.stars::after {
  content: "✦  ·  ✧  ·  ✦  ·  ✧";
  position: fixed;
  color: #fff;
  letter-spacing: 28px;
  opacity: 0.5;
  transform: rotate(-8deg);
}

.stars::before {
  top: 10%;
  left: 3%;
}

.stars::after {
  right: 2%;
  bottom: 14%;
}

.portal {
  position: fixed;
  z-index: -1;
  width: 280px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.45;
  filter: blur(1px);
  background:
    radial-gradient(circle, #0d2317 0 26%, transparent 27%),
    repeating-radial-gradient(
      ellipse at 54% 48%,
      var(--acid) 0 7px,
      #28b95b 8px 13px,
      transparent 14px 20px
    );
  box-shadow: 0 0 30px var(--portal);
}

.portal-one {
  top: -85px;
  right: -75px;
  transform: rotate(22deg) scaleY(0.62);
}

.portal-two {
  bottom: -115px;
  left: -95px;
  transform: rotate(-30deg) scaleY(0.58);
}

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 20px;
}

.hero {
  margin-bottom: 24px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border: 2px solid var(--ink);
  background: var(--yellow);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  transform: rotate(-1deg);
  box-shadow: 3px 3px 0 var(--ink);
}

h1 {
  margin: 4px 0 -5px;
  color: var(--cyan);
  font-family: "Bangers", sans-serif;
  font-size: clamp(58px, 9vw, 108px);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 3px var(--ink);
  text-shadow:
    4px 4px 0 #fff,
    7px 7px 0 var(--ink);
}

h1 span {
  color: var(--acid);
}

h1 small {
  color: var(--yellow);
  font-size: 0.3em;
  -webkit-text-stroke: 1.5px var(--ink);
  text-shadow: 2px 2px 0 var(--ink);
}

.tagline {
  margin: 8px 0 0;
  color: #fff;
  font-family: "Bangers", sans-serif;
  font-size: 21px;
  letter-spacing: 0.12em;
  transform: rotate(-1deg);
}

.seo-lede {
  width: min(620px, 92%);
  margin: 12px auto 0;
  color: rgba(242, 233, 214, 0.78);
  font-size: 12px;
  line-height: 1.55;
}

.seo-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
  color: rgba(242, 233, 214, 0.82);
}

.seo-panel article {
  padding: 14px;
  border: 2px solid rgba(182, 242, 60, 0.35);
  background: rgba(16, 19, 24, 0.55);
}

.seo-panel h2 {
  margin: 0 0 8px;
  color: var(--acid);
  font-family: "DM Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.seo-panel p,
.seo-panel li {
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.seo-panel ul {
  margin: 0;
  padding-left: 16px;
}

.seo-panel li + li {
  margin-top: 4px;
}

.game-layout {
  display: grid;
  grid-template-columns: 260px minmax(320px, 560px);
  justify-content: center;
  gap: 28px;
  align-items: start;
}

.card {
  border: var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.briefing {
  margin-top: 68px;
  padding: 18px;
  transform: rotate(-1deg);
}

.speaker,
.instructions span {
  margin: 0 0 5px;
  color: #473b68;
  font-family: "Bangers", sans-serif;
  font-size: 20px;
  letter-spacing: 0.08em;
}

#rick-line {
  min-height: 90px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.instructions {
  margin: 16px -18px -18px;
  padding: 16px 18px;
  border-top: var(--line);
  background: var(--yellow);
}

.instructions p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.5;
}

.character {
  position: relative;
  width: 112px;
  height: 130px;
  margin: -77px auto 12px;
}

.rick-portrait {
  display: block;
  width: 116px;
  height: 116px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 4px 4px 0 var(--ink);
  object-fit: cover;
  object-position: center top;
  transform: rotate(2deg);
}

.character .head {
  position: absolute;
  top: 36px;
  left: 28px;
  width: 60px;
  height: 74px;
  z-index: 2;
  border: 3px solid var(--ink);
  border-radius: 45% 45% 50% 50%;
  background: #b7d7cf;
}

.hair {
  position: absolute;
  top: 0;
  left: 7px;
  width: 102px;
  height: 76px;
  background: #a5e2ed;
  clip-path: polygon(50% 20%, 63% 0, 68% 24%, 92% 12%, 80% 38%, 100% 47%, 76% 57%, 91% 81%, 62% 72%, 50% 100%, 38% 72%, 8% 82%, 24% 56%, 0 44%, 23% 36%, 10% 10%, 38% 25%);
  filter: drop-shadow(2px 2px 0 var(--ink)) drop-shadow(-2px -1px 0 var(--ink));
}

.eye {
  position: absolute;
  top: 25px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}

.eye::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink);
}

.eye.left { left: 11px; }
.eye.right { right: 11px; }

.brow {
  position: absolute;
  top: 18px;
  left: 9px;
  width: 42px;
  border-top: 3px solid var(--ink);
  transform: rotate(5deg);
}

.mouth {
  position: absolute;
  bottom: 13px;
  left: 16px;
  width: 30px;
  height: 10px;
  border-top: 2px solid var(--ink);
  transform: rotate(-4deg);
}

.coat {
  position: absolute;
  bottom: 0;
  left: 12px;
  width: 90px;
  height: 42px;
  border: 3px solid var(--ink);
  background: #fff;
  clip-path: polygon(18% 0, 43% 15%, 50% 100%, 57% 15%, 82% 0, 100% 100%, 0 100%);
}

.score-row {
  display: grid;
  grid-template-columns: 105px 105px 1fr;
  gap: 10px;
  margin-bottom: 13px;
}

.score-box,
.new-game {
  min-height: 54px;
  border: var(--line);
  box-shadow: 3px 3px 0 var(--ink);
}

.score-box {
  display: flex;
  padding: 6px;
  align-items: center;
  flex-direction: column;
  background: var(--paper);
}

.score-box span {
  color: #655881;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.score-box strong {
  font-family: "Bangers", sans-serif;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

button {
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.new-game {
  background: var(--acid);
  font-family: "Bangers", sans-serif;
  font-size: 18px;
  letter-spacing: 0.06em;
}

button:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.mode-console {
  margin-bottom: 13px;
  border: var(--line);
  background: #282441;
  box-shadow: 4px 4px 0 var(--ink);
}

.mode-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper);
}

.mode-heading span {
  font-family: "DM Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.mode-heading small {
  color: #625a78;
  font-size: 10px;
  letter-spacing: 0;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 7px;
}

.mode-toggle {
  min-width: 0;
  cursor: pointer;
}

.mode-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.mode-toggle > span {
  display: flex;
  min-height: 52px;
  padding: 7px 4px 6px;
  border: 2px solid #100f1d;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  background: #51496d;
  color: #f3eefc;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-align: center;
  transition: 120ms ease;
}

.mode-toggle small {
  display: block;
  color: #c8bfd9;
  font-family: "DM Mono", monospace;
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0;
  opacity: 0.95;
}

.mode-toggle input:checked + span small {
  color: #2d3520;
}

.mode-toggle input:checked + span {
  border-color: var(--ink);
  background: var(--acid);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.mode-toggle input:focus-visible + span {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

.mode-status {
  display: flex;
  min-height: 35px;
  padding: 5px 8px;
  border-top: 2px solid var(--ink);
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--yellow);
  font-family: "Bangers", sans-serif;
  font-size: 13px;
  letter-spacing: 0.06em;
}

.mode-status[hidden],
.mode-status [hidden] {
  display: none;
}

#timer-status strong {
  display: inline-block;
  min-width: 25px;
  color: #c43b4e;
  font-size: 19px;
}

#meeseeks-actions {
  display: flex;
  margin-left: auto;
  gap: 5px;
}

#meeseeks-actions button {
  padding: 4px 7px;
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 2px 2px 0 var(--ink);
  font-family: "Bangers", sans-serif;
  font-size: 11px;
}

#meeseeks-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.board-wrap {
  position: relative;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  aspect-ratio: 1;
  padding: 12px;
  border: 4px solid var(--ink);
  background: #463c65;
  box-shadow: 7px 7px 0 var(--ink);
  touch-action: none;
}

.tile {
  display: grid;
  position: relative;
  place-items: center;
  overflow: hidden;
  border: 3px solid var(--ink);
  background: #605779;
  font-family: "Bangers", sans-serif;
  font-size: clamp(28px, 5vw, 52px);
  letter-spacing: 0.02em;
}

.tile:not([data-value="0"]) {
  box-shadow: inset -5px -5px 0 rgba(16, 19, 24, 0.15);
  animation: tile-in 150ms ease-out;
}

.tile:not([data-value="0"])::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

.tile[data-value="0"] { color: transparent; }
.tile[data-value="2"] { background: #d9e9e1; }
.tile[data-value="4"] { background: #a9e1d8; }
.tile[data-value="8"] { background: #58d6c2; }
.tile[data-value="16"] { background: #b5ed52; }
.tile[data-value="32"] { background: #f0e45a; }
.tile[data-value="64"] { background: #f6b94d; }
.tile[data-value="128"] { background: #f58b55; }
.tile[data-value="256"] { background: #ec6577; color: #fff; }
.tile[data-value="512"] { background: #b162ac; color: #fff; }
.tile[data-value="1024"] { background: #7857b8; color: #fff; font-size: clamp(22px, 4vw, 40px); }
.tile[data-value="2048"] {
  color: #fff;
  background: var(--portal);
  font-size: clamp(22px, 4vw, 40px);
  box-shadow: inset -5px -5px 0 rgba(16, 19, 24, 0.18), 0 0 22px var(--acid);
}

.tile.evil-tile {
  border-color: #d8d0ef;
  background:
    linear-gradient(rgba(70, 20, 88, 0.18), rgba(70, 20, 88, 0.65)),
    url("https://rickandmortyapi.com/api/character/avatar/118.jpeg") center / cover;
  box-shadow: inset 0 0 0 5px #6a287f, 0 0 12px #e24dff;
}

.evil-mark {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  z-index: 4;
  padding: 2px;
  border: 2px solid var(--ink);
  background: #c64ddb;
  color: #fff;
  font-family: "Bangers", sans-serif;
  font-size: clamp(8px, 1.3vw, 12px);
  text-align: center;
}

.tile.portal-cell::before {
  content: attr(data-portal);
  position: absolute;
  z-index: 5;
  top: 4px;
  right: 4px;
  display: grid;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  place-items: center;
  background: var(--acid);
  color: var(--ink);
  box-shadow: 0 0 8px var(--portal);
  font-family: "Bangers", sans-serif;
  font-size: 11px;
}

.tile.portal-cell[data-value="0"] {
  background:
    radial-gradient(ellipse, #17271e 0 25%, var(--portal) 28% 39%, var(--acid) 43% 48%, #605779 51%);
}

.mobile-controls button.hint-move {
  background: var(--acid);
  animation: hint-pulse 650ms ease-in-out infinite alternate;
}

.tile-number {
  position: absolute;
  z-index: 4;
  top: 5px;
  left: 7px;
  padding: 1px 4px;
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: clamp(12px, 2vw, 18px);
  line-height: 1;
  transform: rotate(-4deg);
}

.tile-name {
  position: absolute;
  z-index: 4;
  right: 3px;
  bottom: 3px;
  left: 3px;
  padding: 2px 1px 1px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: clamp(6px, 1.15vw, 10px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
  text-transform: uppercase;
}

.tile-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  user-select: none;
  filter: saturate(1.08) contrast(1.04);
}

.tile-face {
  position: relative;
  width: 58%;
  aspect-ratio: 0.88;
  margin-top: -2px;
  border: 3px solid var(--ink);
  border-radius: 46% 46% 50% 50%;
  background: #f0c5a1;
  box-shadow: inset -4px -3px 0 rgba(16, 19, 24, 0.12);
}

.face-eyes::before,
.face-eyes::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 39%;
  width: 21%;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--ink) 0 18%, #fff 20% 100%);
}

.face-eyes::before { left: 17%; }
.face-eyes::after { right: 17%; }

.face-mouth {
  position: absolute;
  bottom: 19%;
  left: 31%;
  width: 38%;
  height: 12%;
  border-bottom: 3px solid var(--ink);
  border-radius: 50%;
}

.face-hair {
  position: absolute;
  z-index: 1;
  top: -8%;
  left: -7%;
  width: 114%;
  height: 46%;
  border: 3px solid var(--ink);
  border-radius: 48% 48% 30% 30%;
  background: #6d3f25;
}

/* Morty */
.tile[data-character="morty"] .face-hair {
  clip-path: polygon(0 60%, 8% 20%, 26% 2%, 72% 0, 94% 24%, 100% 61%, 80% 38%, 60% 48%, 42% 35%, 18% 48%);
}

.tile[data-character="morty"] .face-mouth {
  height: 16%;
  border: 2px solid var(--ink);
  border-top: 0;
  background: #fff;
}

/* Jerry */
.tile[data-character="jerry"] .tile-face { background: #e3b284; }
.tile[data-character="jerry"] .face-hair {
  height: 36%;
  background: #3c2720;
  clip-path: polygon(0 75%, 12% 8%, 32% 25%, 45% 0, 60% 24%, 80% 3%, 100% 74%, 75% 48%, 50% 60%, 25% 45%);
}

.tile[data-character="jerry"] .face-mouth {
  width: 28%;
  left: 36%;
  transform: rotate(8deg);
}

/* Summer */
.tile[data-character="summer"] .face-hair {
  height: 40%;
  background: #e86f37;
  clip-path: polygon(0 80%, 7% 20%, 40% 0, 94% 21%, 100% 80%, 76% 48%, 48% 55%, 20% 42%);
}

.tile[data-character="summer"] .face-extra::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 3%;
  right: -26%;
  width: 35%;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #e86f37;
}

/* Beth */
.tile[data-character="beth"] .face-hair {
  top: -9%;
  left: -12%;
  width: 124%;
  height: 76%;
  border-radius: 45% 45% 18% 18%;
  background: #f2cf45;
  clip-path: polygon(5% 0, 94% 0, 100% 100%, 78% 84%, 70% 32%, 48% 23%, 30% 35%, 23% 88%, 0 100%);
}

/* Mr. Meeseeks */
.tile[data-character="meeseeks"] .tile-face {
  border-radius: 50%;
  background: #60d8ee;
}

.tile[data-character="meeseeks"] .face-hair { display: none; }
.tile[data-character="meeseeks"] .face-mouth {
  left: 25%;
  width: 50%;
  height: 20%;
  border: 2px solid var(--ink);
  border-top: 0;
  background: #fff;
}

.tile[data-character="meeseeks"] .face-extra::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 43%;
  width: 10%;
  height: 22%;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 0 0;
  background: #ef7159;
}

/* Rick */
.tile[data-character="rick-face"] .tile-face,
.tile[data-character="rick-prime"] .tile-face { background: #b8d8cf; }

.tile[data-character="rick-face"] .face-hair,
.tile[data-character="rick-prime"] .face-hair {
  top: -31%;
  left: -30%;
  width: 160%;
  height: 86%;
  border: 0;
  background: #a5e5ee;
  clip-path: polygon(50% 26%, 63% 0, 68% 28%, 95% 12%, 80% 42%, 100% 51%, 76% 60%, 90% 90%, 60% 72%, 50% 100%, 39% 72%, 8% 91%, 25% 59%, 0 48%, 25% 39%, 9% 10%, 39% 28%);
  filter: drop-shadow(2px 1px 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink));
}

.tile[data-character="rick-face"] .face-mouth,
.tile[data-character="rick-prime"] .face-mouth {
  left: 25%;
  width: 50%;
  transform: rotate(-5deg);
}

/* Squanchy */
.tile[data-character="squanchy"] .tile-face {
  border-radius: 42% 42% 48% 48%;
  background: #eab44a;
}

.tile[data-character="squanchy"] .face-hair {
  top: -20%;
  height: 48%;
  border: 0;
  background: #d68b37;
  clip-path: polygon(0 0, 32% 23%, 50% 13%, 70% 23%, 100% 0, 90% 100%, 10% 100%);
  filter: drop-shadow(2px 0 0 var(--ink)) drop-shadow(-2px 0 0 var(--ink));
}

.tile[data-character="squanchy"] .face-mouth {
  left: 24%;
  width: 52%;
  height: 22%;
  border: 2px solid var(--ink);
  background: #fff;
}

/* Birdperson */
.tile[data-character="birdperson"] .tile-face { background: #d8aa73; }
.tile[data-character="birdperson"] .face-hair {
  top: -15%;
  left: -15%;
  width: 130%;
  height: 52%;
  border-radius: 50% 50% 8% 8%;
  background: #4b3b67;
}

.tile[data-character="birdperson"] .face-extra::after {
  content: "";
  position: absolute;
  top: 18%;
  left: -22%;
  width: 144%;
  border-top: 5px solid #dd5461;
}

/* Evil Morty */
.tile[data-character="evil-morty"] .face-hair {
  background: #694126;
  clip-path: polygon(0 60%, 8% 20%, 26% 2%, 72% 0, 94% 24%, 100% 61%, 80% 38%, 60% 48%, 42% 35%, 18% 48%);
}

.tile[data-character="evil-morty"] .face-extra::before {
  content: "";
  position: absolute;
  z-index: 3;
  top: 38%;
  right: 13%;
  width: 28%;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--ink);
}

.tile[data-character="evil-morty"] .face-extra::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: 24%;
  right: 2%;
  width: 55%;
  border-top: 3px solid var(--ink);
  transform: rotate(-53deg);
}

/* Pickle Rick */
.tile[data-character="pickle-rick"] .tile-face {
  width: 41%;
  aspect-ratio: 0.48;
  border-radius: 45%;
  background: #69b83f;
}

.tile[data-character="pickle-rick"] .face-hair { display: none; }
.tile[data-character="pickle-rick"] .face-eyes::before,
.tile[data-character="pickle-rick"] .face-eyes::after {
  top: 30%;
  width: 28%;
}
.tile[data-character="pickle-rick"] .face-eyes::before { left: 10%; }
.tile[data-character="pickle-rick"] .face-eyes::after { right: 10%; }
.tile[data-character="pickle-rick"] .face-mouth {
  bottom: 23%;
  left: 17%;
  width: 66%;
}

/* Final tile */
.tile[data-character="rick-prime"] .tile-face {
  box-shadow: 0 0 12px #fff, 0 0 20px var(--acid);
}

.tile[data-character="rick-prime"] .face-eyes::before,
.tile[data-character="rick-prime"] .face-eyes::after {
  background: radial-gradient(circle, var(--portal) 0 24%, #111 26% 100%);
}

.game-message {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  background: rgba(182, 242, 60, 0.88);
  text-align: center;
}

.game-message[hidden] {
  display: none;
}

.game-message p {
  margin: 0 0 15px;
  font-family: "Bangers", sans-serif;
  font-size: clamp(34px, 7vw, 62px);
  letter-spacing: 0.04em;
  -webkit-text-stroke: 1px #fff;
}

.game-message button {
  padding: 10px 16px;
  border: var(--line);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: "Bangers", sans-serif;
  font-size: 18px;
}

.mobile-controls {
  display: none;
  margin-top: 18px;
  text-align: center;
}

.mobile-controls button {
  width: 52px;
  height: 44px;
  margin: 2px;
  border: var(--line);
  background: var(--paper);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 20px;
  font-weight: 700;
}

footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.footer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 8px var(--acid);
}

@keyframes tile-in {
  from { transform: scale(0.82) rotate(-2deg); }
  to { transform: scale(1) rotate(0); }
}

@keyframes hint-pulse {
  to { transform: translateY(-3px); box-shadow: 3px 6px 0 var(--ink); }
}

@media (max-width: 780px) {
  .site-shell { padding-top: 22px; }
  .game-layout { grid-template-columns: minmax(300px, 520px); }
  .briefing { display: none; }
  .score-row { grid-template-columns: 82px 82px 1fr; }
  .mode-grid { grid-template-columns: repeat(5, 1fr); }
  .mobile-controls { display: block; }
  .portal { width: 190px; }
  .seo-panel { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .site-shell { width: min(100% - 20px, 390px); }
  h1 { font-size: 58px; -webkit-text-stroke-width: 2px; }
  .tagline { font-size: 17px; }
  .board { gap: 7px; padding: 8px; }
  .tile { border-width: 2px; }
  .mode-heading small { display: none; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .mode-toggle > span { min-height: 48px; font-size: 10px; }
  .mode-toggle small { font-size: 8px; }
  .tile-face { border-width: 2px; }
  .face-eyes::before,
  .face-eyes::after { border-width: 1px; }
  .tile-name { border-width: 1px; }
  .new-game { font-size: 15px; }
}
