:root {
  color-scheme: dark;
  --bg: #050b14;
  --bg-soft: #08111d;
  --panel: rgba(10, 21, 34, 0.82);
  --panel-solid: #0b1724;
  --line: rgba(153, 189, 197, 0.14);
  --line-bright: rgba(100, 255, 206, 0.25);
  --text: #edf7f3;
  --muted: #758d93;
  --mint: #66ffd0;
  --mint-bright: #baffea;
  --mint-dark: #1e9476;
  --cyan: #54cfff;
  --violet: #8a82ff;
  --danger: #ff657b;
  --radius: 18px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 43%, rgba(23, 112, 91, 0.09), transparent 30%),
    linear-gradient(180deg, #07101a 0%, #040911 100%);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

button {
  color: inherit;
  font: inherit;
}

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

.ambient {
  position: fixed;
  z-index: -2;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.08;
  pointer-events: none;
}

.ambient-one {
  top: -280px;
  left: -160px;
  background: #36f3b8;
}

.ambient-two {
  right: -200px;
  bottom: -260px;
  background: #447dff;
}

.grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.1;
  background-image:
    linear-gradient(rgba(128, 183, 179, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 183, 179, 0.12) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(circle at center, black 0%, transparent 75%);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 11, 20, 0.78);
  backdrop-filter: blur(18px);
}

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

.brand-mark {
  position: relative;
  display: grid;
  width: 35px;
  height: 35px;
  margin-right: 11px;
  place-items: center;
  transform: rotate(45deg);
  border: 1px solid rgba(102, 255, 208, 0.52);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(102, 255, 208, 0.15), rgba(102, 255, 208, 0.02));
  box-shadow: inset 0 0 18px rgba(102, 255, 208, 0.08), 0 0 22px rgba(102, 255, 208, 0.09);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border-radius: 3px;
  background: var(--mint);
  box-shadow: 0 0 8px rgba(102, 255, 208, 0.8);
}

.brand-mark::before {
  width: 5px;
  height: 5px;
  top: 8px;
  left: 8px;
}

.brand-mark::after {
  width: 5px;
  height: 5px;
  right: 8px;
  bottom: 8px;
}

.brand-mark span {
  width: 7px;
  height: 7px;
}

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

.brand strong {
  font-size: 15px;
  letter-spacing: 0.22em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.19em;
}

.topbar-status {
  display: flex;
  align-items: center;
  color: #8ba099;
  font: 600 9px/1 var(--mono);
  letter-spacing: 0.16em;
}

.online-dot {
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 9px rgba(102, 255, 208, 0.75);
}

.topbar-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 37px;
  height: 37px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #789096;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-bright);
  color: var(--mint);
  background: rgba(102, 255, 208, 0.06);
}

.icon-button svg {
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sound-off,
.muted .sound-on {
  display: none;
}

.muted .sound-off {
  display: block;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(235px, 280px) minmax(350px, 1fr) minmax(320px, 400px);
  gap: 22px;
  width: min(1510px, calc(100% - 48px));
  min-height: calc(100vh - 120px);
  margin: 22px auto 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.025), transparent 40%),
    var(--panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
}

.left-panel {
  align-self: center;
  padding: 22px;
}

.panel-heading,
.shop-topline,
.session-row,
.combo-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
  color: #98aaa9;
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.15em;
}

.live-pill {
  padding: 5px 7px;
  border: 1px solid rgba(102, 255, 208, 0.18);
  border-radius: 5px;
  color: var(--mint);
  background: rgba(102, 255, 208, 0.07);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.balance-block {
  padding: 23px 0 20px;
}

.eyebrow {
  display: block;
  color: #698086;
  font: 700 8px/1.2 var(--mono);
  letter-spacing: 0.18em;
}

.balance-line {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 8px 0 5px;
}

.balance-line strong {
  overflow: hidden;
  font: 700 clamp(25px, 2.2vw, 34px)/1.1 var(--mono);
  letter-spacing: -0.055em;
  text-overflow: ellipsis;
}

.currency-name {
  margin-left: 31px;
  color: var(--mint);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.14em;
}

.currency-gem {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  transform: rotate(45deg);
  border: 1px solid #97ffe1;
  border-radius: 5px;
  background: linear-gradient(135deg, #b7ffeb 5%, #48eebd 42%, #137b68 100%);
  box-shadow: 0 0 13px rgba(83, 255, 201, 0.35);
}

.currency-gem::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.75);
  border-left: 1px solid rgba(255, 255, 255, 0.55);
}

.currency-gem.mini {
  width: 20px;
  height: 20px;
}

.currency-gem.tiny {
  width: 13px;
  height: 13px;
  border-radius: 3px;
}

.currency-gem.tiny::after {
  inset: 2px;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.metric-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

.metric-icon {
  display: grid;
  width: 25px;
  height: 25px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 7px;
}

.metric-icon svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.click-icon {
  color: var(--mint);
  background: rgba(102, 255, 208, 0.09);
}

.flow-icon {
  color: var(--cyan);
  background: rgba(84, 207, 255, 0.09);
}

.flow-icon svg {
  fill: currentColor;
  stroke: none;
}

.metric-card > span {
  display: block;
  margin-bottom: 5px;
  color: #657a80;
  font: 700 7px/1 var(--mono);
  letter-spacing: 0.12em;
}

.metric-card > strong {
  font: 700 16px/1.1 var(--mono);
}

.session-card {
  margin-top: 17px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.session-row {
  min-height: 28px;
  color: #687e83;
  font: 600 8px/1 var(--mono);
  letter-spacing: 0.08em;
}

.session-row strong {
  color: #a7b7b5;
  font-size: 9px;
  letter-spacing: 0;
}

.tip-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(102, 255, 208, 0.1);
  border-radius: 10px;
  background: rgba(102, 255, 208, 0.035);
}

.tip-card svg {
  flex: 0 0 auto;
  width: 16px;
  color: var(--mint);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.tip-card p {
  margin: 0;
  color: #6f8587;
  font: 500 9px/1.55 var(--mono);
}

.tip-card p strong {
  display: block;
  margin-bottom: 4px;
  color: #9eb0ad;
  font-size: 8px;
  letter-spacing: 0.1em;
}

kbd {
  padding: 1px 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom-width: 2px;
  border-radius: 3px;
  color: #aebfbb;
  background: rgba(255, 255, 255, 0.05);
  font: inherit;
}

.core-stage {
  position: relative;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: space-between;
  min-height: 650px;
  padding: 28px 20px 34px;
}

.stage-heading {
  position: relative;
  z-index: 2;
  text-align: center;
}

.stage-heading h1 {
  margin: 8px 0 8px;
  font-size: clamp(24px, 2.2vw, 35px);
  line-height: 1;
  letter-spacing: 0.08em;
}

.stage-heading p {
  margin: 0;
  color: #6c8286;
  font-size: 12px;
}

.core-wrap {
  position: relative;
  display: grid;
  width: min(460px, 44vw);
  aspect-ratio: 1;
  place-items: center;
  isolation: isolate;
}

.orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(102, 255, 208, 0.11);
  border-radius: 50%;
}

.orbit::before,
.orbit::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(102, 255, 208, 0.6);
  box-shadow: 0 0 10px rgba(102, 255, 208, 0.7);
}

.orbit-outer {
  inset: 2%;
  animation: spin 20s linear infinite;
}

.orbit-outer::before {
  top: 24%;
  right: 5%;
}

.orbit-outer::after {
  bottom: 14%;
  left: 16%;
}

.orbit-inner {
  inset: 14%;
  border-style: dashed;
  border-color: rgba(102, 255, 208, 0.09);
  animation: spin-reverse 28s linear infinite;
}

.orbit-inner::before {
  top: 3%;
  left: 34%;
}

.orbit-inner::after {
  right: 0;
  bottom: 37%;
}

.satellite {
  position: absolute;
  width: 8px;
  height: 8px;
  border: 1px solid var(--mint);
  border-radius: 50%;
  background: #102d2b;
  box-shadow: 0 0 12px rgba(102, 255, 208, 0.55);
}

.satellite-one {
  top: 8%;
  left: 20%;
}

.satellite-two {
  right: 5%;
  bottom: 25%;
  width: 5px;
  height: 5px;
}

.core-button {
  position: relative;
  display: grid;
  width: 57%;
  aspect-ratio: 1;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.core-button::before,
.core-button::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.core-button::before {
  inset: -16%;
  z-index: -2;
  border: 1px solid rgba(102, 255, 208, 0.17);
  background: radial-gradient(circle, rgba(52, 254, 193, 0.08), transparent 66%);
  box-shadow: inset 0 0 45px rgba(102, 255, 208, 0.03);
  transition: transform 100ms ease, opacity 100ms ease;
}

.core-button::after {
  inset: -5%;
  z-index: -1;
  border: 1px solid rgba(146, 255, 223, 0.3);
  box-shadow: 0 0 55px rgba(76, 255, 199, 0.16), inset 0 0 28px rgba(76, 255, 199, 0.08);
}

.core-button:hover::before {
  transform: scale(1.045);
  opacity: 1.4;
}

.core-button.pressed {
  animation: core-press 160ms ease-out;
}

.core-aura {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: var(--mint);
  filter: blur(24px);
  opacity: 0.18;
  animation: breathe 3.8s ease-in-out infinite;
}

.core-shell {
  position: absolute;
  inset: 11%;
  overflow: hidden;
  transform: rotate(45deg);
  border: 1px solid rgba(212, 255, 243, 0.82);
  border-radius: 29%;
  background:
    linear-gradient(135deg, rgba(220, 255, 246, 0.85), transparent 24%),
    linear-gradient(315deg, #0b725e, #4dffd0 53%, #b8ffeb);
  box-shadow:
    0 0 24px rgba(102, 255, 208, 0.56),
    0 0 70px rgba(102, 255, 208, 0.23),
    inset -18px -18px 35px rgba(0, 73, 60, 0.52),
    inset 15px 15px 28px rgba(237, 255, 249, 0.38);
  transition: filter 160ms ease;
}

.core-button:hover .core-shell {
  filter: brightness(1.09);
}

.core-facet {
  position: absolute;
  border: 1px solid rgba(231, 255, 248, 0.22);
}

.facet-one {
  inset: 21%;
  transform: rotate(45deg);
  background: rgba(15, 106, 87, 0.15);
}

.facet-two {
  top: -12%;
  left: 28%;
  width: 48%;
  height: 80%;
  transform: rotate(-17deg);
  background: linear-gradient(90deg, rgba(255,255,255,0.22), transparent);
}

.facet-three {
  right: -11%;
  bottom: -7%;
  width: 70%;
  height: 55%;
  transform: rotate(15deg);
  background: rgba(3, 102, 83, 0.23);
}

.core-light {
  position: absolute;
  top: 12%;
  left: 17%;
  width: 29%;
  height: 14%;
  transform: rotate(-11deg);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  filter: blur(7px);
}

.tap-label {
  position: absolute;
  z-index: 2;
  top: 100%;
  left: 50%;
  display: flex;
  align-items: center;
  flex-direction: column;
  width: max-content;
  transform: translate(-50%, -12px);
  pointer-events: none;
}

.tap-label span {
  color: #718c89;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.17em;
}

.tap-label strong {
  margin-top: 4px;
  color: var(--mint);
  font: 700 14px/1 var(--mono);
}

.click-effects {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: visible;
  pointer-events: none;
}

.gain-float {
  position: absolute;
  transform: translate(-50%, -50%);
  color: var(--mint-bright);
  font: 800 18px/1 var(--mono);
  text-shadow: 0 0 13px rgba(102, 255, 208, 0.8);
  animation: float-away 700ms ease-out forwards;
}

.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--mint-bright);
  box-shadow: 0 0 8px var(--mint);
  animation: spark-out 470ms ease-out forwards;
}

.combo-wrap {
  width: min(370px, 88%);
}

.combo-copy {
  color: #63797c;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.1em;
}

.combo-copy strong {
  color: #94aaa6;
  font-size: 8px;
}

.combo-track {
  height: 4px;
  margin: 9px 0 8px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}

.combo-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint-dark), var(--mint));
  box-shadow: 0 0 10px rgba(102, 255, 208, 0.5);
  transition: width 100ms linear;
}

.combo-wrap small {
  display: block;
  color: #4f6367;
  font: 500 8px/1.4 var(--mono);
  text-align: center;
}

.shop-panel {
  align-self: center;
  max-height: calc(100vh - 125px);
  padding: 24px;
  overflow-y: auto;
  scrollbar-color: rgba(102, 255, 208, 0.18) transparent;
  scrollbar-width: thin;
}

.shop-topline h2 {
  margin: 7px 0 0;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.shop-balance {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  font: 700 11px/1 var(--mono);
}

.bulk-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 20px 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(1, 7, 12, 0.38);
}

.bulk-button {
  padding: 7px;
  border: 0;
  border-radius: 6px;
  color: #61767a;
  background: transparent;
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
}

.bulk-button:hover {
  color: #a0b7b2;
}

.bulk-button.active {
  color: var(--mint);
  background: rgba(102, 255, 208, 0.09);
  box-shadow: inset 0 0 0 1px rgba(102, 255, 208, 0.1);
}

.upgrade-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.upgrade-card {
  position: relative;
  display: grid;
  grid-template-columns: 43px 1fr auto;
  gap: 11px;
  align-items: center;
  width: 100%;
  min-height: 78px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.upgrade-card:hover {
  transform: translateY(-1px);
  border-color: var(--line-bright);
  background: rgba(102, 255, 208, 0.035);
}

.upgrade-card:active {
  transform: translateY(1px);
}

.upgrade-card[aria-disabled="true"] {
  opacity: 0.62;
}

.upgrade-card.affordable {
  border-color: rgba(102, 255, 208, 0.19);
  box-shadow: inset 3px 0 0 rgba(102, 255, 208, 0.42);
}

.upgrade-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border: 1px solid rgba(102, 255, 208, 0.11);
  border-radius: 11px;
  color: var(--accent, var(--mint));
  background: color-mix(in srgb, var(--accent, var(--mint)) 9%, transparent);
}

.upgrade-icon svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

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

.upgrade-title-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.upgrade-title-line strong {
  overflow: hidden;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-badge {
  padding: 3px 5px;
  border-radius: 4px;
  color: #77908e;
  background: rgba(255, 255, 255, 0.05);
  font: 700 7px/1 var(--mono);
  white-space: nowrap;
}

.upgrade-copy p {
  margin: 5px 0 0;
  color: #62767a;
  font: 500 8px/1.35 var(--mono);
}

.upgrade-cost {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 6px;
  padding-left: 8px;
}

.upgrade-cost span {
  color: #53686b;
  font: 700 7px/1 var(--mono);
  letter-spacing: 0.08em;
}

.upgrade-cost strong {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #92a6a2;
  font: 700 10px/1 var(--mono);
}

.affordable .upgrade-cost strong {
  color: var(--mint);
}

.cost-gem {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border: 1px solid currentColor;
  border-radius: 2px;
  background: rgba(102, 255, 208, 0.16);
}

.next-unlock {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 13px;
  padding: 13px 4px 0;
  border-top: 1px solid var(--line);
  opacity: 0.7;
}

.lock-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #617274;
  background: rgba(255, 255, 255, 0.035);
}

.lock-mark svg {
  width: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.next-unlock div:nth-child(2) span,
.next-unlock > span {
  color: #5c6e71;
  font: 700 7px/1 var(--mono);
  letter-spacing: 0.09em;
}

.next-unlock div:nth-child(2) strong {
  display: block;
  margin-top: 4px;
  color: #7e8e8d;
  font-size: 9px;
}

.next-unlock > span {
  letter-spacing: 0;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 0 30px;
  color: #3f5357;
  font: 600 7px/1 var(--mono);
  letter-spacing: 0.13em;
}

.footer strong {
  color: #667b7c;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5d7474;
}

.save-state > span:first-child {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint-dark);
}

.reset-dialog {
  width: min(390px, calc(100% - 32px));
  padding: 30px;
  border: 1px solid rgba(255, 101, 123, 0.22);
  border-radius: 18px;
  color: var(--text);
  text-align: center;
  background: #0c1722;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
}

.reset-dialog::backdrop {
  background: rgba(1, 5, 10, 0.78);
  backdrop-filter: blur(5px);
}

.dialog-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--danger);
  background: rgba(255, 101, 123, 0.1);
}

.dialog-icon svg {
  width: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.reset-dialog h2 {
  margin: 0 0 9px;
  font-size: 21px;
}

.reset-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 25px;
}

.dialog-actions button {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #99aaa8;
  background: rgba(255, 255, 255, 0.03);
  font: 700 8px/1 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}

.dialog-actions .danger {
  border-color: rgba(255, 101, 123, 0.25);
  color: #ff98a8;
  background: rgba(255, 101, 123, 0.09);
}

.toast {
  position: fixed;
  z-index: 50;
  bottom: 25px;
  left: 50%;
  max-width: calc(100% - 32px);
  padding: 10px 15px;
  transform: translate(-50%, 20px);
  border: 1px solid rgba(102, 255, 208, 0.2);
  border-radius: 8px;
  color: #a9eeda;
  background: rgba(8, 23, 28, 0.94);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

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

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  to { transform: rotate(-360deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.13; }
  50% { transform: scale(1.08); opacity: 0.23; }
}

@keyframes core-press {
  0% { transform: scale(1); }
  45% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes float-away {
  0% { transform: translate(-50%, -30%); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate(-50%, -95px); opacity: 0; }
}

@keyframes spark-out {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(var(--spark-x), var(--spark-y)) scale(0); opacity: 0; }
}

@media (max-width: 1120px) {
  .game-layout {
    grid-template-columns: minmax(210px, 250px) minmax(330px, 1fr);
  }

  .shop-panel {
    grid-column: 1 / -1;
    width: 100%;
    max-height: none;
  }

  .upgrade-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .core-wrap {
    width: min(450px, 54vw);
  }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 66px;
    padding: 0 18px;
  }

  .topbar-status {
    display: none;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    width: calc(100% - 24px);
    margin-top: 12px;
  }

  .core-stage {
    order: -1;
    min-height: 580px;
    padding: 26px 10px 25px;
  }

  .core-wrap {
    width: min(420px, 92vw);
  }

  .left-panel,
  .shop-panel {
    width: 100%;
  }

  .upgrade-list {
    display: flex;
  }

  .footer {
    padding: 0 18px;
  }

  .footer > span:last-child {
    display: none;
  }
}

@media (max-width: 430px) {
  .brand small {
    display: none;
  }

  .game-layout {
    gap: 12px;
  }

  .core-stage {
    min-height: 500px;
  }

  .core-wrap {
    width: 96vw;
    max-width: 380px;
  }

  .tap-label {
    transform: translate(-50%, -6px);
  }

  .left-panel,
  .shop-panel {
    padding: 18px;
  }

  .upgrade-card {
    grid-template-columns: 39px 1fr auto;
    gap: 9px;
  }

  .upgrade-icon {
    width: 39px;
    height: 39px;
  }

  .next-unlock {
    grid-template-columns: auto 1fr;
  }

  .next-unlock > span {
    display: none;
  }
}

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