:root {
  --sky-top: #f3f9ff;
  --sky-bottom: #e8f4ff;
  --ink: #23344d;
  --muted: #72839a;
  --blue: #3e87e8;
  --blue-deep: #2768c5;
  --blue-soft: #e9f3ff;
  --blue-line: #cfe2f7;
  --white: #ffffff;
  --cell-cover-top: #ffffff;
  --cell-cover-bottom: #e9f1fa;
  --cell-edge: #d1deec;
  --cell-open: #edf4fb;
  --danger: #e15666;
  --success: #27966f;
  --shadow-large: 0 28px 70px rgba(51, 102, 166, 0.15);
  --shadow-card: 0 8px 24px rgba(51, 102, 166, 0.09);
  --radius-large: 28px;
  --radius-medium: 16px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.95), transparent 28rem),
    radial-gradient(circle at 86% 88%, rgba(172, 214, 255, 0.38), transparent 25rem),
    linear-gradient(155deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  font-family: "Trebuchet MS", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(62, 135, 232, 0.35);
  outline-offset: 3px;
}

.page-decoration {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.cloud {
  position: absolute;
  width: 180px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  filter: blur(1px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  width: 78px;
  height: 78px;
  left: 30px;
  bottom: 8px;
}

.cloud::after {
  width: 104px;
  height: 104px;
  right: 20px;
  bottom: 2px;
}

.cloud-one {
  top: 11%;
  left: -68px;
  transform: scale(0.9);
}

.cloud-two {
  right: -80px;
  bottom: 14%;
  transform: scale(1.35);
  opacity: 0.65;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.45);
}

.bubble-one {
  width: 68px;
  height: 68px;
  top: 20%;
  right: 7%;
}

.bubble-two {
  width: 26px;
  height: 26px;
  top: 28%;
  right: 13%;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 24px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 14px;
  background: linear-gradient(145deg, #7fc1ff, #3d83e4);
  box-shadow: 0 8px 18px rgba(46, 116, 207, 0.24), inset 0 1px 1px rgba(255, 255, 255, 0.55);
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 4px;
  transform: rotate(-6deg);
}

.brand-grid i {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.96);
}

.brand-grid i:last-child {
  border-radius: 50%;
  background: #fff1a8;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 19px;
  letter-spacing: 0.03em;
}

.brand small {
  margin-top: 2px;
  color: #8798ad;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.difficulty-switch {
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(198, 219, 241, 0.9);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 5px 14px rgba(68, 116, 171, 0.07);
  backdrop-filter: blur(12px);
}

.difficulty-button {
  min-width: 68px;
  padding: 9px 15px;
  border: 0;
  border-radius: 11px;
  color: #687a91;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.difficulty-button:hover {
  color: var(--blue-deep);
  background: rgba(231, 242, 254, 0.75);
}

.difficulty-button:active {
  transform: scale(0.97);
}

.difficulty-button.is-active {
  color: var(--blue-deep);
  background: #fff;
  box-shadow: 0 4px 12px rgba(47, 108, 184, 0.12), inset 0 0 0 1px rgba(124, 174, 233, 0.18);
}

.restart-button {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 8px;
  padding: 11px 17px;
  border: 1px solid #cfe2f6;
  border-radius: 13px;
  color: #3e6fa9;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 5px 14px rgba(53, 106, 171, 0.07);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.restart-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: transform 300ms ease;
}

.restart-button:hover {
  color: var(--blue-deep);
  background: #fff;
  box-shadow: 0 8px 20px rgba(45, 107, 183, 0.12);
  transform: translateY(-1px);
}

.restart-button:hover svg {
  transform: rotate(-35deg);
}

.game-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-large);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-large), inset 0 1px 0 #fff;
  backdrop-filter: blur(18px);
}

.game-card::before {
  content: "";
  position: absolute;
  top: -110px;
  right: -80px;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(206, 232, 255, 0.62), rgba(231, 244, 255, 0));
  pointer-events: none;
}

.game-intro {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 19px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #4c88ce;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.game-intro h1 {
  margin: 0;
  color: #263a54;
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.level-pill {
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid #d3e4f5;
  border-radius: 999px;
  color: #52779f;
  background: #f4f9ff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 17px;
}

.stat-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid #dfebf7;
  border-radius: var(--radius-medium);
  background: linear-gradient(135deg, #f8fbff, #f0f7ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat-card-center {
  justify-content: center;
}

.stat-card-right {
  justify-content: flex-end;
}

.stat-icon {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 35px;
  place-items: center;
  border-radius: 11px;
  color: #3b84db;
  background: #e8f3ff;
}

.stat-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mine-stat-icon {
  position: relative;
}

.mine-stat-icon .mine-icon {
  width: 18px;
  height: 18px;
}

.stat-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  overflow: hidden;
  color: #8494a8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-value {
  color: #2d4664;
  font-family: "Courier New", monospace;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: 0.06em;
}

.stat-value-small {
  padding-top: 3px;
  font-size: 17px;
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.tool-group,
.utility-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-label {
  color: #8494a8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.tool-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: #f0f5fb;
}

.tool-button {
  display: inline-flex;
  min-height: 33px;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 0;
  border-radius: 9px;
  color: #8291a4;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.tool-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tool-button.is-active {
  color: #3279cf;
  background: #fff;
  box-shadow: 0 3px 9px rgba(52, 107, 175, 0.1);
}

.mini-flag {
  position: relative;
  width: 12px;
  height: 14px;
}

.mini-flag::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1px;
  bottom: 1px;
  width: 1.5px;
  border-radius: 2px;
  background: #66778c;
}

.mini-flag::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 3px;
  width: 0;
  height: 0;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  border-left: 7px solid #eb5d6d;
}

.status-text {
  margin: 0;
  color: #72849a;
  font-size: 12px;
}

.status-text.is-warning {
  color: #d55766;
}

.status-text.is-success {
  color: #238363;
}

.sound-button {
  display: inline-flex;
  height: 33px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid #dbe7f4;
  border-radius: 10px;
  color: #75869a;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.sound-button:hover {
  color: #397dcf;
  border-color: #c9def3;
  background: #f7fbff;
}

.sound-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sound-off-icon,
.sound-button[aria-pressed="false"] .sound-on-icon {
  display: none;
}

.sound-button[aria-pressed="false"] .sound-off-icon {
  display: block;
}

.result-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #cbe9db;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fbf6, #eaf8f2);
  animation: result-arrive 360ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

.result-panel[hidden] {
  display: none;
}

.result-panel.is-loss {
  border-color: #f2d2d6;
  background: linear-gradient(135deg, #fff8f8, #fff1f2);
}

.result-emblem {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #50c792, #26956e);
  box-shadow: 0 5px 12px rgba(40, 150, 110, 0.2);
}

.is-loss .result-emblem {
  background: linear-gradient(145deg, #f18b96, #dd5767);
  box-shadow: 0 5px 12px rgba(210, 80, 95, 0.18);
}

.is-loss .result-star {
  transform: rotate(45deg);
  font-size: 20px;
}

.result-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.result-copy strong {
  color: #246f55;
  font-size: 13px;
}

.is-loss .result-copy strong {
  color: #b94655;
}

.result-copy span {
  color: #668275;
  font-size: 11px;
}

.is-loss .result-copy span {
  color: #8d7176;
}

.result-restart {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #329a75;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.is-loss .result-restart {
  background: #dc6775;
}

.board-frame {
  padding: 6px;
  border: 1px solid #d8e7f6;
  border-radius: 20px;
  background: linear-gradient(145deg, #eff7ff, #e4f0fc);
  box-shadow: inset 0 1px 2px rgba(84, 123, 168, 0.08);
}

.scroll-hint {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  padding: 2px 0 7px;
  color: #7792af;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.board-scroll {
  overflow: auto;
  border-radius: 15px;
  scrollbar-color: #b8d2ed #edf5fd;
  scrollbar-width: thin;
}

.board-scroll::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.board-scroll::-webkit-scrollbar-track {
  border-radius: 99px;
  background: #edf5fd;
}

.board-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #edf5fd;
  border-radius: 99px;
  background: #b8d2ed;
}

.board {
  --cell-size: 40px;
  display: grid;
  width: max-content;
  grid-template-columns: repeat(var(--cols), var(--cell-size));
  gap: 3px;
  margin: 0 auto;
  padding: 9px;
  border-radius: 15px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0)),
    #dceafa;
  box-shadow: inset 0 1px 4px rgba(62, 108, 162, 0.12);
}

.board[data-difficulty="intermediate"] {
  --cell-size: 35px;
}

.board[data-difficulty="expert"] {
  --cell-size: 31px;
}

.cell {
  position: relative;
  display: grid;
  width: var(--cell-size);
  height: var(--cell-size);
  padding: 0;
  place-items: center;
  border: 1px solid var(--cell-edge);
  border-radius: 7px;
  color: #49627f;
  background: linear-gradient(145deg, var(--cell-cover-top) 8%, var(--cell-cover-bottom) 100%);
  box-shadow:
    0 2px 2px rgba(49, 91, 139, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  cursor: pointer;
  font-family: "Trebuchet MS", "Microsoft YaHei", sans-serif;
  font-size: calc(var(--cell-size) * 0.52);
  font-weight: 900;
  line-height: 1;
  touch-action: manipulation;
  transition:
    transform 130ms ease,
    background 130ms ease,
    border-color 130ms ease,
    box-shadow 130ms ease;
}

.cell:hover:not(.is-revealed) {
  z-index: 1;
  border-color: #b8d2ea;
  background: linear-gradient(145deg, #ffffff 8%, #e2effb 100%);
  box-shadow:
    0 5px 9px rgba(43, 92, 148, 0.16),
    inset 0 1px 0 #fff;
  transform: translateY(-2px);
}

.cell:active:not(.is-revealed) {
  box-shadow: inset 0 2px 4px rgba(56, 92, 130, 0.13);
  transform: translateY(1px) scale(0.97);
}

.cell.is-revealed {
  border-color: #d8e4ef;
  background: var(--cell-open);
  box-shadow: inset 0 1px 2px rgba(53, 92, 132, 0.055);
  cursor: default;
  animation: cell-pop 180ms ease both;
}

.cell.number-1 {
  color: #367ddd;
}

.cell.number-2 {
  color: #168c61;
}

.cell.number-3 {
  color: #df5363;
}

.cell.number-4 {
  color: #7356c6;
}

.cell.number-5 {
  color: #b46a20;
}

.cell.number-6 {
  color: #078da1;
}

.cell.number-7 {
  color: #3d4859;
}

.cell.number-8 {
  color: #885844;
}

.flag-icon {
  position: relative;
  display: block;
  width: 57%;
  height: 62%;
  filter: drop-shadow(0 2px 2px rgba(116, 43, 51, 0.13));
  transform: rotate(-3deg);
}

.flag-icon::before {
  content: "";
  position: absolute;
  left: 25%;
  top: 10%;
  width: 2px;
  height: 82%;
  border-radius: 3px;
  background: #50647c;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.7);
}

.flag-icon::after {
  content: "";
  position: absolute;
  left: 31%;
  top: 11%;
  width: 0;
  height: 0;
  border-top: calc(var(--cell-size) * 0.12) solid transparent;
  border-bottom: calc(var(--cell-size) * 0.12) solid transparent;
  border-left: calc(var(--cell-size) * 0.27) solid #eb596b;
  filter: drop-shadow(0 1px 0 #c43e51);
}

.cell.is-flagged {
  background: linear-gradient(145deg, #fffafa, #f7e9ec);
}

.mine-icon {
  position: relative;
  display: block;
  width: 55%;
  height: 55%;
  border: 1.5px solid #32485f;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6d8297 0 9%, #3d5369 11% 54%, #263a50 58% 100%);
  box-shadow: 0 2px 3px rgba(34, 53, 73, 0.18);
}

.mine-icon::before,
.mine-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 2px;
  background: #354b61;
  transform: translate(-50%, -50%);
}

.mine-icon::before {
  width: 146%;
  height: 2px;
}

.mine-icon::after {
  width: 2px;
  height: 146%;
}

.cell.is-mine {
  background: #e7f0fa;
}

.cell.is-mine.correct-mine {
  background: #edf9f4;
}

.cell.is-mine.exploded {
  border-color: #dd6976;
  background: radial-gradient(circle, #fff1f1, #f7c7ce);
  animation: mine-shake 380ms ease both;
}

.cell.is-wrong-flag {
  border-color: #ef9da7;
  background: #fff0f2;
}

.cell.is-wrong-flag::after {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 3px;
  background:
    linear-gradient(45deg, transparent 43%, #de5364 44% 56%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, #de5364 44% 56%, transparent 57%);
  pointer-events: none;
}

.cell.nudge {
  animation: cell-nudge 240ms ease;
}

.game-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 3px 0;
}

.help-text,
.keyboard-tip {
  margin: 0;
  color: #8a99aa;
  font-size: 11px;
}

.mobile-help {
  display: none;
}

.keyboard-tip {
  flex: 0 0 auto;
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px 10px 0;
  color: #8698ad;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a2b7cd;
}

.celebration {
  position: absolute;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -15px;
  left: var(--x);
  width: 8px;
  height: 13px;
  border-radius: 2px;
  background: var(--color);
  opacity: 0;
  animation: confetti-fall var(--fall-time) cubic-bezier(0.22, 0.7, 0.48, 1) var(--delay) forwards;
}

.confetti.is-round {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.game-card.is-celebrating .board-frame {
  animation: win-glow 1100ms ease;
}

@keyframes result-arrive {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cell-pop {
  0% {
    opacity: 0.7;
    transform: scale(0.86);
  }
  70% {
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes cell-nudge {
  0%,
  100% {
    transform: translateX(0);
  }
  30% {
    transform: translateX(-3px);
  }
  65% {
    transform: translateX(2px);
  }
}

@keyframes mine-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3px, 1px);
  }
  40% {
    transform: translate(3px, -1px);
  }
  60% {
    transform: translate(-2px, -1px);
  }
  80% {
    transform: translate(2px, 1px);
  }
}

@keyframes confetti-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -30px, 0) rotate(0deg);
  }
  10% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), 850px, 0) rotate(var(--spin));
  }
}

@keyframes win-glow {
  0%,
  100% {
    box-shadow: inset 0 1px 2px rgba(84, 123, 168, 0.08);
  }
  45% {
    border-color: #91d9ba;
    box-shadow: 0 0 0 7px rgba(88, 200, 150, 0.11), 0 12px 30px rgba(57, 164, 122, 0.16);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 22px, 720px);
    padding-top: 16px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .difficulty-switch {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: center;
  }

  .difficulty-button {
    min-width: 78px;
  }

  .restart-button span {
    display: none;
  }

  .restart-button {
    width: 42px;
    height: 42px;
    justify-content: center;
    padding: 0;
  }

  .game-card {
    padding: 20px;
  }

  .board-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .utility-group {
    width: 100%;
    justify-content: space-between;
  }

  .mobile-help {
    display: inline;
  }

  .desktop-help,
  .keyboard-tip {
    display: none;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 14px, 520px);
    padding-top: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 17px;
  }

  .game-card {
    padding: 15px;
    border-radius: 22px;
  }

  .game-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
  }

  .game-intro h1 {
    font-size: 25px;
  }

  .level-pill {
    padding: 6px 10px;
    font-size: 10px;
  }

  .scoreboard {
    gap: 6px;
  }

  .stat-card {
    gap: 7px;
    padding: 10px 8px;
    border-radius: 13px;
  }

  .stat-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 9px;
  }

  .stat-icon svg {
    width: 16px;
    height: 16px;
  }

  .stat-label {
    font-size: 8px;
  }

  .stat-value {
    font-size: 18px;
  }

  .stat-value-small {
    font-size: 14px;
  }

  .tool-label {
    display: none;
  }

  .tool-button {
    padding-right: 10px;
    padding-left: 10px;
  }

  .status-text {
    font-size: 10px;
  }

  .board {
    --cell-size: clamp(30px, 9.1vw, 38px);
    gap: 2px;
    padding: 7px;
  }

  .board[data-difficulty="intermediate"] {
    --cell-size: 34px;
  }

  .board[data-difficulty="expert"] {
    --cell-size: 33px;
  }

  .board-frame {
    padding: 4px;
    border-radius: 16px;
  }

  .scroll-hint.is-visible {
    display: flex;
  }

  .result-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .result-restart {
    margin-left: 48px;
  }

  .game-footer {
    justify-content: center;
    text-align: center;
  }

  .page-footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
