:root {
  color-scheme: dark;
  --ink-950: #070b1b;
  --ink-900: #0a1028;
  --ink-850: #101832;
  --ink-800: #151f3c;
  --slate-500: #7983a4;
  --slate-300: #bdc4dd;
  --paper: #f8f5ed;
  --copper: #f5a84a;
  --copper-light: #ffd58a;
  --violet: #ac79ff;
  --violet-bright: #d1adff;
  --mint: #99f4d1;
  --rose: #ff8e9d;
  --line: rgba(214, 222, 255, 0.14);
  --shadow-deep: 0 24px 70px rgba(0, 0, 0, 0.38);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink-950);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(80, 67, 155, 0.18), transparent 32rem),
    var(--ink-950);
  color: var(--paper);
}

button {
  font: inherit;
}

button:focus-visible {
  outline: 3px solid var(--mint);
  outline-offset: 4px;
}

.app-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(13, 20, 52, 0.56), rgba(7, 11, 27, 0.88)),
    radial-gradient(circle at 50% 38%, rgba(71, 54, 148, 0.22), transparent 42%),
    repeating-linear-gradient(122deg, transparent 0 38px, rgba(171, 191, 255, 0.018) 39px 40px),
    var(--ink-900);
  box-shadow: var(--shadow-deep);
}

.app-shell::before,
.app-shell::after {
  position: absolute;
  z-index: 0;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(158, 120, 255, 0.12);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.app-shell::before {
  top: 150px;
  left: -155px;
}

.app-shell::after {
  right: -170px;
  bottom: 170px;
}

.topbar,
.game-main,
.app-footer {
  position: relative;
  z-index: 1;
}

/* Keep the fixed one-thumb action dock above the footer after a portrait scroll. */
.game-main {
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 18px 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--copper);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  filter: drop-shadow(0 0 8px rgba(245, 168, 74, 0.55));
}

.brand-name {
  color: var(--paper);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.brand-phase,
.eyebrow,
.section-label,
.arena-hint,
.app-footer,
.text-button {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-phase {
  padding-left: 7px;
  border-left: 1px solid var(--line);
  color: var(--slate-500);
  font-size: 0.58rem;
  white-space: nowrap;
}

.cash-readout {
  display: grid;
  justify-items: end;
  flex: 0 0 auto;
}

.topbar-stats {
  display: flex;
  align-items: end;
  gap: 16px;
}

.hammer-readout {
  display: grid;
  justify-items: end;
  gap: 1px;
}

.hammer-readout strong {
  color: var(--violet-bright);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.eyebrow,
.section-label {
  color: var(--slate-500);
  font-size: 0.58rem;
  font-weight: 700;
}

.cash-readout strong {
  color: var(--copper-light);
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  text-shadow: 0 0 18px rgba(245, 168, 74, 0.2);
}

.game-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 13px;
  padding: 6px 16px 12px;
}

.status-row,
.arena-heading,
.meter-topline,
.goal-panel,
.last-break,
.result-panel,
.action-panel {
  position: relative;
  z-index: 1;
}

.status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 46px;
}

.status-text {
  max-width: 270px;
  margin: 5px 0 0;
  color: var(--slate-300);
  font-size: 0.78rem;
  line-height: 1.35;
}

.break-counter {
  display: grid;
  justify-items: end;
  padding-top: 1px;
}

.break-counter strong {
  color: var(--paper);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.arena {
  position: relative;
  display: flex;
  min-height: 360px;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 11px 0 14px;
  border-top: 1px solid rgba(171, 191, 255, 0.08);
  border-bottom: 1px solid rgba(171, 191, 255, 0.08);
  background:
    radial-gradient(circle at 50% 47%, rgba(105, 75, 218, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(11, 17, 41, 0.28), rgba(7, 11, 27, 0.12));
}

.arena-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.55;
  pointer-events: none;
}

.contour {
  position: absolute;
  display: block;
  width: 260px;
  height: 140px;
  border: 1px solid rgba(137, 124, 236, 0.16);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.contour-a {
  top: 28%;
  left: -135px;
}

.contour-b {
  top: 46%;
  right: -156px;
  transform: rotate(19deg);
}

.contour-c {
  bottom: -58px;
  left: 20%;
  width: 330px;
  transform: rotate(3deg);
}

.arena-heading {
  display: flex;
  width: 100%;
  justify-content: space-between;
  padding: 0 2px;
}

.arena-hint {
  color: var(--copper);
  font-size: 0.57rem;
  font-weight: 700;
}

.geode-button {
  position: relative;
  display: grid;
  width: min(76vw, 308px);
  aspect-ratio: 1;
  margin: 3px 0 1px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
  isolation: isolate;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 560ms var(--ease);
}

.geode-button:not(:disabled) {
  cursor: pointer;
}

.app-shell[data-phase="cracking"] .geode-button {
  cursor: pointer;
}

.geode-button:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 9px;
  border-radius: 50%;
}

.geode-button:disabled {
  opacity: 0.92;
}

.result-amount-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  min-width: 100px;
  color: var(--copper-light);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-variant-numeric: tabular-nums;
  font-weight: 950;
  letter-spacing: -0.08em;
  line-height: 0.9;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 3px 0 rgba(7, 11, 27, 0.8), 0 0 24px rgba(245, 168, 74, 0.7);
  transform: translate(-50%, -50%) scale(0.72) rotate(-4deg);
}

.app-shell[data-phase="result"] .result-amount-overlay {
  opacity: 1;
  animation: payoff-number 720ms var(--ease) both;
}

.app-shell[data-result="loss"] .result-amount-overlay,
.result-amount-overlay[data-result="loss"] {
  color: #ffd2d8;
  text-shadow: 0 3px 0 rgba(69, 20, 42, 0.9), 0 0 24px rgba(255, 142, 157, 0.7);
}

.app-shell[data-result="gain"] .result-amount-overlay,
.result-amount-overlay[data-result="gain"] {
  color: var(--copper-light);
}

.result-amount-overlay[data-result="even"] {
  color: var(--slate-300);
  text-shadow: 0 3px 0 rgba(7, 11, 27, 0.8), 0 0 18px rgba(189, 196, 221, 0.34);
}

.app-shell[data-phase="result"] .result-amount-overlay[data-large="true"] {
  font-size: clamp(2.5rem, 10vw, 4rem);
}

.geode-halo {
  position: absolute;
  z-index: -1;
  width: 75%;
  height: 75%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(119, 88, 242, 0.34), transparent 68%);
  filter: blur(10px);
  transition: background 240ms var(--ease), transform 240ms var(--ease);
}

.geode-button:not(:disabled) .geode-halo {
  background: radial-gradient(circle, rgba(245, 168, 74, 0.2), rgba(119, 88, 242, 0.14) 42%, transparent 72%);
  transform: scale(1.16);
}

.inner-peek {
  position: absolute;
  z-index: 1;
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 224, 133, 0.72), rgba(245, 168, 74, 0.16) 42%, transparent 72%);
  filter: blur(9px);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.42);
  transition: opacity 220ms var(--ease), transform 340ms var(--ease), background 220ms var(--ease);
}

.inner-peek-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16%;
  height: 16%;
  border-radius: 50%;
  background: #fff0b2;
  box-shadow: 0 0 22px 8px rgba(255, 201, 88, 0.7);
  transform: translate(-50%, -50%);
}

.app-shell[data-phase="cracking"] .inner-peek {
  opacity: 0.14;
  transform: scale(0.66);
  animation: peek-breathe 1.2s ease-in-out infinite alternate;
}

.app-shell[data-phase="cracking"][data-hits="2"] .inner-peek,
.app-shell[data-phase="cracking"][data-hits="3"] .inner-peek {
  opacity: 0.28;
  transform: scale(0.84);
}

.app-shell[data-phase="cracking"][data-hits="4"] .inner-peek,
.app-shell[data-phase="cracking"][data-hits="5"] .inner-peek {
  opacity: 0.42;
  transform: scale(1);
}

.app-shell[data-tier="geode"] .inner-peek {
  background: radial-gradient(circle, rgba(225, 180, 255, 0.82), rgba(142, 84, 232, 0.2) 42%, transparent 72%);
}

.app-shell[data-tier="geode"] .inner-peek-core {
  background: #f1d6ff;
  box-shadow: 0 0 22px 8px rgba(178, 105, 255, 0.82);
}

.geode-image {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  transition:
    opacity 420ms var(--ease),
    transform 560ms var(--ease),
    filter 420ms var(--ease);
}

.geode-image-closed {
  opacity: 1;
  filter: drop-shadow(0 22px 17px rgba(0, 0, 0, 0.45));
}

.geode-image-open {
  opacity: 0;
  transform: scale(0.84);
  filter: drop-shadow(0 20px 22px rgba(155, 101, 255, 0.3));
}

.app-shell[data-phase="reveal"] .geode-image-closed,
.app-shell[data-phase="result"] .geode-image-closed {
  opacity: 0;
  transform: scale(0.82) rotate(-3deg);
}

.app-shell[data-phase="reveal"] .geode-image-open,
.app-shell[data-phase="result"] .geode-image-open {
  opacity: 1;
  transform: scale(1);
}

.app-shell[data-phase="reveal"] .inner-peek,
.app-shell[data-phase="result"] .inner-peek,
.app-shell[data-phase="idle"] .inner-peek {
  opacity: 0;
}

.app-shell[data-tier="geode"] .geode-image-closed {
  filter: saturate(1.12) brightness(0.88) drop-shadow(0 0 22px rgba(172, 121, 255, 0.24)) drop-shadow(0 22px 17px rgba(0, 0, 0, 0.45));
}

.app-shell[data-tier="geode"] .geode-halo {
  background: radial-gradient(circle, rgba(172, 121, 255, 0.34), rgba(245, 168, 74, 0.12) 42%, transparent 72%);
}

.app-shell[data-tier="geode"] .meter-fill {
  background: linear-gradient(90deg, #8550d8, var(--copper-light));
}

.app-shell[data-outcome="quartz"] .geode-image-open {
  filter: brightness(0.95) drop-shadow(0 15px 18px rgba(0, 0, 0, 0.42));
}

.app-shell[data-outcome="iron"] .geode-image-open {
  filter: grayscale(0.24) saturate(0.8) brightness(0.88) drop-shadow(0 15px 18px rgba(0, 0, 0, 0.42));
}

.app-shell[data-outcome="gold"] .geode-image-open {
  filter: saturate(1.05) brightness(1.02) drop-shadow(0 20px 22px rgba(245, 168, 74, 0.28));
}

.app-shell[data-outcome="legendary"] .geode-image-open {
  filter: saturate(1.22) brightness(1.08) drop-shadow(0 0 28px rgba(208, 164, 255, 0.74));
}

.crack-layer {
  position: absolute;
  width: 69%;
  height: 69%;
  opacity: 0;
  transform: rotate(-2deg);
  transition: opacity 180ms var(--ease);
  pointer-events: none;
}

.crack-line {
  fill: none;
  stroke: #f5c878;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.7;
  filter: drop-shadow(0 0 3px rgba(245, 168, 74, 0.72));
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.app-shell[data-phase="cracking"] .crack-layer,
.app-shell[data-phase="reveal"] .crack-layer {
  opacity: 1;
}

.app-shell[data-hits="1"] .crack-one,
.app-shell[data-hits="2"] .crack-one,
.app-shell[data-hits="3"] .crack-one,
.app-shell[data-hits="4"] .crack-one,
.app-shell[data-hits="5"] .crack-one {
  opacity: 0.8;
}

.app-shell[data-hits="2"] .crack-two,
.app-shell[data-hits="3"] .crack-two,
.app-shell[data-hits="4"] .crack-two,
.app-shell[data-hits="5"] .crack-two {
  opacity: 0.74;
}

.app-shell[data-hits="3"] .crack-three,
.app-shell[data-hits="4"] .crack-three,
.app-shell[data-hits="5"] .crack-three {
  opacity: 0.72;
}

.app-shell[data-hits="4"] .crack-four,
.app-shell[data-hits="5"] .crack-four {
  opacity: 0.76;
}

.touch-hint {
  position: absolute;
  bottom: 5%;
  left: 50%;
  z-index: 2;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 99px;
  background: rgba(8, 12, 30, 0.62);
  color: var(--paper);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease);
}

.app-shell[data-phase="idle"] .touch-hint {
  opacity: 0.85;
  transform: translate(-50%, 0);
}

.app-shell[data-phase="cracking"] .touch-hint {
  opacity: 0;
}

.damage-meter {
  width: min(84vw, 330px);
}

.meter-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.meter-topline strong {
  color: var(--paper);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.meter-track {
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(245, 168, 74, 0.18);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.meter-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d97b38, var(--copper-light));
  box-shadow: 0 0 14px rgba(245, 168, 74, 0.52);
  transition: width 260ms var(--ease);
}

.peek-signal {
  display: block;
  min-height: 14px;
  margin-top: 6px;
  color: var(--slate-500);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.04em;
  opacity: 0.72;
  text-align: center;
  transition: color 180ms var(--ease), opacity 180ms var(--ease);
}

.peek-signal.is-live {
  color: var(--copper-light);
  opacity: 1;
}

.action-zone {
  display: grid;
  gap: 9px;
}

.goal-panel {
  display: grid;
  min-height: 132px;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(153, 244, 209, 0.3);
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 0%, rgba(153, 244, 209, 0.14), transparent 44%),
    linear-gradient(135deg, rgba(19, 53, 61, 0.9), rgba(15, 21, 45, 0.92));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  transition: border-color 220ms var(--ease), background 220ms var(--ease), opacity 220ms var(--ease), transform 220ms var(--ease);
}

.goal-panel[data-state="geode"] {
  border-color: rgba(172, 121, 255, 0.52);
  background:
    radial-gradient(circle at 86% 0%, rgba(172, 121, 255, 0.24), transparent 44%),
    linear-gradient(135deg, rgba(44, 32, 80, 0.92), rgba(15, 21, 45, 0.92));
}

.goal-panel[data-state="hammer"] {
  border-color: rgba(245, 168, 74, 0.58);
  background:
    radial-gradient(circle at 86% 0%, rgba(245, 168, 74, 0.22), transparent 44%),
    linear-gradient(135deg, rgba(66, 42, 31, 0.92), rgba(15, 21, 45, 0.92));
}

.goal-panel[data-state="max"] {
  border-color: rgba(209, 173, 255, 0.44);
}

.goal-topline,
.goal-value-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.goal-step {
  color: var(--copper-light);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.goal-panel[data-state="geode"] .goal-step {
  color: var(--violet-bright);
}

.goal-panel[data-state="hammer"] .goal-step,
.goal-panel[data-state="max"] .goal-step {
  color: var(--copper-light);
}

.goal-panel > strong {
  overflow: hidden;
  color: var(--paper);
  font-size: 1.02rem;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.goal-value {
  color: var(--mint);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.08rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.goal-panel[data-state="geode"] .goal-value {
  color: var(--violet-bright);
}

.goal-panel[data-state="hammer"] .goal-value,
.goal-panel[data-state="max"] .goal-value {
  color: var(--copper-light);
}

.goal-current {
  color: var(--slate-500);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.56rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.goal-track {
  height: 7px;
  overflow: hidden;
  border: 1px solid rgba(214, 222, 255, 0.15);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
}

.goal-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #55bfaa, var(--copper-light));
  box-shadow: 0 0 14px rgba(153, 244, 209, 0.34);
  transition: width 320ms var(--ease);
}

.goal-panel[data-state="geode"] .goal-fill {
  background: linear-gradient(90deg, var(--violet), var(--violet-bright));
  box-shadow: 0 0 14px rgba(172, 121, 255, 0.38);
}

.goal-panel[data-state="hammer"] .goal-fill,
.goal-panel[data-state="max"] .goal-fill {
  background: linear-gradient(90deg, #d97b38, var(--copper-light));
  box-shadow: 0 0 14px rgba(245, 168, 74, 0.38);
}

.goal-copy {
  overflow: hidden;
  color: var(--slate-300);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-progress {
  display: grid;
  gap: 5px;
  padding-top: 7px;
  border-top: 1px solid rgba(214, 222, 255, 0.1);
}

.scene-progress-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scene-progress-label,
.scene-progress-topline strong {
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.53rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-progress-label {
  color: var(--slate-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene-progress-topline strong {
  color: var(--slate-300);
  font-weight: 700;
  text-align: right;
}

.scene-progress-track {
  height: 5px;
  overflow: hidden;
  border: 1px solid rgba(214, 222, 255, 0.13);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
}

.scene-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--copper-light));
  box-shadow: 0 0 12px rgba(172, 121, 255, 0.32);
  transition: width 360ms var(--ease), background 180ms var(--ease);
}

.scene-progress[data-state="near"] .scene-progress-topline strong {
  color: var(--copper-light);
}

.scene-progress[data-state="near"] .scene-progress-fill {
  background: linear-gradient(90deg, var(--copper), var(--copper-light));
}

.scene-progress[data-state="changed"] {
  animation: scene-shift-pulse 620ms var(--ease) both;
}

.scene-progress[data-state="changed"] .scene-progress-topline strong {
  color: var(--violet-bright);
}

.growth-rail {
  display: grid;
  gap: 11px;
  padding: 12px;
  border: 1px solid rgba(172, 121, 255, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 0%, rgba(172, 121, 255, 0.14), transparent 38%),
    linear-gradient(135deg, rgba(27, 29, 61, 0.9), rgba(15, 21, 45, 0.92));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  transition: opacity 220ms var(--ease), transform 220ms var(--ease), filter 220ms var(--ease);
}

.growth-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.growth-heading .panel-copy {
  gap: 3px;
}

.growth-heading .panel-copy strong {
  font-size: 0.73rem;
  letter-spacing: 0.06em;
}

.growth-hint {
  max-width: 120px;
  color: var(--slate-500);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.56rem;
  line-height: 1.35;
  text-align: right;
}

.growth-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}

.growth-option {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(214, 222, 255, 0.1);
  border-radius: 13px;
  background: rgba(8, 13, 33, 0.42);
}

.growth-option-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.growth-state,
.upgrade-hint {
  overflow: hidden;
  color: var(--slate-300);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.54rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.tier-button,
.upgrade-button {
  display: inline-grid;
  min-width: 0;
  min-height: 45px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 6px 5px;
  border: 1px solid rgba(214, 222, 255, 0.15);
  border-radius: 10px;
  background: rgba(60, 68, 101, 0.3);
  color: var(--slate-300);
  cursor: pointer;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: transform 150ms var(--ease), border-color 150ms var(--ease), background 150ms var(--ease), opacity 150ms var(--ease);
  touch-action: manipulation;
}

.tier-button strong,
.upgrade-button strong {
  color: var(--paper);
  font-size: 0.75rem;
  letter-spacing: -0.03em;
}

.tier-button small {
  color: var(--slate-500);
  font-size: 0.44rem;
  letter-spacing: 0.09em;
}

.tier-button.is-selected {
  border-color: rgba(245, 168, 74, 0.74);
  background: linear-gradient(145deg, rgba(123, 74, 42, 0.65), rgba(67, 48, 66, 0.72));
  color: var(--copper-light);
  box-shadow: inset 0 0 16px rgba(245, 168, 74, 0.08);
}

#geodeTierButton:not(:disabled):not(.is-selected) {
  border-color: rgba(172, 121, 255, 0.62);
  background: linear-gradient(145deg, rgba(92, 62, 145, 0.48), rgba(44, 35, 83, 0.72));
  color: var(--violet-bright);
  box-shadow: inset 0 0 16px rgba(172, 121, 255, 0.08), 0 0 14px rgba(127, 78, 212, 0.12);
}

#geodeTierButton:not(:disabled):not(.is-selected) small {
  color: #d8baff;
}

.tier-button:not(:disabled):not(.is-selected):hover {
  border-color: rgba(172, 121, 255, 0.62);
  background: rgba(75, 62, 122, 0.42);
}

.tier-button:disabled,
.upgrade-button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.upgrade-button {
  width: 100%;
  border-color: rgba(209, 173, 255, 0.48);
  background: linear-gradient(145deg, rgba(126, 85, 197, 0.82), rgba(69, 49, 130, 0.9));
  color: var(--violet-bright);
  box-shadow: 0 6px 14px rgba(92, 58, 170, 0.18);
}

.upgrade-button:not(:disabled):hover {
  border-color: var(--violet-bright);
  filter: brightness(1.08);
}

.upgrade-button:not(:disabled):active,
.tier-button:not(:disabled):active {
  transform: translateY(1px) scale(0.98);
}

.action-panel {
  display: grid;
  min-height: 88px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(26, 34, 64, 0.86), rgba(15, 21, 45, 0.88));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.panel-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.panel-copy strong {
  overflow: hidden;
  color: var(--paper);
  font-size: 0.96rem;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-copy > span:last-child {
  color: var(--slate-500);
  font-size: 0.7rem;
}

.primary-button,
.sell-button {
  display: inline-grid;
  min-width: 114px;
  min-height: 58px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 214, 139, 0.58);
  border-radius: 15px;
  background: linear-gradient(150deg, #ffc56a, #d8782c);
  color: #241408;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 8px 18px rgba(212, 113, 38, 0.25);
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 150ms var(--ease), filter 150ms var(--ease), opacity 150ms var(--ease);
  touch-action: manipulation;
}

.primary-button strong,
.sell-button strong {
  font-size: 1.05rem;
  letter-spacing: -0.04em;
}

.primary-button:not(:disabled):active,
.sell-button:not(:disabled):active,
.crack-button:not(:disabled):active {
  transform: translateY(2px) scale(0.98);
}

.primary-button:not(:disabled):hover,
.sell-button:not(:disabled):hover {
  filter: brightness(1.08);
}

.primary-button:disabled {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(74, 83, 112, 0.45);
  color: var(--slate-300);
  cursor: not-allowed;
  box-shadow: none;
}

.tap-panel {
  min-height: 108px;
}

.outcome-odds {
  display: grid;
  grid-column: 1 / -1;
  gap: 4px;
  min-width: 0;
  padding-top: 7px;
  border-top: 1px solid rgba(171, 191, 255, 0.12);
}

.odds-list {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
}

.odds-item {
  display: inline-flex;
  min-width: 43px;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid rgba(189, 196, 221, 0.2);
  border-radius: 8px;
  background: rgba(7, 12, 31, 0.46);
  color: var(--paper);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.odds-item strong {
  font-size: 0.63rem;
  letter-spacing: -0.03em;
}

.odds-item small {
  color: var(--slate-300);
  font-size: 0.5rem;
}

.odds-item[data-loss="true"] {
  border-color: rgba(255, 142, 157, 0.52);
  background: rgba(95, 34, 55, 0.34);
  color: var(--rose);
}

.odds-item[data-loss="true"] small {
  color: rgba(255, 203, 210, 0.82);
}

.odds-note {
  overflow: hidden;
  color: var(--slate-500);
  font-size: 0.48rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crack-button {
  display: grid;
  width: 82px;
  height: 82px;
  flex: 0 0 auto;
  place-items: center;
  align-content: center;
  gap: 2px;
  border: 2px solid rgba(255, 214, 139, 0.72);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #ffd88d, #dc7c2e 70%);
  color: #251507;
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 0 0 7px rgba(245, 168, 74, 0.08),
    0 10px 24px rgba(215, 116, 40, 0.28);
  cursor: pointer;
  font-size: 0.59rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  touch-action: manipulation;
  transition: transform 150ms var(--ease), filter 150ms var(--ease);
}

.crack-button-mark {
  display: grid;
  place-items: center;
}

.crack-button-mark svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.reveal-panel {
  display: flex;
  min-height: 88px;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  border: 1px solid rgba(172, 121, 255, 0.45);
  border-radius: 18px;
  background:
    radial-gradient(circle at 87% 50%, rgba(172, 121, 255, 0.3), transparent 35%),
    rgba(37, 26, 75, 0.78);
  box-shadow: 0 0 28px rgba(172, 121, 255, 0.14);
}

.reveal-panel strong {
  display: block;
  margin-top: 4px;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
}

.reveal-copy {
  display: block;
  margin-top: 4px;
  color: var(--slate-300);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.56rem;
  letter-spacing: 0.05em;
}

.reveal-panel[data-tone="gold"] {
  border-color: rgba(245, 168, 74, 0.62);
  background:
    radial-gradient(circle at 87% 50%, rgba(245, 168, 74, 0.32), transparent 35%),
    rgba(65, 42, 29, 0.82);
}

.reveal-panel[data-tone="amethyst"],
.reveal-panel[data-tone="legendary"] {
  border-color: rgba(209, 173, 255, 0.72);
  background:
    radial-gradient(circle at 87% 50%, rgba(172, 121, 255, 0.42), transparent 38%),
    rgba(37, 26, 75, 0.88);
}

.reveal-spark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(209, 173, 255, 0.48);
  border-radius: 50%;
  color: var(--violet-bright);
  font-size: 1.35rem;
  box-shadow: 0 0 20px rgba(172, 121, 255, 0.35);
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 106px;
  padding: 13px;
  border: 1px solid rgba(153, 244, 209, 0.3);
  border-radius: 18px;
  border-color: rgba(153, 244, 209, 0.3);
  background:
    radial-gradient(circle at 78% 15%, rgba(153, 244, 209, 0.14), transparent 42%),
    linear-gradient(135deg, rgba(21, 54, 62, 0.9), rgba(15, 29, 50, 0.92));
}

.result-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.result-copy strong {
  overflow: hidden;
  font-size: 0.92rem;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-net {
  color: var(--mint);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.69rem;
}

.result-bank {
  overflow: hidden;
  color: var(--slate-300);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.55rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-panel[data-result="loss"] {
  border-color: rgba(255, 142, 157, 0.68);
  background:
    radial-gradient(circle at 78% 15%, rgba(255, 142, 157, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(69, 34, 53, 0.9), rgba(15, 29, 50, 0.94));
}

.result-panel[data-result="loss"] .result-net,
.result-panel[data-result="loss"] .result-value strong {
  color: var(--rose);
}

.result-panel[data-result="gain"] .result-net {
  color: var(--mint);
}

.result-panel[data-result="even"] {
  border-color: rgba(189, 196, 221, 0.34);
  background:
    radial-gradient(circle at 78% 15%, rgba(189, 196, 221, 0.13), transparent 42%),
    linear-gradient(135deg, rgba(35, 43, 64, 0.9), rgba(15, 29, 50, 0.94));
}

.result-panel[data-result="even"] .result-net,
.result-panel[data-result="even"] .result-value strong {
  color: var(--slate-200);
}

.result-quartz .result-net {
  color: var(--rose);
}

.result-value {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.result-value strong {
  color: var(--mint);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.result-quartz .result-value strong {
  color: var(--rose);
}

.result-gold {
  border-color: rgba(245, 168, 74, 0.65);
  background:
    radial-gradient(circle at 78% 15%, rgba(245, 168, 74, 0.24), transparent 42%),
    linear-gradient(135deg, rgba(67, 46, 31, 0.92), rgba(25, 27, 48, 0.94));
}

.result-gold .result-value strong {
  color: var(--copper-light);
  font-size: 1.38rem;
}

.result-amethyst,
.result-legendary {
  border-color: rgba(209, 173, 255, 0.62);
  background:
    radial-gradient(circle at 86% 45%, rgba(172, 121, 255, 0.36), transparent 48%),
    linear-gradient(135deg, rgba(49, 33, 87, 0.94), rgba(20, 23, 56, 0.94));
  animation: jackpot-glow 1.5s ease-in-out infinite alternate;
}

.result-amethyst .result-value strong,
.result-legendary .result-value strong {
  color: var(--violet-bright);
  font-size: 1.52rem;
}

.result-legendary {
  border-color: rgba(245, 168, 74, 0.82);
  background:
    radial-gradient(circle at 86% 45%, rgba(245, 168, 74, 0.4), transparent 48%),
    linear-gradient(135deg, rgba(73, 47, 64, 0.95), rgba(29, 24, 49, 0.96));
}

.result-legendary .result-value strong {
  color: var(--copper-light);
  font-size: 1.72rem;
}

.cash-readout strong.cash-surging {
  color: var(--copper-light);
  animation: cash-surging 460ms var(--ease) both;
}

.sell-button {
  min-width: 76px;
  min-height: 58px;
  border-color: rgba(153, 244, 209, 0.7);
  background: linear-gradient(150deg, #a8f7d9, #4cbf9c);
  color: #09221e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 18px rgba(76, 191, 156, 0.2);
}

.last-break {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 25px;
  padding: 0 3px;
  color: var(--slate-500);
  font-size: 0.67rem;
}

.last-break > span:last-child {
  color: var(--slate-300);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.65rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 18px max(13px, env(safe-area-inset-bottom));
  color: rgba(121, 131, 164, 0.72);
  font-size: 0.53rem;
}

.text-button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--slate-500);
  cursor: pointer;
  font-size: 0.55rem;
}

.text-button:hover {
  color: var(--paper);
}

.is-hidden {
  display: none !important;
}

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.impact-ring {
  position: absolute;
  top: 49%;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 214, 139, 0.85);
  border-radius: 50%;
  animation: ring-burst 500ms var(--ease) forwards;
}

.particle {
  position: absolute;
  top: 49%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--copper-light);
  box-shadow: 0 0 8px rgba(245, 168, 74, 0.7);
  animation: particle-burst 540ms var(--ease) forwards;
}

.toast {
  position: absolute;
  right: 18px;
  bottom: 45px;
  left: 18px;
  z-index: 6;
  padding: 10px 14px;
  border: 1px solid rgba(153, 244, 209, 0.28);
  border-radius: 12px;
  background: rgba(7, 12, 28, 0.92);
  color: var(--mint);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translateY(8px);
}

.toast.is-visible {
  animation: toast-in 1.3s var(--ease) both;
}

.impact .geode-button {
  animation: geode-impact 330ms var(--ease);
}

.reveal-punch .geode-button {
  animation: reveal-punch 520ms var(--ease);
}

.reveal-punch .reveal-panel {
  animation: reveal-panel-in 520ms var(--ease);
}

.payoff-loss .result-panel {
  box-shadow: 0 0 0 1px rgba(255, 142, 157, 0.16), 0 0 26px rgba(255, 142, 157, 0.2);
}

.payoff-gain .result-panel {
  box-shadow: 0 0 0 1px rgba(245, 168, 74, 0.16), 0 0 26px rgba(245, 168, 74, 0.18);
}

.payoff-large .arena {
  animation: payoff-shake 460ms var(--ease);
}

.payoff-large .result-panel {
  animation: payoff-card 760ms var(--ease) both;
}

.jackpot-moment .result-panel {
  animation: jackpot-arrival 900ms var(--ease) both, jackpot-glow 1.5s ease-in-out 900ms infinite alternate;
}

.jackpot-moment .result-value strong {
  animation: jackpot-number 720ms var(--ease) both;
}

.is-broke .geode-image-closed {
  filter: grayscale(0.7) brightness(0.65) drop-shadow(0 17px 16px rgba(0, 0, 0, 0.48));
}

@keyframes geode-impact {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  24% {
    transform: translateX(-4px) rotate(-1deg);
  }
  48% {
    transform: translateX(4px) rotate(1deg);
  }
  72% {
    transform: translateX(-2px) rotate(-0.5deg);
  }
}

@keyframes peek-breathe {
  from {
    filter: blur(9px);
  }
  to {
    filter: blur(13px);
  }
}

@keyframes reveal-punch {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.045);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes reveal-panel-in {
  from {
    opacity: 0.2;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes jackpot-arrival {
  0% {
    opacity: 0.2;
    transform: translateY(12px) scale(0.96);
  }
  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes jackpot-number {
  0% {
    transform: scale(0.78);
    filter: brightness(1);
  }
  62% {
    transform: scale(1.16);
    filter: brightness(1.45);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes cash-surging {
  0% {
    transform: translateY(4px) scale(0.92);
  }
  58% {
    transform: translateY(-2px) scale(1.12);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes payoff-number {
  0% {
    opacity: 0;
    transform: translate(-50%, -42%) scale(0.62) rotate(-7deg);
  }
  42% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.14) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
}

@keyframes payoff-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  18% {
    transform: translateX(-5px);
  }
  36% {
    transform: translateX(5px);
  }
  54% {
    transform: translateX(-3px);
  }
  72% {
    transform: translateX(3px);
  }
}

@keyframes payoff-card {
  0% {
    transform: scale(0.96);
  }
  44% {
    transform: scale(1.035);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes ring-burst {
  from {
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.6);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(8);
  }
}

@keyframes particle-burst {
  from {
    opacity: 0.95;
    transform: translate(-50%, -50%) rotate(var(--particle-angle)) translateY(-12px) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--particle-angle)) translateY(calc(-1 * var(--particle-distance))) scale(0.2);
  }
}

@keyframes scene-shift-pulse {
  0% {
    opacity: 0.55;
    transform: translateY(3px);
  }

  55% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jackpot-glow {
  from {
    box-shadow: 0 0 0 rgba(172, 121, 255, 0);
  }
  to {
    box-shadow: 0 0 25px rgba(172, 121, 255, 0.18);
  }
}

@keyframes toast-in {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  15%,
  78% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}

@media (min-width: 560px) {
  body {
    display: grid;
    padding: 24px 0;
    place-items: center;
  }

  .app-shell {
    min-height: min(900px, calc(100dvh - 48px));
    border: 1px solid rgba(171, 191, 255, 0.1);
    border-radius: 28px;
  }
}

@media (max-height: 720px) {
  .game-main {
    gap: 9px;
  }

  .arena {
    min-height: 300px;
  }

  .geode-button {
    width: min(64vw, 250px);
  }

  .status-text {
    font-size: 0.7rem;
  }
}

@media (max-width: 370px) {
  .topbar-stats {
    gap: 9px;
  }

  .growth-body {
    grid-template-columns: 1fr;
  }
}

/* Phase 1R.2: the loop is spatially different on a phone and on a wide screen. */
.play-layout {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 13px;
}

.left-rail,
.right-rail {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.arena {
  order: 1;
}

.left-rail {
  order: 3;
}

.right-rail {
  order: 2;
}

.tier-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tier-button {
  min-height: 48px;
  padding-right: 3px;
  padding-left: 3px;
}

.tier-button span,
.tier-button strong,
.tier-button small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tier-button.is-safety {
  border-color: rgba(153, 244, 209, 0.35);
  background: linear-gradient(145deg, rgba(33, 85, 83, 0.46), rgba(28, 46, 70, 0.74));
}

.tier-button.is-safety.is-selected {
  border-color: rgba(153, 244, 209, 0.72);
  background: linear-gradient(145deg, rgba(47, 105, 88, 0.72), rgba(31, 56, 76, 0.8));
  color: var(--mint);
}

.tier-button[data-locked="true"] {
  filter: saturate(0.55);
}

.app-shell[data-tier="free"] .geode-halo {
  background: radial-gradient(circle, rgba(153, 244, 209, 0.23), rgba(245, 168, 74, 0.1) 42%, transparent 72%);
}

.app-shell[data-tier="free"] .geode-image-closed {
  filter: saturate(0.72) brightness(0.91) drop-shadow(0 18px 16px rgba(0, 0, 0, 0.48));
}

.app-shell[data-tier="free"] .meter-fill {
  background: linear-gradient(90deg, #55bfaa, var(--copper-light));
  box-shadow: 0 0 14px rgba(153, 244, 209, 0.34);
}

.app-shell[data-outcome="free"] .geode-image-open {
  filter: saturate(0.82) brightness(1.04) drop-shadow(0 15px 18px rgba(76, 191, 156, 0.22));
}

.result-free {
  border-color: rgba(153, 244, 209, 0.48);
  background:
    radial-gradient(circle at 78% 15%, rgba(153, 244, 209, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(23, 65, 66, 0.9), rgba(15, 29, 50, 0.92));
}

.result-free .result-net,
.result-free .result-value strong {
  color: var(--mint);
}

.app-shell[data-outcome-id="spark"] .result-free {
  border-color: rgba(245, 168, 74, 0.56);
  background:
    radial-gradient(circle at 78% 15%, rgba(245, 168, 74, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(67, 46, 31, 0.9), rgba(15, 29, 50, 0.92));
}

.app-shell[data-outcome-id="spark"] .result-free .result-net,
.app-shell[data-outcome-id="spark"] .result-free .result-value strong {
  color: var(--copper-light);
}

.app-shell[data-outcome-id="glint"] .result-free {
  border-color: rgba(171, 191, 255, 0.68);
  background:
    radial-gradient(circle at 78% 15%, rgba(171, 191, 255, 0.24), transparent 42%),
    linear-gradient(135deg, rgba(31, 49, 79, 0.9), rgba(15, 29, 50, 0.92));
}

.app-shell[data-outcome-id="glint"] .result-free .result-net,
.app-shell[data-outcome-id="glint"] .result-free .result-value strong {
  color: var(--paper);
}

.app-shell[data-outcome-id="lucky"] .result-free {
  border-color: rgba(209, 173, 255, 0.68);
  background:
    radial-gradient(circle at 78% 15%, rgba(172, 121, 255, 0.3), transparent 44%),
    linear-gradient(135deg, rgba(49, 33, 87, 0.92), rgba(15, 29, 50, 0.94));
}

.app-shell[data-outcome-id="lucky"] .result-free .result-net,
.app-shell[data-outcome-id="lucky"] .result-free .result-value strong {
  color: var(--violet-bright);
}

.app-shell[data-outcome-id="lucky"] .result-free .result-value strong {
  font-size: 1.34rem;
}

.flow-light {
  position: absolute;
  top: 16%;
  right: -20%;
  width: 54%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(245, 168, 74, 0.5), transparent);
  opacity: 0.24;
  transform: rotate(-18deg);
}

.app-shell[data-variant="1"] .geode-image-closed {
  transform: rotate(-5deg) scale(0.94) translateY(2px);
}

.app-shell[data-variant="2"] .geode-image-closed {
  transform: rotate(4deg) scale(1.04) translateY(-1px);
  filter: saturate(1.08) brightness(1.02) drop-shadow(0 22px 17px rgba(0, 0, 0, 0.45));
}

.app-shell[data-variant="3"] .geode-image-closed {
  transform: rotate(-2deg) scale(0.98) translateY(-3px);
  filter: saturate(1.16) brightness(0.96) drop-shadow(0 22px 17px rgba(0, 0, 0, 0.45));
}

.stone-arrival .arena .geode-button {
  animation: stone-arrival 680ms var(--ease) both;
}

.stone-arrival .flow-light {
  animation: flow-sweep 680ms var(--ease) both;
}

.cycle-reset .arena {
  animation: station-reset 420ms var(--ease) both;
}

.cycle-reset .growth-rail,
.cycle-reset .last-break {
  animation: cycle-copy-reset 420ms var(--ease) both;
}

@media (min-width: 680px) {
  body {
    display: grid;
    padding: 0;
    place-items: stretch;
  }

  .app-shell {
    max-width: 1280px;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .topbar {
    padding: max(12px, env(safe-area-inset-top)) 28px 8px;
  }

  .game-main {
    gap: 8px;
    padding: 4px 24px 8px;
  }

  .status-row {
    min-height: 40px;
  }

  .play-layout {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-areas: "left arena right";
    grid-template-columns: minmax(210px, 0.82fr) minmax(300px, 1.3fr) minmax(210px, 0.9fr);
    align-items: stretch;
    gap: 16px;
  }

  .left-rail,
  .arena,
  .right-rail {
    min-height: 0;
  }

  .left-rail {
    grid-area: left;
    order: initial;
    align-content: center;
  }

  .arena {
    grid-area: arena;
    order: initial;
    height: 100%;
    max-height: calc(100dvh - 112px);
    min-height: 0;
    padding: 12px 16px 14px;
    border: 1px solid rgba(171, 191, 255, 0.11);
    border-radius: 22px;
  }

  .right-rail {
    grid-area: right;
    order: initial;
    align-content: center;
  }

  .app-shell[data-phase="cracking"] .growth-rail,
  .app-shell[data-phase="reveal"] .growth-rail,
  .app-shell[data-phase="result"] .growth-rail {
    opacity: 0.12;
    filter: saturate(0.55);
    pointer-events: none;
    transform: translateX(-10px) scale(0.98);
  }

  .app-shell[data-phase="cracking"] .arena,
  .app-shell[data-phase="reveal"] .arena {
    border-color: rgba(245, 168, 74, 0.28);
    background:
      radial-gradient(circle at 50% 47%, rgba(105, 75, 218, 0.26), transparent 42%),
      linear-gradient(180deg, rgba(23, 23, 58, 0.4), rgba(7, 11, 27, 0.14));
  }

  .app-shell[data-phase="result"] .arena {
    border-color: rgba(153, 244, 209, 0.24);
    background:
      radial-gradient(circle at 52% 46%, rgba(76, 191, 156, 0.18), transparent 42%),
      linear-gradient(180deg, rgba(12, 39, 50, 0.34), rgba(7, 11, 27, 0.14));
  }

  .growth-body {
    grid-template-columns: 1fr;
  }

  .tier-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .growth-heading {
    align-items: end;
    flex-direction: row;
  }

  .growth-hint {
    max-width: none;
    text-align: left;
  }

  .geode-button {
    width: min(42vw, 260px, 62vh);
    margin: 0;
  }

  .damage-meter {
    width: min(32vw, 360px);
  }

  .action-panel {
    min-height: 92px;
  }

  .app-footer {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (min-width: 680px) and (max-height: 480px) {
  .topbar {
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 5px;
  }

  .game-main {
    padding-top: 2px;
    padding-bottom: 0;
  }

  .status-text {
    max-width: 420px;
    margin-top: 2px;
    overflow: hidden;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .status-row {
    height: 32px;
    min-height: 32px;
    overflow: hidden;
  }

  .play-layout {
    gap: 10px;
    grid-template-columns: minmax(190px, 0.72fr) minmax(280px, 1.3fr) minmax(210px, 0.88fr);
  }

  .arena {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .geode-button {
    width: min(42vw, 250px, 62vh);
  }

  .goal-panel {
    min-height: 124px;
    gap: 7px;
    padding: 11px;
  }

  .goal-panel > strong {
    font-size: 0.94rem;
  }

  .goal-value {
    font-size: 1rem;
  }

  .goal-copy {
    font-size: 0.54rem;
  }

  .growth-rail {
    gap: 5px;
    padding: 6px;
  }

  .growth-option {
    gap: 4px;
    padding: 5px;
  }

  .growth-heading .panel-copy {
    gap: 1px;
  }

  .growth-heading .panel-copy strong {
    font-size: 0.76rem;
    line-height: 1.05;
  }

  .growth-hint {
    max-width: 92px;
    font-size: 0.52rem;
    line-height: 1.1;
  }

  .growth-state,
  .upgrade-hint {
    font-size: 0.5rem;
    line-height: 1.1;
  }

  .growth-body,
  .tier-options {
    gap: 5px;
  }

  .tier-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tier-button {
    min-height: 42px;
    padding-top: 3px;
    padding-bottom: 3px;
    line-height: 1.02;
  }

  .tier-button strong {
    font-size: 0.72rem;
  }

  .tier-button small {
    font-size: 0.4rem;
  }

  .left-rail #buyPanel {
    gap: 8px;
    min-height: 78px;
    padding: 8px;
  }

  .left-rail #buyPanel .panel-copy > span:last-child {
    overflow: hidden;
    font-size: 0.5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .left-rail #buyPanel .primary-button {
    min-width: 88px;
    min-height: 48px;
    padding-right: 5px;
    padding-left: 5px;
  }

  .hammer-option .upgrade-button {
    min-height: 36px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .app-footer {
    min-height: 20px;
    font-size: 0.5rem;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: max(3px, env(safe-area-inset-bottom));
  }

  .action-panel {
    min-height: 78px;
    padding: 10px;
  }

  .tap-panel {
    gap: 8px;
    min-height: 112px;
  }

  .outcome-odds {
    gap: 3px;
    padding-top: 5px;
  }

  .odds-list {
    gap: 3px;
  }

  .odds-item {
    min-width: 40px;
    padding: 3px 5px;
  }

  .odds-item strong {
    font-size: 0.57rem;
  }

  .odds-item small,
  .odds-note {
    font-size: 0.45rem;
  }

  .primary-button,
  .sell-button {
    min-height: 52px;
  }

  .app-footer {
    padding-top: 2px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .app-footer {
    min-height: 16px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@media (min-width: 680px) and (max-height: 380px) {
  .app-footer {
    display: none;
  }

  .growth-rail {
    gap: 3px;
    padding: 4px;
  }

  .growth-heading {
    max-height: 24px;
    overflow: hidden;
  }

  .growth-heading .panel-copy strong {
    font-size: 0.68rem;
  }

  .tap-panel {
    min-height: 104px;
    gap: 5px;
  }

  .outcome-odds {
    padding-top: 4px;
  }

  .odds-item {
    min-width: 36px;
    padding: 2px 4px;
  }

  .odds-item strong {
    font-size: 0.51rem;
  }

  .odds-item small,
  .odds-note {
    font-size: 0.4rem;
  }

  .growth-hint {
    max-width: 78px;
    font-size: 0.45rem;
  }

  .goal-panel {
    min-height: 112px;
    gap: 5px;
    padding: 8px;
  }

  .goal-panel > strong {
    font-size: 0.82rem;
  }

  .goal-value {
    font-size: 0.92rem;
  }

  .goal-current,
  .goal-copy {
    font-size: 0.46rem;
  }

  .growth-body,
  .tier-options {
    gap: 3px;
  }

  .growth-option {
    gap: 2px;
    padding: 3px;
  }

  .tier-button {
    min-height: 37px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .tier-button strong {
    font-size: 0.64rem;
  }

  .tier-button small {
    font-size: 0.34rem;
  }

  .hammer-option .upgrade-hint {
    display: none;
  }

  .hammer-option .upgrade-button {
    min-height: 30px;
  }
}

/* Keep the finite order board modal truly modal across the surrounding rails.
   The stage owns the close action; unrelated investment controls stay inert
   while the player is choosing or reviewing an order. */
.app-shell.is-order-board-open .left-rail,
.app-shell.is-order-board-open .right-rail {
  pointer-events: none;
}

/* R75: finite workshop orders add long-session purpose without turning the
   world into a permanent dashboard. The ribbon is a small contextual cue;
   the board exists only after an intentional tap and has an explicit close
   path so it cannot become an input-blocking overlay. */
.order-ribbon {
  position: absolute;
  z-index: 8;
  top: 51px;
  left: 50%;
  display: grid;
  width: min(238px, calc(100% - 20px));
  min-height: 48px;
  grid-template-columns: 25px minmax(0, 1fr) 58px;
  align-items: center;
  gap: 7px;
  padding: 6px 7px;
  border: 1px solid rgba(130, 93, 126, 0.28);
  border-radius: 13px;
  background: rgba(255, 251, 247, 0.9);
  box-shadow: 0 8px 18px rgba(126, 79, 97, 0.13), inset 0 1px rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
  transition: opacity 180ms var(--ease), transform 180ms var(--ease), border-color 180ms var(--ease);
}

.order-ribbon[data-state="complete"] {
  border-color: rgba(213, 154, 49, 0.52);
  background: rgba(255, 247, 221, 0.94);
}

.order-ribbon[data-state="done"] {
  opacity: 0.72;
}

.order-ribbon-mark,
.order-choice-mark {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(213, 154, 49, 0.6);
  border-radius: 7px;
  background: linear-gradient(145deg, #fff4c9, #f2c76e);
  color: #8d5d13;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.9), 0 4px 8px rgba(143, 99, 35, 0.12);
}

.order-ribbon-mark {
  width: 25px;
  height: 31px;
}

.order-ribbon-mark::after {
  position: absolute;
  right: 3px;
  bottom: 3px;
  color: rgba(141, 93, 19, 0.56);
  content: "✦";
  font-size: 0.7rem;
}

.order-ribbon-copy,
.order-choice-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.order-ribbon-label,
.order-board-heading .section-label {
  color: #9b7d87;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.43rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.order-ribbon-copy strong {
  overflow: hidden;
  color: #493452;
  font-size: 0.59rem;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-ribbon-copy small {
  overflow: hidden;
  color: #7c6477;
  font-size: 0.45rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-board-button {
  display: grid;
  min-width: 0;
  min-height: 35px;
  align-content: center;
  justify-items: center;
  gap: 1px;
  padding: 4px 3px;
  border: 1px solid rgba(50, 185, 159, 0.42);
  border-radius: 9px;
  background: rgba(232, 255, 248, 0.92);
  color: #167e6c;
  cursor: pointer;
  font: inherit;
  font-size: 0.46rem;
  font-weight: 850;
  line-height: 1.05;
  touch-action: manipulation;
  transition: transform 150ms var(--ease), filter 150ms var(--ease), background 150ms var(--ease);
}

.order-board-button:hover,
.order-board-button:focus-visible {
  background: rgba(211, 252, 238, 0.98);
  filter: brightness(1.03);
  transform: translateY(-1px);
}

.order-board-button:active {
  transform: translateY(1px);
}

.order-board-count {
  color: #6e998e;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.4rem;
  font-weight: 750;
}

.order-board-backdrop {
  position: absolute;
  z-index: 20;
  inset: 0;
  background: rgba(58, 42, 67, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 170ms var(--ease);
}

.order-board-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.order-board-panel {
  position: absolute;
  z-index: 21;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(510px, calc(100% - 20px));
  max-height: calc(100% - 22px);
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(130, 93, 126, 0.34);
  border-radius: 17px;
  background:
    radial-gradient(circle at 88% 0%, rgba(255, 221, 151, 0.28), transparent 42%),
    rgba(255, 252, 248, 0.98);
  box-shadow: 0 18px 38px rgba(83, 51, 74, 0.26), inset 0 1px rgba(255, 255, 255, 0.98);
  opacity: 0;
  overflow: auto;
  pointer-events: none;
  transform: translate(-50%, -47%) scale(0.98);
  transition: opacity 170ms var(--ease), transform 170ms var(--ease);
}

.order-board-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.order-board-close {
  position: absolute;
  top: 7px;
  right: 8px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(130, 93, 126, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: #6e5870;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  touch-action: manipulation;
}

.order-board-close:hover,
.order-board-close:focus-visible {
  border-color: rgba(50, 185, 159, 0.55);
  color: #167e6c;
}

.order-board-heading {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding-right: 34px;
}

.order-board-heading strong {
  overflow: hidden;
  color: #493452;
  font-size: 0.96rem;
  line-height: 1.08;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-board-heading p {
  margin: 0;
  color: #765d70;
  font-size: 0.57rem;
  line-height: 1.25;
}

.order-choice-list {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.order-choice-button {
  display: grid;
  min-width: 0;
  min-height: 82px;
  grid-template-columns: 27px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 4px;
  padding: 7px;
  border: 1px solid rgba(140, 124, 241, 0.32);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(248, 245, 255, 0.98), rgba(255, 248, 241, 0.98));
  color: #493452;
  cursor: pointer;
  font: inherit;
  text-align: left;
  touch-action: manipulation;
  transition: transform 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.order-choice-button:hover,
.order-choice-button:focus-visible {
  border-color: rgba(50, 185, 159, 0.62);
  box-shadow: 0 7px 14px rgba(79, 125, 119, 0.13);
  transform: translateY(-2px);
}

.order-choice-button:active {
  transform: translateY(1px);
}

.order-choice-mark {
  grid-row: 1 / -1;
  width: 27px;
  height: 33px;
  font-size: 0.48rem;
}

.order-choice-copy strong {
  overflow: hidden;
  color: #493452;
  font-size: 0.61rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-choice-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: #765d70;
  font-size: 0.46rem;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.order-choice-reward {
  grid-column: 2;
  justify-self: end;
  color: #b66a1d;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.51rem;
  letter-spacing: 0.02em;
}

.order-active-card {
  display: grid;
  gap: 7px;
  min-height: 62px;
  align-content: center;
  padding: 10px;
  border: 1px solid rgba(50, 185, 159, 0.36);
  border-radius: 12px;
  background: rgba(233, 255, 248, 0.82);
}

.order-active-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.order-active-progress {
  color: #167e6c;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.order-active-reward {
  flex: 0 0 auto;
  color: #b66a1d;
  font-size: 0.54rem;
  font-weight: 800;
  white-space: nowrap;
}

.order-active-track {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(50, 185, 159, 0.15);
}

.order-active-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #32b99f, #f3a84a);
  transition: width 220ms var(--ease);
}

.order-all-done {
  display: grid;
  min-height: 72px;
  place-items: center;
  border: 1px dashed rgba(213, 154, 49, 0.48);
  border-radius: 12px;
  background: rgba(255, 247, 221, 0.78);
  color: #8d5d13;
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
}

.order-board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(130, 93, 126, 0.14);
}

.order-board-footer > span {
  overflow: hidden;
  color: #8a7180;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.47rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-abandon-button {
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid rgba(221, 92, 118, 0.3);
  border-radius: 8px;
  background: rgba(255, 240, 243, 0.82);
  color: #bd3e5c;
  cursor: pointer;
  font: inherit;
  font-size: 0.48rem;
  font-weight: 800;
  white-space: nowrap;
}

.order-abandon-button:hover,
.order-abandon-button:focus-visible {
  border-color: rgba(221, 92, 118, 0.58);
  background: rgba(255, 229, 235, 0.96);
}

.app-shell[data-phase="cracking"] .order-ribbon,
.app-shell[data-phase="reveal"] .order-ribbon,
.app-shell[data-phase="result"] .order-ribbon {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -5px);
}

@media (min-width: 680px) and (max-height: 420px) {
  .order-ribbon {
    top: 50px;
    left: 50%;
    width: min(224px, calc(100% - 16px));
    min-height: 43px;
    grid-template-columns: 22px minmax(0, 1fr) 54px;
    gap: 5px;
    padding: 5px;
  }

  .order-ribbon-mark {
    width: 22px;
    height: 27px;
  }

  .order-ribbon-label,
  .order-board-heading .section-label {
    font-size: 0.39rem;
  }

  .order-ribbon-copy strong {
    font-size: 0.54rem;
  }

  .order-ribbon-copy small,
  .order-board-button,
  .order-board-count {
    font-size: 0.4rem;
  }

  .order-board-button {
    min-height: 31px;
  }

  .order-board-panel {
    gap: 6px;
    padding: 9px;
  }

  .order-board-heading strong {
    font-size: 0.8rem;
  }

  .order-board-heading p,
  .order-choice-copy small {
    font-size: 0.43rem;
  }

  .order-choice-list {
    gap: 5px;
  }

  .order-choice-button {
    min-height: 65px;
    padding: 5px;
  }

  .order-choice-copy strong {
    font-size: 0.53rem;
  }

  .order-choice-reward {
    font-size: 0.45rem;
  }

  .order-active-card {
    min-height: 48px;
    padding: 7px;
  }
}

@media (max-width: 679px) and (orientation: landscape) {
  .order-ribbon {
    top: 49px;
    left: 50%;
    width: min(210px, calc(100% - 12px));
    min-height: 42px;
    grid-template-columns: 22px minmax(0, 1fr) 50px;
    gap: 5px;
    padding: 4px 5px;
  }

  .order-ribbon-mark {
    width: 22px;
    height: 26px;
  }

  .order-ribbon-copy strong {
    font-size: 0.5rem;
  }

  .order-ribbon-copy small,
  .order-board-button,
  .order-board-count {
    font-size: 0.38rem;
  }

  .order-board-panel {
    width: min(470px, calc(100% - 12px));
    gap: 6px;
    padding: 8px;
  }
}

@media (min-width: 680px) and (max-height: 480px) {
  html[lang="en"] #freeTierName,
  html[lang="en"] #rockTierName,
  html[lang="en"] #geodeTierName {
    max-height: 2.15em;
    overflow: visible;
    font-size: 0.42rem;
    letter-spacing: -0.035em;
    line-height: 1.05;
    text-overflow: clip;
    white-space: normal;
  }
}

@media (max-width: 370px) {
  .tier-button {
    min-height: 44px;
    font-size: 0.48rem;
  }

  .tier-button strong {
    font-size: 0.66rem;
  }

  .tier-button small {
    font-size: 0.38rem;
  }
}

.app-shell.jackpot-moment::after {
  inset: 0;
  z-index: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 55% 50%, rgba(172, 121, 255, 0.32), transparent 28%),
    linear-gradient(115deg, rgba(7, 11, 27, 0.62), rgba(48, 22, 73, 0.28), rgba(7, 11, 27, 0.62));
  animation: jackpot-screen 1800ms var(--ease) both;
}

.app-shell.jackpot-moment .status-row,
.app-shell.jackpot-moment .left-rail,
.app-shell.jackpot-moment .last-break {
  opacity: 0.18;
  filter: saturate(0.45);
  transform: scale(0.98);
  transition: opacity 220ms var(--ease), filter 220ms var(--ease), transform 220ms var(--ease);
}

.app-shell.jackpot-moment .arena {
  z-index: 2;
  border-color: rgba(209, 173, 255, 0.76);
  background:
    radial-gradient(circle at 52% 46%, rgba(172, 121, 255, 0.42), transparent 48%),
    linear-gradient(180deg, rgba(38, 24, 78, 0.62), rgba(7, 11, 27, 0.2));
  box-shadow: 0 0 34px rgba(172, 121, 255, 0.22);
}

.app-shell.jackpot-moment .geode-image-open {
  filter: saturate(1.28) brightness(1.18) drop-shadow(0 0 30px rgba(209, 173, 255, 0.8));
  transform: scale(1.08);
}

.app-shell.jackpot-moment .right-rail {
  z-index: 3;
}

.app-shell.jackpot-moment .right-rail .result-panel {
  display: grid;
  min-height: 184px;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 8px;
  padding: 17px;
  transform: scale(1.03);
}

.app-shell.jackpot-moment .result-copy strong {
  font-size: 1.14rem;
}

.app-shell.jackpot-moment .result-value {
  justify-items: start;
}

.app-shell.jackpot-moment .result-value strong,
.app-shell[data-outcome="amethyst"].jackpot-moment .result-value strong,
.app-shell[data-outcome="legendary"].jackpot-moment .result-value strong {
  font-size: 2.22rem;
  line-height: 0.95;
  text-shadow: 0 0 22px rgba(209, 173, 255, 0.38);
}

.app-shell.jackpot-moment .sell-button {
  width: 100%;
  min-height: 50px;
}

.app-shell.jackpot-moment .toast {
  display: none;
}

@keyframes jackpot-screen {
  0% {
    opacity: 0;
  }
  20%,
  72% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes stone-arrival {
  0% {
    opacity: 0.18;
    transform: translateX(-24px) translateY(8px) scale(0.8) rotate(-7deg);
  }
  58% {
    opacity: 1;
    transform: translateX(5px) translateY(-2px) scale(1.04) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1) rotate(0);
  }
}

@keyframes flow-sweep {
  0% {
    opacity: 0;
    transform: translateX(-80%) rotate(-18deg);
  }
  35% {
    opacity: 0.85;
  }
  100% {
    opacity: 0.24;
    transform: translateX(170%) rotate(-18deg);
  }
}

@keyframes station-reset {
  0% {
    filter: brightness(1.26);
    transform: translateY(3px) scale(1.01);
  }
  100% {
    filter: brightness(1);
    transform: translateY(0) scale(1);
  }
}

@keyframes cycle-copy-reset {
  0% {
    opacity: 0.3;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* R3: one-thumb action dock and a living mining scene. */
.target-panel {
  min-height: 78px;
  align-items: center;
}

.target-price {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 76px;
}

.target-price strong {
  color: var(--copper-light);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}

.action-microcopy {
  color: var(--slate-300);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.58rem;
  line-height: 1.25;
}

.action-dock {
  position: fixed;
  right: auto;
  bottom: max(8px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 12;
  display: grid;
  width: min(calc(100vw - 32px), 520px);
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) minmax(138px, 0.7fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(245, 168, 74, 0.46);
  border-radius: 17px;
  background: rgba(9, 16, 38, 0.94);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38), 0 0 22px rgba(245, 168, 74, 0.1);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  transition: border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.action-dock[data-phase="cracking"] {
  border-color: rgba(153, 244, 209, 0.64);
  background: rgba(9, 25, 40, 0.95);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 0 22px rgba(153, 244, 209, 0.12);
}

.action-dock[data-phase="reveal"] {
  border-color: rgba(209, 173, 255, 0.62);
  background: rgba(27, 18, 59, 0.95);
}

.action-dock[data-phase="result"] {
  border-color: rgba(153, 244, 209, 0.72);
  background: rgba(10, 39, 45, 0.95);
}

.action-dock-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.action-dock-copy > strong {
  overflow: hidden;
  color: var(--paper);
  font-size: 0.98rem;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-dock-copy .action-microcopy {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-action {
  display: grid;
  min-height: 52px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 214, 139, 0.72);
  border-radius: 13px;
  background: linear-gradient(145deg, #ffc56a, #d8782c);
  color: #241408;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), 0 8px 18px rgba(212, 113, 38, 0.24);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: transform 150ms var(--ease), filter 150ms var(--ease), opacity 150ms var(--ease), background 180ms var(--ease);
}

.main-action strong {
  font-size: 1rem;
  letter-spacing: -0.04em;
}

.main-action:not(:disabled):active {
  transform: translateY(2px) scale(0.98);
}

.main-action:not(:disabled):hover {
  filter: brightness(1.08);
}

.main-action:disabled {
  border-color: rgba(214, 222, 255, 0.18);
  background: rgba(74, 83, 112, 0.56);
  color: var(--slate-300);
  cursor: wait;
  box-shadow: none;
}

.action-dock[data-phase="cracking"] .main-action {
  border-color: rgba(153, 244, 209, 0.82);
  background: linear-gradient(145deg, #a8f7d9, #4cbf9c);
  color: #09221e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 18px rgba(76, 191, 156, 0.24);
}

.action-dock[data-phase="result"] .main-action {
  border-color: rgba(153, 244, 209, 0.84);
  background: linear-gradient(145deg, #b4f8dc, #4cbf9c);
  color: #09221e;
}

.toast {
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 11;
}

.arena {
  isolation: isolate;
}

.mine-tunnel,
.mine-vein,
.mine-lamp,
.mine-rail,
.mine-cart,
.ore-pile,
.debris,
.mine-caption {
  position: absolute;
  pointer-events: none;
}

.mine-tunnel {
  inset: 7% 5% 13%;
  border: 1px solid rgba(171, 191, 255, 0.16);
  border-radius: 49% 51% 44% 56% / 44% 46% 54% 56%;
  box-shadow: inset 0 0 28px rgba(4, 8, 23, 0.72), 0 0 0 18px rgba(8, 12, 32, 0.16);
  opacity: 0.72;
  transform: rotate(-2deg);
}

.mine-tunnel::before,
.mine-tunnel::after {
  position: absolute;
  content: "";
  border-radius: 50%;
  border: 1px solid rgba(171, 191, 255, 0.12);
}

.mine-tunnel::before {
  inset: 9% 12%;
}

.mine-tunnel::after {
  inset: 19% 23%;
  border-color: rgba(245, 168, 74, 0.11);
}

.mine-vein {
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(245, 168, 74, 0.58), transparent);
  box-shadow: 0 0 9px rgba(245, 168, 74, 0.24);
  opacity: 0.65;
  transform-origin: left center;
}

.mine-vein::after {
  position: absolute;
  top: -3px;
  left: 36%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--copper-light);
  box-shadow: 0 0 12px rgba(245, 168, 74, 0.72);
  content: "";
}

.mine-vein-a {
  top: 28%;
  left: 4%;
  width: 32%;
  transform: rotate(18deg);
}

.mine-vein-b {
  right: 4%;
  bottom: 30%;
  width: 27%;
  transform: rotate(-22deg);
}

.mine-lamp {
  top: 13%;
  right: 9%;
  width: 12px;
  height: 16px;
  border: 1px solid rgba(255, 214, 139, 0.65);
  border-radius: 5px 5px 7px 7px;
  background: #ffc56a;
  box-shadow: 0 0 23px 8px rgba(245, 168, 74, 0.25);
  opacity: 0.88;
}

.mine-lamp::before {
  position: absolute;
  top: -6px;
  left: 3px;
  width: 5px;
  height: 6px;
  border: 1px solid rgba(255, 214, 139, 0.68);
  border-bottom: 0;
  content: "";
}

.mine-rail {
  right: -5%;
  bottom: 10%;
  left: -5%;
  height: 10px;
  border-top: 2px solid rgba(171, 191, 255, 0.23);
  border-bottom: 2px solid rgba(171, 191, 255, 0.13);
  opacity: 0.72;
  transform: skewY(-7deg);
}

.mine-rail::before,
.mine-rail::after {
  position: absolute;
  top: -5px;
  width: 3px;
  height: 20px;
  background: rgba(171, 191, 255, 0.18);
  box-shadow: 40px 4px rgba(171, 191, 255, 0.18), 80px 8px rgba(171, 191, 255, 0.18), 120px 12px rgba(171, 191, 255, 0.18), 160px 16px rgba(171, 191, 255, 0.18);
  content: "";
}

.mine-rail::before {
  left: 17%;
}

.mine-rail::after {
  right: 17%;
}

.mine-cart {
  right: 12%;
  bottom: 14%;
  z-index: 1;
  width: 60px;
  height: 28px;
  border: 2px solid rgba(171, 191, 255, 0.48);
  border-radius: 5px 5px 9px 9px;
  background: linear-gradient(160deg, rgba(43, 51, 78, 0.94), rgba(17, 22, 46, 0.96));
  box-shadow: 0 7px 9px rgba(0, 0, 0, 0.3);
  transform: skewX(-7deg);
  transition: transform 420ms var(--ease), filter 420ms var(--ease);
}

.mine-cart::before {
  position: absolute;
  top: -7px;
  right: 4px;
  left: 4px;
  height: 10px;
  border: 1px solid rgba(245, 168, 74, 0.28);
  border-radius: 50% 50% 4px 4px;
  background: rgba(41, 32, 41, 0.9);
  content: "";
}

.mine-cart-load {
  position: absolute;
  right: 7px;
  bottom: 7px;
  left: 7px;
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.mine-cart-load > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--copper), var(--violet-bright));
  box-shadow: 0 0 9px rgba(172, 121, 255, 0.58);
  transition: width 500ms var(--ease);
}

.mine-cart-count {
  position: absolute;
  top: 3px;
  right: 7px;
  color: var(--paper);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.45rem;
  font-weight: 800;
}

.mine-cart-wheel {
  position: absolute;
  bottom: -7px;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(171, 191, 255, 0.56);
  border-radius: 50%;
  background: #0b1127;
}

.mine-cart-wheel-a {
  left: 8px;
}

.mine-cart-wheel-b {
  right: 8px;
}

.ore-pile {
  bottom: 17%;
  width: 17px;
  height: 11px;
  border-radius: 55% 45% 45% 55%;
  background: linear-gradient(135deg, rgba(245, 168, 74, 0.78), rgba(172, 121, 255, 0.45));
  box-shadow: 0 0 10px rgba(245, 168, 74, 0.34);
  opacity: 0.78;
}

.ore-pile-a {
  right: 27%;
  transform: rotate(18deg);
}

.ore-pile-b {
  right: 22%;
  bottom: 20%;
  width: 11px;
  height: 8px;
  transform: rotate(-22deg);
}

.debris {
  z-index: 2;
  width: 9px;
  height: 7px;
  border-radius: 2px 5px 2px 4px;
  background: linear-gradient(135deg, var(--copper-light), rgba(171, 191, 255, 0.68));
  opacity: 0;
  transform: translate(0, 0) rotate(0) scale(0.5);
  transition: opacity 180ms var(--ease), transform 360ms var(--ease);
}

.debris-a {
  top: 42%;
  left: 26%;
}

.debris-b {
  top: 51%;
  right: 23%;
  width: 6px;
  height: 10px;
}

.debris-c {
  top: 61%;
  left: 34%;
  width: 6px;
  height: 6px;
}

.app-shell[data-phase="cracking"][data-hits="1"] .debris-a,
.app-shell[data-phase="cracking"][data-hits="2"] .debris-a,
.app-shell[data-phase="cracking"][data-hits="3"] .debris-a,
.app-shell[data-phase="cracking"][data-hits="4"] .debris-a,
.app-shell[data-phase="cracking"][data-hits="5"] .debris-a,
.app-shell[data-phase="reveal"] .debris-a,
.app-shell[data-phase="result"] .debris-a {
  opacity: 0.88;
  transform: translate(-14px, -8px) rotate(24deg) scale(1);
}

.app-shell[data-hits="2"] .debris-b,
.app-shell[data-hits="3"] .debris-b,
.app-shell[data-hits="4"] .debris-b,
.app-shell[data-hits="5"] .debris-b,
.app-shell[data-phase="reveal"] .debris-b,
.app-shell[data-phase="result"] .debris-b {
  opacity: 0.8;
  transform: translate(13px, -10px) rotate(-32deg) scale(1);
}

.app-shell[data-hits="3"] .debris-c,
.app-shell[data-hits="4"] .debris-c,
.app-shell[data-hits="5"] .debris-c,
.app-shell[data-phase="reveal"] .debris-c,
.app-shell[data-phase="result"] .debris-c {
  opacity: 0.74;
  transform: translate(-18px, 10px) rotate(44deg) scale(1);
}

.mine-caption {
  bottom: 4%;
  left: 5%;
  z-index: 2;
  color: rgba(214, 222, 255, 0.62);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.46rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.app-shell[data-scene="1"] .mine-lamp {
  background: #ffe49a;
  box-shadow: 0 0 25px 9px rgba(245, 168, 74, 0.34);
}

.app-shell[data-scene="1"] .mine-vein {
  background: linear-gradient(90deg, transparent, rgba(255, 214, 139, 0.82), transparent);
}

.app-shell[data-scene="2"] .mine-lamp {
  background: #e2c6ff;
  box-shadow: 0 0 27px 10px rgba(172, 121, 255, 0.38);
}

.app-shell[data-scene="2"] .mine-vein {
  background: linear-gradient(90deg, transparent, rgba(209, 173, 255, 0.82), transparent);
  box-shadow: 0 0 12px rgba(172, 121, 255, 0.42);
}

.app-shell[data-scene="1"] .arena {
  background:
    radial-gradient(circle at 50% 47%, rgba(164, 91, 45, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(31, 25, 41, 0.4), rgba(7, 11, 27, 0.14));
}

.app-shell[data-scene="2"] .arena {
  background:
    radial-gradient(circle at 50% 47%, rgba(118, 73, 188, 0.26), transparent 44%),
    linear-gradient(180deg, rgba(22, 19, 52, 0.44), rgba(7, 11, 27, 0.14));
}

/* Each four-break shift changes the camera and work area, not only the caption. */
.app-shell[data-scene="0"] .geode-button {
  transform: translate(-2px, 3px) scale(0.94);
}

.app-shell[data-scene="1"] .geode-button {
  transform: translate(-9px, 1px) rotate(-2deg) scale(0.88);
}

.app-shell[data-scene="2"] .geode-button {
  transform: translate(9px, -2px) rotate(2deg) scale(0.9);
}

.app-shell[data-scene="1"] .mine-cart {
  right: 25%;
  bottom: 17%;
}

.app-shell[data-scene="2"] .mine-cart {
  right: 7%;
  bottom: 20%;
  transform: scale(1.05) skewX(-7deg);
}

.app-shell[data-scene="1"] .mine-caption,
.app-shell[data-scene="2"] .mine-caption {
  color: var(--copper-light);
}

.app-shell[data-phase="result"] .mine-cart {
  filter: brightness(1.28) saturate(1.15);
  transform: translateX(-4px) skewX(-7deg);
}

.app-shell.cycle-reset .mine-cart {
  animation: cart-haul 560ms var(--ease) both;
}

.app-shell.cycle-reset .ore-pile {
  animation: ore-drop 560ms var(--ease) both;
}

.app-shell.jackpot-moment .mine-tunnel {
  border-color: rgba(209, 173, 255, 0.34);
  box-shadow: inset 0 0 34px rgba(4, 8, 23, 0.72), 0 0 0 18px rgba(172, 121, 255, 0.12);
}

.app-shell.jackpot-moment .mine-lamp {
  background: #f0dcff;
  box-shadow: 0 0 32px 13px rgba(172, 121, 255, 0.64);
}

@media (max-width: 679px) {
  .game-main {
    padding-bottom: 84px;
  }

  .action-dock {
    width: calc(100vw - 24px);
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) 142px;
    padding: 8px;
  }

  .arena {
    min-height: 350px;
  }

  .geode-button {
    width: min(58vw, 220px);
  }

  .damage-meter {
    margin-bottom: 48px;
  }

  .app-footer {
    padding-bottom: 78px;
  }
}

/* R5: keep the portrait core loop in one readable first viewport. */
@media (max-width: 559px) {
  .topbar-stats {
    gap: 0;
  }

  .hammer-readout {
    display: none;
  }

  .game-main {
    gap: 8px;
    padding: 3px 12px 76px;
  }

  .status-row {
    min-height: 38px;
  }

  .status-text {
    max-width: 250px;
    margin-top: 3px;
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .arena {
    min-height: 300px;
    padding: 8px 0 10px;
  }

  .geode-button {
    width: min(52vw, 198px);
    margin: 0;
  }

  .damage-meter {
    width: min(78vw, 300px);
    margin-bottom: 30px;
  }

  .right-rail {
    gap: 6px;
  }

  .goal-panel {
    min-height: 136px;
    gap: 6px;
    padding: 10px;
    border-radius: 14px;
  }

  .goal-panel > strong {
    font-size: 0.92rem;
  }

  .goal-value {
    font-size: 1rem;
  }

  .goal-copy {
    font-size: 0.54rem;
  }

  .scene-progress {
    gap: 4px;
    padding-top: 5px;
  }

  .app-shell[data-has-last-outcome="false"] .last-break {
    display: none;
  }

  .left-rail #buyPanel {
    display: none;
  }

  .growth-rail {
    gap: 6px;
    padding: 8px;
    border-radius: 14px;
  }

  .growth-heading .panel-copy strong {
    font-size: 0.7rem;
  }

  .growth-hint {
    max-width: 126px;
    font-size: 0.52rem;
  }

  .growth-body {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hammer-option {
    display: none;
  }

  .growth-option {
    gap: 6px;
    padding: 7px;
  }

  .tier-button {
    min-height: 44px;
  }

  .mine-caption {
    bottom: 5%;
    left: 7px;
    padding: 3px 6px;
    border: 1px solid rgba(214, 222, 255, 0.16);
    border-radius: 99px;
    background: rgba(8, 12, 30, 0.48);
    color: rgba(214, 222, 255, 0.82);
    font-size: 0.54rem;
    letter-spacing: 0.08em;
  }

  .mine-cart {
    right: 6%;
    transform: scale(0.9) skewX(-7deg);
  }

  .app-footer {
    display: none;
  }
}

@media (min-width: 680px) {
  .action-dock {
    width: min(calc(100vw - 32px), 440px);
  }

  .geode-button {
    width: min(28vw, 168px, 42vh);
  }

  .damage-meter {
    width: min(31vw, 320px);
    margin-bottom: 46px;
  }

  .mine-caption {
    bottom: 5%;
  }
}

@media (min-width: 680px) and (max-height: 480px) {
  .action-dock {
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr) 132px;
    padding: 6px;
  }

  .action-dock-copy > strong {
    font-size: 0.86rem;
  }

  .action-microcopy {
    font-size: 0.52rem;
  }

  .main-action {
    min-height: 46px;
    font-size: 0.62rem;
  }

  .main-action strong {
    font-size: 0.9rem;
  }

  .target-panel {
    min-height: 68px;
  }

  .target-price strong {
    font-size: 1rem;
  }

  .mine-cart {
    right: 9%;
    bottom: 16%;
    transform: scale(0.9) skewX(-7deg);
  }

  .mine-caption {
    font-size: 0.4rem;
  }
}

@keyframes cart-haul {
  0% {
    transform: translateX(-4px) skewX(-7deg);
  }
  45% {
    transform: translateX(8px) skewX(-7deg);
  }
  100% {
    transform: translateX(0) skewX(-7deg);
  }
}

@keyframes ore-drop {
  0% {
    opacity: 0.3;
    transform: translateY(-10px) scale(1.35);
  }
  100% {
    opacity: 0.78;
    transform: translateY(0) scale(1);
  }
}

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

/* Phase 2A: visible flow equipment. The machine surfaces stay compact so the
   stone remains the visual subject while automation is still discoverable. */
.automation-status {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border: 1px solid rgba(117, 237, 205, 0.32);
  border-radius: 999px;
  color: #9df6da;
  background: rgba(12, 64, 68, 0.48);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.facility-panel {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(113, 224, 198, 0.3);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(15, 55, 59, 0.92), rgba(10, 27, 43, 0.94));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 10px 24px rgba(1, 10, 22, 0.18);
}

.facility-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.facility-step {
  color: #8fe6cd;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facility-panel > strong {
  color: #f3fff9;
  font-size: 13px;
  line-height: 1.1;
}

.facility-effect,
.facility-reserve {
  color: rgba(231, 247, 244, 0.7);
  font-size: 9px;
  line-height: 1.25;
}

.facility-reserve {
  color: #f4c36c;
  font-weight: 700;
}

.facility-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid rgba(255, 194, 94, 0.54);
  border-radius: 9px;
  color: #21180e;
  background: linear-gradient(135deg, #ffd27e, #f5a84f);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.facility-button strong {
  font-size: 13px;
}

.facility-button:disabled {
  border-color: rgba(159, 183, 191, 0.18);
  color: rgba(231, 240, 244, 0.42);
  background: rgba(97, 113, 130, 0.26);
  cursor: not-allowed;
}

.app-shell.facility-upgrade .facility-panel,
.app-shell.new-game-plus .facility-panel {
  animation: facility-flash 960ms var(--ease) both;
}

@keyframes facility-flash {
  0% { box-shadow: 0 0 0 rgba(255, 199, 105, 0); }
  35% { box-shadow: 0 0 30px rgba(255, 199, 105, 0.32); }
  100% { box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 10px 24px rgba(1, 10, 22, 0.18); }
}

@media (max-width: 679px) {
  .facility-panel {
    margin-top: 5px;
    padding: 7px 8px;
  }

  .facility-panel > strong {
    font-size: 11px;
  }

  .facility-button {
    min-height: 29px;
  }

}

/* R6: make the choice, object, reward, and workshop progression readable before the human test. */
.scene-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 58%;
  opacity: 0.92;
  filter: saturate(0.88) brightness(0.72);
  transition: opacity 420ms var(--ease), filter 620ms var(--ease);
}

.arena-backdrop {
  z-index: 0;
  opacity: 1;
  background: #11172d;
}

.arena-backdrop::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 11, 27, 0.46), transparent 32%, rgba(7, 11, 27, 0.35)),
    radial-gradient(circle at 50% 55%, transparent 18%, rgba(7, 11, 27, 0.42) 90%);
  content: "";
}

.mine-tunnel,
.mine-vein,
.mine-lamp,
.mine-rail,
.mine-cart,
.ore-pile,
.debris,
.contour,
.flow-light {
  display: none;
}

.mine-caption {
  z-index: 3;
  bottom: 8%;
  left: 7%;
  padding: 5px 8px;
  border: 1px solid rgba(255, 214, 139, 0.42);
  border-radius: 999px;
  background: rgba(8, 12, 30, 0.7);
  color: var(--copper-light);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.arena::after {
  position: absolute;
  right: 9%;
  bottom: 10%;
  left: 9%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 214, 139, 0.55), transparent);
  content: "";
  opacity: 0.8;
}

.app-shell[data-scene="1"] .scene-backdrop {
  filter: saturate(1.08) brightness(0.8);
}

.app-shell[data-scene="2"] .scene-backdrop {
  filter: saturate(1.14) brightness(0.82);
}

.app-shell[data-scene="1"] .mine-caption {
  border-color: rgba(245, 168, 74, 0.72);
  color: #ffe0a5;
}

.app-shell[data-scene="2"] .mine-caption {
  border-color: rgba(209, 173, 255, 0.72);
  color: var(--violet-bright);
}

.tier-button {
  position: relative;
  overflow: hidden;
  text-align: left;
}

.tier-art {
  display: grid;
  place-items: center;
  pointer-events: none;
}

.tier-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 6px rgba(0, 0, 0, 0.4));
}

.tier-button[data-tier="geode"] .tier-art img {
  filter: saturate(1.2) drop-shadow(0 4px 8px rgba(172, 121, 255, 0.48));
}

.tier-button[data-locked="true"] {
  filter: saturate(0.78);
}

.tier-button[data-locked="true"]::after {
  position: absolute;
  top: 4px;
  right: 5px;
  color: rgba(214, 222, 255, 0.62);
  content: "LOCKED";
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.42rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hammer-art {
  display: grid;
  place-items: center;
}

.hammer-art svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: rgba(245, 168, 74, 0.9);
  stroke: #ffe0a5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  filter: drop-shadow(0 5px 8px rgba(245, 168, 74, 0.26));
}

.hammer-art svg path:last-child {
  fill: none;
  stroke: #7a4220;
  stroke-width: 3.4;
}

.result-panel {
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 132px;
  padding: 11px;
  border-radius: 18px;
}

.result-art {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.38));
}

.result-copy {
  min-width: 0;
}

.result-copy strong {
  display: block;
  font-size: 1.06rem;
  line-height: 1.05;
}

.result-net {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
  font-weight: 900;
}

.result-bank {
  display: block;
  margin-top: 3px;
  color: var(--slate-300);
  font-size: 0.58rem;
  line-height: 1.2;
}

.result-value {
  min-width: 68px;
  text-align: right;
}

.result-value strong {
  display: block;
  margin-top: 3px;
  color: var(--copper-light);
  font-size: 1.7rem;
  line-height: 0.95;
}

.goal-panel {
  border-color: rgba(245, 168, 74, 0.38);
  background:
    radial-gradient(circle at 95% 5%, rgba(245, 168, 74, 0.17), transparent 42%),
    rgba(17, 24, 49, 0.88);
}

.goal-value {
  color: var(--copper-light);
  font-weight: 900;
}

.scene-progress {
  border-top-color: rgba(245, 168, 74, 0.22);
}

.scene-progress-track {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 23%, transparent 23% 25%),
    rgba(7, 11, 27, 0.78);
}

.scene-progress[data-state="changed"] {
  border-color: rgba(209, 173, 255, 0.7);
  background: rgba(61, 39, 96, 0.42);
}

.scene-progress[data-state="changed"] .scene-progress-value,
.scene-progress[data-state="changed"] strong {
  color: var(--violet-bright);
}

.touch-hint {
  display: none;
}

@media (max-width: 679px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 100dvh;
  }

  .topbar {
    padding: max(9px, env(safe-area-inset-top)) 15px 4px;
  }

  .brand-phase {
    display: none;
  }

  .brand-name {
    font-size: 0.78rem;
  }

  .cash-readout strong {
    font-size: 1.28rem;
  }

  .game-main {
    min-height: 0;
    gap: 6px;
    overflow: hidden;
    padding: 2px 12px calc(78px + env(safe-area-inset-bottom));
  }

  .status-row {
    min-height: 32px;
    height: 32px;
    overflow: hidden;
  }

  .status-text {
    max-width: 280px;
    margin-top: 2px;
    overflow: hidden;
    font-size: 0.66rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .break-counter {
    display: none;
  }

  .play-layout {
    min-height: 0;
    gap: 6px;
    overflow: hidden;
  }

  .arena {
    min-height: 264px;
    height: 264px;
    flex: 0 0 264px;
    padding: 8px 0 7px;
    border: 1px solid rgba(255, 214, 139, 0.27);
    border-radius: 18px;
  }

  .arena-heading {
    padding: 0 9px;
  }

  .arena-hint {
    font-size: 0.54rem;
  }

  .geode-button {
    width: min(45vw, 174px);
    margin: 0;
  }

  .damage-meter {
    width: min(78vw, 296px);
    margin-bottom: 7px;
  }

  .peek-signal {
    font-size: 0.55rem;
  }

  .right-rail {
    gap: 6px;
  }

  .goal-panel {
    min-height: 102px;
    gap: 5px;
    padding: 8px 10px;
    border-radius: 15px;
  }

  .goal-panel > strong {
    font-size: 0.96rem;
  }

  .goal-value {
    font-size: 1.05rem;
  }

  .goal-copy {
    overflow: hidden;
    font-size: 0.54rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .scene-progress {
    gap: 3px;
    padding-top: 5px;
  }

  .scene-progress-label,
  .scene-progress strong {
    font-size: 0.5rem;
  }

  .app-shell[data-phase="result"] .last-break {
    display: none;
  }

  .left-rail {
    gap: 6px;
  }

  .left-rail #buyPanel {
    display: none;
  }

  .growth-rail {
    gap: 5px;
    padding: 7px;
    border-radius: 15px;
  }

  .growth-heading {
    align-items: center;
  }

  .growth-heading .panel-copy {
    gap: 1px;
  }

  .growth-heading .panel-copy strong {
    font-size: 0.72rem;
  }

  .growth-hint {
    max-width: 150px;
    font-size: 0.52rem;
  }

  .growth-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .growth-option {
    gap: 5px;
    padding: 6px;
  }

  .growth-option-heading {
    gap: 3px;
  }

  .tier-options {
    gap: 5px;
  }

  .tier-button {
    min-height: 64px;
    padding: 5px 4px 5px 35px;
    border-radius: 11px;
  }

  .tier-button > span:not(.tier-art) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.55rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tier-button > strong {
    display: block;
    margin-top: 2px;
    font-size: 0.82rem;
    line-height: 1;
  }

  .tier-button > small {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    font-size: 0.44rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tier-art {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 4px;
    width: 27px;
  }

  .hammer-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 94px;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 6px;
  }

  .hammer-art {
    grid-row: 1 / -1;
    width: 32px;
    height: 32px;
  }

  .hammer-option .growth-option-heading {
    grid-column: 2;
    grid-row: 1;
  }

  .hammer-option .upgrade-hint {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.5rem;
  }

  .hammer-option .upgrade-button {
    grid-column: 3;
    grid-row: 1 / -1;
    min-height: 44px;
    padding: 5px;
  }

  .upgrade-button strong {
    font-size: 0.8rem;
  }

  .result-panel {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    min-height: 116px;
    padding: 9px;
  }

  .result-art {
    width: 58px;
    height: 58px;
  }

  .result-copy strong {
    font-size: 0.94rem;
  }

  .result-net {
    font-size: 0.94rem;
  }

  .result-value strong {
    font-size: 1.55rem;
  }

  .result-bank {
    font-size: 0.52rem;
  }

  .action-dock {
    width: calc(100vw - 24px);
    min-height: 68px;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 7px;
    padding: 7px;
    border-radius: 16px;
  }

  .action-dock-copy > strong {
    font-size: 0.88rem;
  }

  .action-dock-copy .action-microcopy {
    font-size: 0.52rem;
  }

  .main-action {
    min-height: 54px;
    border-radius: 12px;
  }

  .main-action strong {
    font-size: 1.1rem;
  }

  .app-footer {
    display: none;
  }

  .app-shell[data-phase="result"] .goal-panel,
  .app-shell[data-phase="result"] .left-rail,
  .app-shell[data-phase="result"] .last-break {
    display: none;
  }

  .app-shell[data-phase="result"] .arena {
    min-height: 290px;
    height: 290px;
    flex-basis: 290px;
  }

  .app-shell[data-phase="result"] .right-rail {
    margin-top: -1px;
  }
}

@media (min-width: 680px) {
  .play-layout {
    grid-template-columns: minmax(200px, 0.78fr) minmax(340px, 1.42fr) minmax(225px, 0.9fr);
    gap: 12px;
  }

  .left-rail {
    gap: 8px;
    align-content: start;
  }

  .left-rail #buyPanel {
    display: none;
  }

  .growth-rail {
    gap: 8px;
    padding: 10px;
    border-color: rgba(245, 168, 74, 0.3);
    background: rgba(13, 20, 45, 0.82);
  }

  .growth-heading .panel-copy strong {
    font-size: 0.82rem;
  }

  .tier-options {
    gap: 6px;
  }

  .tier-button {
    min-height: 72px;
    padding: 6px 5px 6px 43px;
    border-radius: 12px;
  }

  .tier-button > span:not(.tier-art) {
    display: block;
    font-size: 0.55rem;
    font-weight: 800;
    line-height: 1;
  }

  .tier-button > strong {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
  }

  .tier-button > small {
    display: block;
    margin-top: 4px;
    font-size: 0.42rem;
  }

  .tier-art {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 5px;
    width: 34px;
  }

  .hammer-option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 92px;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 6px;
  }

  .hammer-art {
    grid-row: 1 / -1;
    width: 32px;
    height: 32px;
  }

  .hammer-option .growth-option-heading {
    grid-column: 2;
    grid-row: 1;
  }

  .hammer-option .upgrade-hint {
    grid-column: 2;
    grid-row: 2;
    font-size: 0.48rem;
  }

  .hammer-option .upgrade-button {
    grid-column: 3;
    grid-row: 1 / -1;
    min-height: 44px;
    padding: 5px;
  }

  .arena {
    background:
      linear-gradient(180deg, rgba(7, 11, 27, 0.15), rgba(7, 11, 27, 0.3)),
      rgba(13, 20, 45, 0.48);
  }

  .geode-button {
    width: min(38vh, 174px);
  }

  .scene-backdrop {
    object-position: center 60%;
  }

  .result-panel {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    min-height: 126px;
  }

  .result-art {
    width: 54px;
    height: 54px;
  }

  .result-value strong {
    font-size: 1.55rem;
  }

  .action-dock {
    width: min(440px, calc(100vw - 28px));
  }
}

/* R6 candidate-recognition preflight: a tier must read as an object, not a pill. */
.tier-button[data-tier="free"] {
  border-color: rgba(133, 219, 193, 0.64);
  background: linear-gradient(145deg, rgba(35, 92, 91, 0.88), rgba(12, 35, 58, 0.9));
}

.tier-button[data-tier="rock"] {
  border-color: rgba(196, 142, 93, 0.58);
  background: linear-gradient(145deg, rgba(82, 55, 43, 0.88), rgba(24, 30, 47, 0.92));
}

.tier-button[data-tier="geode"] {
  border-color: rgba(188, 145, 255, 0.64);
  background: linear-gradient(145deg, rgba(67, 43, 95, 0.9), rgba(25, 25, 56, 0.92));
}

.tier-button:not(:disabled):hover,
.tier-button:not(:disabled):focus-visible {
  transform: translateY(-1px);
}

.tier-button > strong {
  letter-spacing: 0.04em;
}

@media (max-width: 679px) {
  .tier-art {
    left: 3px;
    width: 34px;
  }
}

@media (min-width: 680px) {
  .tier-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .tier-button {
    min-height: 54px;
    padding: 5px 4px 5px 42px;
  }

  .tier-button > span:not(.tier-art) {
    max-width: 100%;
    overflow: hidden;
    font-size: 0.52rem;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tier-button > strong {
    margin-top: 2px;
    font-size: 0.82rem;
    line-height: 1;
  }

  .tier-button > small {
    margin-top: 2px;
    overflow: hidden;
    font-size: 0.43rem;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tier-art {
    top: 6px;
    bottom: 6px;
    left: 4px;
    width: 34px;
  }

  .hammer-option {
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: 5px;
    row-gap: 2px;
  }

  .hammer-art {
    width: 36px;
    height: 36px;
  }

  .hammer-option .growth-option-heading .panel-copy strong {
    font-size: 0.66rem;
    white-space: nowrap;
  }

  .hammer-option .growth-option-heading {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .hammer-option .upgrade-hint {
    grid-column: 2;
    grid-row: 2;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.44rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hammer-option .upgrade-button {
    grid-column: 2;
    grid-row: 3;
    min-height: 27px;
    padding: 3px 5px;
  }

  .hammer-option .upgrade-button strong {
    font-size: 0.7rem;
  }
}

@media (min-width: 680px) and (max-width: 839px) {
  .play-layout {
    grid-template-columns: 190px minmax(0, 1fr) 219px;
    gap: 8px;
  }
}

/* R7: gameplay is intentionally Landscape-only. Portrait is a clear orientation gate. */
html,
body {
  overflow: hidden;
}

.orientation-gate {
  display: none;
  width: min(86vw, 360px);
  min-height: min(78dvh, 420px);
  place-items: center;
  align-content: center;
  gap: 13px;
  padding: 28px 24px;
  border: 1px solid rgba(245, 168, 74, 0.42);
  border-radius: 28px;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 168, 74, 0.18), transparent 46%),
    rgba(16, 24, 50, 0.94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.orientation-gate-mark {
  display: grid;
  width: 72px;
  height: 48px;
  place-items: center;
  border: 2px solid var(--copper-light);
  border-radius: 11px;
  color: var(--copper-light);
  font-size: 2rem;
  line-height: 1;
  transform: rotate(90deg);
}

.orientation-gate strong {
  color: var(--paper);
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}

.orientation-gate p {
  max-width: 250px;
  margin: 0;
  color: var(--slate-300);
  font-size: 0.82rem;
  line-height: 1.55;
}

.orientation-gate-hint {
  color: var(--copper-light);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

@media (orientation: portrait), (max-width: 679px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    display: grid;
    padding: 0;
    place-items: center;
  }

  .app-shell {
    display: none !important;
  }

  .orientation-gate {
    display: grid;
  }
}

@media (min-width: 680px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .app-shell {
    display: flex !important;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
  }

  .game-main {
    min-height: 0;
    overflow: hidden;
  }

  .scene-progress {
    display: grid;
    gap: 5px;
    padding-top: 7px;
  }

  .scene-progress[data-state="ready"] {
    border-top-color: rgba(153, 244, 209, 0.64);
    background: rgba(19, 61, 58, 0.36);
  }

  .scene-progress[data-state="ready"] strong,
  .scene-progress[data-state="ready"] .workshop-effect {
    color: var(--mint);
  }

  .scene-progress[data-state="max"] {
    opacity: 0.82;
  }

  .workshop-effect {
    color: var(--copper-light);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.52rem;
    font-weight: 800;
    line-height: 1.15;
    text-transform: uppercase;
  }

  .workshop-reserve-hint {
    color: var(--slate-300);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.47rem;
    font-weight: 750;
    line-height: 1.15;
    text-transform: uppercase;
  }

  .workshop-upgrade-button {
    display: flex;
    min-height: 36px;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(245, 168, 74, 0.64);
    border-radius: 9px;
    background: linear-gradient(135deg, rgba(121, 63, 32, 0.92), rgba(65, 36, 35, 0.92));
    color: var(--paper);
    cursor: pointer;
    font-size: 0.56rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
    touch-action: manipulation;
    transition: transform 150ms var(--ease), filter 150ms var(--ease), opacity 150ms var(--ease), border-color 150ms var(--ease);
  }

  .workshop-upgrade-button strong {
    flex: 0 0 auto;
    color: var(--copper-light);
    font-size: 0.72rem;
    letter-spacing: -0.02em;
  }

  .workshop-upgrade-button:not(:disabled):hover,
  .workshop-upgrade-button:not(:disabled):focus-visible {
    border-color: var(--copper-light);
    filter: brightness(1.12);
    transform: translateY(-1px);
  }

  .workshop-upgrade-button:disabled {
    border-color: rgba(214, 222, 255, 0.16);
    background: rgba(42, 49, 76, 0.7);
    color: var(--slate-500);
    cursor: not-allowed;
  }

  .workshop-upgrade-button:disabled strong {
    color: var(--slate-300);
  }

  .hammer-art svg path.hammer-head {
    fill: #f3a84b;
    stroke: #ffe0a5;
    stroke-width: 1.4;
  }

  .hammer-art svg path.hammer-neck {
    fill: none;
    stroke: #ffe0a5;
    stroke-width: 3;
  }

  .hammer-art svg path.hammer-handle {
    fill: #9b542b;
    stroke: #ffd08b;
    stroke-width: 1.3;
  }

  .hammer-art svg path.hammer-grip {
    fill: none;
    stroke: #5a2f24;
    stroke-width: 3.8;
  }

  .app-shell[data-phase="result"] .play-layout {
    grid-template-areas: "arena right";
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.76fr);
    gap: 14px;
  }

  .app-shell[data-phase="result"] .left-rail {
    display: none;
  }

  .app-shell[data-phase="result"] .right-rail {
    align-content: center;
  }

  .app-shell[data-phase="result"] .result-panel {
    display: grid;
    min-height: 220px;
    grid-template-areas: "art copy" "value value";
    grid-template-columns: 88px minmax(0, 1fr);
    align-content: center;
    gap: 12px;
    padding: 17px;
    border-radius: 22px;
  }

  .app-shell[data-phase="result"] .result-art {
    grid-area: art;
    width: 88px;
    height: 88px;
  }

  .app-shell[data-phase="result"] .result-copy {
    grid-area: copy;
    align-self: center;
  }

  .app-shell[data-phase="result"] .result-copy strong {
    font-size: 1.28rem;
    line-height: 1.02;
  }

  .app-shell[data-phase="result"] .result-net {
    margin-top: 9px;
    font-size: 1.68rem;
    line-height: 1;
  }

  .app-shell[data-phase="result"] .result-bank {
    margin-top: 7px;
    font-size: 0.66rem;
    line-height: 1.25;
  }

  .app-shell[data-phase="result"] .result-value {
    display: flex;
    grid-area: value;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(214, 222, 255, 0.16);
    text-align: left;
  }

  .app-shell[data-phase="result"] .result-value strong {
    margin-top: 0;
    font-size: 2.05rem;
  }

  .result-panel[data-result="loss"] {
    border-color: rgba(255, 142, 157, 0.78);
    background:
      radial-gradient(circle at 92% 8%, rgba(255, 142, 157, 0.22), transparent 45%),
      linear-gradient(145deg, rgba(78, 30, 54, 0.98), rgba(38, 24, 52, 0.98));
    box-shadow: 0 0 0 1px rgba(255, 142, 157, 0.12), 0 18px 42px rgba(0, 0, 0, 0.32), 0 0 28px rgba(255, 142, 157, 0.16);
  }

  .result-panel[data-result="loss"] .result-net {
    color: var(--rose);
    text-shadow: 0 0 18px rgba(255, 142, 157, 0.28);
  }

  .result-panel[data-result="loss"] .result-value strong {
    color: #ffd2d8;
  }

  .result-panel[data-result="gain"] .result-net {
    color: var(--mint);
    text-shadow: 0 0 18px rgba(153, 244, 209, 0.2);
  }

  .action-dock[data-result="loss"] {
    border-color: rgba(255, 142, 157, 0.72);
    background: rgba(50, 22, 47, 0.96);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42), 0 0 24px rgba(255, 142, 157, 0.13);
  }

  .action-dock[data-result="loss"] .main-action {
    border-color: rgba(255, 190, 199, 0.84);
    background: linear-gradient(145deg, #ffc4cd, #d95e78);
    color: #35131e;
  }

  .app-shell[data-result="loss"] .arena {
    border-color: rgba(255, 142, 157, 0.32);
    background:
      radial-gradient(circle at 52% 46%, rgba(255, 111, 132, 0.15), transparent 42%),
      linear-gradient(180deg, rgba(50, 20, 50, 0.38), rgba(7, 11, 27, 0.16));
  }

  .workshop-upgrade .arena-backdrop {
    animation: workshop-flash 820ms var(--ease) both;
  }

  .workshop-upgrade .mine-caption {
    animation: workshop-caption 820ms var(--ease) both;
  }

}

@media (min-width: 680px) and (max-height: 480px) {
  .goal-panel {
    min-height: 0;
    gap: 5px;
    padding: 8px 9px;
  }

  .scene-progress {
    gap: 4px;
    padding-top: 5px;
  }

  .scene-progress-label,
  .scene-progress strong {
    font-size: 0.47rem;
    line-height: 1.05;
  }

  .workshop-effect {
    font-size: 0.45rem;
  }

  .workshop-upgrade-button {
    min-height: 32px;
    padding: 4px 7px;
    font-size: 0.5rem;
  }

  .workshop-upgrade-button strong {
    font-size: 0.64rem;
  }

  .last-break {
    display: none;
  }

  .app-shell[data-phase="result"] .result-panel {
    min-height: 204px;
    padding: 13px;
  }

  .app-shell[data-phase="result"] .result-art {
    width: 74px;
    height: 74px;
  }

  .app-shell[data-phase="result"] .result-net {
    font-size: 1.42rem;
  }

  .app-shell[data-phase="result"] .result-value strong {
    font-size: 1.72rem;
  }
}

@keyframes workshop-flash {
  0% {
    filter: saturate(1) brightness(0.72);
  }
  35% {
    filter: saturate(1.4) brightness(1.14);
  }
  100% {
    filter: saturate(1.08) brightness(0.8);
  }
}

@keyframes workshop-caption {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-3px) scale(1.06);
  }
}

/* Keep both optional upgrade controls above the fixed action at compact height. */
@media (min-width: 680px) and (max-height: 480px) {
  .right-rail {
    align-content: start;
  }

  .app-shell[data-phase="result"] .right-rail {
    align-content: center;
  }

  .growth-rail {
    gap: 4px;
    padding: 5px;
  }

  .growth-heading {
    display: none;
  }

  .stone-tier-option {
    gap: 4px;
    padding: 5px;
  }

  .tier-options {
    gap: 4px;
  }

  .tier-button {
    min-height: 48px;
    padding: 4px 4px 4px 38px;
  }

  .tier-art {
    top: 5px;
    bottom: 5px;
    left: 4px;
    width: 30px;
  }

  .hammer-option {
    min-height: 56px;
    padding: 4px;
  }

  .hammer-art {
    width: 31px;
    height: 31px;
  }

  .hammer-option .upgrade-button {
    min-height: 29px;
  }
}

/* R8 handoff: keep the product Landscape-only, but letterbox that stage inside
   a wide Portrait browser panel so a narrow app pane cannot hide the game. */
@media (orientation: portrait) and (min-width: 680px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    display: grid;
    padding: 0;
    place-items: center;
  }

  .orientation-gate {
    display: none;
  }

  .app-shell {
    display: flex !important;
    width: min(100vw, 844px);
    height: min(390px, 46.2085vw);
    min-height: 0 !important;
    max-height: min(390px, 46.2085vw);
    margin: 0 auto;
  }

  .action-dock {
    position: absolute;
  }

  .app-footer {
    display: none;
  }
}

/* Use the same compact-height rules for a vertically docked browser preview.
   The viewport is tall, but the letterboxed game stage is still 390px high. */
@media (orientation: portrait) and (min-width: 680px) {
  .action-dock {
    min-height: 58px;
    grid-template-columns: minmax(0, 1fr) 132px;
    padding: 6px;
  }

  .action-dock-copy > strong {
    font-size: 0.86rem;
  }

  .action-microcopy {
    font-size: 0.52rem;
  }

  .main-action {
    min-height: 46px;
    font-size: 0.62rem;
  }

  .main-action strong {
    font-size: 0.9rem;
  }

  .target-panel {
    min-height: 68px;
  }

  .target-price strong {
    font-size: 1rem;
  }

  .right-rail {
    align-content: start;
  }

  .app-shell[data-phase="result"] .right-rail {
    align-content: center;
  }

  .growth-rail {
    gap: 4px;
    padding: 5px;
  }

  .growth-heading {
    display: none;
  }

  .goal-panel {
    min-height: 0;
    gap: 5px;
    padding: 8px 9px;
  }

  .scene-progress {
    gap: 4px;
    padding-top: 5px;
  }

  .scene-progress-label,
  .scene-progress strong {
    font-size: 0.47rem;
    line-height: 1.05;
  }

  .workshop-effect {
    font-size: 0.45rem;
  }

  .workshop-upgrade-button {
    min-height: 32px;
    padding: 4px 7px;
    font-size: 0.5rem;
  }

  .workshop-upgrade-button strong {
    font-size: 0.64rem;
  }

  .last-break {
    display: none;
  }

  .stone-tier-option {
    gap: 4px;
    padding: 5px;
  }

  .tier-options {
    gap: 4px;
  }

  .tier-button {
    min-height: 48px;
    padding: 4px 4px 4px 38px;
  }

  .tier-art {
    top: 5px;
    bottom: 5px;
    left: 4px;
    width: 30px;
  }

  .hammer-option {
    min-height: 56px;
    padding: 4px;
  }

  .hammer-art {
    width: 31px;
    height: 31px;
  }

  .hammer-option .upgrade-button {
    min-height: 29px;
  }
}

/* R9: keep the result in the same three-column frame. A clear result card can
   be strong without making the whole workbench jump to a new composition. */
@media (min-width: 680px) {
  .app-shell[data-phase="idle"] .last-break[data-result="gain"],
  .app-shell[data-phase="idle"] .last-break[data-result="even"] {
    display: none;
  }

  .app-shell[data-phase="result"] .play-layout {
    grid-template-areas: "left arena right";
    grid-template-columns: minmax(190px, 0.78fr) minmax(0, 1.42fr) minmax(219px, 0.9fr);
    gap: 8px;
  }

  .app-shell[data-phase="result"] .left-rail {
    display: grid;
    opacity: 0.42;
    filter: saturate(0.55);
    pointer-events: none;
    transform: none;
  }

  .app-shell[data-phase="result"] .right-rail {
    align-content: start;
  }

  .app-shell[data-phase="result"] .result-panel {
    display: grid;
    min-height: 188px;
    grid-template-areas: "art copy" "value value";
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }

  .app-shell[data-phase="result"] .result-art {
    grid-area: art;
    width: 54px;
    height: 54px;
  }

  .app-shell[data-phase="result"] .result-copy {
    grid-area: copy;
    align-self: center;
  }

  .app-shell[data-phase="result"] .result-copy strong {
    font-size: 0.92rem;
  }

  .app-shell[data-phase="result"] .result-net {
    margin-top: 5px;
    font-size: 1.12rem;
  }

  .app-shell[data-phase="result"] .result-bank {
    margin-top: 4px;
    font-size: 0.52rem;
  }

  .app-shell[data-phase="result"] .result-value {
    display: flex;
    grid-area: value;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(214, 222, 255, 0.16);
    text-align: left;
  }

  .app-shell[data-phase="result"] .result-value strong {
    margin-top: 0;
    font-size: 1.42rem;
  }
}

.last-break[data-result="loss"] {
  padding: 5px 8px;
  border: 1px solid rgba(255, 142, 157, 0.45);
  border-radius: 10px;
  background: rgba(78, 30, 54, 0.38);
  color: var(--rose);
}

.last-break[data-result="loss"] > span:last-child {
  color: #ffd2d8;
  font-weight: 850;
}

.last-break[data-result="gain"] > span:last-child {
  color: var(--mint);
  font-weight: 800;
}

@media (min-width: 680px) {
  .app-shell[data-phase="idle"] .last-break {
    display: flex;
    min-height: 24px;
  }
}

/* R10: edit the surface down to the decisions that make the loop readable.
   The scene, candidates, balance, result, and fixed action are the product;
   phase/debug copy and duplicate explanations are not. */
@media (min-width: 680px) {
  .brand-phase,
  .hammer-readout,
  .status-row,
  .app-footer {
    display: none;
  }

  .topbar {
    min-height: 42px;
    padding-top: max(8px, env(safe-area-inset-top));
    padding-bottom: 5px;
  }

  .topbar-stats {
    gap: 0;
  }

  .cash-readout {
    min-width: 62px;
    gap: 2px;
    padding: 4px 9px 5px;
    border: 1px solid rgba(245, 168, 74, 0.32);
    border-radius: 10px;
    background: rgba(18, 25, 52, 0.72);
  }

  .cash-readout .eyebrow {
    font-size: 0.48rem;
  }

  .cash-readout strong {
    font-size: 1.32rem;
    line-height: 0.95;
  }

  .game-main {
    gap: 4px;
    padding-top: 0;
  }

  .growth-rail {
    gap: 7px;
    padding: 8px;
  }

  .growth-heading .panel-copy .section-label,
  .growth-hint,
  .hammer-option .upgrade-hint {
    display: none;
  }

  .growth-heading .panel-copy strong {
    font-size: 0.9rem;
    letter-spacing: 0.04em;
  }

  .stone-tier-option {
    gap: 5px;
    padding: 6px;
  }

  .tier-options {
    gap: 5px;
  }

  .tier-button {
    min-height: 76px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .tier-button small {
    font-size: 0.52rem;
    letter-spacing: 0.02em;
  }

  .tier-button:not(.is-selected) small {
    display: none;
  }

  .hammer-option {
    min-height: 66px;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: auto auto;
    row-gap: 4px;
    padding: 6px;
  }

  .hammer-art {
    grid-column: 1;
    grid-row: 1 / -1;
    width: 38px;
    height: 38px;
  }

  .hammer-option .growth-option-heading,
  .hammer-option .upgrade-button,
  .hammer-option .upgrade-button strong {
    min-width: 0;
  }

  .hammer-option .growth-option-heading {
    grid-column: 2;
    grid-row: 1;
  }

  .hammer-option .growth-option-heading .eyebrow {
    display: none;
  }

  .hammer-option .growth-option-heading .growth-state {
    font-size: 0.58rem;
  }

  .hammer-option .upgrade-button {
    grid-column: 2;
    grid-row: 2;
    width: 100%;
    min-height: 28px;
  }

  .arena-heading #geodeNumber {
    display: none;
  }

  .arena-heading {
    justify-content: flex-end;
  }

  .arena-hint {
    font-size: 0.56rem;
  }

  .app-shell[data-phase="idle"] .arena-hint,
  .app-shell[data-phase="idle"] .damage-meter {
    display: none;
  }

  .app-shell[data-phase="idle"] .arena {
    justify-content: center;
  }

  .app-shell[data-phase="idle"] .peek-signal {
    display: none;
  }

  .goal-panel {
    gap: 6px;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    padding: 10px;
  }

  .goal-panel > *,
  .scene-progress-topline > * {
    min-width: 0;
  }

  .scene-progress-topline {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }

  .scene-progress-topline strong {
    width: 100%;
    text-align: left;
  }

  .goal-current {
    display: none;
  }

  .goal-copy {
    font-size: 0.58rem;
    line-height: 1.15;
  }

  .scene-progress {
    gap: 4px;
    padding-top: 7px;
  }

  .scene-progress-track {
    display: none;
  }

  .scene-progress-label,
  .scene-progress strong {
    font-size: 0.62rem;
  }

  .workshop-effect {
    font-size: 0.58rem;
    line-height: 1.18;
  }

  .workshop-upgrade-button {
    min-height: 34px;
    font-size: 0.58rem;
  }

  /* R27 mobile review: keep lower-frequency investment controls tappable
     without moving the fixed break/reveal/sell action. */
  .hammer-option .upgrade-button,
  .workshop-upgrade-button {
    min-height: 44px;
  }

  /* R29 language audit: keep the English safety-net tier name readable. */
  html[lang="en"] #freeTierName {
    font-size: 0.45rem;
    letter-spacing: -0.04em;
  }

  .last-break[data-result="none"] {
    display: none;
  }

  .app-shell[data-phase="idle"][data-has-last-outcome="false"] .last-break {
    display: none;
  }

  .result-bank {
    color: var(--paper);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0;
  }

  .app-shell[data-phase="result"] .result-bank {
    margin-top: 4px;
    color: var(--paper);
    font-size: 0.7rem;
    font-weight: 800;
  }

  .app-shell[data-phase="idle"] .last-break {
    min-height: 30px;
    padding: 4px 7px;
    border: 1px solid rgba(214, 222, 255, 0.14);
    border-radius: 8px;
    background: rgba(18, 25, 52, 0.56);
  }

  .app-shell[data-phase="idle"] .last-break > span:last-child {
    font-size: 0.7rem;
    font-weight: 800;
  }

  .app-shell[data-phase="idle"] .last-break[data-result="gain"] {
    border-color: rgba(153, 244, 209, 0.28);
    background: rgba(25, 66, 65, 0.34);
  }

  .app-shell[data-phase="idle"] .last-break[data-result="loss"] {
    border-color: rgba(255, 142, 157, 0.52);
    background: rgba(78, 30, 54, 0.48);
  }

  .action-dock-copy {
    gap: 0;
  }

  .action-dock-copy .section-label,
  .action-dock-copy .action-microcopy {
    display: none;
  }

  .action-dock-copy > strong {
    font-size: 1rem;
  }
}

/* R11 payoff language: ordinary profit is gold, loss is rose, and rare states
   keep their existing violet/legendary treatment. */
.result-panel[data-result="gain"]:not(.result-gold):not(.result-amethyst):not(.result-legendary) {
  border-color: rgba(245, 168, 74, 0.62);
  background:
    radial-gradient(circle at 78% 15%, rgba(245, 168, 74, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(67, 46, 31, 0.9), rgba(25, 27, 48, 0.94));
}

.result-panel[data-result="gain"]:not(.result-amethyst):not(.result-legendary) .result-net,
.result-panel[data-result="gain"]:not(.result-amethyst):not(.result-legendary) .result-value strong {
  color: var(--copper-light);
}

/* Result is a decision moment: keep the payout and transaction card, remove
   idle-only progress surfaces and repeated action amounts. */
.main-action strong:empty {
  display: none;
}

.goal-panel[data-state="workshop"] .goal-copy {
  display: none;
}

/* Keep the optional workshop control, but remove the auto-generated next-goal
   copy and progress numbers from the decision surface. */
.goal-panel > .goal-topline,
.goal-panel > .goal-value-line,
.goal-panel > .goal-track,
.goal-panel > .goal-copy,
.goal-panel > strong {
  display: none;
}

.goal-panel:has(.scene-progress:not(.is-hidden)) {
  min-height: 0;
}

/* 2A: purchased stones become visible, tappable objects before the crack loop. */

.field-stones {
  position: absolute;
  inset: 25% 7% 12%;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  justify-items: center;
  gap: 5px;
}

.field-stones[data-count="1"] {
  grid-template-columns: minmax(0, 126px);
  justify-content: center;
}

.field-stones[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 112px));
  justify-content: center;
}

.field-stones[data-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-stones[data-count="5"] {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.field-stones[data-count="6"],
.field-stones[data-count="7"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field-stone-button {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 102px;
  align-content: center;
  justify-items: center;
  gap: 1px;
  padding: 7px 5px 6px;
  border: 1px solid rgba(214, 222, 255, 0.22);
  border-radius: 16px;
  background: rgba(18, 25, 52, 0.78);
  color: var(--paper);
  cursor: pointer;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.22), inset 0 0 18px rgba(255, 255, 255, 0.04);
  touch-action: manipulation;
  transition: transform 150ms var(--ease), filter 150ms var(--ease), border-color 150ms var(--ease);
}

.field-stone-button::after {
  position: absolute;
  right: 9px;
  bottom: 7px;
  left: 9px;
  height: 2px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  content: "";
}

.field-stone-button[data-tier="free"] {
  border-color: rgba(153, 244, 209, 0.64);
  background: linear-gradient(145deg, rgba(35, 92, 91, 0.9), rgba(12, 35, 58, 0.9));
}

.field-stone-button[data-tier="rock"] {
  border-color: rgba(245, 168, 74, 0.66);
  background: linear-gradient(145deg, rgba(82, 55, 43, 0.92), rgba(24, 30, 47, 0.94));
}

.field-stone-button[data-tier="geode"] {
  border-color: rgba(188, 145, 255, 0.78);
  background: linear-gradient(145deg, rgba(67, 43, 95, 0.92), rgba(25, 25, 56, 0.94));
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25), inset 0 0 22px rgba(172, 121, 255, 0.12);
}

.field-stone-button:hover,
.field-stone-button:focus-visible {
  filter: brightness(1.12);
  transform: translateY(-3px);
}

.field-stone-button:active {
  transform: translateY(1px) scale(0.97);
}

.field-stone-art {
  width: min(100%, 84px);
  height: 61px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 9px 9px rgba(0, 0, 0, 0.38));
}

.field-stone-button:nth-child(1) .field-stone-art {
  transform: rotate(-7deg) translateY(2px);
}

.field-stone-button:nth-child(2) .field-stone-art {
  transform: rotate(3deg) translateY(-2px);
}

.field-stone-button:nth-child(3) .field-stone-art {
  transform: rotate(7deg) translateY(1px);
}

.field-stones[data-count="4"] .field-stone-button,
.field-stones[data-count="5"] .field-stone-button,
.field-stones[data-count="6"] .field-stone-button,
.field-stones[data-count="7"] .field-stone-button {
  border-radius: 11px;
}

.field-stones[data-count="6"] .field-stone-button,
.field-stones[data-count="7"] .field-stone-button {
  min-height: 76px;
  padding-block: 3px;
}

.field-stones[data-count="6"] .field-stone-art,
.field-stones[data-count="7"] .field-stone-art {
  height: 43px;
}

.field-stone-button[data-variant="1"] .field-stone-art {
  transform: rotate(-5deg) scale(0.94) translateY(2px);
}

.field-stone-button[data-variant="2"] .field-stone-art {
  transform: rotate(4deg) scale(1.04) translateY(-1px);
}

.field-stone-button[data-variant="3"] .field-stone-art {
  transform: rotate(-2deg) scale(0.98) translateY(-3px);
}

.field-stone-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--paper);
  font-size: 0.5rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-stone-hint {
  max-width: 100%;
  overflow: hidden;
  color: var(--slate-300);
  font-size: 0.4rem;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.field-arrival .field-stone-button:last-child {
  animation: stone-arrival 680ms var(--ease) both;
}

@media (min-width: 680px) and (max-height: 480px) {
  .field-stones {
    inset: 22% 5% 10%;
  }

  .field-stone-button {
    min-height: 84px;
    padding: 4px 4px 5px;
    border-radius: 13px;
  }

  .field-stone-art {
    height: 50px;
  }

  .field-stone-name {
    font-size: 0.45rem;
  }

  .field-stone-hint {
    font-size: 0.36rem;
  }

}

@media (min-width: 680px) and (max-height: 380px) {
  .field-stones {
    inset: 19% 4% 8%;
  }

  .field-stone-button {
    min-height: 72px;
    padding: 3px;
  }

  .field-stone-art {
    height: 42px;
  }

  .field-stone-hint {
    display: none;
  }
}

@media (min-width: 680px) {
  .app-shell[data-phase="idle"][data-workshop-panel="false"] .play-layout {
    grid-template-areas: "left arena";
    grid-template-columns: minmax(210px, 0.82fr) minmax(0, 2.2fr);
  }

  .app-shell[data-phase="idle"][data-workshop-panel="false"] .right-rail {
    display: none;
  }

  .app-shell[data-phase="result"] .play-layout {
    grid-template-areas: "arena right";
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
    gap: 14px;
  }

  .app-shell[data-phase="result"] .left-rail {
    display: none;
  }

  .app-shell[data-phase="result"] .left-rail {
    visibility: hidden;
    pointer-events: none;
  }

  .app-shell[data-phase="result"] .damage-meter {
    visibility: hidden;
  }

  .app-shell[data-phase="result"] .main-action strong:empty {
    display: none;
  }
}

.last-break[data-result="gain"] {
  border-color: rgba(245, 168, 74, 0.34);
  background: rgba(78, 52, 28, 0.4);
}

.last-break[data-result="gain"] > span:last-child {
  color: var(--copper-light);
}

/* R15.3: make the public payout table scannable and make a paid loss read as damage. */
.odds-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px 42px;
  min-width: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(189, 196, 221, 0.16);
  border-radius: 8px;
  background: rgba(7, 12, 31, 0.34);
}

.odds-table-heading {
  padding: 3px 6px 2px;
  color: var(--slate-500);
  font-size: 0.43rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.odds-table-heading:first-child {
  grid-column: 1;
}

.odds-table-heading:last-child {
  grid-column: 3;
  text-align: right;
}

.odds-item {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 16px 42px;
  min-width: 0;
  align-items: baseline;
  gap: 0;
  padding: 3px 6px;
  border: 0;
  border-top: 1px solid rgba(189, 196, 221, 0.1);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.odds-item strong {
  grid-column: 1;
  min-width: 0;
  font-size: 0.61rem;
  letter-spacing: -0.03em;
}

.odds-arrow {
  grid-column: 2;
  color: var(--slate-500);
  font-size: 0.51rem;
  text-align: center;
}

.odds-item small {
  grid-column: 3;
  color: var(--slate-200);
  font-size: 0.54rem;
  text-align: right;
}

.odds-item[data-loss="true"] {
  border-top-color: rgba(255, 142, 157, 0.26);
  background: rgba(95, 34, 55, 0.4);
  color: var(--rose);
}

.odds-item[data-loss="true"] small {
  color: rgba(255, 220, 224, 0.94);
}

.result-art-frame {
  position: relative;
  display: grid;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  grid-area: auto;
  place-items: center;
  isolation: isolate;
}

.result-art-frame .result-art {
  display: block;
  width: 100%;
  height: 100%;
  grid-area: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.38));
  transition: filter 240ms var(--ease), transform 240ms var(--ease);
}

.result-art-fracture,
.result-art-rubble,
.result-damage-marker {
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.result-art-fracture {
  position: absolute;
  z-index: 2;
  width: 2px;
  border-radius: 99px;
  background: linear-gradient(180deg, rgba(255, 236, 238, 0.95), rgba(255, 93, 116, 0.95) 58%, rgba(108, 25, 53, 0.25));
  box-shadow: 0 0 5px rgba(255, 97, 121, 0.72);
}

.result-art-fracture-a {
  top: 12%;
  left: 47%;
  height: 76%;
  transform: rotate(27deg);
}

.result-art-fracture-b {
  top: 35%;
  left: 23%;
  height: 55%;
  transform: rotate(-53deg);
}

.result-art-rubble {
  position: absolute;
  z-index: 2;
  width: 18%;
  height: 14%;
  border: 1px solid rgba(255, 163, 176, 0.72);
  background: rgba(77, 35, 55, 0.94);
  clip-path: polygon(8% 26%, 74% 0, 100% 62%, 42% 100%, 0 70%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.result-art-rubble-a {
  right: 5%;
  bottom: 5%;
  transform: rotate(23deg);
}

.result-art-rubble-b {
  bottom: 16%;
  left: 4%;
  transform: rotate(-31deg) scale(0.75);
}

.result-art-frame[data-result="loss"] .result-art {
  filter: grayscale(0.82) saturate(0.3) brightness(0.58) contrast(1.28) drop-shadow(0 6px 8px rgba(255, 73, 101, 0.22));
  transform: rotate(-7deg) scale(0.86);
}

.result-art-frame[data-result="loss"] .result-art-fracture,
.result-art-frame[data-result="loss"] .result-art-rubble {
  opacity: 1;
}

.result-damage-marker {
  position: absolute;
  top: -4px;
  right: -8px;
  z-index: 3;
  padding: 3px 4px 2px;
  border: 1px solid rgba(255, 142, 157, 0.7);
  border-radius: 4px;
  background: rgba(52, 17, 35, 0.94);
  color: #ffd2d8;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.result-art-frame[data-result="loss"] .result-damage-marker {
  opacity: 1;
}

@media (min-width: 680px) {
  .app-shell[data-phase="result"] .result-art-frame {
    width: 54px;
    height: 54px;
    grid-area: art;
  }
}

@media (min-width: 680px) and (max-height: 380px) {
  .odds-table-heading {
    padding-top: 2px;
    padding-bottom: 1px;
    font-size: 0.39rem;
  }

  .odds-item {
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .odds-item strong {
    font-size: 0.53rem;
  }

  .odds-item small,
  .odds-arrow {
    font-size: 0.46rem;
  }

  .odds-note {
    font-size: 0.39rem;
  }
}

/* The arena is also part of the result proof: a loss must not leave a clean prize image. */
.app-shell[data-phase="result"][data-result="loss"] .geode-image-open {
  filter: grayscale(0.9) saturate(0.24) brightness(0.54) contrast(1.34) drop-shadow(0 8px 10px rgba(255, 73, 101, 0.26));
  transform: scale(0.84) rotate(-7deg);
}

.app-shell[data-phase="result"][data-result="loss"] .geode-button::before {
  position: absolute;
  z-index: 3;
  inset: 10% 16%;
  border-radius: 50%;
  background:
    linear-gradient(31deg, transparent 47%, rgba(255, 225, 230, 0.92) 49%, rgba(255, 75, 103, 0.96) 51%, transparent 54%),
    linear-gradient(124deg, transparent 46%, rgba(255, 225, 230, 0.86) 49%, rgba(255, 75, 103, 0.9) 52%, transparent 55%),
    linear-gradient(78deg, transparent 50%, rgba(255, 119, 139, 0.68) 51%, transparent 54%);
  content: "";
  opacity: 0.94;
  pointer-events: none;
  transform: rotate(-7deg) scale(0.84);
}

.app-shell[data-phase="result"][data-result="loss"] .geode-button::after {
  position: absolute;
  right: 13%;
  bottom: 13%;
  z-index: 3;
  width: 16%;
  height: 13%;
  border: 1px solid rgba(255, 163, 176, 0.82);
  background: rgba(77, 35, 55, 0.94);
  box-shadow: -42px 13px 0 -3px rgba(77, 35, 55, 0.94), -18px 23px 0 -5px rgba(255, 142, 157, 0.78);
  clip-path: polygon(8% 26%, 74% 0, 100% 62%, 42% 100%, 0 70%);
  content: "";
  opacity: 0.98;
  pointer-events: none;
  transform: rotate(23deg);
}

/* R48: Northstar is a bright surprise studio now. The capsule remains the
   tactile object, while the belt and pop press read as visible equipment. */
:root {
  color-scheme: light;
  --ink-950: #fff4ef;
  --ink-900: #fffaf6;
  --ink-850: #fff0e8;
  --ink-800: #ffe5da;
  --slate-500: #8a7180;
  --slate-300: #5f4b61;
  --paper: #2f2440;
  --copper: #ff805d;
  --copper-light: #f36b4d;
  --violet: #8c7cf1;
  --violet-bright: #6555d6;
  --mint: #32b99f;
  --rose: #dd5c76;
  --line: rgba(111, 78, 111, 0.18);
  --shadow-deep: 0 24px 70px rgba(119, 74, 92, 0.18);
}

body {
  background:
    radial-gradient(circle at 18% 9%, rgba(255, 207, 144, 0.34), transparent 28rem),
    radial-gradient(circle at 84% 92%, rgba(177, 219, 255, 0.32), transparent 30rem),
    #fff4ef;
  color: var(--paper);
}

.app-shell {
  background:
    radial-gradient(circle at 76% 16%, rgba(255, 221, 151, 0.2), transparent 32rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 237, 0.98)),
    var(--ink-900);
  box-shadow: 0 24px 80px rgba(127, 84, 104, 0.16);
}

.app-shell::before,
.app-shell::after {
  border-color: rgba(140, 124, 241, 0.14);
  opacity: 0.5;
}

.brand-name,
.status-text,
.break-counter strong,
.facility-panel > strong,
.goal-panel,
.last-break,
.result-panel,
.action-panel,
.action-dock,
.growth-rail,
.tap-panel,
.reveal-panel {
  color: var(--paper);
}

.brand-mark {
  color: var(--copper);
}

.brand-phase,
.eyebrow,
.section-label,
.app-footer,
.text-button {
  color: var(--slate-500);
}

.cash-readout strong,
.goal-value,
.result-value strong {
  color: var(--copper-light);
  text-shadow: 0 0 18px rgba(243, 107, 77, 0.18);
}

.hammer-readout strong {
  color: var(--violet-bright);
}

.status-text,
.result-bank,
.facility-effect,
.facility-reserve,
.growth-hint,
.field-stone-hint {
  color: #725b70;
}

.action-panel,
.growth-rail,
.goal-panel,
.last-break,
.tap-panel,
.reveal-panel,
.result-panel,
.action-dock,
.facility-panel {
  border-color: rgba(130, 93, 126, 0.22);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 241, 234, 0.94));
  box-shadow: 0 12px 30px rgba(136, 87, 105, 0.12), inset 0 1px rgba(255, 255, 255, 0.9);
}

.arena {
  border-color: rgba(125, 100, 148, 0.24);
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(255, 247, 239, 0.42), rgba(231, 221, 255, 0.24));
}

.arena-backdrop {
  background: #ffe8dd;
}

.arena-backdrop::after {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 48%, rgba(76, 57, 97, 0.08)),
    radial-gradient(circle at 50% 48%, transparent 26%, rgba(84, 55, 103, 0.08) 100%);
}

.scene-backdrop {
  opacity: 1;
  filter: saturate(1.08) brightness(1.06) contrast(0.96);
  mix-blend-mode: normal;
}

.app-shell[data-scene="1"] .scene-backdrop {
  filter: saturate(1.2) brightness(1.1) hue-rotate(-4deg) contrast(0.96);
}

.app-shell[data-scene="2"] .scene-backdrop {
  filter: saturate(1.32) brightness(1.12) hue-rotate(7deg) contrast(0.96);
}

.mine-tunnel,
.mine-vein,
.mine-lamp,
.mine-rail,
.mine-cart,
.ore-pile,
.debris,
.contour,
.flow-light {
  display: none !important;
}

.mine-caption {
  bottom: 7%;
  left: 6%;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.78);
  color: #71556d;
  box-shadow: 0 6px 15px rgba(95, 67, 86, 0.1);
}

.arena::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.74), transparent);
  opacity: 0.7;
}

.arena-heading {
  color: var(--paper);
}

.arena-hint {
  color: var(--copper-light);
}

.geode-halo {
  background: radial-gradient(circle, rgba(255, 184, 116, 0.32), rgba(172, 151, 255, 0.18) 46%, transparent 72%);
}

.geode-button:not(:disabled) .geode-halo {
  background: radial-gradient(circle, rgba(255, 185, 117, 0.42), rgba(133, 219, 200, 0.22) 44%, transparent 74%);
}

.geode-image-closed,
.geode-image-open,
.result-art,
.field-stone-art {
  filter: drop-shadow(0 12px 12px rgba(92, 59, 91, 0.2));
}

.app-shell[data-tier="free"] .geode-image-closed,
.tier-button[data-tier="free"] .tier-art img,
.field-stone-button[data-tier="free"] .field-stone-art {
  filter: saturate(0.72) hue-rotate(10deg) drop-shadow(0 12px 12px rgba(62, 168, 144, 0.22));
}

.app-shell[data-tier="rock"] .geode-image-closed,
.tier-button[data-tier="rock"] .tier-art img,
.field-stone-button[data-tier="rock"] .field-stone-art {
  filter: saturate(1.18) hue-rotate(-12deg) drop-shadow(0 12px 12px rgba(255, 128, 93, 0.26));
}

.app-shell[data-tier="geode"] .geode-image-closed,
.tier-button[data-tier="geode"] .tier-art img,
.field-stone-button[data-tier="geode"] .field-stone-art {
  filter: saturate(1.28) hue-rotate(24deg) drop-shadow(0 12px 12px rgba(117, 101, 224, 0.28));
}

.tier-button[data-tier="free"],
.field-stone-button[data-tier="free"] {
  border-color: rgba(50, 185, 159, 0.48);
  background: linear-gradient(145deg, rgba(224, 255, 246, 0.96), rgba(246, 255, 252, 0.96));
}

.tier-button[data-tier="rock"],
.field-stone-button[data-tier="rock"] {
  border-color: rgba(255, 128, 93, 0.48);
  background: linear-gradient(145deg, rgba(255, 235, 216, 0.96), rgba(255, 249, 238, 0.96));
}

.tier-button[data-tier="geode"],
.field-stone-button[data-tier="geode"] {
  border-color: rgba(140, 124, 241, 0.5);
  background: linear-gradient(145deg, rgba(237, 232, 255, 0.96), rgba(253, 249, 255, 0.96));
}

.tier-button.is-selected {
  box-shadow: 0 8px 20px rgba(103, 85, 214, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

.tier-button.is-safety.is-selected {
  border-color: rgba(50, 185, 159, 0.82);
  background: linear-gradient(145deg, rgba(206, 251, 237, 0.98), rgba(243, 255, 250, 0.98));
  color: #167e6c;
}

.tier-button[data-tier="geode"] .tier-art img {
  filter: saturate(1.28) hue-rotate(24deg) drop-shadow(0 8px 10px rgba(117, 101, 224, 0.24));
}

.field-stone-button {
  border-color: rgba(130, 93, 126, 0.24);
  background: rgba(255, 255, 255, 0.84);
  color: var(--paper);
  box-shadow: 0 10px 18px rgba(115, 72, 93, 0.12), inset 0 0 18px rgba(255, 255, 255, 0.72);
}

.field-stone-button[data-prepped-hits]:not([data-prepped-hits="0"]) {
  box-shadow: 0 0 0 2px rgba(255, 128, 93, 0.18), 0 12px 22px rgba(255, 128, 93, 0.16);
}

.field-stone-button[data-prepped-hits]:not([data-prepped-hits="0"])::before {
  position: absolute;
  top: 6px;
  right: 7px;
  padding: 2px 4px;
  border-radius: 999px;
  background: #ff805d;
  color: #fff;
  content: "PRESS";
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.38rem;
  letter-spacing: 0.08em;
}

.facility-panel {
  border-color: rgba(255, 128, 93, 0.34);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 237, 225, 0.96));
}

.facility-panel > strong {
  color: #4e3857;
}

.facility-step {
  color: #7e67d9;
}

.facility-effect {
  color: #765d70;
}

.facility-reserve {
  color: #d5674d;
}

.facility-button {
  border-color: rgba(255, 128, 93, 0.62);
  background: linear-gradient(135deg, #ffd1a0, #ff9477);
  color: #4d2d3d;
}

.facility-button:disabled {
  border-color: rgba(130, 93, 126, 0.18);
  color: rgba(95, 75, 97, 0.48);
  background: rgba(226, 215, 225, 0.72);
}

.automation-status {
  min-height: 22px;
  padding: 2px 9px;
  border-color: rgba(50, 185, 159, 0.42);
  background: rgba(235, 255, 248, 0.92);
  color: #16826e;
  box-shadow: 0 6px 14px rgba(50, 185, 159, 0.12);
}

.facility-line-motion,
.facility-press-motion {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms var(--ease);
}

.app-shell[data-conveyor-level="1"] .facility-line-motion,
.app-shell[data-conveyor-level="2"] .facility-line-motion,
.app-shell[data-press-level="1"] .facility-press-motion,
.app-shell[data-press-level="2"] .facility-press-motion {
  opacity: 1;
}

.facility-slot-rail {
  position: absolute;
  bottom: 17%;
  left: 17%;
  display: grid;
  width: 48%;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  opacity: 0;
  transition: opacity 260ms var(--ease);
}

.app-shell[data-conveyor-level="1"] .facility-slot-rail,
.app-shell[data-conveyor-level="2"] .facility-slot-rail {
  opacity: 1;
}

.facility-slot-light {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 248, 215, 0.92);
  border-radius: 50%;
  background: rgba(105, 82, 91, 0.44);
  box-shadow: 0 0 0 2px rgba(116, 89, 65, 0.12), inset 0 1px rgba(255, 255, 255, 0.36);
  opacity: 0.72;
}

.facility-slot-light.is-filled {
  background: #ff8b6c;
  box-shadow: 0 0 0 2px rgba(116, 89, 65, 0.12), 0 0 10px rgba(255, 128, 93, 0.78);
  opacity: 1;
}

.app-shell[data-conveyor-level="1"] .facility-slot-light:nth-child(n + 6) {
  display: none;
}

.app-shell.conveyor-arrival .facility-slot-light.is-filled {
  animation: r52-line-ready 720ms ease-out both;
}

.facility-motion-capsule {
  position: absolute;
  bottom: 19%;
  left: -14%;
  width: 14%;
  max-width: 58px;
  opacity: 0;
  filter: drop-shadow(0 7px 6px rgba(87, 58, 86, 0.24));
  transform: translateY(0) rotate(-7deg) scale(0.78);
  transform-origin: center bottom;
}

.app-shell.conveyor-arrival .facility-motion-capsule {
  animation: r52-capsule-feed 720ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

.facility-press-platen {
  position: absolute;
  right: 13.5%;
  bottom: 29%;
  width: 19%;
  height: 7%;
  border: 2px solid rgba(255, 250, 228, 0.86);
  border-radius: 50%;
  background: linear-gradient(180deg, #f8f1e7, #b9a9a6 42%, #fff7e6 52%, #aa9792);
  box-shadow: 0 5px 8px rgba(76, 55, 77, 0.24), inset 0 2px rgba(255, 255, 255, 0.86);
  opacity: 0;
  transform: translateY(-30px) scaleX(0.82);
}

.facility-press-flash {
  position: absolute;
  right: 16%;
  bottom: 19%;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 249, 202, 0.94), rgba(255, 181, 85, 0.42) 36%, transparent 70%);
  opacity: 0;
  transform: scale(0.4);
}

.facility-press-crack {
  position: absolute;
  right: 22%;
  bottom: 23%;
  width: 2px;
  height: 19px;
  border-radius: 99px;
  background: #fff6b8;
  box-shadow: 0 0 6px #ffba5c;
  opacity: 0;
  transform-origin: top;
}

.facility-press-crack-a { transform: rotate(34deg); }
.facility-press-crack-b { right: 19%; transform: rotate(-42deg); }

.app-shell.press-cycle .facility-press-platen {
  animation: r52-press-platen 560ms cubic-bezier(0.18, 0.72, 0.22, 1) both;
}

.app-shell.press-cycle .facility-press-flash {
  animation: r52-press-flash 560ms var(--ease) both;
}

.app-shell.press-cycle .facility-press-crack {
  animation: r52-press-crack 560ms var(--ease) both;
}

.app-shell.press-cycle .facility-motion-capsule {
  animation: r52-capsule-to-press 560ms cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

.app-shell.sale-ready .result-panel {
  animation: r48-sale-ready 720ms var(--ease) both;
}

.result-panel {
  border-color: rgba(255, 128, 93, 0.42);
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 207, 126, 0.28), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 237, 226, 0.98));
  box-shadow: 0 16px 34px rgba(142, 82, 98, 0.16), inset 0 1px rgba(255, 255, 255, 0.98);
}

.result-copy strong {
  color: #3d2a4d;
}

.result-value {
  border-color: rgba(130, 93, 126, 0.2);
}

.result-value strong {
  font-size: clamp(1.65rem, 4vw, 2.5rem);
}

.result-panel[data-result="loss"] {
  border-color: rgba(221, 92, 118, 0.62);
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 158, 178, 0.3), transparent 40%),
    linear-gradient(145deg, rgba(255, 248, 247, 0.98), rgba(255, 229, 232, 0.98));
}

.result-panel[data-result="loss"] .result-value strong,
.result-amount-overlay[data-result="loss"] {
  color: var(--rose);
}

.result-panel[data-result="gain"] .result-value strong,
.result-amount-overlay[data-result="gain"] {
  color: var(--copper-light);
}

.result-damage-marker {
  border-color: rgba(221, 92, 118, 0.64);
  background: rgba(255, 235, 237, 0.94);
  color: #bd3e5c;
}

.action-dock {
  border-color: rgba(50, 185, 159, 0.42);
  background: linear-gradient(135deg, rgba(237, 255, 249, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 15px 30px rgba(50, 185, 159, 0.14);
}

.action-dock[data-result="loss"] {
  border-color: rgba(221, 92, 118, 0.5);
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.98), rgba(255, 255, 255, 0.98));
}

.main-action {
  border-color: rgba(50, 185, 159, 0.48);
  background: linear-gradient(135deg, #8cebd1, #50cbb0);
  color: #173b3a;
  box-shadow: 0 8px 18px rgba(50, 185, 159, 0.2);
}

.main-action:hover,
.main-action:focus-visible {
  filter: saturate(1.08) brightness(1.04);
}

.last-break[data-result="gain"] {
  border-color: rgba(255, 128, 93, 0.3);
  background: rgba(255, 238, 225, 0.72);
}

.last-break[data-result="loss"] {
  border-color: rgba(221, 92, 118, 0.36);
  background: rgba(255, 232, 235, 0.74);
}

/* The compact landscape layout historically hid this receipt to save height.
   It is part of the cash-change lesson now, so keep it visible after sale. */
@media (min-width: 680px) and (max-height: 480px) {
  .app-shell[data-phase="idle"][data-has-last-outcome="true"] .last-break {
    display: flex;
  }
}

@media (min-width: 680px) {
  .game-main > #lastBreak {
    position: absolute;
    right: 12px;
    bottom: 4px;
    z-index: 4;
    width: max-content;
    max-width: min(42vw, 320px);
  }
}

/* R11's dark ordinary-result selector is more specific than the general
   bright-theme surface. Match it here so the result card follows the new
   light surprise-studio direction for every non-jackpot gain. */
.result-panel[data-result="gain"]:not(.result-gold):not(.result-amethyst):not(.result-legendary) {
  border-color: rgba(255, 128, 93, 0.42);
  background:
    radial-gradient(circle at 84% 8%, rgba(255, 207, 126, 0.28), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 237, 226, 0.98));
}

.orientation-gate {
  border-color: rgba(255, 128, 93, 0.5);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 207, 126, 0.42), transparent 46%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 236, 227, 0.98));
  box-shadow: 0 24px 80px rgba(127, 84, 104, 0.18);
}

.orientation-gate strong {
  color: var(--paper);
}

.orientation-gate p {
  color: #725b70;
}

.workshop-upgrade-button:not(:disabled),
.facility-button:not(:disabled) {
  border-color: rgba(50, 185, 159, 0.48);
  background: linear-gradient(135deg, #8cebd1, #50cbb0);
  color: #173b3a;
  box-shadow: 0 7px 16px rgba(50, 185, 159, 0.16);
}

.workshop-upgrade-button:not(:disabled) strong,
.facility-button:not(:disabled) strong {
  color: #173b3a;
}

.workshop-upgrade-button:disabled,
.facility-button:disabled {
  border-color: rgba(130, 93, 126, 0.2);
  background: rgba(244, 235, 239, 0.92);
  color: #9b8798;
}

.goal-panel[data-state="geode"],
.goal-panel[data-state="hammer"],
.goal-panel[data-state="max"] {
  border-color: rgba(140, 124, 241, 0.34);
  background:
    radial-gradient(circle at 86% 0%, rgba(203, 191, 255, 0.3), transparent 44%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 239, 255, 0.96));
}

.scene-progress[data-state="changed"],
.scene-progress[data-state="ready"] {
  border-top-color: rgba(140, 124, 241, 0.34);
  background: rgba(239, 234, 255, 0.72);
}

.growth-rail,
.growth-option {
  border-color: rgba(130, 93, 126, 0.2);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(244, 239, 255, 0.94));
  box-shadow: 0 10px 24px rgba(136, 87, 105, 0.1);
}

.upgrade-button:not(:disabled) {
  border-color: rgba(140, 124, 241, 0.42);
  background: linear-gradient(135deg, #c9c0ff, #9c91f4);
  color: #302765;
  box-shadow: 0 7px 16px rgba(117, 101, 224, 0.16);
}

.upgrade-button:not(:disabled) strong {
  color: #302765;
}

.upgrade-button:disabled {
  border-color: rgba(130, 93, 126, 0.2);
  background: rgba(244, 235, 239, 0.92);
  color: #9b8798;
}

.action-dock[data-phase="cracking"],
.action-dock[data-phase="reveal"],
.action-dock[data-phase="result"] {
  border-color: rgba(50, 185, 159, 0.38);
  background: linear-gradient(135deg, rgba(237, 255, 249, 0.98), rgba(255, 255, 255, 0.98));
  box-shadow: 0 15px 30px rgba(50, 185, 159, 0.14);
}

.action-dock[data-result="loss"] {
  border-color: rgba(221, 92, 118, 0.46);
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.98), rgba(255, 255, 255, 0.98));
}

@keyframes r52-line-ready {
  0%, 100% { opacity: 0.46; transform: scale(0.82); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes r52-capsule-feed {
  0% { left: -14%; opacity: 0; transform: translateY(-2px) rotate(-10deg) scale(0.68); }
  15% { opacity: 1; }
  72% { left: 61%; opacity: 1; transform: translateY(0) rotate(4deg) scale(0.84); }
  100% { left: 70%; opacity: 0; transform: translateY(2px) rotate(0) scale(0.78); }
}

@keyframes r52-capsule-to-press {
  0% { left: 54%; opacity: 0; transform: translateY(0) rotate(-4deg) scale(0.76); }
  18% { opacity: 1; }
  54% { left: 68%; opacity: 1; transform: translateY(1px) rotate(0) scale(0.82); }
  74% { left: 68%; opacity: 1; transform: translateY(7px) rotate(0) scale(0.76, 0.66); }
  100% { left: 68%; opacity: 0; transform: translateY(1px) rotate(2deg) scale(0.82); }
}

@keyframes r52-press-platen {
  0% { opacity: 0; transform: translateY(-30px) scaleX(0.82); }
  16% { opacity: 0.92; }
  46% { opacity: 1; transform: translateY(4px) scaleX(1); }
  64% { opacity: 1; transform: translateY(0) scaleX(0.96); }
  100% { opacity: 0; transform: translateY(-30px) scaleX(0.82); }
}

@keyframes r52-press-flash {
  0%, 38% { opacity: 0; transform: scale(0.35); }
  52% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 0; transform: scale(1.55); }
}

@keyframes r52-press-crack {
  0%, 46% { opacity: 0; transform: translateY(-3px) rotate(34deg) scaleY(0.4); }
  62% { opacity: 1; transform: translateY(0) rotate(34deg) scaleY(1); }
  100% { opacity: 0; transform: translateY(3px) rotate(34deg) scaleY(0.9); }
}

.facility-press-crack-b {
  animation-name: r52-press-crack-b !important;
}

@keyframes r52-press-crack-b {
  0%, 46% { opacity: 0; transform: translateY(-3px) rotate(-42deg) scaleY(0.4); }
  62% { opacity: 1; transform: translateY(0) rotate(-42deg) scaleY(1); }
  100% { opacity: 0; transform: translateY(3px) rotate(-42deg) scaleY(0.9); }
}

@keyframes r48-sale-ready {
  0% { box-shadow: 0 16px 34px rgba(142, 82, 98, 0.16), inset 0 1px rgba(255, 255, 255, 0.98); }
  45% { box-shadow: 0 0 0 5px rgba(50, 185, 159, 0.12), 0 19px 38px rgba(50, 185, 159, 0.22), inset 0 1px rgba(255, 255, 255, 0.98); }
  100% { box-shadow: 0 16px 34px rgba(142, 82, 98, 0.16), inset 0 1px rgba(255, 255, 255, 0.98); }
}

@media (min-width: 680px) and (max-height: 380px) {
  .topbar {
    padding-top: 7px;
    padding-bottom: 4px;
  }

  .game-main {
    gap: 5px;
    padding-top: 2px;
    padding-bottom: 4px;
  }

  .status-row {
    min-height: 32px;
  }

  .status-text {
    margin-top: 2px;
    font-size: 0.66rem;
  }

  .arena {
    padding-top: 7px;
    padding-bottom: 8px;
  }

  .facility-motion-capsule {
    bottom: 17%;
    width: 12%;
  }

  .facility-slot-rail {
    bottom: 15%;
    gap: 3px;
  }

  .automation-status {
    min-height: 18px;
    padding-inline: 6px;
    font-size: 0.43rem;
  }

  .result-panel {
    min-height: 178px;
  }

  .result-value strong {
    font-size: 1.7rem;
  }
}
.test-mode-panel {
  display: none;
}

body.test-mode .test-mode-panel {
  display: grid;
  position: fixed;
  z-index: 40;
  top: 10px;
  left: 10px;
  gap: 7px;
  width: min(360px, calc(100vw - 20px));
  padding: 9px 10px 10px;
  color: #4d3857;
  background: rgba(255, 252, 249, 0.94);
  border: 1px solid rgba(130, 93, 126, 0.24);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(127, 84, 104, 0.17), inset 0 1px rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
}

.test-mode-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.test-mode-heading > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.test-mode-heading strong {
  color: #4d3857;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.test-mode-heading > div > span {
  color: #94788a;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.test-mode-state {
  max-width: 45%;
  overflow: hidden;
  padding: 4px 7px;
  border: 1px solid rgba(140, 124, 241, 0.28);
  border-radius: 999px;
  background: rgba(239, 234, 255, 0.78);
  color: #6555d6;
  font-size: 0.55rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.test-mode-button,
.test-mode-demo-button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(130, 93, 126, 0.2);
  border-radius: 9px;
  font: inherit;
  font-size: 0.58rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms var(--ease), border-color 160ms var(--ease), background 160ms var(--ease), color 160ms var(--ease);
}

.test-mode-button {
  background: rgba(255, 255, 255, 0.8);
  color: #69556b;
}

.test-mode-button:hover,
.test-mode-button:focus-visible,
.test-mode-button.is-active {
  border-color: rgba(50, 185, 159, 0.52);
  background: rgba(224, 255, 246, 0.96);
  color: #167e6c;
  transform: translateY(-1px);
}

.test-mode-demo-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-top: 2px;
  border-top: 1px solid rgba(130, 93, 126, 0.14);
}

.test-mode-demo-button {
  flex: 0 0 auto;
  border-color: rgba(255, 128, 93, 0.42);
  background: linear-gradient(135deg, #ffd1a0, #ff9477);
  color: #4d2d3d;
}

.test-mode-demo-button.is-running {
  border-color: rgba(221, 92, 118, 0.42);
  background: rgba(255, 232, 235, 0.94);
  color: #bd3e5c;
}

.test-mode-demo-row > span {
  min-width: 0;
  color: #94788a;
  font-size: 0.5rem;
  line-height: 1.25;
}

@media (max-height: 420px) {
  body.test-mode .test-mode-panel {
    display: flex;
    align-items: center;
    top: 4px;
    left: 4px;
    width: calc(100vw - 8px);
    max-width: none;
    padding: 5px 6px 6px;
    gap: 4px;
  }

  .test-mode-heading {
    flex: 0 0 auto;
    gap: 4px;
  }

  .test-mode-heading strong {
    font-size: 0.58rem;
  }

  .test-mode-heading > div > span,
  .test-mode-demo-row > span {
    display: none;
  }

  .test-mode-state {
    max-width: 74px;
    padding: 3px 5px;
    font-size: 0.46rem;
  }

  .test-mode-actions {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
  }

  .test-mode-button,
  .test-mode-demo-button {
    min-height: 28px;
    padding: 4px 7px;
    font-size: 0.5rem;
    white-space: nowrap;
  }

  .test-mode-demo-row {
    display: contents;
    border-top: 0;
    padding-top: 0;
  }
}

@media (orientation: portrait) and (max-width: 600px) {
  body.test-mode .test-mode-panel {
    display: none;
  }
}

@media (min-width: 680px) and (max-height: 480px) {
  body.test-mode {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }

  body.test-mode .test-mode-panel {
    position: relative;
    inset: auto;
    flex: 0 0 auto;
    margin: 4px;
    width: calc(100vw - 8px);
  }

  body.test-mode .app-shell {
    min-height: calc(100dvh - 49px);
    height: calc(100dvh - 49px);
  }
}

/* R53 rendered correction: waiting capsules sit on the connected line instead
   of covering the machinery. The first DOM item remains the next manual target
   and is placed nearest the press; the rest read as a compact physical queue. */
.app-shell[data-conveyor-level="1"] .field-stones,
.app-shell[data-conveyor-level="2"] .field-stones {
  inset: auto 2% 10% 2%;
  display: flex;
  height: 58px;
  flex-direction: row-reverse;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 2px;
}

.app-shell[data-conveyor-level="1"] .field-stone-button,
.app-shell[data-conveyor-level="2"] .field-stone-button {
  width: 44px;
  min-width: 44px;
  min-height: 48px;
  flex: 0 0 44px;
  gap: 0;
  padding: 2px;
  border-color: transparent;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.app-shell[data-conveyor-level="1"] .field-stone-art,
.app-shell[data-conveyor-level="2"] .field-stone-art {
  width: 40px;
  height: 40px;
  transform: none;
  filter: drop-shadow(0 5px 5px rgba(92, 59, 91, 0.18));
}

.app-shell[data-conveyor-level="1"] .field-stone-name,
.app-shell[data-conveyor-level="1"] .field-stone-hint,
.app-shell[data-conveyor-level="2"] .field-stone-name,
.app-shell[data-conveyor-level="2"] .field-stone-hint {
  display: none;
}

.app-shell[data-conveyor-level="1"] .field-stone-button::after,
.app-shell[data-conveyor-level="2"] .field-stone-button::after {
  right: 5px;
  bottom: 0;
  left: 5px;
  height: 7px;
  border-radius: 50%;
  background: rgba(74, 62, 83, 0.2);
  filter: blur(2px);
}

.app-shell[data-conveyor-level="1"] .field-stone-button.is-next,
.app-shell[data-conveyor-level="2"] .field-stone-button.is-next {
  z-index: 2;
  border-color: transparent;
  box-shadow: none;
  filter: drop-shadow(0 0 7px rgba(255, 128, 93, 0.58));
  transform: translateY(-5px) scale(1.08);
}

.app-shell[data-conveyor-level="1"] .field-stone-button.is-queued,
.app-shell[data-conveyor-level="2"] .field-stone-button.is-queued {
  opacity: 0.84;
}

.app-shell[data-conveyor-level="1"] .field-stone-button:hover,
.app-shell[data-conveyor-level="1"] .field-stone-button:focus-visible,
.app-shell[data-conveyor-level="2"] .field-stone-button:hover,
.app-shell[data-conveyor-level="2"] .field-stone-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 253, 246, 0.58);
}

.app-shell[data-conveyor-level="1"] .field-stone-button[data-prepped-hits]:not([data-prepped-hits="0"])::before,
.app-shell[data-conveyor-level="2"] .field-stone-button[data-prepped-hits]:not([data-prepped-hits="0"])::before {
  top: -5px;
  right: -3px;
  display: grid;
  width: 17px;
  height: 17px;
  padding: 0;
  place-items: center;
  border: 2px solid #fff9df;
  border-radius: 50%;
  content: "★";
  font-size: 0.48rem;
  letter-spacing: 0;
  box-shadow: 0 3px 8px rgba(183, 75, 72, 0.24);
}

/* Toasts are short status pills, never a full-width curtain over the game. */
.toast {
  top: 46px;
  right: auto;
  bottom: auto;
  left: 50%;
  width: max-content;
  max-width: min(360px, calc(100% - 36px));
  padding: 7px 11px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  transform: translate(-50%, 6px);
}

.toast.is-visible {
  animation: r53-toast-pill 1.3s var(--ease) both;
}

@keyframes r53-toast-pill {
  0% { opacity: 0; transform: translate(-50%, 6px); }
  15%, 78% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -3px); }
}

@media (min-width: 680px) and (max-height: 380px) {
  .app-shell[data-conveyor-level="1"] .field-stones,
  .app-shell[data-conveyor-level="2"] .field-stones {
    bottom: 8%;
    height: 52px;
    gap: 1px;
  }

  .app-shell[data-conveyor-level="1"] .field-stone-button,
  .app-shell[data-conveyor-level="2"] .field-stone-button {
    width: 42px;
    min-width: 42px;
    min-height: 44px;
    flex-basis: 42px;
  }

  .app-shell[data-conveyor-level="1"] .field-stone-art,
  .app-shell[data-conveyor-level="2"] .field-stone-art {
    width: 36px;
    height: 36px;
  }
}

/* R55: a tall desktop review pane may position the phone stage, but it must
   never reshape it. The game remains an exact 844:390 Landscape composition. */
@media (orientation: portrait) and (min-width: 680px) {
  body.test-mode {
    display: grid;
    grid-template-columns: minmax(0, 844px);
    grid-template-rows: 46px auto;
    align-content: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
  }

  body.test-mode .test-mode-panel {
    position: relative;
    inset: auto;
    display: flex;
    align-items: center;
    width: min(calc(100vw - 16px), 844px);
    max-width: 844px;
    min-height: 46px;
    margin: 0;
    gap: 7px;
    padding: 5px 8px;
    border-radius: 13px;
  }

  body.test-mode .test-mode-heading > div > span,
  body.test-mode .test-mode-demo-row > span {
    display: none;
  }

  body.test-mode .test-mode-actions {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
  }

  body.test-mode .test-mode-demo-row {
    display: contents;
  }

  body.test-mode .app-shell {
    width: min(calc(100vw - 16px), 844px);
    height: min(390px, calc((100vw - 16px) * 390 / 844));
    min-height: 0 !important;
    max-height: 390px;
    aspect-ratio: 844 / 390;
  }
}

/* R59: tier escalation must read through silhouette and risk, not recoloring.
   Free is a squat paper parcel, Surprise stays round, and Prism is a tall vault. */
.tier-button[data-tier="free"] .tier-art img,
.field-stone-button[data-tier="free"] .field-stone-art {
  transform: scale(0.86);
  filter: drop-shadow(0 5px 5px rgba(58, 132, 112, 0.22));
}

.tier-button[data-tier="rock"] .tier-art img,
.field-stone-button[data-tier="rock"] .field-stone-art {
  transform: scale(1.02);
  filter: drop-shadow(0 6px 6px rgba(219, 103, 76, 0.24));
}

.tier-button[data-tier="geode"] .tier-art img,
.field-stone-button[data-tier="geode"] .field-stone-art {
  transform: scale(1.08);
  filter: drop-shadow(0 0 7px rgba(106, 89, 224, 0.36));
}

.tier-button[data-tier="geode"] > span:not(.tier-art) {
  font-size: 0.48rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.tier-button[data-tier="geode"] small,
.tier-button[data-tier="geode"]:not(.is-selected) small {
  display: block;
  width: max-content;
  max-width: 100%;
  padding: 2px 5px;
  border-radius: 999px;
  color: #7b365f;
  background: rgba(255, 213, 221, 0.92);
  font-weight: 900;
  letter-spacing: 0.01em;
}

.tier-button[data-tier="geode"][data-risk-level="medium"] small {
  color: #795019;
  background: rgba(255, 231, 167, 0.94);
}

.tier-button[data-tier="geode"][data-risk-level="low"] small {
  color: #166b5e;
  background: rgba(204, 247, 232, 0.95);
}

.tier-button[data-affordable="false"]::after {
  content: attr(data-unlock);
}

.tier-button[data-affordable="true"][data-locked="true"]::after {
  display: none;
}

.app-shell[data-tier="free"] .geode-image-closed {
  transform: scale(0.9);
}

.app-shell[data-tier="geode"] .geode-image-closed {
  transform: scale(1.08);
}

/* R68: keep the odds surface light, semantic, and scannable at phone width.
   The signed loss plus the sale/loss header explain the cash movement without
   introducing a player-facing profit calculation. */
.outcome-odds {
  gap: 5px;
  padding-top: 6px;
  border-top-color: rgba(126, 91, 112, 0.2);
}

.outcome-odds > .section-label {
  color: #7d6476;
  font-size: 0.5rem;
  letter-spacing: 0.06em;
}

.odds-list {
  grid-template-columns: minmax(0, max-content) minmax(24px, 1fr) 42px;
  border-color: rgba(126, 91, 112, 0.22);
  border-radius: 10px;
  background: rgba(255, 250, 247, 0.82);
  box-shadow: 0 4px 12px rgba(107, 71, 99, 0.08);
}

.odds-table-heading {
  padding: 4px 6px 3px;
  color: #7d6476;
  font-size: 0.47rem;
  letter-spacing: 0.05em;
}

.odds-table-heading:first-child {
  grid-column: 1 / span 2;
}

.odds-table-heading:last-child {
  grid-column: 3;
}

.odds-item {
  grid-template-columns: minmax(0, max-content) minmax(24px, 1fr) 42px;
  min-height: 22px;
  align-items: center;
  padding: 3px 6px;
  border-top-color: rgba(126, 91, 112, 0.14);
  color: #44334a;
  font-family: inherit;
}

.odds-item strong {
  grid-column: 1;
  font-size: 0.64rem;
  letter-spacing: 0;
}

.odds-meter {
  grid-column: 2;
  display: block;
  height: 4px;
  min-width: 0;
  margin: 0 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(126, 91, 112, 0.13);
}

.odds-meter::after {
  display: block;
  width: var(--odds-pct, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e5b14d, #c98025);
  content: "";
}

.odds-item small {
  grid-column: 3;
  color: #65505f;
  font-size: 0.57rem;
  font-weight: 850;
  text-align: right;
}

.odds-item[data-impact="payout"] {
  border-top-color: rgba(211, 151, 48, 0.2);
  background: rgba(255, 244, 213, 0.78);
  box-shadow: inset 3px 0 #d59a31;
  color: #8a5a12;
}

.odds-item[data-impact="payout"] small {
  color: #8a5a12;
}

.odds-item[data-impact="payout"] .odds-meter::after {
  background: linear-gradient(90deg, #e4ae46, #c98326);
}

.odds-item[data-impact="loss"] {
  border-top-color: rgba(207, 76, 103, 0.22);
  background: rgba(255, 228, 233, 0.86);
  box-shadow: inset 3px 0 #d95773;
  color: #b43d59;
}

.odds-item[data-impact="loss"] small {
  color: #9c3b55;
}

.odds-item[data-impact="loss"] .odds-meter::after {
  background: linear-gradient(90deg, #e66a82, #c94667);
}

.odds-item[data-impact="even"] {
  background: rgba(238, 237, 248, 0.72);
  box-shadow: inset 3px 0 #8b84be;
  color: #5f598b;
}

.odds-note {
  color: #7f6c78;
  font-size: 0.48rem;
  line-height: 1.25;
}

/* Ordinary positive results use a readable gold, while jackpot classes keep
   their existing special treatments. */
.result-panel[data-result="gain"]:not(.result-gold):not(.result-amethyst):not(.result-legendary) .result-value strong,
.result-panel[data-result="gain"]:not(.result-gold):not(.result-amethyst):not(.result-legendary) .result-amount-overlay {
  color: #a66516;
}

.app-shell[data-result="gain"] .result-amount-overlay[data-result="gain"] {
  color: #a66516;
  text-shadow: 0 3px 0 rgba(92, 57, 15, 0.74), 0 0 24px rgba(213, 154, 49, 0.58);
}

.last-break[data-result="gain"] {
  border-color: rgba(213, 154, 49, 0.42);
  background: rgba(255, 242, 205, 0.82);
}

.last-break[data-result="gain"] > span:last-child {
  color: #8d5d13;
}

@media (min-width: 680px) and (max-height: 380px) {
  .odds-table-heading {
    padding-top: 3px;
    padding-bottom: 2px;
    font-size: 0.43rem;
  }

  .odds-item {
    min-height: 20px;
    padding-top: 2px;
    padding-bottom: 2px;
  }

  .odds-item strong {
    font-size: 0.59rem;
  }

  .odds-item small,
  .odds-note {
    font-size: 0.43rem;
  }
}
