:root {
  --void: #06090c;
  --ink: #0a1015;
  --cyan: #9ce8f4;
  --cyan-deep: #35acbd;
  --emerald: #9de6bf;
  --rose: #efaeb5;
  --fog: #b0bdc5;
  --white: #f1f4f5;
  --line: #344650;
  --mono: var(--studio-mono, "IBM Plex Mono", monospace);
  --display: var(--studio-sans, Outfit, system-ui, sans-serif);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* {
  box-sizing: border-box;
}
html {
  background: var(--void);
  min-width: 320px;
}
body {
  margin: 0;
  min-height: 100svh;
  color: var(--white);
  background: radial-gradient(ellipse at 45% 0, #0a1b24, var(--void) 65%);
}
button,
input,
select {
  font: inherit;
}
button {
  color: inherit;
}
button:not(:disabled) {
  cursor: pointer;
}
[hidden] {
  display: none !important;
}
button:focus-visible,
input:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid #c2f6ff;
  outline-offset: 4px;
}
button:disabled {
  cursor: wait;
}
.app-shell {
  width: min(1440px, calc(100% - 64px));
  margin: auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.topbar {
  min-height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 44px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #426b76;
  border-radius: 8px;
  background: #0a1b24;
}
.brand-mark svg {
  width: 25px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.2;
}
.wordmark > span:last-child {
  display: grid;
  gap: 3px;
}
.wordmark small {
  font: 500 11px var(--display);
  color: var(--fog);
  letter-spacing: 0.12em;
}
.wordmark strong {
  font: 600 24px/1 var(--display);
  letter-spacing: 0.26em;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.demo-badge {
  font: 400 11px var(--mono);
  color: var(--fog);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.demo-badge i,
.pulse-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cyan);
}
.balance-block {
  display: grid;
  gap: 4px;
  text-align: right;
  white-space: nowrap;
}
.balance-block span {
  font: 400 11px var(--display);
  color: var(--fog);
  letter-spacing: 0.08em;
}
.balance-block strong {
  font: 500 16px var(--mono);
}
.game-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #344650;
  border-radius: 9px;
  color: #d8e5ea;
  background: #0b171d;
  font: 500 13px var(--display);
}
.tool-button:hover {
  border-color: var(--cyan);
  background: #102630;
}
.tool-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  display: block;
}
.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  padding: 24px 0;
  align-items: center;
}
.arena-panel {
  min-width: 0;
}
.arena-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.eyebrow {
  margin: 0;
  color: var(--fog);
  font: 500 11px var(--display);
  letter-spacing: 0.1em;
}
.arena-heading h1 {
  font: 600 clamp(20px, 1.8vw, 28px)/1.2 var(--display);
  letter-spacing: -0.01em;
  margin: 6px 0 0;
}
.arena-heading h1 em {
  font-style: normal;
  color: var(--fog);
}
.step-label {
  font: 500 11px var(--mono);
  color: var(--cyan);
  white-space: nowrap;
}
.arena {
  height: clamp(450px, 65svh, 660px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(90deg, #060a0dbc, #060a0d30 34%, #060a0d20 70%, #060a0db0),
    url("/fracture/assets/obsidian-chamber.webp") center 55% / cover no-repeat,
    #06090c;
  box-shadow: inset 0 0 90px #01040790;
  --energy: var(--cyan);
}
.arena::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 -60px 70px #020608a0;
}
.arena[data-tone="high"] {
  --energy: #b4f3ff;
}
.arena[data-tone="secured"] {
  --energy: var(--emerald);
}
.arena[data-tone="failure"] {
  --energy: var(--rose);
}
.world-backdrop,
.arena-grain,
.ambient {
  display: none;
}
.core-readout {
  position: absolute;
  z-index: 6;
  top: 24px;
  left: 24px;
  display: grid;
  gap: 3px;
  max-width: 62%;
  text-shadow: 0 2px 16px #010508;
}
.core-readout > span {
  font: 500 12px var(--display);
  color: #d1e8ec;
  letter-spacing: 0.04em;
}
.core-readout > strong {
  font: 500 clamp(46px, 5vw, 70px)/1.04 var(--display);
  color: var(--cyan);
  letter-spacing: -0.02em;
}
.current-return {
  color: var(--white);
  font: 500 clamp(18px, 1.7vw, 24px)/1.3 var(--display);
  margin-top: 2px;
}
.core-readout > small {
  font: 400 12px/1.5 var(--display);
  color: #c1cdd3;
  max-width: 270px;
}
.crystal {
  position: absolute;
  z-index: 2;
  left: 54%;
  top: 54%;
  height: 94%;
  width: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  overflow: visible;
  filter: drop-shadow(0 22px 18px #000c);
}
.crystal-body {
  transform-origin: 356px 288px;
}
.ground-aura {
  filter: url(#groundBlur);
  opacity: 0.4;
  transition: opacity 0.5s;
}
.ground-shadow {
  fill: #000;
  opacity: 0.86;
  filter: url(#groundBlur);
}
.scene-caption,
.energy-points {
  display: none;
}
.scene-callout {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font: 500 11px var(--display);
  color: #c4e0e5;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-align: center;
}
.energy-index {
  position: absolute;
  right: 20px;
  bottom: 54px;
  z-index: 6;
  display: flex;
  gap: 10px;
  align-items: center;
  font: 400 11px var(--display);
  color: var(--fog);
  letter-spacing: 0.06em;
}
.energy-index strong {
  font: 500 20px var(--mono);
  color: #d0eff3;
}
.arena-footer {
  display: flex;
  justify-content: space-between;
  padding: 10px 2px 0;
  color: var(--fog);
  font: 400 11px var(--display);
  letter-spacing: 0.03em;
}
.arena-footer strong {
  font: 400 11px var(--mono);
  color: var(--white);
}
.control-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(140deg, #0d1d25eb, #080e13);
  box-shadow: 0 20px 50px #0003;
}
.setup-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.stake-label {
  display: block;
  margin-bottom: 7px;
  color: var(--fog);
  font: 500 12px var(--display);
  letter-spacing: 0.04em;
}
.stake-input-wrap {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: #060b0f;
  border: 1px solid #526671;
  border-radius: 8px;
}
.stake-input-wrap:focus-within {
  border-color: var(--cyan);
}
.stake-input-wrap input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--white);
  font: 500 22px var(--mono);
  outline: 0;
  appearance: textfield;
}
.stake-input-wrap input::-webkit-inner-spin-button,
.stake-input-wrap input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stake-input-wrap > span {
  font: 400 12px var(--mono);
  color: var(--fog);
}
.stake-shortcuts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}
.stake-shortcuts button {
  min-width: 44px;
  min-height: 32px;
  padding: 0 8px;
  background: #0b1820;
  border: 1px solid #344650;
  border-radius: 6px;
  font: 400 12px var(--mono);
}
.stake-shortcuts button:hover {
  border-color: var(--cyan);
}
.helper-text {
  grid-column: 1/-1;
  color: var(--fog);
  font: 400 12px/1.4 var(--display);
}
.helper-text.input-error {
  color: #ffc1c8;
}
.stake-input-wrap:has([aria-invalid="true"]) {
  border-color: var(--rose);
}
.affordable-button {
  grid-column: 1/-1;
  min-height: 44px;
  border: 1px solid #587781;
  border-radius: 8px;
  background: #102630;
  font: 500 13px var(--display);
}
.panel-label {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 10px;
  font: 500 11px/1.4 var(--display);
  color: #bfd1d8;
  letter-spacing: 0.03em;
}
.panel-label > span:last-child {
  white-space: nowrap;
  font-family: var(--mono);
}
.decision-heading h2,
.decision-copy {
  display: none;
}
.target-list {
  display: grid;
  gap: 10px;
}
.target-option {
  position: relative;
  min-width: 0;
  min-height: 96px;
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 104px;
  grid-template-rows: auto auto;
  gap: 7px 10px;
  align-items: center;
  border: 1px solid #4a6975;
  border-radius: 10px;
  background: linear-gradient(140deg, #102832, #0a141b);
  text-align: left;
  transition:
    border-color 0.16s,
    background 0.16s,
    transform 0.16s;
}
.target-option:hover,
.target-option:focus-visible {
  border-color: var(--cyan);
  background: linear-gradient(140deg, #183b47, #0e1f29);
}
.target-option:active {
  transform: scale(0.99);
}
.target-option:disabled {
  opacity: 0.56;
  transform: none;
}
.target-option:disabled:hover {
  border-color: #4a6975;
  background: linear-gradient(140deg, #102832, #0a141b);
}
.target-route {
  grid-column: 1;
  grid-row: 1/3;
  position: relative;
  width: 20px;
  height: 35px;
  border-left: 1px solid #79c5d2;
  transform: skew(-18deg);
}
.target-route::before,
.target-route::after,
.target-route i {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 1px;
  height: 25px;
  background: #a3e8f1;
  transform: rotate(-25deg);
}
.target-route::after {
  left: 12px;
  top: 10px;
  height: 18px;
  transform: rotate(20deg);
}
.target-route.deep::before {
  height: 30px;
  transform: rotate(-37deg);
}
.target-route.deep::after {
  height: 29px;
  left: 13px;
  top: 4px;
  transform: rotate(36deg);
}
.target-route.core::before {
  height: 31px;
  left: 8px;
  transform: rotate(-53deg);
}
.target-route.core::after {
  height: 31px;
  left: 12px;
  top: 5px;
  transform: rotate(48deg);
}
.target-route.core i {
  height: 28px;
  left: 10px;
  top: 4px;
  transform: rotate(0);
}
.target-copy {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 3px;
}
.target-copy b {
  font: 600 15px/1 var(--display);
  letter-spacing: 0.09em;
}
.target-copy small {
  font: 400 11px var(--display);
  color: var(--fog);
}
.target-value {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  gap: 3px;
  min-width: 0;
}
.target-value > b {
  font: 500 26px/1 var(--display);
  color: #c2f6ff;
}
.target-value small {
  font: 400 12px/1.3 var(--display);
  color: #cfdee4;
  overflow-wrap: anywhere;
}
.target-chance {
  grid-column: 3;
  grid-row: 1/3;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-self: end;
}
.chance-fraction {
  display: grid;
  gap: 3px;
  justify-items: center;
  font: 400 14px/1 var(--mono);
  min-width: 29px;
  color: #dceff3;
}
.chance-fraction b {
  font-weight: 400;
}
.chance-fraction i {
  width: 100%;
  height: 1px;
  background: #809ca6;
}
.chance-copy {
  display: grid;
  gap: 5px;
  max-width: 66px;
}
.chance-copy b {
  font: 500 12px var(--mono);
  color: #c3e9ef;
  white-space: nowrap;
}
.chance-copy small {
  font: 400 11px/1.25 var(--display);
  color: var(--fog);
}
.target-arrow {
  display: none;
}
.target-deep {
  border-color: #56818d;
}
.target-core {
  border-color: #6395a1;
}
.secure-button {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  text-align: left;
  background: linear-gradient(120deg, #103b2b, #0a231c);
  border: 1px solid #6baf91;
  border-radius: 10px;
  transition:
    border-color 0.16s,
    background 0.16s;
}
.secure-button > span {
  font: 600 12px var(--display);
  color: #c6efdb;
  letter-spacing: 0.06em;
}
.secure-button > strong {
  font: 500 21px/1.2 var(--display);
  color: #d6f6e5;
}
.secure-button > small {
  font: 400 12px/1.3 var(--display);
  color: #b7d4c6;
}
.secure-button:hover {
  border-color: #b1eacb;
  background: linear-gradient(120deg, #184e39, #102f24);
}
.secure-button:disabled {
  opacity: 0.58;
}
.resolving-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  color: #d4edf2;
  font: 500 12px/1.4 var(--display);
}
.resolving-note i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--cyan);
  border-radius: 50%;
  animation: confirm-pulse 1.4s ease-in-out infinite;
}
.balance-strip {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font: 400 11px var(--display);
  color: var(--fog);
}
.balance-strip strong {
  font: 500 13px var(--mono);
  color: var(--white);
}
.balance-strip > span:last-child {
  margin-left: auto;
  font-size: 10px;
}
.fairness-note {
  display: flex;
  align-items: start;
  gap: 9px;
  color: var(--fog);
  font: 400 12px/1.45 var(--display);
}
.fairness-icon {
  font-size: 20px;
  color: #afced7;
}
.fairness-note p {
  margin: 0;
}
.fairness-note strong {
  font-weight: 500;
  color: #d4e1e7;
}
.connection-panel {
  padding: 14px;
  border: 1px solid #76919e;
  border-radius: 10px;
  background: #12252f;
}
.connection-panel strong {
  font: 500 15px/1.3 var(--display);
}
.connection-panel p {
  margin: 6px 0 0;
  color: #c2d0d7;
  font: 400 13px/1.5 var(--display);
}
.connection-panel .tool-button {
  width: 100%;
  margin-top: 12px;
}
.connection-panel[data-kind="unconfirmed"],
.connection-panel[data-kind="unavailable"] {
  border-color: #bc9990;
  background: #2b2423;
}
.result-card {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  text-align: center;
  background: linear-gradient(180deg, #06110fcf, #030a09b8);
}
.result-card.is-loss {
  background: linear-gradient(180deg, #170d10d9, #09070bc5);
}
.result-symbol {
  width: 34px;
  height: 34px;
  transform: rotate(45deg);
  border: 1px solid var(--emerald);
  background: #194936;
  margin-bottom: 2px;
}
.result-symbol span {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid #bdeacf;
  margin: 10px;
}
.is-loss .result-symbol {
  border-color: var(--rose);
  background: #40262f;
}
.is-loss .result-symbol span {
  border-color: #f1c3c8;
}
.result-card h2 {
  font: 600 clamp(25px, 3vw, 40px)/1.1 var(--display);
  letter-spacing: 0.03em;
  margin: 4px 0 6px;
  color: #d9f6e5;
}
.result-card.is-loss h2 {
  color: #f4d4d8;
}
.return-label {
  color: #c3d0d5;
  font: 500 12px var(--display);
  letter-spacing: 0.07em;
}
.result-return {
  font: 500 clamp(32px, 4.7vw, 65px)/1.1 var(--display);
  color: var(--white);
  overflow-wrap: anywhere;
  max-width: 100%;
}
.result-facts {
  display: grid;
  gap: 8px;
  color: #d0dde2;
  font: 400 13px/1.35 var(--display);
}
.result-facts > span:last-child {
  font: 500 17px var(--display);
  color: var(--emerald);
}
.is-loss .result-facts > span:last-child {
  color: var(--rose);
}
.result-detail {
  margin: 4px 0 10px;
  max-width: 370px;
  color: #c9d7dd;
  font: 400 14px/1.5 var(--display);
}
.primary-button {
  min-height: 48px;
  min-width: 180px;
  padding: 0 20px;
  border: 1px solid #739dab;
  border-radius: 9px;
  background: #16323d;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  color: #e1f5f8;
  font: 600 13px var(--display);
  letter-spacing: 0.04em;
}
.primary-button b {
  font-size: 21px;
  font-weight: 400;
}
.primary-button:hover {
  border-color: var(--cyan);
  background: #234652;
}
.primary-button:disabled {
  opacity: 0.5;
}
.arena:has(#result-card:not([hidden])) .core-readout,
.arena:has(#result-card:not([hidden])) .energy-index,
.arena:has(#result-card:not([hidden])) .scene-callout {
  visibility: hidden;
}
.game-layout:has(#result-card:not([hidden])) .control-panel .balance-strip,
.game-layout:has(#result-card:not([hidden])) .control-panel .fairness-note {
  display: none;
}
.game-layout:has(#result-card:not([hidden])):has(#connection-panel[hidden]) .control-panel {
  display: none;
}
.game-layout:has(#result-card:not([hidden])):has(#connection-panel[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.game-layout:has(#result-card:not([hidden])) .arena {
  width: min(100%, 1000px);
  margin: auto;
}
.disclaimer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 4px 0 calc(4px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  color: var(--fog);
  font: 400 11px var(--display);
  letter-spacing: 0.02em;
}
.disclaimer a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  color: #c3d4dc;
  text-decoration: none;
  font: 500 12px var(--display);
}
.disclaimer a:hover {
  color: var(--white);
}
.rules-dialog {
  width: min(580px, calc(100% - 28px));
  max-height: min(90svh, 800px);
  padding: 32px;
  border: 1px solid #4b6977;
  border-radius: 20px;
  background: linear-gradient(140deg, #10232d, #080f15);
  color: var(--white);
  box-shadow: 0 30px 100px #0008;
}
.rules-dialog form:first-child {
  position: absolute;
  top: 10px;
  right: 10px;
}
.dialog-close {
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 0;
  font-size: 28px;
  color: #d1dfe6;
}
.rules-dialog h2 {
  font: 600 32px/1.15 var(--display);
  margin: 12px 0 20px;
  padding-right: 16px;
  letter-spacing: -0.02em;
}
.rules-dialog h2 em {
  font-style: normal;
  color: var(--cyan);
}
.rule-list {
  display: grid;
  gap: 16px;
}
.rule-list p {
  margin: 0;
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  color: #c4d1d9;
  font: 400 14px/1.6 var(--display);
}
.rule-list b {
  color: var(--cyan);
  font-weight: 500;
}
.rule-list code {
  font: 400 12px var(--mono);
  color: #d9f5fa;
}
.rule-foot {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font: 500 11px var(--display);
  color: var(--cyan);
}
.rule-foot span {
  color: #c4d1d9;
  font: 400 13px/1.5 var(--display);
}
.dialog-done {
  width: 100%;
  margin-top: 24px;
}
.dialog-intro {
  margin: 0 0 18px;
  color: #c4d1d9;
  font: 400 14px/1.5 var(--display);
}
.preference-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.preference-row > span {
  display: grid;
  gap: 5px;
}
.preference-row strong {
  font: 500 16px var(--display);
}
.preference-row small {
  color: var(--fog);
  font: 400 13px/1.4 var(--display);
}
.preference-row input {
  min-width: 24px;
  width: 24px;
  height: 24px;
  accent-color: #8fcfe0;
  cursor: pointer;
}
.preference-row select {
  min-height: 44px;
  width: 148px;
  max-width: 42%;
  padding: 0 8px;
  background: #0a171f;
  border: 1px solid #587481;
  border-radius: 8px;
  color: var(--white);
  font: 400 13px var(--display);
}
.history-list {
  display: grid;
  gap: 12px;
}
.history-round {
  padding: 14px;
  background: #0a171e;
  border: 1px solid #314b58;
  border-radius: 10px;
}
.history-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font: 500 14px var(--display);
}
.history-heading strong {
  font-weight: 500;
}
.history-heading > strong:last-child {
  color: var(--emerald);
}
.history-round.negative .history-heading > strong:last-child {
  color: var(--rose);
}
.history-round p {
  margin: 8px 0;
  font: 400 13px/1.5 var(--display);
  color: #c0d0d8;
}
.history-round > small {
  display: block;
  font: 400 11px/1.5 var(--mono);
  color: #a8bdc7;
  overflow-wrap: anywhere;
}
.history-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--fog);
  font-size: 14px;
}
.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 10px);
  max-width: calc(100% - 30px);
  padding: 13px 16px;
  border: 1px solid #6e95a4;
  border-radius: 10px;
  background: #0e2530;
  color: var(--white);
  box-shadow: 0 15px 45px #0005;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  font: 400 13px var(--display);
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes confirm-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (min-width: 1100px) and (max-height: 760px) {
  .app-shell {
    width: calc(100% - 48px);
  }
  .topbar {
    min-height: 64px;
  }
  .game-layout {
    padding: 16px 0;
    grid-template-columns: minmax(0, 1fr) 380px;
  }
  .arena {
    height: 480px;
  }
  .arena-heading .eyebrow {
    display: none;
  }
  .control-panel {
    padding: 16px;
    gap: 12px;
  }
  .target-option {
    min-height: 88px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .fairness-note {
    display: none;
  }
}
@media (max-width: 1099px) and (min-width: 701px) {
  .app-shell {
    width: calc(100% - 36px);
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 348px;
    gap: 16px;
  }
  .control-panel {
    padding: 16px;
  }
  .demo-badge {
    display: none;
  }
  .arena-heading h1 {
    font-size: 20px;
  }
  .arena-heading h1 em {
    display: block;
  }
  .arena {
    height: 535px;
  }
  .core-readout {
    max-width: 90%;
  }
  .core-readout > strong {
    font-size: 50px;
  }
  .crystal {
    top: 58%;
    height: 84%;
  }
  .energy-index {
    display: none;
  }
}
@media (max-width: 700px) {
  .app-shell {
    width: 100%;
    padding: 0 12px calc(4px + var(--safe-bottom));
  }
  .topbar {
    min-height: 64px;
    gap: 6px;
  }
  .brand-mark,
  .demo-badge {
    display: none;
  }
  .wordmark {
    gap: 0;
  }
  .wordmark small {
    font-size: 10px;
    letter-spacing: 0.05em;
  }
  .wordmark strong {
    font-size: 18px;
    letter-spacing: 0.1em;
  }
  .topbar-actions {
    display: contents;
  }
  .balance-block {
    margin-left: auto;
  }
  .balance-block span {
    font-size: 10px;
  }
  .balance-block strong {
    font-size: 12px;
  }
  .game-tools {
    gap: 3px;
  }
  .game-tools .tool-button {
    padding: 0 5px;
    min-width: 44px;
    font-size: 11px;
  }
  .game-tools .tool-button svg {
    width: 18px;
  }
  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 12px;
    align-items: stretch;
  }
  .arena-heading {
    display: none;
  }
  .arena {
    height: min(28svh, 240px);
    min-height: 160px;
    border-radius: 12px;
  }
  .crystal {
    height: 115%;
    top: 51%;
    left: 68%;
  }
  .core-readout {
    top: 16px;
    left: 14px;
    max-width: 52%;
    gap: 3px;
  }
  .core-readout > span {
    font-size: 11px;
    line-height: 1.3;
    max-width: 155px;
  }
  .core-readout > strong {
    font-size: 44px;
  }
  .current-return {
    font-size: 17px;
    max-width: 165px;
  }
  .core-readout > small {
    display: none;
  }
  .scene-callout {
    display: none;
  }
  .energy-index {
    display: none;
  }
  .arena-footer {
    font-size: 10px;
    padding-top: 6px;
  }
  .arena-footer strong {
    font-size: 10px;
  }
  .control-panel {
    padding: 0;
    gap: 10px;
    border: 0;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
  }
  .setup-controls {
    grid-template-columns: minmax(100px, 1fr) auto;
    gap: 7px 10px;
  }
  .stake-label {
    font-size: 11px;
    margin-bottom: 5px;
  }
  .stake-input-wrap {
    min-height: 44px;
  }
  .stake-input-wrap input {
    font-size: 20px;
  }
  .stake-shortcuts {
    display: flex;
    gap: 5px;
  }
  .stake-shortcuts button {
    min-width: 36px;
    min-height: 44px;
  }
  .helper-text {
    font-size: 12px;
    line-height: 1.3;
  }
  .panel-label {
    font-size: 11px;
    margin-bottom: 7px;
  }
  .panel-label > span:first-child {
    max-width: 228px;
  }
  .target-list {
    gap: 7px;
  }
  .target-option {
    min-height: 74px;
    padding: 10px 11px;
    gap: 5px 9px;
    grid-template-columns: minmax(0, 1fr) 109px;
    border-radius: 9px;
  }
  .target-route {
    display: none;
  }
  .target-copy {
    grid-column: 1;
    gap: 0;
  }
  .target-copy b {
    font-size: 14px;
  }
  .target-copy small {
    display: none;
  }
  .target-value {
    grid-column: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 3px 8px;
  }
  .target-value > b {
    font-size: 24px;
  }
  .target-value small {
    font-size: 12px;
  }
  .target-chance {
    grid-column: 2;
    gap: 8px;
  }
  .chance-fraction {
    font-size: 13px;
    min-width: 28px;
  }
  .chance-copy b {
    font-size: 12px;
  }
  .chance-copy small {
    font-size: 11px;
  }
  .secure-button {
    min-height: 60px;
    padding: 9px 13px;
    margin-top: 9px;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
  }
  .secure-button > strong {
    font-size: 20px;
    grid-column: 2;
    grid-row: 1;
  }
  .secure-button > small {
    grid-column: 1/-1;
    font-size: 12px;
  }
  .balance-strip {
    margin: 0;
    padding-top: 8px;
    font-size: 11px;
  }
  .balance-strip strong {
    font-size: 12px;
  }
  .balance-strip > span:last-child {
    display: none;
  }
  .fairness-note {
    display: none;
  }
  .resolving-note {
    margin-top: 8px;
  }
  .arena:has(#result-card:not([hidden])) {
    height: min(65svh, 540px);
    min-height: 360px;
  }
  .arena:has(#result-card:not([hidden])) .crystal {
    left: 50%;
    height: 100%;
  }
  .result-card {
    padding: 22px 16px;
    gap: 9px;
  }
  .result-card h2 {
    font-size: 30px;
  }
  .result-return {
    font-size: clamp(34px, 10vw, 48px);
  }
  .result-facts {
    font-size: 13px;
  }
  .result-detail {
    font-size: 13px;
  }
  .disclaimer {
    min-height: 36px;
    font-size: 10px;
  }
  .disclaimer a {
    font-size: 11px;
    min-height: 36px;
  }
  .rules-dialog {
    padding: 28px 22px 22px;
  }
  .rules-dialog h2 {
    font-size: 28px;
  }
}
@media (max-width: 700px) and (max-height: 700px) {
  .game-layout {
    padding-top: 8px;
    gap: 8px;
  }
  .arena {
    height: 130px;
    min-height: 130px;
  }
  .arena-footer {
    display: none;
  }
  .core-readout {
    top: 12px;
  }
  .core-readout > strong {
    font-size: 40px;
  }
  .core-readout > span {
    font-size: 11px;
  }
  .crystal {
    height: 126%;
  }
  .target-option {
    min-height: 66px;
    padding: 8px 11px;
    gap: 4px 9px;
  }
  .target-value > b {
    font-size: 22px;
  }
  .control-panel {
    gap: 8px;
  }
  .helper-text {
    font-size: 12px;
  }
  .arena:has(#result-card:not([hidden])) {
    height: min(65svh, 460px);
    min-height: 370px;
  }
}
@media (max-width: 340px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }
  .topbar {
    flex-wrap: wrap;
    padding: 7px 0;
    gap: 3px 12px;
  }
  .wordmark strong {
    font-size: 18px;
  }
  .game-tools {
    width: 100%;
    justify-content: end;
  }
  .target-option {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 4px 8px;
    padding-left: 9px;
    padding-right: 9px;
  }
  .target-value > b {
    font-size: 22px;
  }
  .secure-button > span {
    font-size: 11px;
  }
  .secure-button > strong {
    font-size: 17px;
  }
  .stake-shortcuts {
    gap: 4px;
  }
  .stake-shortcuts button {
    min-width: 32px;
    padding: 0 5px;
  }
}
@media (min-width: 701px) and (max-height: 500px) {
  .app-shell {
    width: calc(100% - 32px);
  }
  .topbar {
    min-height: 54px;
  }
  .wordmark strong {
    font-size: 20px;
  }
  .demo-badge,
  .brand-mark {
    display: none;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 14px;
    padding: 8px 0;
    align-items: start;
  }
  .arena-heading,
  .arena-footer,
  .scene-callout,
  .energy-index {
    display: none;
  }
  .arena {
    height: 276px;
  }
  .crystal {
    height: 105%;
    top: 55%;
    left: 66%;
  }
  .core-readout {
    left: 14px;
    top: 14px;
    max-width: 55%;
  }
  .core-readout > strong {
    font-size: 42px;
  }
  .core-readout > small {
    display: none;
  }
  .current-return {
    font-size: 18px;
  }
  .control-panel {
    padding: 0;
    gap: 8px;
    border: 0;
    background: transparent;
  }
  .setup-controls {
    grid-template-columns: 1fr auto;
    gap: 6px;
  }
  .stake-label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  .stake-input-wrap {
    min-height: 44px;
  }
  .stake-shortcuts {
    display: flex;
    gap: 4px;
  }
  .stake-shortcuts button {
    min-width: 32px;
    min-height: 44px;
  }
  .helper-text {
    font-size: 12px;
  }
  .target-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .target-option {
    display: flex;
    flex-direction: column;
    align-items: start;
    min-height: 150px;
    padding: 9px 8px;
    gap: 7px;
  }
  .target-route {
    display: none;
  }
  .target-copy b {
    font-size: 14px;
  }
  .target-copy small {
    display: none;
  }
  .target-value {
    display: grid;
    align-items: baseline;
    gap: 4px;
  }
  .target-value > b {
    font-size: 23px;
  }
  .target-value small {
    font-size: 12px;
  }
  .target-chance {
    width: 100%;
    gap: 6px;
    margin-top: auto;
  }
  .chance-fraction {
    font-size: 13px;
    min-width: 23px;
  }
  .chance-copy {
    gap: 4px;
  }
  .chance-copy b {
    font-size: 11px;
  }
  .chance-copy small {
    font-size: 11px;
  }
  .panel-label {
    font-size: 11px;
    margin-bottom: 6px;
  }
  .secure-button {
    min-height: 58px;
    padding: 8px 12px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 8px;
    margin-top: 8px;
  }
  .secure-button strong {
    font-size: 18px;
    grid-column: 2;
    grid-row: 1;
  }
  .secure-button small {
    grid-column: 1/-1;
  }
  .balance-strip {
    padding-top: 6px;
  }
  .fairness-note {
    display: none;
  }
  .disclaimer {
    min-height: 24px;
    font-size: 10px;
  }
  .disclaimer a {
    min-height: 24px;
    font-size: 11px;
  }
  .game-layout:has(#result-card:not([hidden])) .arena {
    height: 380px;
  }
}
html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* A landscape receipt keeps its returned amount, net and next action in view. */
@media (min-width: 701px) and (max-height: 500px) {
  .game-layout:has(#result-card:not([hidden])) .arena {
    height: calc(100svh - 96px);
    min-height: 0;
  }
  .result-card {
    padding: 10px 20px;
    gap: 6px;
  }
  .result-symbol {
    display: none;
  }
  .result-card h2 {
    font-size: 26px;
    margin: 0;
  }
  .result-return {
    font-size: 36px;
  }
  .result-facts {
    grid-template-columns: auto auto;
    gap: 16px;
    align-items: baseline;
  }
  .result-detail {
    max-width: 600px;
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
  }
  .result-card .primary-button {
    min-height: 44px;
  }
}
