/* Generated by scripts/build-styles.mjs. Edit styles/src/*.css. */

/* Source: styles/src/00-foundation.css */
:root {
  --paper: #f4f5f7;
  --surface: #ffffff;
  --ink: #101217;
  --muted: #686d76;
  --line: #d8dbe1;
  --soft-line: #e9ebef;
  --signal: #b7ff2a;
  --signal-strong: #8fdb00;
  --alert: #ff4b36;
  --blue: #5865f2;
  --shadow: 0 22px 60px rgba(16, 18, 23, 0.1);
  --max-width: 1320px;
  --game-board-width: 590px;
  --game-controls-width: 430px;
}

@font-face {
  font-family: "Mines Manrope";
  src: url("assets/manrope-latin.a30ddcd34970.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400 800;
}

@font-face {
  font-family: "Mines Outfit";
  src: url("assets/outfit-latin.6c18d579fd87.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400 900;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(16, 18, 23, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 18, 23, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "Mines Manrope", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.4;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

/* Source: styles/src/10-header.css */
.app-shell {
  min-height: 100svh;
}

.topbar {
  position: relative;
  z-index: 20;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 12px max(24px, calc((100vw - var(--max-width)) / 2));
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

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

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.96rem;
  font-weight: 950;
  line-height: 1;
}

.wordmark i {
  width: 3px;
  height: 22px;
  display: inline-block;
  background: var(--signal-strong);
  transform: skewX(-12deg);
}

.brand-type {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0;
}

.game-id {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.game-kicker,
.wallet span,
.round-metric span,
.board-meta span,
.commit-preview span,
.control-label,
.control-label small,
.game-footer,
th {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 850;
  letter-spacing: 0;
}

.game-id strong {
  font-size: 1.2rem;
  font-weight: 950;
}

.wallet {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.wallet strong {
  font-variant-numeric: tabular-nums;
  font-size: 1.04rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-weight: 900;
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--ink);
}

/* Source: styles/src/20-board.css */
.game-stage {
  width: min(var(--max-width), calc(100% - 48px));
  min-height: calc(100svh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.72fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: center;
  margin: 0 auto;
  padding: 24px 0 36px;
}

.board-zone,

.control-zone {
  min-width: 0;
}

.round-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Mines Outfit", Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}

.round-head h1 {
  margin-bottom: 0;
  font-size: clamp(1.85rem, 4vw, 3.35rem);
  line-height: 0.96;
}

.round-metric {
  text-align: right;
}

.round-metric strong {
  display: block;
  margin-top: 2px;
  color: var(--signal-strong);
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  font-variant-numeric: tabular-nums;
}

.board-wrap {
  position: relative;
  width: min(100%, 610px);
  aspect-ratio: 1;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #c7cad1;
  border-radius: 8px;
  background: #dfe2e7;
  box-shadow: var(--shadow);
}

.mine-board {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 1px;
  background: #cfd2d8;
}

.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease, color 160ms ease;
}

.cell::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid #b5b8bf;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 160ms ease, height 160ms ease, background 160ms ease, border-color 160ms ease;
}

.cell::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: clamp(0.7rem, 1.4vw, 0.92rem);
  font-weight: 950;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.cell:not(:disabled):hover {
  z-index: 2;
  background: #f7ffe8;
  transform: scale(0.96);
}

.cell:not(:disabled):focus-visible {
  z-index: 3;
  outline: 3px solid var(--blue);
  outline-offset: -4px;
}

.cell.is-safe {
  background: var(--signal);
  color: #172100;
  animation: cell-in 260ms ease both;
}

.cell.is-safe::before {
  width: 48%;
  height: 48%;
  border-color: rgba(16, 18, 23, 0.26);
  background: rgba(255, 255, 255, 0.36);
}

.cell.is-safe::after,
.cell.is-mine::after {
  opacity: 1;
  transform: none;
}

.cell.is-mine {
  background: var(--alert);
  color: #ffffff;
  animation: mine-in 340ms ease both;
}

.cell.is-mine::before {
  width: 48%;
  height: 48%;
  border: 6px solid rgba(255, 255, 255, 0.76);
  background: transparent;
}

.cell.is-mine::after {
  content: "MINE";
}

.cell.is-revealed-mine {
  background: #ffe8e4;
  color: var(--alert);
}

.cell.is-revealed-mine::before {
  width: 34%;
  height: 34%;
  border: 4px solid var(--alert);
}

.cell.is-revealed-mine::after {
  content: "";
}

#signalCanvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.board-lock {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.78);
  text-align: center;
  backdrop-filter: blur(5px);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.board-lock span {
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 900;
}

.board-lock strong {
  max-width: 420px;
  font-size: clamp(1.25rem, 3vw, 2.35rem);
  line-height: 1;
}

.board-lock.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.board-meta {
  width: min(100%, 610px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 16px;
  padding: 13px 0 0;
}

.board-meta div {
  min-width: 0;
}

.board-meta strong {
  display: block;
  font-size: 0.97rem;
  font-variant-numeric: tabular-nums;
}

.text-button {
  min-height: 38px;
  padding: 8px 0 8px 14px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

/* Source: styles/src/30-controls.css */
.control-zone {
  padding-left: clamp(0px, 2vw, 28px);
  border-left: 1px solid var(--line);
}

.control-intro {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.control-intro h2 {
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  line-height: 0.98;
}

.control-intro p:last-child {
  max-width: 440px;
  margin-bottom: 0;
  color: var(--muted);
}

.control-group {
  margin: 22px 0 0;
  padding: 0;
  border: 0;
}

.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
}

.control-label label,
.control-label > span {
  color: var(--ink);
}

.stepper {
  height: 54px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  overflow: hidden;
  border: 1px solid #c8cbd2;
  border-radius: 6px;
  background: var(--surface);
}

.stepper button {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 900;
  cursor: pointer;
}

.stepper button:hover {
  background: var(--paper);
}

.stepper input {
  min-width: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  outline: 0;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.risk-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.risk-options button {
  min-height: 48px;
  border: 1px solid #c8cbd2;
  border-radius: 6px;
  background: var(--surface);
  font-weight: 900;
  cursor: pointer;
}

.risk-options button:hover {
  border-color: var(--ink);
}

.risk-options button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.commit-preview {
  margin-top: 20px;
}

.commit-preview code {
  display: block;
  max-width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commit-preview small {
  display: block;
  margin-top: 4px;
  color: #817789;
  font-size: 0.66rem;
  font-weight: 750;
}

.primary-action,
.secondary-action {
  min-height: 58px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  font-weight: 950;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 12px 18px;
  background: var(--signal);
  color: #111700;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.primary-action:hover {
  background: #c5ff52;
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--ink);
}

.primary-action:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.primary-action.is-cashout {
  background: var(--ink);
  color: var(--surface);
  box-shadow: 5px 5px 0 var(--signal-strong);
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.primary-action.compact {
  width: auto;
  min-width: 120px;
  margin-top: 0;
}

.secondary-action {
  padding: 12px 18px;
  background: var(--surface);
}

.action-note {
  min-height: 38px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

/* Source: styles/src/35-experience.css */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 200;
  padding: 10px 14px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--signal);
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 140ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

#balance.is-changing {
  color: var(--purple);
}

.cell.is-pending {
  border-color: var(--signal);
  cursor: wait;
}

.cell.is-pending::before {
  border-color: var(--signal);
  animation: pending-cell 540ms ease-in-out infinite alternate;
}

.risk-options.is-guided,
.board-wrap.is-guided,
.primary-action.is-guided {
  animation: guide-focus 1.8s ease-in-out 2;
}

.primary-action.is-pending {
  cursor: wait;
  animation: pending-action 720ms ease-in-out infinite alternate;
}

.board-wrap.feedback-start {
  animation: board-start 460ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.board-wrap.feedback-safe {
  animation: board-safe 460ms ease;
}

.board-wrap.feedback-mine {
  animation: board-mine 560ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

.board-wrap.feedback-cashout {
  animation: board-cashout 520ms ease;
}

.toast[data-tone="success"] {
  border-left-color: #67c62f;
}

.toast[data-tone="warning"] {
  border-left-color: var(--signal);
}

.toast[data-tone="danger"] {
  border-left-color: var(--alert);
}

@keyframes pending-cell {
  from {
    opacity: 0.48;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(135deg) scale(1.12);
  }
}

@keyframes guide-focus {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(114, 36, 244, 0);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(114, 36, 244, 0.24), 0 0 0 8px rgba(255, 220, 32, 0.18);
  }
}

@keyframes pending-action {
  from {
    filter: saturate(0.78);
  }
  to {
    filter: saturate(1.08);
  }
}

@keyframes board-start {
  0% {
    transform: scale(0.992);
  }
  55% {
    box-shadow: 0 26px 65px rgba(33, 18, 50, 0.24), 0 0 0 5px rgba(114, 36, 244, 0.24);
    transform: scale(1.004);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes board-safe {
  45% {
    box-shadow: 0 26px 65px rgba(33, 18, 50, 0.24), 0 0 32px rgba(255, 220, 32, 0.32);
  }
}

@keyframes board-mine {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

@keyframes board-cashout {
  45% {
    box-shadow: 0 26px 65px rgba(33, 18, 50, 0.24), 0 0 0 5px rgba(255, 220, 32, 0.32), 0 0 34px rgba(114, 36, 244, 0.28);
  }
}

@media (prefers-contrast: more) {
  .cell,
  .stepper,
  .risk-options button,
  .primary-action,
  .secondary-action {
    border-width: 2px;
  }

  .cell:not(:disabled):focus-visible {
    outline-width: 4px;
  }
}

@media (forced-colors: active) {
  .cell,
  .cell.is-safe,
  .cell.is-revealed-mine,
  .primary-action,
  .risk-options button {
    forced-color-adjust: auto;
  }

  .cell::before {
    border: 2px solid ButtonText;
    background: transparent;
  }
}

/* Source: styles/src/40-overlays.css */
.history-band {
  padding: clamp(42px, 6vw, 82px) max(24px, calc((100vw - var(--max-width)) / 2));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.history-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3.3rem);
  line-height: 0.95;
}

.history-heading > span {
  color: var(--muted);
  font-size: 0.78rem;
}

.history-table-wrap {
  overflow-x: auto;
  border-top: 2px solid var(--ink);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th:first-child,
td:first-child {
  padding-left: 0;
}

th:last-child,
td:last-child {
  padding-right: 0;
  text-align: right;
}

td {
  font-size: 0.86rem;
  font-weight: 750;
}

.history-result {
  font-weight: 950;
}

.history-result.is-win {
  color: #3d8300;
}

.history-result.is-loss {
  color: var(--alert);
}

.history-result.is-refund {
  color: var(--blue);
}

.history-verify {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.empty-row td {
  padding: 24px 0;
  color: var(--muted);
  text-align: left;
}

.game-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 24px max(24px, calc((100vw - var(--max-width)) / 2));
  background: var(--ink);
  color: #a9adb6;
}

.game-footer p {
  margin: 0;
  text-align: center;
}

.game-footer a {
  justify-self: end;
  color: var(--signal);
  text-decoration: none;
}

.fairness-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: calc(100svh - 28px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 12px 12px 0 rgba(16, 18, 23, 0.2);
}

.fairness-dialog::backdrop {
  background: rgba(16, 18, 23, 0.58);
  backdrop-filter: blur(5px);
}

.fairness-dialog form {
  padding: clamp(22px, 5vw, 38px);
}

.fairness-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.fairness-dialog h2 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 4vw, 2.8rem);
  line-height: 0.95;
}

.dialog-copy {
  margin: 18px 0 24px;
  color: var(--muted);
}

.fairness-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fairness-fields label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.fairness-fields label:first-child,
.fairness-fields label:last-child {
  grid-column: 1 / -1;
}

.fairness-fields input,
.fairness-fields textarea {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  outline: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.74rem;
}

.fairness-fields input:focus {
  border-color: var(--blue);
}

.verification-result {
  min-height: 48px;
  margin-top: 18px;
  padding: 12px;
  border-left: 3px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 0.8rem;
}

.verification-result.is-pass {
  border-color: var(--signal-strong);
  color: #315e00;
}

.verification-result.is-fail {
  border-color: var(--alert);
  color: #9b1f10;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.82rem;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes cell-in {
  0% {
    transform: scale(0.78);
  }
  70% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes mine-in {
  0% {
    transform: scale(0.7) rotate(-6deg);
  }
  55% {
    transform: scale(1.08) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

/* Source: styles/src/50-responsive.css */
@media (max-width: 960px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .game-id {
    display: none;
  }

  .game-stage {
    grid-template-columns: 1fr;
    gap: 34px;
    min-height: 0;
    padding-top: 22px;
  }

  .board-wrap,
  .board-meta {
    margin-inline: auto;
  }

  .control-zone {
    padding: 28px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 64px;
    padding: 10px 14px;
  }

  .brand-type,
  .wallet span {
    display: none;
  }

  .wallet {
    gap: 7px;
  }

  .game-stage {
    width: calc(100% - 24px);
    padding-top: 16px;
  }

  .round-head {
    align-items: flex-end;
  }

  .round-head h1 {
    font-size: 1.7rem;
  }

  .round-metric strong {
    font-size: 1.3rem;
  }

  .board-meta {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .board-meta .text-button {
    grid-column: 1 / -1;
    justify-self: start;
    padding-left: 0;
  }

  .control-intro h2 {
    font-size: 1.75rem;
  }

  .history-band {
    padding-inline: 16px;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-footer {
    grid-template-columns: 1fr;
    justify-items: start;
    padding-inline: 16px;
  }

  .game-footer p {
    text-align: left;
  }

  .game-footer a {
    justify-self: start;
  }

  .fairness-fields {
    grid-template-columns: 1fr;
  }

  .fairness-fields label {
    grid-column: 1 / -1;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions .primary-action,
  .dialog-actions .secondary-action {
    width: 100%;
  }
}

/* Embedded supplier-demo surface */
.is-embedded .topbar,
.is-embedded .history-band,
.is-embedded .game-footer {
  display: none;
}

.is-embedded body,
.is-embedded .app-shell {
  min-height: 100svh;
}

.is-embedded .game-stage {
  min-height: 100svh;
  align-content: center;
  padding-top: 20px;
  padding-bottom: 20px;
}

@media (max-width: 960px) {
  .is-embedded .game-stage {
    align-content: start;
    padding-top: 14px;
  }
}

@media (max-width: 620px) {
  .is-embedded .game-stage {
    padding-top: 10px;
    padding-bottom: 14px;
  }
}

@media (max-height: 760px) and (min-width: 961px) {
  .topbar {
    min-height: 64px;
  }

  .game-stage {
    min-height: calc(100svh - 64px);
    padding-block: 14px 24px;
  }

  .board-wrap {
    width: min(100%, calc(100svh - 188px), 540px);
  }

  .round-head {
    margin-bottom: 9px;
  }

  .control-intro {
    padding-bottom: 16px;
  }

  .control-group {
    margin-top: 15px;
  }

  .commit-preview,
  .primary-action {
    margin-top: 14px;
  }
}

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

/* Mobile play-first controls */
@media (max-width: 620px) {
  .game-stage {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-top: 12px;
  }

  .control-zone {
    order: -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    padding: 0 0 16px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
  }

  .control-intro,
  .action-note {
    display: none;
  }

  .commit-preview {
    grid-column: 1 / -1;
    margin: 0;
    padding: 8px 10px;
  }

  .commit-preview code {
    margin-top: 3px;
    font-size: 0.68rem;
  }

  .commit-preview small {
    font-size: 0.6rem;
  }

  .control-zone > .control-group {
    min-width: 0;
    margin: 0;
  }

  .control-zone > .primary-action {
    grid-column: 1 / -1;
    margin-top: 0;
  }

  .board-zone {
    order: 2;
  }
}

/* Source: styles/src/60-player.css */
/* Mines v0.2 player experience */
:root {
  --paper: #f7f5fa;
  --surface: #ffffff;
  --ink: #15121b;
  --muted: #6c6673;
  --line: #dcd7e2;
  --soft-line: #eeeaf2;
  --signal: #ffdc20;
  --signal-strong: #f0c900;
  --alert: #ff3d58;
  --blue: #7224f4;
  --purple: #7224f4;
  --purple-dark: #35105f;
  --lilac: #f1e9ff;
  --shadow: 0 22px 55px rgba(21, 18, 27, 0.14);
}

html {
  background: var(--ink);
}

body {
  background:
    linear-gradient(rgba(114, 36, 244, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(114, 36, 244, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

.topbar {
  min-height: 68px;
  border-bottom-color: #d9d3df;
  background: rgba(255, 255, 255, 0.97);
}

.wordmark i {
  background: var(--purple);
}

.wallet {
  gap: 12px;
}

.sound-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.sound-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.sound-track {
  position: relative;
  width: 34px;
  height: 20px;
  display: block;
  border: 1px solid #a9a2b1;
  border-radius: 10px;
  background: #d9d4de;
  transition: border-color 150ms ease, background 150ms ease;
}

.sound-track i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(21, 18, 27, 0.25);
  transition: transform 150ms ease;
}

.sound-switch input:checked + .sound-track {
  border-color: var(--purple);
  background: var(--purple);
}

.sound-switch input:checked + .sound-track i {
  transform: translateX(14px);
}

.sound-switch input:focus-visible + .sound-track {
  outline: 3px solid var(--signal);
  outline-offset: 3px;
}

.sound-label {
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 850;
}

.game-stage {
  min-height: calc(100svh - 68px);
  grid-template-columns: minmax(0, var(--game-board-width)) minmax(340px, var(--game-controls-width));
  justify-content: center;
  gap: clamp(24px, 2.2vw, 32px);
  padding-top: 20px;
}

.board-zone {
  width: 100%;
  max-width: var(--game-board-width);
  justify-self: end;
}

.round-head {
  margin-bottom: 12px;
}

.round-head h1 {
  font-size: clamp(2rem, 3.7vw, 3.2rem);
}

.round-metric strong {
  color: var(--purple);
}

.board-wrap {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: #1f162a;
  box-shadow: 0 26px 65px rgba(33, 18, 50, 0.24);
}

.board-wrap::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.mine-board {
  inset: 10px;
  gap: 7px;
  background: transparent;
}

.cell {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: linear-gradient(145deg, #342640 0%, #241a30 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -5px 10px rgba(8, 4, 13, 0.26);
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.cell::before {
  width: 15%;
  height: 15%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  transform: translate(-50%, -50%) rotate(45deg);
  transition: width 180ms ease, height 180ms ease, transform 180ms ease, opacity 180ms ease;
}

.cell::after {
  inset: 7px 8px auto auto;
  display: block;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.54rem, 1vw, 0.7rem);
  line-height: 1;
  transform: none;
}

.cell:not(:disabled):hover {
  border-color: rgba(255, 220, 32, 0.72);
  background: linear-gradient(145deg, #453050 0%, #2f2040 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 0 2px rgba(255, 220, 32, 0.12);
  transform: translateY(-2px);
}

.cell.is-safe {
  border-color: rgba(255, 220, 32, 0.62);
  background: linear-gradient(145deg, #4a2c70 0%, #2a183e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    0 0 22px rgba(255, 220, 32, 0.2);
  color: var(--surface);
}

.cell.is-safe.is-new {
  animation: gem-reveal 380ms cubic-bezier(0.2, 0.82, 0.22, 1) both;
}

.cell.is-safe::before {
  width: 74%;
  height: 74%;
  border: 0;
  border-radius: 0;
  background: transparent url("assets/gem-v2.e69b56ddaaa5.webp") center / contain no-repeat;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.26));
  transform: translate(-50%, -50%);
}

.cell.is-safe::after,
.cell.is-mine::after {
  opacity: 1;
}

.cell.is-revealed-mine {
  border-color: rgba(166, 91, 255, 0.52);
  background: linear-gradient(145deg, #321844 0%, #1f102c 100%);
  color: var(--surface);
}

.cell.is-revealed-mine::before {
  width: 72%;
  height: 72%;
  border: 0;
  border-radius: 0;
  background: transparent url("assets/mine-v2.1542193f2a13.webp") center / contain no-repeat;
  filter: drop-shadow(0 0 13px rgba(148, 65, 255, 0.52));
  transform: translate(-50%, -50%);
}

.cell.is-revealed-mine::after {
  content: "";
}

.cell.is-hit {
  border-color: var(--alert);
  background: #3a1123;
  animation: mine-hit 520ms cubic-bezier(0.2, 0.72, 0.25, 1) both;
  box-shadow: 0 0 28px rgba(255, 61, 88, 0.48);
}

.cell.is-hit::before {
  filter: drop-shadow(0 0 18px rgba(255, 61, 88, 0.72));
}

#signalCanvas {
  z-index: 4;
}

.board-lock {
  inset: auto 50% 22px auto;
  width: min(430px, calc(100% - 44px));
  display: block;
  padding: 14px 18px;
  border: 0;
  border-left: 4px solid var(--signal);
  border-radius: 4px;
  background: rgba(21, 18, 27, 0.92);
  color: var(--surface);
  text-align: left;
  appearance: none;
  cursor: pointer;
  font: inherit;
  pointer-events: auto;
  transform: translateX(50%);
  backdrop-filter: blur(8px);
}

.board-lock:hover {
  background: rgba(21, 18, 27, 0.98);
}

.board-lock:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 4px;
}

.board-lock span {
  display: block;
  margin-bottom: 3px;
  color: var(--signal);
}

.board-lock strong {
  display: block;
  max-width: none;
  font-size: clamp(0.88rem, 1.6vw, 1.1rem);
  line-height: 1.1;
}

.board-lock small {
  display: block;
  margin-top: 4px;
  color: #c9c1d0;
  font-size: 0.7rem;
}

.board-lock.is-hidden {
  transform: translateX(50%) translateY(8px);
}

.board-meta {
  width: 100%;
}

.control-zone {
  width: 100%;
  max-width: var(--game-controls-width);
  justify-self: start;
  padding-left: clamp(18px, 1.5vw, 24px);
  border-left-color: #d3ccd9;
}

.control-intro {
  padding-bottom: 20px;
}

.control-intro h2 {
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
}

.control-group {
  margin-top: 18px;
}

.stepper,
.risk-options button {
  border-radius: 4px;
}

.stepper button:focus-visible,
.risk-options button:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.text-button:focus-visible,
.icon-button:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

.risk-options button.is-active {
  border-color: var(--purple);
  background: var(--purple);
}

.risk-options button.is-locked {
  cursor: help;
}

.risk-options button.is-locked:not(.is-active) {
  border-color: #d8d2df;
  background: #eeeaf1;
  color: #87808d;
  opacity: 0.72;
}

.commit-preview {
  margin-top: 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--purple);
  background: var(--lilac);
}

.commit-preview code {
  color: #675d70;
}

.primary-action,
.secondary-action {
  min-height: 54px;
  border-radius: 4px;
}

.primary-action {
  margin-top: 16px;
  border-color: var(--ink);
  background: var(--signal);
  box-shadow: none;
}

.primary-action:hover {
  border-color: var(--purple);
  background: var(--purple);
  color: var(--surface);
  box-shadow: none;
  transform: translateY(-2px);
}

.primary-action:active {
  box-shadow: none;
  transform: translateY(0);
}

.primary-action.is-cashout {
  border-color: var(--purple);
  background: var(--purple);
  box-shadow: none;
}

.primary-action.is-cashout:hover {
  border-color: var(--ink);
  background: var(--ink);
}

.action-note {
  min-height: 34px;
  margin-top: 12px;
}

.history-band {
  background: #fcfbfd;
}

.fairness-dialog {
  border-radius: 6px;
  box-shadow: 10px 10px 0 rgba(114, 36, 244, 0.24);
}

.toast {
  border-left: 4px solid var(--signal);
  border-radius: 4px;
}

@keyframes gem-reveal {
  0% {
    opacity: 0.3;
    transform: scale(0.72) rotate(-3deg);
  }
  68% {
    transform: scale(1.05) rotate(1deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes mine-hit {
  0% {
    transform: scale(0.7);
  }
  45% {
    transform: scale(1.12) rotate(3deg);
  }
  70% {
    transform: scale(0.97) rotate(-2deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@media (max-width: 960px) {
  .game-stage {
    min-height: 0;
  }

  .board-zone,
  .control-zone {
    justify-self: center;
  }

  .control-zone {
    max-width: var(--game-board-width);
  }

  .control-zone {
    padding-left: 0;
  }
}

@media (max-width: 620px) {
  .topbar {
    min-height: 60px;
  }

  .sound-label {
    display: none;
  }

  .sound-switch {
    gap: 0;
  }

  .game-stage {
    gap: 14px;
    padding-top: 10px;
  }

  .control-zone {
    gap: 9px 8px;
    padding-bottom: 12px;
  }

  .control-label {
    margin-bottom: 6px;
  }

  .stepper {
    height: 48px;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .risk-options button {
    min-height: 48px;
  }

  .control-zone > .primary-action {
    min-height: 52px;
  }

  .round-head {
    margin-bottom: 9px;
  }

  .round-head h1 {
    font-size: 1.65rem;
  }

  .board-wrap {
    width: 100%;
  }

  .mine-board {
    inset: 6px;
    gap: 4px;
  }

  .cell {
    border-radius: 5px;
  }

  .cell::after {
    inset: 5px 5px auto auto;
  }

  .board-lock {
    bottom: 10px;
    width: calc(100% - 24px);
    padding: 10px 12px;
  }

  .board-lock strong {
    font-size: 0.82rem;
  }

  .board-lock small {
    font-size: 0.63rem;
  }
}
