/* ==========================================================================
   深脉淘金 · DEEP VEIN
   A hand-built industrial gold mining interface.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg-0: #07090c;
  --bg-1: #0b0f13;
  --bg-2: #10161c;
  --bg-3: #151d24;
  --bg-4: #1b252e;
  --ink: #eef0e8;
  --ink-soft: #b9c1bd;
  --ink-dim: #7d8a88;
  --ink-faint: #586461;
  --line: rgba(210, 224, 214, 0.11);
  --line-strong: rgba(210, 224, 214, 0.2);
  --gold: #f2b644;
  --gold-hot: #ffd477;
  --gold-deep: #a86919;
  --gold-soft: rgba(242, 182, 68, 0.12);
  --amber: #df8743;
  --copper: #cd8151;
  --silver: #b9c8cf;
  --cyan: #66d4c5;
  --cyan-soft: rgba(102, 212, 197, 0.1);
  --red: #ec6969;
  --red-soft: rgba(236, 105, 105, 0.12);
  --green: #8fce86;
  --soil-1: #51391f;
  --soil-2: #3b2918;
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.28);
  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sidebar-w: 226px;
  --topbar-h: 72px;
}

/* Brighter user-selectable background themes. They keep light text and
   increase the page/panel values without turning the game into a white UI. */
html[data-background="steel"] {
  --bg-0: #16242c;
  --bg-1: #1c2d36;
  --bg-2: #243a44;
  --bg-3: #2c4651;
  --bg-4: #35525e;
  --ink: #f1f4eb;
  --ink-soft: #c2cec8;
  --ink-dim: #8d9f9a;
  --ink-faint: #6b807b;
  --line: rgba(212, 229, 220, 0.14);
  --line-strong: rgba(212, 229, 220, 0.24);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.22);
}

html[data-background="steel"] body {
  background: linear-gradient(165deg, #22353e 0%, #121f26 58%, #0d171c 100%);
}
html[data-background="steel"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%),
    #16262d;
}
html[data-background="steel"] .topbar { background: rgba(24, 40, 48, 0.92); }
html[data-background="steel"] .factory-void {
  filter: brightness(1.28) saturate(0.9);
}

html[data-background="warm"] {
  --bg-0: #2b2822;
  --bg-1: #353129;
  --bg-2: #403b31;
  --bg-3: #4b4539;
  --bg-4: #585144;
  --ink: #f3eee1;
  --ink-soft: #c8c0af;
  --ink-dim: #9c9280;
  --ink-faint: #7a7160;
  --line: rgba(230, 219, 194, 0.14);
  --line-strong: rgba(230, 219, 194, 0.24);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.22);
}

html[data-background="warm"] body {
  background: linear-gradient(165deg, #3b372d 0%, #27241e 60%, #1b1915 100%);
}
html[data-background="warm"] .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%),
    #2b2821;
}
html[data-background="warm"] .topbar { background: rgba(43, 39, 32, 0.93); }
html[data-background="warm"] .factory-void {
  filter: sepia(0.18) brightness(1.24) saturate(0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--gold);
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  color: #191207;
  background: var(--gold);
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: #2a363e;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #41525c;
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */

.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(circle at 50% 45%, rgba(242, 182, 68, 0.07), transparent 36%),
    var(--bg-0);
}

.boot-screen.is-done {
  animation: boot-out 0.55s ease forwards;
}

.boot-mark {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 36px;
}

.boot-mark span {
  display: block;
  width: 9px;
  border-radius: 2px;
  background: var(--gold);
  animation: boot-bars 0.9s ease-in-out infinite alternate;
}

.boot-mark span:nth-child(1) {
  height: 17px;
  animation-delay: -0.25s;
  opacity: 0.6;
}

.boot-mark span:nth-child(2) {
  height: 30px;
}

.boot-mark span:nth-child(3) {
  height: 23px;
  animation-delay: -0.5s;
  opacity: 0.8;
}

.boot-word {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.45em;
  color: var(--gold);
}

.boot-status {
  color: var(--ink-dim);
  font-size: 12px;
  letter-spacing: 0.08em;
}

@keyframes boot-bars {
  to { transform: scaleY(0.55); }
}

@keyframes boot-out {
  to { opacity: 0; visibility: hidden; }
}

/* --------------------------------------------------------------------------
   Auth
   -------------------------------------------------------------------------- */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(430px, 0.75fr);
  background: var(--bg-0);
  animation: screen-in 0.6s ease both;
}

@keyframes screen-in {
  from { opacity: 0; }
}

.auth-hero {
  position: relative;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 38px clamp(34px, 5vw, 76px) 30px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(100deg, rgba(5, 10, 13, 0.9) 0%, rgba(5, 11, 14, 0.66) 48%, rgba(4, 12, 15, 0.3) 100%),
    radial-gradient(circle at 70% 20%, rgba(242, 182, 68, 0.12), transparent 27%),
    url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/21301183bbc9db3f5c72ce1906d97148222e4dd7e04474ab0b3dd80b62104073/nebula.webp") center / cover no-repeat,
    linear-gradient(140deg, #141a1d 0%, #0b1014 55%, #090c0f 100%);
  isolation: isolate;
}

.auth-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(208, 220, 212, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 220, 212, 0.07) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at 30% 30%, black 5%, transparent 70%);
}

.auth-glow {
  position: absolute;
  z-index: -1;
  width: 50vw;
  height: 50vw;
  left: -15vw;
  bottom: -34vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(202, 129, 48, 0.15), transparent 65%);
  filter: blur(30px);
}

.auth-brand {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--gold);
  border: 1px solid rgba(242, 182, 68, 0.34);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(242, 182, 68, 0.16), rgba(242, 182, 68, 0.03));
  box-shadow: inset 0 0 20px rgba(242, 182, 68, 0.06), 0 8px 20px rgba(0, 0, 0, 0.22);
}

.brand-mark svg {
  width: 27px;
  height: 27px;
}

.auth-brand strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0.18em;
}

.auth-brand span {
  display: block;
  margin-top: 2px;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
}

.auth-copy {
  position: relative;
  z-index: 3;
  max-width: 640px;
  margin-top: auto;
  margin-bottom: auto;
  padding-top: 5vh;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(242, 182, 68, 0.12);
  animation: live-pulse 2.2s infinite;
}

@keyframes live-pulse {
  50% { box-shadow: 0 0 0 8px rgba(242, 182, 68, 0.02); }
}

.auth-copy h1 {
  margin: 24px 0 20px;
  max-width: 590px;
  font-size: clamp(38px, 4.8vw, 72px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 900;
  text-wrap: balance;
}

.auth-copy h1 span {
  position: relative;
  color: var(--gold);
  font-style: normal;
}

.auth-copy h1 span::after {
  content: "";
  position: absolute;
  left: 1%;
  right: 1%;
  bottom: 4px;
  height: 8px;
  z-index: -1;
  opacity: 0.28;
  background: var(--gold);
  transform: skewX(-18deg);
}

.auth-copy > p {
  max-width: 490px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.9;
}

.auth-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.auth-tags span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #9ba8a3;
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
}

.auth-tags span::before {
  content: "�?;
  margin-right: 6px;
  color: var(--gold-deep);
}

.auth-landscape {
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  bottom: 0;
  height: 47%;
  pointer-events: none;
  overflow: hidden;
}

.auth-groundline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14%;
  background: linear-gradient(180deg, #191c18, #0a0c0b);
  border-top: 1px solid rgba(242, 182, 68, 0.09);
}

.auth-ridge {
  position: absolute;
  left: -10%;
  right: -10%;
  border-radius: 50% 50% 0 0;
}

.ridge-a {
  bottom: 12%;
  height: 55%;
  background: linear-gradient(170deg, #1d2627, #13191a);
  clip-path: polygon(0 76%, 12% 56%, 23% 64%, 38% 25%, 52% 55%, 63% 36%, 76% 62%, 88% 43%, 100% 68%, 100% 100%, 0 100%);
}

.ridge-b {
  bottom: 8%;
  height: 40%;
  opacity: 0.9;
  background: linear-gradient(20deg, #141b1b, #0b1010);
  clip-path: polygon(0 80%, 11% 67%, 27% 78%, 42% 48%, 58% 77%, 71% 58%, 86% 75%, 100% 57%, 100% 100%, 0 100%);
}

.ridge-c {
  bottom: 0;
  height: 24%;
  background: #080b0b;
  clip-path: polygon(0 62%, 14% 48%, 31% 64%, 45% 50%, 62% 69%, 79% 47%, 92% 61%, 100% 48%, 100% 100%, 0 100%);
}

.auth-sun {
  position: absolute;
  right: 19%;
  bottom: 38%;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  opacity: 0.8;
  background: radial-gradient(circle at 43% 38%, #f8cb70, #dc8732 56%, #8f431c 100%);
  box-shadow: 0 0 90px 30px rgba(231, 145, 49, 0.13);
}

.auth-planet {
  position: absolute;
  z-index: 0;
  right: -4%;
  bottom: 18%;
  width: min(44vw, 560px);
  aspect-ratio: 1;
  opacity: 0.78;
  background: url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/6a46078c16bc9b16cd191364946730685339fc943ff365340bbb78c3979a8196/planet.webp") center / contain no-repeat;
  filter: saturate(0.84) brightness(0.82) drop-shadow(0 0 44px rgba(85, 210, 198, 0.16));
  animation: planet-breathe 12s ease-in-out infinite;
  pointer-events: none;
}

@keyframes planet-breathe {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(0.5deg); }
}

.headframe {
  position: absolute;
  z-index: 2;
  left: 11%;
  bottom: 9%;
  width: 178px;
  height: 210px;
  opacity: 0.85;
}

.headframe .wheel {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 78px;
  height: 78px;
  transform: translateX(-50%);
  border: 5px solid #3d4644;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #101414;
  animation: spin-slow 18s linear infinite;
}

.headframe .wheel::before,
.headframe .wheel::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 68%;
  background: #39413e;
  transform-origin: center;
  translate: -50% -50%;
}

.headframe .wheel::after {
  rotate: 90deg;
}

@keyframes spin-slow {
  to { rotate: 360deg; }
}

.headframe .leg {
  position: absolute;
  bottom: 0;
  width: 6px;
  height: 145px;
  background: linear-gradient(90deg, #434b46, #252b28);
  transform-origin: bottom;
}

.headframe .leg-a { left: 38px; rotate: 11deg; }
.headframe .leg-b { right: 38px; rotate: -11deg; }

.headframe .beam {
  position: absolute;
  left: 23px;
  right: 23px;
  bottom: 62px;
  height: 6px;
  background: #3b433f;
  rotate: -2deg;
}

.headframe .beam::after {
  content: "";
  position: absolute;
  left: 58%;
  top: 6px;
  width: 1px;
  height: 82px;
  background: rgba(255, 220, 151, 0.25);
}

.auth-conveyor {
  position: absolute;
  z-index: 3;
  left: 33%;
  bottom: 12%;
  width: 34%;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 3px solid #403d32;
  border-bottom: 3px solid #171a17;
  background: repeating-linear-gradient(90deg, #1f2420 0 8px, #292e28 8px 16px);
  rotate: -2.5deg;
  opacity: 0.9;
}

.auth-conveyor i {
  width: 13px;
  height: 9px;
  border-radius: 1px;
  background: var(--gold);
  opacity: 0.55;
  animation: cargo-slide 4s linear infinite;
}

.auth-conveyor i:nth-child(2) { animation-delay: -0.8s; }
.auth-conveyor i:nth-child(3) { animation-delay: -1.6s; opacity: 0.3; background: var(--silver); }
.auth-conveyor i:nth-child(4) { animation-delay: -2.4s; }
.auth-conveyor i:nth-child(5) { animation-delay: -3.2s; opacity: 0.4; background: var(--copper); }

@keyframes cargo-slide {
  0%, 100% { translate: -8px 0; opacity: 0.15; }
  15%, 80% { opacity: 0.7; }
  90% { translate: 8px 0; opacity: 0.1; }
}

.auth-dust {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.auth-dust i,
.auth-dust span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(250, 206, 119, 0.65);
  animation: dust-drift 9s linear infinite;
}

.auth-dust i:nth-child(1) { left: 26%; top: 34%; animation-delay: -1s; }
.auth-dust i:nth-child(2) { left: 46%; top: 56%; animation-delay: -4s; width: 2px; height: 2px; }
.auth-dust i:nth-child(3) { left: 64%; top: 26%; animation-delay: -7s; }
.auth-dust i:nth-child(4) { left: 78%; top: 62%; animation-delay: -2s; width: 2px; height: 2px; }
.auth-dust i:nth-child(5) { left: 53%; top: 76%; animation-delay: -6s; }
.auth-dust span:nth-of-type(1) { left: 88%; top: 48%; animation-delay: -3s; }
.auth-dust span:nth-of-type(2) { left: 34%; top: 74%; animation-delay: -8s; width: 2px; height: 2px; }

@keyframes dust-drift {
  0% { opacity: 0; translate: 0 12px; }
  20%, 70% { opacity: 0.8; }
  100% { opacity: 0; translate: 16px -44px; }
}

.auth-foot {
  position: relative;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 32px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.auth-foot span:first-child {
  color: rgba(242, 182, 68, 0.55);
}

.auth-side {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px clamp(26px, 4vw, 58px);
  background:
    radial-gradient(circle at 100% 0%, rgba(242, 182, 68, 0.06), transparent 28%),
    linear-gradient(180deg, #0d1115, #090c0f);
}

.auth-card {
  width: min(100%, 420px);
  animation: card-rise 0.7s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes card-rise {
  from { opacity: 0; transform: translateY(16px); }
}

.auth-card-head {
  margin-bottom: 26px;
}

.auth-stamp {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.auth-stamp::before {
  content: "";
  width: 16px;
  height: 1px;
  background: var(--gold);
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 27px;
  letter-spacing: -0.04em;
}

.auth-card-head p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 12.5px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.seg-btn {
  border: 0;
  border-radius: 6px;
  padding: 9px 12px;
  background: transparent;
  color: var(--ink-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.seg-btn:hover { color: var(--ink); }

.seg-btn.is-active {
  background: #202a31;
  color: var(--ink);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.06), 0 4px 12px rgba(0, 0, 0, 0.2);
}

.auth-form {
  margin-top: 22px;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field > span {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.field > span em {
  color: var(--ink-faint);
  font-style: normal;
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.03em;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #0b1115;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
  border-color: rgba(242, 182, 68, 0.52);
  box-shadow: 0 0 0 3px rgba(242, 182, 68, 0.08);
}

.input-wrap > svg {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-left: 13px;
  fill: none;
  stroke: var(--ink-faint);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-wrap input {
  min-width: 0;
  flex: 1;
  height: 45px;
  border: 0;
  outline: 0;
  padding: 0 12px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.input-wrap input::placeholder {
  color: #45524f;
}

.peek-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-right: 5px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
}

.peek-btn:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.peek-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.auth-options {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 10px;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-dim);
  font-size: 10.5px;
  cursor: pointer;
}

.checkline input {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #0a0f13;
  cursor: pointer;
}

.checkline input:checked {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: inset 0 0 0 3px #0a0f13;
}

.text-link {
  border: 0;
  padding: 0;
  background: none;
  color: var(--ink-dim);
  font-size: 10px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.18);
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-link:hover { color: var(--gold); }
.text-link.strong { color: var(--gold); font-size: 10.5px; }
.local-note { color: var(--ink-faint); font-size: 10px; }

.form-error {
  min-height: 17px;
  margin: 0 0 8px;
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 15px;
  background: var(--bg-3);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease, opacity 0.14s ease;
  user-select: none;
}

.btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: #222d35;
}

.btn:active { transform: translateY(1px); }

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-gold {
  border-color: #e2a438;
  background: linear-gradient(180deg, #ffd16d, #e8ab3e);
  color: #231708;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.35), 0 8px 22px rgba(200, 140, 35, 0.16);
}

.btn-gold:hover {
  border-color: #ffdb8a;
  background: linear-gradient(180deg, #ffdc89, #f2b644);
}

.btn-cyan {
  border-color: rgba(102, 212, 197, 0.3);
  background: var(--cyan-soft);
  color: var(--cyan);
}

.btn-cyan:hover {
  border-color: rgba(102, 212, 197, 0.5);
  background: rgba(102, 212, 197, 0.16);
}

.btn-danger {
  border-color: rgba(236, 105, 105, 0.28);
  background: var(--red-soft);
  color: #f08b8b;
}

.btn-danger:hover {
  border-color: rgba(236, 105, 105, 0.5);
  background: rgba(236, 105, 105, 0.18);
}

.btn-sm {
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 10px;
  gap: 5px;
}

.btn-sm svg { width: 13px; height: 13px; }

.btn-wide { width: 100%; }

.btn-auth {
  width: 100%;
  height: 48px;
  justify-content: space-between;
  padding: 0 18px;
  margin-top: 3px;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.btn-auth svg { width: 19px; height: 19px; }

.auth-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 20px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.local-badge {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 34px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.db-pulse {
  position: relative;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(143, 206, 134, 0.08);
}

.local-badge div {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.local-badge strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.15em;
}

.local-badge div span {
  color: var(--ink-faint);
  font-size: 9.5px;
}

.local-badge-code {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 3px 5px;
}

.auth-legal {
  position: absolute;
  bottom: 18px;
  left: 20px;
  right: 20px;
  margin: 0;
  color: #3e4845;
  text-align: center;
  font-size: 8.5px;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  background: var(--bg-0);
  animation: screen-in 0.45s ease both;
}

.sidebar {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 22%),
    #0a0e12;
  z-index: 15;
}

.sidebar::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  width: 1px;
  height: 140px;
  background: linear-gradient(180deg, rgba(242, 182, 68, 0.6), transparent);
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--topbar-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.side-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.side-brand .brand-mark svg { width: 22px; height: 22px; }

.side-brand strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0.13em;
  line-height: 1.2;
}

.side-brand small {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.2em;
}

.nav-label {
  padding: 24px 22px 10px;
  color: #495551;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 0 12px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #84908b;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.035);
}

.nav-item.is-active {
  color: var(--gold-hot);
  background: linear-gradient(90deg, rgba(242, 182, 68, 0.11), rgba(242, 182, 68, 0.02));
  border-color: rgba(242, 182, 68, 0.1);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(242, 182, 68, 0.5);
}

.nav-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
}

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

.nav-text {
  flex: 1;
  min-width: 0;
}

.nav-text span {
  display: block;
  font-size: 12.5px;
}

.nav-text small {
  display: block;
  margin-top: 1px;
  color: #4e5b56;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.nav-item.is-active .nav-text small { color: rgba(242, 182, 68, 0.45); }

.nav-badge {
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 4px;
  background: rgba(242, 182, 68, 0.13);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
}

.nav-badge:empty { display: none; }

.sidebar-spacer { flex: 1; }

.side-power {
  margin: 10px 12px 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.side-power-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.side-power-top + .side-power-top { margin-top: 5px; }

.side-power-top strong {
  color: var(--cyan);
  font-size: 10px;
  letter-spacing: 0;
}

.side-power-generation-row strong { color: var(--gold); }

.power-mini-bar {
  height: 3px;
  margin: 8px 0 6px;
  border-radius: 3px;
  background: #1c272c;
  overflow: hidden;
}

.power-mini-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), #adf1dc);
  box-shadow: 0 0 8px rgba(102, 212, 197, 0.4);
  transition: width 0.4s ease, background 0.2s ease;
}

.power-mini-bar.is-over i { background: linear-gradient(90deg, var(--red), #f3a56c); }
.side-power-caption { color: var(--ink-faint); font-size: 8.5px; }

.side-account {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(242, 182, 68, 0.22);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(242, 182, 68, 0.22), rgba(242, 182, 68, 0.03)),
    #151b1c;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.side-account-info {
  flex: 1;
  min-width: 0;
}

.side-account-info strong {
  display: block;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-account-info span {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.04em;
}

.save-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  transition: background 0.2s;
}

.save-dot.is-saving { background: var(--gold); animation: live-pulse 1s infinite; }
.save-dot.is-error { background: var(--red); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.main-shell {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex: 0 0 var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 18, 0.9);
  backdrop-filter: blur(14px);
  z-index: 10;
}

.topbar-title {
  min-width: 0;
  flex: 1;
}

.topbar-title h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.topbar-title p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.topbar-title p::before {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-deep);
}

.topbar-mobile-brand { display: none; }

.hud-strip {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
}

.hud-pill .hud-icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
}

.hud-pill .hud-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
}

.hud-pill-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hud-pill-copy small {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.1em;
}

.hud-pill-copy strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.hud-pill.cash {
  min-width: 139px;
  border-color: rgba(242, 182, 68, 0.2);
  background: linear-gradient(180deg, rgba(242, 182, 68, 0.08), rgba(242, 182, 68, 0.025));
}

.hud-pill.cash .hud-pill-copy strong { color: var(--gold-hot); }

.hud-pill.cash.is-bumped strong {
  animation: cash-bump 0.34s ease;
}

@keyframes cash-bump {
  50% { color: #fff3c7; transform: scale(1.05); }
}

.hud-pill.power-pill .hud-icon { color: var(--cyan); }
.hud-pill.power-pill .hud-pill-copy strong { font-size: 11.5px; }
.hud-pill.power-pill.is-offline { border-color: rgba(236, 105, 105, 0.25); }
.hud-pill.power-pill.is-offline .hud-icon,
.hud-pill.power-pill.is-offline .hud-pill-copy strong { color: var(--red); }

.hud-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
  border-left: 1px solid var(--line);
}

.view-root {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background:
    radial-gradient(ellipse at 72% -20%, rgba(242, 182, 68, 0.045), transparent 40%),
    radial-gradient(ellipse at 0% 100%, rgba(42, 88, 81, 0.06), transparent 40%),
    var(--bg-1);
}

.page {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 26px 28px 50px;
  animation: page-in 0.28s ease both;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(5px); }
}

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

.page-head-left { min-width: 0; }

.page-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.page-kicker::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--gold);
}

.page-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.4vw, 32px);
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.page-head p {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--ink-dim);
  font-size: 12.5px;
  line-height: 1.7;
}

.page-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 0 0 auto;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 20px;
  align-items: start;
}

.two-col.wide-rail { grid-template-columns: minmax(0, 1fr) 360px; }
.two-col.compact-rail { grid-template-columns: minmax(0, 1fr) 312px; }

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.027), rgba(255, 255, 255, 0.006) 42%),
    var(--bg-2);
  box-shadow: var(--shadow-md);
}

.panel.flat { box-shadow: none; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 53px;
  padding: 13px 17px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel-head h3 svg {
  width: 15px;
  height: 15px;
  color: var(--gold);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.panel-head .sub {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.panel-body { padding: 16px; }

.panel-section + .panel-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pill.gold { color: var(--gold); border-color: rgba(242, 182, 68, 0.2); background: var(--gold-soft); }
.pill.cyan { color: var(--cyan); border-color: rgba(102, 212, 197, 0.2); background: var(--cyan-soft); }
.pill.red { color: #ef8d8d; border-color: rgba(236, 105, 105, 0.22); background: var(--red-soft); }
.pill.green { color: var(--green); border-color: rgba(143, 206, 134, 0.2); background: rgba(143, 206, 134, 0.08); }

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.status-dot.live { animation: live-pulse 2s infinite; }

.empty-state {
  padding: 30px 18px;
  color: var(--ink-faint);
  text-align: center;
  font-size: 11px;
  line-height: 1.7;
}

.empty-state strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
  font-size: 12px;
}

.divider {
  height: 1px;
  margin: 14px 0;
  background: var(--line);
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.text-gold { color: var(--gold); }
.text-cyan { color: var(--cyan); }
.text-dim { color: var(--ink-dim); }
.text-faint { color: var(--ink-faint); }
.text-red { color: var(--red); }
.nowrap { white-space: nowrap; }

/* --------------------------------------------------------------------------
   Mine page
   -------------------------------------------------------------------------- */

.mine-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: #12100d;
  box-shadow: var(--shadow-lg);
}

.mine-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, #11181b, #0d1316);
}

.mine-location {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.mine-location-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--gold);
  border: 1px solid rgba(242, 182, 68, 0.15);
  border-radius: 6px;
  background: rgba(242, 182, 68, 0.06);
}

.mine-location-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.mine-location-copy {
  min-width: 0;
}

.mine-location-copy strong {
  display: block;
  font-size: 11px;
  letter-spacing: 0.03em;
}

.mine-location-copy span {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7.5px;
}

.mine-topbar-spacer { flex: 1; }

.mine-seam {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.mine-seam i {
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  box-shadow: 0 0 8px rgba(242, 182, 68, 0.3);
}

.mine-surface {
  position: relative;
  height: 92px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 12, 16, 0.2), rgba(5, 11, 13, 0.64) 72%, #241a10 72%),
    radial-gradient(circle at 78% 18%, rgba(242, 182, 68, 0.12), transparent 30%),
    url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/21301183bbc9db3f5c72ce1906d97148222e4dd7e04474ab0b3dd80b62104073/nebula.webp") center 38% / cover no-repeat;
}

.mine-skyline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 30px;
  height: 25px;
  opacity: 0.7;
  color: #263337;
  background:
    linear-gradient(90deg, transparent 0 6%, currentColor 6% 7%, transparent 7% 12%, currentColor 12% 12.8%, transparent 12.8% 16%, currentColor 16% 16.7%, transparent 16.7% 25%, currentColor 25% 26%, transparent 26% 34%, currentColor 34% 35%, transparent 35% 45%, currentColor 45% 46%, transparent 46% 53%, currentColor 53% 54%, transparent 54% 61%, currentColor 61% 62%, transparent 62% 72%, currentColor 72% 73%, transparent 73% 84%, currentColor 84% 87%, transparent 87% 100%);
    clip-path: polygon(0 85%, 4% 85%, 4% 48%, 6% 48%, 6% 0, 7% 0, 7% 48%, 12% 48%, 12% 66%, 14% 66%, 14% 10%, 16% 10%, 16% 85%, 25% 85%, 25% 35%, 27% 35%, 27% 85%, 35% 85%, 35% 55%, 37% 55%, 37% 20%, 39% 20%, 39% 85%, 47% 85%, 47% 40%, 53% 40%, 53% 85%, 61% 85%, 61% 58%, 63% 58%, 63% 25%, 65% 25%, 65% 85%, 73% 85%, 73% 48%, 76% 48%, 76% 85%, 86% 85%, 86% 30%, 88% 30%, 88% 85%, 100% 85%, 100% 100%, 0 100%);
}

.mine-derrick {
  position: absolute;
  left: 9%;
  bottom: 29px;
  width: 84px;
  height: 78px;
  opacity: 0.92;
}

.mine-derrick .tower {
  position: absolute;
  inset: 0;
  border-top: 3px solid #70604a;
  border-left: 3px solid #3f3d34;
  border-right: 3px solid #3f3d34;
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 78% 100%, 52% 14%, 26% 100%, 0 100%, 0 0);
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(172, 139, 91, 0.14) 12px 14px),
    transparent;
}

.mine-derrick .cable {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 1px;
  height: 42px;
  background: rgba(242, 182, 68, 0.26);
}

.mine-derrick .cable::after {
  content: "";
  position: absolute;
  left: -3px;
  bottom: 0;
  width: 7px;
  height: 7px;
  border: 1px solid #7e694a;
  border-radius: 50%;
}

.mine-sun {
  position: absolute;
  right: 15%;
  bottom: 42px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f8d695, #e6a64f 60%, rgba(230, 166, 79, 0));
  opacity: 0.6;
  filter: blur(0.2px);
}

.mine-planet {
  position: absolute;
  right: 5%;
  bottom: 20px;
  width: 128px;
  height: 128px;
  background: url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/6a46078c16bc9b16cd191364946730685339fc943ff365340bbb78c3979a8196/planet.webp") center / contain no-repeat;
  opacity: 0.42;
  filter: saturate(0.8) brightness(0.8) drop-shadow(0 0 20px rgba(96, 210, 196, 0.12));
  pointer-events: none;
  animation: planet-breathe 14s ease-in-out infinite;
}

.mine-surface-label {
  position: absolute;
  right: 14px;
  bottom: 36px;
  color: #5d6155;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.13em;
}

.mine-surface::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30px;
  background:
    linear-gradient(180deg, #3b2c1a 0%, #2a1e12 80%),
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(0, 0, 0, 0.17) 14px 16px);
  box-shadow: inset 0 2px rgba(255, 210, 134, 0.06);
}

.mine-surface::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 25px;
  height: 6px;
  background:
    repeating-linear-gradient(90deg, #5d482b 0 7px, #4a371f 7px 14px);
  opacity: 0.75;
}

.mine-field-wrap {
  position: relative;
  padding: 16px 17px 19px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242, 182, 68, 0.055), transparent 54%),
    linear-gradient(180deg, #0c1012, #0b0d0e 75%);
  touch-action: manipulation;
}

.mine-field-wrap::before,
.mine-field-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 13px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.55), transparent),
    repeating-linear-gradient(180deg, #372819 0 22px, #2a1e12 22px 26px);
  z-index: 5;
  opacity: 0.85;
}

.mine-field-wrap::before { left: 0; border-right: 1px solid rgba(242, 182, 68, 0.05); }
.mine-field-wrap::after { right: 0; transform: scaleX(-1); border-right: 1px solid rgba(242, 182, 68, 0.05); }

.mine-depth-scale {
  position: absolute;
  z-index: 7;
  left: 4px;
  top: 16px;
  bottom: 19px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #596159;
  font-family: var(--mono);
  font-size: 6.5px;
  writing-mode: vertical-rl;
  pointer-events: none;
  opacity: 0.65;
}

.mine-field {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(242, 182, 68, 0.075);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(59, 45, 28, 0.45), rgba(18, 17, 14, 0.65)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 6px);
  box-shadow:
    inset 0 4px 25px rgba(0, 0, 0, 0.48),
    inset 0 0 0 4px rgba(7, 9, 10, 0.32);
  overflow: hidden;
}

.mine-field.is-shaking {
  animation: field-shake 0.3s ease;
}

@keyframes field-shake {
  20% { transform: translate(2px, -1px); }
  45% { transform: translate(-2px, 1px); }
  70% { transform: translate(1px, 1px); }
}

.mine-field::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(ellipse at 38% 25%, transparent 20%, rgba(0, 0, 0, 0.24) 100%);
}

.mine-tile {
  --tile-h: 31;
  --soil-pos: 0% 0%;
  position: relative;
  aspect-ratio: 1.06 / 1;
  min-height: 40px;
  border: 0;
  padding: 0;
  border-radius: 2px;
  outline: 1px solid rgba(0, 0, 0, 0.23);
  outline-offset: -1px;
  background-color: hsl(var(--tile-h), 27%, 22%);
  background-image:
    radial-gradient(ellipse at 20% 22%, hsla(var(--tile-h), 38%, 55%, 0.34) 0 2px, transparent 3px),
    radial-gradient(ellipse at 73% 62%, rgba(0, 0, 0, 0.16) 0 4px, transparent 5px),
    radial-gradient(ellipse at 32% 82%, rgba(255, 225, 169, 0.08) 0 2px, transparent 3px),
    linear-gradient(145deg, hsla(var(--tile-h), 31%, 38%, 0.38), hsla(var(--tile-h), 34%, 12%, 0.58)),
    url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/890a3c806d1ce69642168d2dd4c62d48ee53ae40c99207a281fc501fb2d8adb0/soil-atlas.webp");
  background-size: auto, auto, auto, auto, 200% 200%;
  background-position: center, center, center, center, var(--soil-pos);
  box-shadow:
    inset 0 2px 0 rgba(255, 235, 195, 0.055),
    inset 0 -5px 8px rgba(0, 0, 0, 0.26),
    0 1px 0 rgba(255, 255, 255, 0.018);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M6 22 19 9' stroke='%23f2b644' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M13 5c4-2 8 1 9 5l-5-1-4-4Z' fill='%23e7edf0' stroke='%23101416' stroke-width='1.4'/%3E%3C/svg%3E") 5 23, pointer;
  transition: filter 0.15s ease, transform 0.1s ease, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  isolation: isolate;
}

.mine-tile:nth-child(4n + 1) { --soil-pos: 0% 0%; }
.mine-tile:nth-child(4n + 2) { --soil-pos: 100% 0%; }
.mine-tile:nth-child(4n + 3) { --soil-pos: 0% 100%; }
.mine-tile:nth-child(4n + 4) { --soil-pos: 100% 100%; }

.mine-tile:hover {
  z-index: 2;
  filter: brightness(1.25) saturate(1.12);
  box-shadow:
    inset 0 2px 0 rgba(255, 235, 195, 0.1),
    inset 0 -5px 8px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(242, 182, 68, 0.45),
    0 0 18px rgba(242, 182, 68, 0.12);
}

.mine-tile:active { transform: scale(0.965); }

.mine-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.28;
  background-image:
    repeating-linear-gradient(12deg, transparent 0 10px, rgba(0, 0, 0, 0.12) 10px 11px),
    repeating-linear-gradient(102deg, transparent 0 17px, rgba(255, 228, 181, 0.045) 17px 18px);
}

.mine-tile .tile-rock {
  position: absolute;
  left: var(--rx);
  top: var(--ry);
  width: var(--rs);
  height: calc(var(--rs) * 0.7);
  border-radius: 42% 50% 38% 48%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 238, 199, 0.28), transparent 38%),
    linear-gradient(160deg, #806947, #352b1e);
  opacity: var(--ro);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.16);
  transform: rotate(var(--rr));
}

.mine-tile .tile-pebble {
  position: absolute;
  left: var(--rx);
  top: var(--ry);
  width: var(--rs);
  height: var(--rs);
  border-radius: 45% 55% 50% 45%;
  background: linear-gradient(150deg, rgba(180, 151, 108, 0.52), rgba(42, 30, 19, 0.8));
  box-shadow: inset 0 1px rgba(255, 231, 186, 0.13);
  opacity: var(--ro);
  transform: rotate(var(--rr));
}

.mine-tile .tile-crack {
  position: absolute;
  left: var(--rx);
  top: var(--ry);
  width: var(--rw);
  height: 1px;
  transform-origin: left center;
  transform: rotate(var(--rr));
  background: linear-gradient(90deg, rgba(22, 14, 8, 0.62), rgba(20, 13, 8, 0));
  opacity: 0.55;
}

.mine-tile .tile-crack::after {
  content: "";
  position: absolute;
  left: 42%;
  top: 0;
  width: 55%;
  height: 1px;
  transform-origin: left center;
  transform: rotate(var(--bend, 22deg));
  background: inherit;
  opacity: 0.7;
}

.mine-tile .tile-root {
  position: absolute;
  left: var(--rx);
  top: var(--ry);
  width: 1px;
  height: var(--rs);
  background: rgba(28, 20, 12, 0.8);
  transform: rotate(var(--rr));
  opacity: 0.7;
}

.mine-tile .tile-root::after {
  content: "";
  position: absolute;
  left: 0;
  top: 60%;
  width: var(--rs);
  height: 1px;
  background: inherit;
  transform: rotate(38deg);
  transform-origin: left center;
}

.mine-tile .tile-glint {
  position: absolute;
  left: var(--rx);
  top: var(--ry);
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: var(--glint, #b69862);
  box-shadow: 0 0 6px rgba(242, 182, 68, 0.55);
  opacity: 0.7;
  animation: glint-shift 4.5s ease-in-out infinite;
  animation-delay: var(--gd, 0s);
}

.mine-tile .tile-glint::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 3px;
  width: 2px;
  height: 2px;
  background: inherit;
  opacity: 0.6;
}

@keyframes glint-shift {
  0%, 80%, 100% { opacity: 0.25; }
  88% { opacity: 0.95; }
  94% { opacity: 0.4; }
}

.mine-tile.is-swiping::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -30% -80%;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 238, 188, 0.26) 48%, transparent 55%);
  animation: tile-swipe 0.3s ease-out;
}

@keyframes tile-swipe {
  from { transform: translateX(-60%); opacity: 0.8; }
  to { transform: translateX(60%); opacity: 0; }
}

.mine-tile.is-hit {
  animation: tile-hit 0.26s ease;
}

@keyframes tile-hit {
  0% { filter: brightness(1.7); transform: scale(0.92); }
  55% { filter: brightness(0.8); transform: scale(1.02); }
  100% { filter: brightness(1); }
}

.mine-tile.is-gold-hit {
  animation: gold-tile-hit 0.5s ease;
}

@keyframes gold-tile-hit {
  0% { box-shadow: inset 0 0 0 2px var(--gold), 0 0 25px rgba(242, 182, 68, 0.7); filter: brightness(2); }
  100% { box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.26); filter: brightness(1); }
}

.mine-tile.is-cooling {
  cursor: default;
  filter: saturate(0.4) brightness(0.65);
}

.mine-tile.is-cooling::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.1) 0 5px, transparent 5px 10px),
    rgba(11, 8, 5, 0.28);
  pointer-events: none;
}

.mine-tile.is-cooling .refill {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fill, 0%);
  background: linear-gradient(0deg, rgba(242, 182, 68, 0.1), transparent);
  transition: height 0.1s linear;
}

.mine-tile.tile-row-top {
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.mine-tile.is-vein {
  outline-color: rgba(242, 182, 68, 0.2);
  box-shadow: inset 0 0 20px rgba(242, 182, 68, 0.055), inset 0 -5px 8px rgba(0, 0, 0, 0.26);
}

.mine-tile.is-vein::before {
  background-image:
    radial-gradient(circle at 68% 37%, rgba(242, 182, 68, 0.5) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 30% 68%, rgba(242, 182, 68, 0.28) 0 1px, transparent 2px),
    repeating-linear-gradient(12deg, transparent 0 8px, rgba(0, 0, 0, 0.15) 8px 9px);
}

.mine-tile[disabled] { pointer-events: auto; }

.mine-float-layer {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: visible;
}

.loot-float {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  background: rgba(8, 11, 12, 0.88);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  animation: loot-float 1.05s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

.loot-float.gold { color: var(--gold-hot); border-color: rgba(242, 182, 68, 0.24); }
.loot-float.silver { color: #d9e5e9; border-color: rgba(185, 200, 207, 0.2); }
.loot-float.copper { color: #ecac7c; border-color: rgba(205, 129, 81, 0.24); }
.loot-float.dirt { color: #b9a78b; }

.loot-float i {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  box-shadow: 0 0 5px currentColor;
}

@keyframes loot-float {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.85); }
  12% { opacity: 1; transform: translate(-50%, -6px) scale(1); }
  70% { opacity: 1; transform: translate(-50%, -28px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -42px) scale(0.93); }
}

.dust-burst {
  position: absolute;
  z-index: 1;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #bfa47c;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
  animation: dust-burst 0.55s ease-out forwards;
}

@keyframes dust-burst {
  from { opacity: 0.85; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

.mine-rig-bay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  background: #0c1114;
}

.rig-bay-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 9px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.09em;
  border-right: 1px solid var(--line);
}

.rig-bay-label::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-deep);
}

.rig-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--ink-dim);
  font-size: 8px;
}

.rig-chip svg { width: 25px; height: 20px; }
.rig-chip img.rig-art { width: 25px; height: 20px; }

.rig-chip.is-working { border-color: rgba(242, 182, 68, 0.25); color: var(--gold); background: rgba(242, 182, 68, 0.05); }
.rig-chip.is-paused { border-color: rgba(255, 255, 255, 0.1); color: var(--ink-faint); border-style: dashed; }
.rig-chip.is-unwired { color: var(--ink-faint); border-style: dashed; }
.rig-chip small { color: var(--ink-faint); font-family: var(--mono); font-size: 6.5px; }

.mine-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 17px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.mine-footer-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-dim);
  font-size: 9px;
}

.mine-footer-stat strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

.mine-footer-stat .mini-icon {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 4px;
  color: var(--gold);
  background: var(--gold-soft);
}

.mine-footer-stat .mini-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.mine-footer-spacer { flex: 1; }

.mine-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.03em;
}

.mine-hint kbd {
  padding: 2px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #10171b;
  font-family: var(--mono);
  font-size: 7px;
  color: var(--ink-soft);
}

.tool-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(242, 182, 68, 0.055), transparent 65%);
}

.tool-banner-art {
  flex: 0 0 auto;
  width: 42px;
  height: 38px;
}

.tool-banner-art img.tool-art { width: 42px; height: 38px; }

.tool-banner-copy { min-width: 0; flex: 1; }
.tool-banner-copy strong { display: block; font-size: 10.5px; }
.tool-banner-copy span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 8.4px; }

.tool-tags { display: flex; gap: 5px; flex-wrap: wrap; }

/* Mine sidebar cards */

.rail-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quest-row {
  display: flex;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
}

.quest-row:last-child { border-bottom: 0; }

.quest-check {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7px;
}

.quest-row.is-complete .quest-check {
  color: #17200f;
  background: var(--green);
  border-color: var(--green);
}

.quest-row.is-claimed { opacity: 0.45; }

.quest-main { flex: 1; min-width: 0; }
.quest-main strong { display: block; color: var(--ink-soft); font-size: 11.5px; font-weight: 600; }
.quest-main p { margin: 3px 0 7px; color: var(--ink-faint); font-size: 9.7px; line-height: 1.55; }
.quest-progress { display: flex; align-items: center; gap: 7px; }
.quest-progress .bar { flex: 1; height: 3px; border-radius: 3px; background: #1c2529; overflow: hidden; }
.quest-progress .bar i { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width 0.4s ease; }
.quest-progress span { color: var(--ink-faint); font-family: var(--mono); font-size: 8px; }
.quest-reward { display: flex; align-items: center; gap: 5px; margin-top: 7px; color: var(--gold); font-family: var(--mono); font-size: 8px; }
.quest-claim {
  margin-top: 8px;
  width: 100%;
}

.rail-tool {
  display: flex;
  gap: 11px;
  align-items: center;
}

.rail-tool-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 60px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #0e1418;
}

.rail-tool-art svg { width: 49px; height: 44px; }
.rail-tool-art img.tool-art { width: 49px; height: 44px; }
.rail-tool-info { min-width: 0; }
.rail-tool-info strong { display: block; font-size: 11px; }
.rail-tool-info span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 8.5px; }
.rail-tool-info .pill { margin-top: 6px; }

.rig-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.rig-card + .rig-card { margin-top: 8px; }

.rig-card-top { display: flex; gap: 9px; align-items: center; }
.rig-card-art { flex: 0 0 auto; width: 50px; height: 38px; display: grid; place-items: center; }
.rig-card-art svg { width: 48px; height: 37px; }
.rig-card-copy { flex: 1; min-width: 0; }
.rig-card-copy strong { display: block; font-size: 10px; }
.rig-card-copy span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 8px; }
.rig-card-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.rig-card-actions .btn { flex: 1 1 calc(50% - 5px); min-width: 0; font-size: 8px; padding-left: 4px; padding-right: 4px; }
.rig-card-actions .btn-danger { flex-basis: 100%; }
.rig-level-pips { display: inline-flex; gap: 2px; margin-left: 4px; }
.level-pip { width: 8px; height: 3px; border-radius: 1px; background: #2a3539; }
.level-pip.on { background: var(--gold); }

.rail-note {
  padding: 11px;
  border: 1px dashed rgba(242, 182, 68, 0.17);
  border-radius: 7px;
  color: #9d9888;
  background: rgba(242, 182, 68, 0.025);
  font-size: 9px;
  line-height: 1.65;
}

.rail-note strong { color: var(--gold); font-weight: 600; }

/* --------------------------------------------------------------------------
   Factory
   -------------------------------------------------------------------------- */

.factory-panel {
  overflow: hidden;
}

.factory-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: #0d1317;
}

.factory-title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.factory-title-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(102, 212, 197, 0.15);
  border-radius: 6px;
  color: var(--cyan);
  background: var(--cyan-soft);
}

.factory-title-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.factory-title-copy strong { display: block; font-size: 11px; }
.factory-title-copy span { display: block; margin-top: 2px; color: var(--ink-faint); font-family: var(--mono); font-size: 7.5px; }

.factory-head-spacer { flex: 1; }

.factory-mode-switch {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.mode-btn {
  padding: 6px 9px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.mode-btn:hover { color: var(--ink); }
.mode-btn.is-active { background: #263238; color: var(--ink); box-shadow: 0 2px 7px rgba(0,0,0,.2); }
.mode-btn.danger.is-active { background: rgba(236, 105, 105, 0.17); color: #f09595; }

.factory-stage {
  position: relative;
  padding: 20px 20px 17px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(102, 212, 197, 0.045), transparent 55%),
    linear-gradient(180deg, #0b1115, #0a0e11);
}

.factory-ruler {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #4f5e5e;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.12em;
}

.factory-ruler-line {
  flex: 1;
  height: 1px;
  margin: 0 10px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 18px);
}

.factory-board-wrap {
  position: relative;
  border: 1px solid rgba(166, 196, 190, 0.09);
  border-radius: 8px;
  background: #090d0f;
  box-shadow: inset 0 10px 28px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.factory-board-wrap.is-building {
  border-color: rgba(242, 182, 68, 0.25);
  cursor: crosshair;
}

.factory-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 3px;
  padding: 7px;
  touch-action: pan-y;
  user-select: none;
}

.factory-board-wrap.is-painting .factory-board {
  touch-action: none;
}

.factory-cell {
  position: relative;
  min-width: 0;
  aspect-ratio: 1.28 / 1;
  border: 1px solid rgba(144, 170, 163, 0.08);
  border-radius: 3px;
  background:
    linear-gradient(135deg, rgba(176, 200, 190, 0.03), rgba(0, 0, 0, 0.04)),
    repeating-linear-gradient(0deg, transparent 0 10px, rgba(255, 255, 255, 0.012) 10px 11px),
    #10171b;
  color: var(--ink-dim);
  overflow: hidden;
  touch-action: pan-y;
  transition: border-color 0.12s, background 0.12s;
}

.factory-board-wrap.is-painting .factory-cell {
  touch-action: none;
}

.factory-cell::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(255, 255, 255, 0.028);
  border-radius: 2px;
  pointer-events: none;
}

.factory-board-wrap.is-building .factory-cell.is-empty:hover {
  border-color: rgba(242, 182, 68, 0.55);
  background: rgba(242, 182, 68, 0.07);
}

.factory-board-wrap.is-building .factory-cell.is-empty:hover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(242, 182, 68, 0.2) 0 2px, transparent 3px);
}

.factory-cell.is-source,
.factory-cell.is-output {
  background: #141b1d;
  overflow: visible;
}

.factory-cell.is-source { border-color: rgba(102, 212, 197, 0.2); }
.factory-cell.is-output { border-color: rgba(242, 182, 68, 0.25); }

.factory-cell.is-belt {
  background:
    linear-gradient(180deg, #1d292d, #172124),
    #172124;
  border-color: rgba(109, 138, 132, 0.16);
}

.factory-cell.is-belt .belt-bed {
  position: absolute;
  inset: 23% 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(0, 0, 0, 0.22) 8px 10px),
    linear-gradient(180deg, #415353, #293838);
  border-top: 1px solid #536965;
  border-bottom: 1px solid #162021;
  box-shadow: inset 0 4px 4px rgba(0, 0, 0, 0.18);
}

.factory-cell.is-belt .belt-motion {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 21%;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(242, 182, 68, 0.22) 7px 9px, transparent 9px 16px);
  animation: belt-flow 1.1s linear infinite;
  opacity: 0.8;
}

@keyframes belt-flow {
  to { background-position: 16px 0; }
}

.factory-cell[data-dir="left"] .belt-motion { animation-direction: reverse; }
.factory-cell[data-dir="up"] .belt-motion,
.factory-cell[data-dir="down"] .belt-motion { display: none; }

.factory-cell[data-dir="up"] .belt-bed,
.factory-cell[data-dir="down"] .belt-bed {
  inset: 0 23%;
  background:
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(0, 0, 0, 0.22) 8px 10px),
    linear-gradient(90deg, #415353, #293838);
  border-top: 0;
  border-bottom: 0;
  border-left: 1px solid #536965;
  border-right: 1px solid #162021;
}

.factory-cell .belt-arrow {
  position: absolute;
  z-index: 2;
  width: 0;
  height: 0;
  opacity: 0.42;
}

.factory-cell[data-dir="right"] .belt-arrow { right: 3px; top: 50%; transform: translateY(-50%); border-left: 4px solid #b8d0c8; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.factory-cell[data-dir="left"] .belt-arrow { left: 3px; top: 50%; transform: translateY(-50%); border-right: 4px solid #b8d0c8; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.factory-cell[data-dir="up"] .belt-arrow { left: 50%; top: 3px; transform: translateX(-50%); border-bottom: 4px solid #b8d0c8; border-left: 3px solid transparent; border-right: 3px solid transparent; }
.factory-cell[data-dir="down"] .belt-arrow { left: 50%; bottom: 3px; transform: translateX(-50%); border-top: 4px solid #b8d0c8; border-left: 3px solid transparent; border-right: 3px solid transparent; }

.factory-cell.is-machine { background: #111a1e; border-color: rgba(123, 154, 147, 0.13); }

.machine-slot {
  position: absolute;
  inset: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.machine-slot > svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: visible;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

.machine-progress {
  position: absolute;
  z-index: 5;
  left: 4px;
  right: 4px;
  bottom: 3px;
  height: 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.machine-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  box-shadow: 0 0 6px rgba(242, 182, 68, 0.5);
  transition: width 0.42s linear;
}

.factory-cell.is-machine.is-running .machine-slot > svg {
  filter: drop-shadow(0 0 8px rgba(242, 182, 68, 0.26)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.35));
}

.factory-cell.is-machine.is-running .machine-led {
  animation: led-pulse 0.9s ease-in-out infinite;
}

.machine-led {
  position: absolute;
  z-index: 4;
  right: 5px;
  top: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 5px var(--cyan);
}

@keyframes led-pulse {
  50% { opacity: 0.25; }
}

.machine-badge-row {
  position: absolute;
  z-index: 5;
  left: 4px;
  top: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

.machine-level {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 3px;
  border-radius: 2px;
  color: var(--gold);
  background: rgba(6, 9, 10, 0.7);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.02em;
}

.machine-unwired {
  display: grid;
  place-items: center;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(236, 105, 105, 0.4);
  border-radius: 2px;
  color: var(--red);
  background: rgba(20, 8, 8, 0.85);
  font-family: var(--mono);
  font-size: 6px;
  animation: unplugged 1.8s ease-in-out infinite;
}

@keyframes unplugged {
  50% { opacity: 0.35; }
}

.machine-queue {
  position: absolute;
  z-index: 5;
  right: 4px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 1px;
}

.machine-queue i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.machine-queue i:nth-child(2) { opacity: 0.7; }
.machine-queue i:nth-child(3) { opacity: 0.4; }

.factory-item {
  position: absolute;
  z-index: 12;
  width: clamp(11px, 1.5vw, 19px);
  aspect-ratio: 4 / 3;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
  transition: left 0.28s linear, top 0.28s linear;
  animation: item-bob 1.2s ease-in-out infinite alternate;
}

.factory-item svg { width: 100%; height: 100%; }

@keyframes item-bob {
  from { translate: 0 -1px; }
  to { translate: 0 1px; }
}

.factory-items-layer {
  position: absolute;
  inset: 7px;
  z-index: 10;
  pointer-events: none;
}

.source-art,
.output-art {
  position: absolute;
  inset: 3px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.source-art svg,
.output-art svg {
  width: 76%;
  height: 54%;
  overflow: visible;
}

.source-art span,
.output-art span {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.source-art.is-pulsing { animation: source-pulse 0.5s ease; }
@keyframes source-pulse {
  50% { filter: brightness(1.7) drop-shadow(0 0 8px rgba(102, 212, 197, 0.5)); }
}

.factory-output-float {
  position: absolute;
  z-index: 30;
  right: -12px;
  top: -25px;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--gold);
  color: #1c1204;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  pointer-events: none;
  animation: output-float 1.15s ease-out forwards;
}

@keyframes output-float {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-26px); }
}

.factory-empty-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 250px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  color: #4f5d5b;
  text-align: center;
  font-size: 9px;
  line-height: 1.7;
}

.factory-empty-hint strong {
  display: block;
  margin-bottom: 4px;
  color: #697a76;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.factory-empty-hint span { color: var(--gold-deep); }

.build-tray {
  display: flex;
  align-items: stretch;
  gap: 7px;
  overflow-x: auto;
  padding: 11px 13px;
  border-top: 1px solid var(--line);
  background: #0b1114;
}

.build-card {
  position: relative;
  flex: 1 1 0;
  min-width: 86px;
  max-width: 144px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--ink-dim);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.build-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.035); transform: translateY(-1px); }
.build-card.is-active { border-color: rgba(242, 182, 68, 0.55); background: rgba(242, 182, 68, 0.07); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(242, 182, 68, 0.08); }
.build-card.is-out { opacity: 0.52; }
.build-card.is-out:hover { opacity: 0.78; }

.build-art { display: grid; place-items: center; width: 66px; height: 40px; color: var(--gold); filter: brightness(1.16); }
.build-art svg { width: 100%; height: 100%; overflow: visible; }
.build-card strong { display: block; width: 100%; overflow: hidden; font-size: 9.5px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.build-meta { display: flex; align-items: center; gap: 4px; color: var(--ink-faint); font-family: var(--mono); font-size: 7.2px; }
.build-meta b { color: var(--gold); font-weight: 500; }
.build-stock {
  position: absolute;
  right: 4px;
  top: 4px;
  min-width: 13px;
  padding: 1px 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.45);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 6px;
  text-align: center;
}
.build-stock.zero { color: var(--red); }
.build-quick-buy {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: #1b252a;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 10px;
  cursor: pointer;
}
.build-quick-buy:hover { background: var(--gold); color: #171006; }

.factory-tips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 9px 13px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 8.4px;
}

.factory-tips span { display: flex; align-items: center; gap: 5px; }
.factory-tips kbd {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 15px;
  padding: 0 3px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: #131b1f;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 7px;
}

.factory-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.power-dashboard {
  padding: 15px;
}

.power-dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.power-dash-head h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 11px;
}

.power-dash-head h3 svg { width: 14px; height: 14px; color: var(--cyan); fill: none; stroke: currentColor; stroke-width: 1.7; }
.power-dash-head .pill { font-size: 7px; }

.grid-meter {
  margin-bottom: 11px;
}

.grid-meter-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 7px;
}

.grid-meter-top strong {
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: -0.05em;
}

.grid-meter-top strong small { color: var(--ink-faint); font-size: 9px; letter-spacing: 0; font-weight: 400; }
.grid-meter-top span { color: var(--ink-faint); font-family: var(--mono); font-size: 7.5px; }

.grid-meter-track {
  position: relative;
  display: flex;
  height: 7px;
  border-radius: 3px;
  background: #1a2428;
  overflow: hidden;
}

.grid-meter-track .demand {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #407f76, var(--cyan));
  transition: width 0.3s ease;
}

.grid-meter-track.is-over .demand { background: linear-gradient(90deg, #a95436, var(--red)); }

.grid-meter-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7px;
}

.grid-meter-legend span { display: flex; align-items: center; gap: 4px; }
.grid-meter-legend i { width: 4px; height: 4px; border-radius: 50%; }

.power-source-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.power-source-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  color: var(--ink-dim);
  font-size: 9px;
}

.power-source-row .src-icon { display: grid; place-items: center; width: 17px; height: 17px; color: var(--ink-faint); }
.power-source-row .src-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.power-source-row strong { margin-left: auto; color: var(--ink-soft); font-family: var(--mono); font-size: 8.5px; font-weight: 500; }
.power-source-row .source-sub { color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }
.power-source-row.is-off { opacity: 0.45; }
.power-source-row.is-off strong { color: var(--ink-faint); }

.bill-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding: 7px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--ink-faint);
  font-size: 8px;
}

.bill-line strong { color: var(--gold); font-family: var(--mono); font-weight: 500; }
.bill-line.is-danger strong { color: var(--red); }

.fuel-mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 9px;
}

.fuel-mini {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
}

.fuel-mini span { display: block; color: var(--ink-faint); font-family: var(--mono); font-size: 6.5px; }
.fuel-mini strong { display: block; margin-top: 3px; color: var(--ink-soft); font-family: var(--mono); font-size: 10px; font-weight: 500; }

.inspector-card {
  min-height: 130px;
}

.inspector-empty {
  padding: 23px 15px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.7;
}

.inspector-empty strong { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; }
.inspector-head { display: flex; gap: 11px; align-items: center; }
.inspector-art { flex: 0 0 auto; display: grid; place-items: center; width: 63px; height: 51px; border: 1px solid var(--line); border-radius: 6px; background: #0c1215; }
.inspector-art svg { width: 56px; height: 47px; overflow: visible; }
.inspector-copy { min-width: 0; }
.inspector-copy h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 11px; }
.inspector-copy p { margin: 0; color: var(--ink-faint); font-size: 8px; line-height: 1.5; }
.inspector-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 11px 0; }
.inspector-stat { padding: 7px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.017); }
.inspector-stat span { display: block; color: var(--ink-faint); font-family: var(--mono); font-size: 6px; letter-spacing: 0.03em; }
.inspector-stat strong { display: block; margin-top: 3px; color: var(--ink-soft); font-family: var(--mono); font-size: 9px; font-weight: 500; }
.inspector-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.inspector-actions .btn { flex: 1 1 auto; }
.inspector-warning {
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(236, 105, 105, 0.18);
  border-radius: 4px;
  background: var(--red-soft);
  color: #e69c9c;
  font-size: 8px;
  line-height: 1.5;
}
.inspector-note {
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.6;
}
.inspector-note b { color: var(--ink-dim); font-weight: 500; }

.inline-empty {
  margin: 3px 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.65;
}

.inspector-byproducts {
  margin-top: 8px;
  padding: 6px 7px;
  border: 1px solid rgba(201, 162, 91, 0.18);
  border-radius: 5px;
  background: rgba(201, 162, 91, 0.045);
}
.inspector-byproducts-label {
  display: block;
  margin-bottom: 3px;
  color: #bfa56e;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.04em;
}
.inspector-byproducts > div { display: flex; flex-wrap: wrap; gap: 4px; }
.inspector-byproducts .pill { padding: 2px 4px 2px 2px; }

.output-ports {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(118, 183, 174, 0.13);
}
.output-ports-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 8px;
}
.output-ports-head span:first-child { display: flex; align-items: center; gap: 4px; }
.output-ports-head span:last-child {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.12em;
}
.output-port-rows { display: grid; gap: 4px; }
.output-port-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 4px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 6px;
}
.output-port-dir { color: var(--ink-dim); white-space: nowrap; }
.output-port-row select {
  min-width: 0;
  height: 22px;
  padding: 0 4px;
  border: 1px solid rgba(115, 178, 169, 0.18);
  border-radius: 3px;
  background: #0c1c1e;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 6.5px;
}
.output-port-row small { color: var(--ink-faint); text-align: right; white-space: nowrap; }
.output-port-row small.is-pipe { color: #79cbbf; }
.output-port-row small.is-bad { color: #d98668; }
.output-ports-note {
  margin: 6px 0 0;
  color: var(--ink-faint);
  font-size: 7px;
  line-height: 1.6;
}

.inspector-related {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid rgba(118, 183, 174, 0.13);
}
.inspector-related-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 8px;
}
.inspector-related-head span:first-child { display: flex; align-items: center; gap: 4px; }
.inspector-related-head span:last-child {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.12em;
}
.inspector-related-groups { display: grid; gap: 7px; }
.inspector-related-group { display: grid; gap: 4px; }
.inspector-related-label {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 5.5px;
  letter-spacing: 0.08em;
}
.inspector-related-list { display: flex; flex-wrap: wrap; gap: 4px; }
.related-chip {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  border: 1px solid rgba(115, 178, 169, 0.13);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
}
.related-chip.is-logistics { border-color: rgba(191, 164, 105, 0.16); }
.related-chip-art {
  flex: 0 0 26px;
  width: 26px;
  height: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.related-chip-art svg { width: 100%; height: 100%; }
.related-chip-copy { min-width: 0; display: grid; gap: 1px; }
.related-chip-copy b {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 7px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.related-chip-copy small {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 5.3px;
  letter-spacing: 0.04em;
}

.factory-help-card { padding: 13px 15px; font-size: 8.5px; line-height: 1.75; color: var(--ink-faint); }
.factory-help-card strong { display: block; margin-bottom: 5px; color: var(--ink-soft); font-size: 10px; }
.factory-help-card b { color: var(--gold); font-weight: 500; }
.factory-help-card .keys { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.factory-help-card .keys kbd { border: 1px solid var(--line-strong); border-radius: 3px; padding: 2px 4px; color: var(--ink-dim); background: #11191c; font-family: var(--mono); font-size: 7px; }

/* --------------------------------------------------------------------------
   Shops
   -------------------------------------------------------------------------- */

.shop-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 118px;
  margin-bottom: 18px;
  padding: 20px 25px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(242, 182, 68, 0.12), transparent 35%),
    linear-gradient(120deg, #151b1c, #0f1416 55%, #0c1113);
}

.shop-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(90deg, transparent, black 70%);
}

.shop-hero::after {
  content: attr(data-mark);
  position: absolute;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(242, 182, 68, 0.055);
  font-family: var(--mono);
  font-size: 84px;
  font-weight: 700;
  letter-spacing: -0.08em;
  pointer-events: none;
}

.shop-hero-copy {
  position: relative;
  z-index: 2;
  max-width: 570px;
}

.shop-hero .eyebrow { color: var(--gold); margin-bottom: 9px; }
.shop-hero h3 { margin: 0 0 7px; font-size: 23px; letter-spacing: -0.04em; }
.shop-hero p { margin: 0; color: var(--ink-dim); font-size: 11px; line-height: 1.7; }

.shop-hero-art {
  position: absolute;
  z-index: 1;
  right: 28px;
  bottom: -8px;
  width: 205px;
  height: 125px;
  opacity: 0.93;
}

.shop-hero-art svg { width: 100%; height: 100%; overflow: visible; }

.shop-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.02);
}

.filter-btn {
  border: 0;
  padding: 7px 11px;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-dim);
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn:hover { color: var(--ink); }
.filter-btn.is-active { color: var(--ink); background: #253037; box-shadow: 0 2px 7px rgba(0,0,0,.2); }
.shop-toolbar-spacer { flex: 1; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.shop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.026), transparent 40%),
    var(--bg-2);
  transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s;
}

.shop-card:hover {
  border-color: rgba(210, 224, 214, 0.2);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.036), transparent 45%),
    #131b21;
  transform: translateY(-1px);
}

.shop-card.is-owned { border-color: rgba(143, 206, 134, 0.2); }
.shop-card.is-owned:hover { border-color: rgba(143, 206, 134, 0.32); }

.shop-card-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}

.shop-art {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 79px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background:
    radial-gradient(ellipse at 50% 80%, rgba(242, 182, 68, 0.08), transparent 70%),
    #0c1215;
  overflow: hidden;
}

.shop-art svg { width: 75px; height: 61px; overflow: visible; }
.shop-art img.tool-art { width: 75px; height: 61px; }
.shop-card-heading { flex: 1; min-width: 0; padding-top: 1px; }
.shop-card-heading .shop-type { display: flex; align-items: center; gap: 5px; margin-bottom: 5px; color: var(--ink-faint); font-family: var(--mono); font-size: 6.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.shop-type::before { content: ""; width: 9px; height: 1px; background: var(--gold-deep); }
.shop-card h4 { margin: 0 0 4px; font-size: 13px; letter-spacing: -0.01em; }
.shop-card .shop-desc { margin: 0; color: var(--ink-faint); font-size: 9.4px; line-height: 1.65; }

.shop-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 11px 0 12px;
}

.shop-card-stats span {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-dim);
  background: rgba(255, 255, 255, 0.02);
  font-family: var(--mono);
  font-size: 7.8px;
}

.shop-card-stats span.good { color: var(--gold); border-color: rgba(242, 182, 68, 0.16); }
.shop-card-stats span.power { color: var(--cyan); border-color: rgba(102, 212, 197, 0.14); }
.shop-card-stats span.owned { color: var(--green); border-color: rgba(143, 206, 134, 0.15); }

.shop-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.shop-price { display: flex; align-items: baseline; gap: 3px; min-width: 0; margin-right: auto; }
.shop-price strong { color: var(--gold); font-family: var(--mono); font-size: 15px; font-weight: 600; letter-spacing: -0.04em; }
.shop-price span { color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }
.shop-price.is-unaffordable strong { color: var(--red); }
.shop-card-foot .btn { flex: 0 0 auto; }

.shop-owned-tag {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--green);
  font-family: var(--mono);
  font-size: 8px;
}

.bulk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.bulk-btn {
  flex: 1;
  min-width: 58px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #11191d;
  color: var(--ink-dim);
  font-size: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.bulk-btn:hover { color: var(--gold); border-color: rgba(242, 182, 68, 0.28); background: rgba(242, 182, 68, 0.05); }
.bulk-btn strong { display: block; margin-top: 1px; font-family: var(--mono); font-size: 8px; font-weight: 500; }
.bulk-btn:disabled { opacity: .35; cursor: not-allowed; }

.industry-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.industry-stat {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.022);
}

.industry-stat span { display: block; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.05em; }
.industry-stat strong { display: block; margin-top: 5px; color: var(--ink); font-family: var(--mono); font-size: 15px; font-weight: 500; letter-spacing: -0.03em; }
.industry-stat strong small { color: var(--ink-faint); font-size: 8px; letter-spacing: 0; }

.shop-section + .shop-section { margin-top: 26px; }

.shop-section-head {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 12px;
}

.shop-section-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
}

.shop-section-head h3 span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
}

.shop-section-head .rule { flex: 1; height: 1px; background: var(--line); }
.shop-section-head > span { color: var(--ink-faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; }

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

.fuel-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,.024), transparent 50%), var(--bg-2);
}

.fuel-card-head { display: flex; align-items: center; gap: 10px; }
.fuel-art { width: 54px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #0d1215; }
.fuel-art svg { width: 45px; height: 42px; }
.fuel-card-head h4 { margin: 0 0 3px; font-size: 11px; }
.fuel-card-head p { margin: 0; color: var(--ink-faint); font-size: 8px; }
.fuel-stock-line { display: flex; align-items: baseline; gap: 5px; margin: 12px 0 3px; }
.fuel-stock-line strong { color: var(--ink); font-family: var(--mono); font-size: 21px; font-weight: 500; letter-spacing: -0.05em; }
.fuel-stock-line span { color: var(--ink-faint); font-family: var(--mono); font-size: 8px; }
.fuel-bar { height: 3px; margin-bottom: 10px; border-radius: 3px; background: #1a2428; overflow: hidden; }
.fuel-bar i { display: block; height: 100%; width: 30%; background: var(--gold); border-radius: inherit; }

/* --------------------------------------------------------------------------
   Market
   -------------------------------------------------------------------------- */

.market-tape {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c1114;
  overflow: hidden;
}

.market-tape-label {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  border-right: 1px solid var(--line);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  background: var(--gold-soft);
}

.market-tape-label .live-dot { width: 4px; height: 4px; }
.market-tape-scroll { flex: 1; display: flex; gap: 24px; overflow: hidden; padding: 0 17px; }
.market-tick { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-family: var(--mono); font-size: 8px; }
.market-tick-name { color: var(--ink-faint); }
.market-tick-price { color: var(--ink-soft); }
.market-tick-change { font-size: 7px; }
.market-tick-change.up { color: var(--green); }
.market-tick-change.down { color: var(--red); }
.market-tape-right { flex: 0 0 auto; padding: 0 12px; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }

.market-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 75% 20%, rgba(242, 182, 68, 0.09), transparent 45%),
    linear-gradient(125deg, #121a1c, #0c1114);
}

.market-headline h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.04em; }
.market-headline p { margin: 0; color: var(--ink-dim); font-size: 10.5px; line-height: 1.7; }
.market-insights { display: flex; gap: 22px; margin-top: 15px; }
.market-insight span { display: block; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.05em; }
.market-insight strong { display: block; margin-top: 4px; color: var(--ink-soft); font-family: var(--mono); font-size: 14px; font-weight: 500; }
.market-insight strong.gold { color: var(--gold); }
.market-report {
  align-self: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}
.market-report-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }
.market-report-top .pill { font-size: 6.5px; }
.market-report p { margin: 11px 0; color: var(--ink-soft); font-size: 9px; line-height: 1.65; }
.market-refresh { display: flex; align-items: center; justify-content: space-between; color: var(--ink-faint); font-size: 8px; }
.market-refresh strong { color: var(--cyan); font-family: var(--mono); font-weight: 500; }

.market-group { margin-bottom: 26px; }
.market-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.market-group-head h3 { margin: 0; font-size: 13px; }
.market-group-head .pill { font-size: 7px; }
.market-group-head .rule { flex: 1; height: 1px; background: var(--line); }
.market-group-head > span { color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }

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

.market-card {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(150deg, rgba(255,255,255,.022), transparent 45%), var(--bg-2);
  transition: border-color 0.16s, background 0.16s;
}

.market-card:hover { border-color: var(--line-strong); background: linear-gradient(150deg, rgba(255,255,255,.03), transparent 45%), #11181d; }
.market-card.is-empty { opacity: 0.6; }

.market-card-top { display: flex; align-items: flex-start; gap: 9px; }
.market-art { flex: 0 0 auto; width: 40px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #0b1114; }
.market-art svg { width: 35px; height: 32px; }
.market-name { flex: 1; min-width: 0; }
.market-name h4 { margin: 0 0 3px; font-size: 11px; font-weight: 600; }
.market-name span { color: var(--ink-faint); font-family: var(--mono); font-size: 7.3px; }
.market-trend { font-family: var(--mono); font-size: 7px; }
.market-trend.up { color: var(--green); }
.market-trend.down { color: var(--red); }

.market-sparkline { height: 28px; margin: 9px 0 7px; }
.market-sparkline svg { width: 100%; height: 100%; overflow: visible; }
.market-sparkline .spark-fill { opacity: 0.14; }
.market-sparkline .spark-line { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

.market-price-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 5px; }
.market-price { display: flex; align-items: baseline; gap: 2px; }
.market-price strong { color: var(--ink); font-family: var(--mono); font-size: 16px; font-weight: 500; letter-spacing: -0.05em; }
.market-price span { color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }
.market-stock { color: var(--ink-faint); font-family: var(--mono); font-size: 7.5px; text-align: right; }
.market-stock strong { color: var(--ink-soft); font-weight: 500; }

.market-actions { display: flex; gap: 4px; margin-top: 9px; }
.market-actions .btn { flex: 1; padding: 6px 4px; font-size: 8.3px; min-height: 26px; border-radius: 4px; }
.market-actions .btn:disabled { opacity: 0.3; }

.market-note {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px dashed rgba(242, 182, 68, 0.16);
  border-radius: 7px;
  color: var(--ink-faint);
  font-size: 8.5px;
  line-height: 1.65;
}
.market-note strong { color: var(--gold); font-weight: 500; }

/* --------------------------------------------------------------------------
   Warehouse
   -------------------------------------------------------------------------- */

.warehouse-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.wh-stat {
  position: relative;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(140deg, rgba(255,255,255,.025), transparent 55%), var(--bg-2);
  overflow: hidden;
}
.wh-stat::after { content: attr(data-mark); position: absolute; right: 6px; bottom: -9px; color: rgba(255,255,255,.025); font-family: var(--mono); font-size: 35px; font-weight: 700; }
.wh-stat span { color: var(--ink-faint); font-family: var(--mono); font-size: 7px; letter-spacing: .06em; }
.wh-stat strong { display: block; margin-top: 6px; color: var(--ink); font-family: var(--mono); font-size: 20px; font-weight: 500; letter-spacing: -0.05em; }
.wh-stat strong small { color: var(--ink-faint); font-size: 8px; letter-spacing: 0; }

.warehouse-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.warehouse-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.wh-item { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.018); }
.wh-item.is-empty { opacity: .45; }
.wh-item-art { flex: 0 0 auto; width: 34px; height: 33px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #0b1114; }
.wh-item-art svg { width: 29px; height: 28px; }
.wh-item-copy { min-width: 0; flex: 1; }
.wh-item-copy strong { display: block; overflow: hidden; font-size: 10.2px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.wh-item-copy span { display: block; margin-top: 2px; color: var(--ink-faint); font-family: var(--mono); font-size: 7.6px; }
.wh-item-count { color: var(--ink-soft); font-family: var(--mono); font-size: 13px; font-weight: 500; }

.wh-equipment-row { display: flex; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 9px; color: var(--ink-dim); }
.wh-equipment-row:last-child { border-bottom: 0; }
.wh-equipment-row svg { width: 22px; height: 19px; color: var(--gold); }
.wh-equipment-row span { flex: 1; }
.wh-equipment-row strong { color: var(--ink-soft); font-family: var(--mono); font-size: 9px; font-weight: 500; }
.wh-value-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; color: var(--ink-faint); font-size: 9px; }
.wh-value-row strong { color: var(--gold); font-family: var(--mono); font-size: 10px; font-weight: 500; }

/* --------------------------------------------------------------------------
   Toasts, modals, misc
   -------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  z-index: 300;
  right: 22px;
  top: 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  pointer-events: none;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: max-content;
  max-width: 100%;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(18, 25, 29, 0.97);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.55;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.25s cubic-bezier(.2,.8,.3,1) both;
  backdrop-filter: blur(10px);
}

.toast.is-out { animation: toast-out 0.24s ease forwards; }
.toast-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: -1px;
  border-radius: 4px;
  background: var(--gold-soft);
  color: var(--gold);
}
.toast-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast.success .toast-icon { color: var(--green); background: rgba(143, 206, 134, 0.1); }
.toast.error .toast-icon { color: var(--red); background: var(--red-soft); }
.toast.power .toast-icon { color: var(--cyan); background: var(--cyan-soft); }
.toast strong { color: var(--ink); font-weight: 600; }
.toast-body { min-width: 0; }
.toast-body small { display: block; margin-top: 1px; color: var(--ink-faint); font-size: 8px; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(13px); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(13px); }
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 6, 8, 0.72);
  backdrop-filter: blur(5px);
  animation: modal-bg 0.18s ease;
}

@keyframes modal-bg { from { opacity: 0; } }

.modal {
  width: min(100%, 480px);
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background:
    linear-gradient(160deg, rgba(255,255,255,.04), transparent 30%),
    var(--bg-2);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.22s cubic-bezier(.2,.8,.3,1) both;
  overflow: hidden;
}

.modal.wide { width: min(100%, 640px); }
.modal.narrow { width: min(100%, 390px); }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
}

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 13px;
  border-bottom: 1px solid var(--line);
}

.modal-head-copy { flex: 1; min-width: 0; }
.modal-kicker { margin-bottom: 6px; color: var(--gold); font-family: var(--mono); font-size: 7px; letter-spacing: .12em; text-transform: uppercase; }
.modal-head h3 { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.modal-head p { margin: 5px 0 0; color: var(--ink-dim); font-size: 10px; line-height: 1.6; }
.modal-close { flex: 0 0 auto; margin: 0 -4px 0 0; }
.modal-body { min-height: 0; overflow-y: auto; padding: 17px 18px; }
.modal-body p { margin: 0 0 10px; color: var(--ink-dim); font-size: 10.5px; line-height: 1.8; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body strong { color: var(--ink); font-weight: 600; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid var(--line); background: rgba(255,255,255,.012); }
.modal-foot .modal-foot-left { margin-right: auto; color: var(--ink-faint); font-size: 8px; }
.modal.is-danger .modal-head { border-bottom-color: rgba(236,105,105,.15); }
.modal.is-danger .modal-kicker { color: var(--red); }
.modal.is-danger .modal-head h3 { color: #f2a5a5; }

.modal-choices { display: flex; flex-direction: column; gap: 7px; }
.modal-choice {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: 7px;
  background: rgba(255,255,255,.02); color: var(--ink-soft);
  text-align: left; cursor: pointer; transition: border-color .15s, background .15s;
}
.modal-choice:hover { border-color: rgba(242,182,68,.3); background: rgba(242,182,68,.05); }
.modal-choice-icon { width: 36px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: #0b1114; color: var(--gold); }
.modal-choice-icon svg { width: 26px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.modal-choice-copy { flex: 1; min-width: 0; }
.modal-choice-copy strong { display: block; color: var(--ink-soft); font-size: 10px; }
.modal-choice-copy span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 8px; line-height: 1.45; }
.modal-choice > strong { color: var(--gold); font-family: var(--mono); font-size: 10px; font-weight: 500; }
.modal-choice > svg { width: 14px; height: 14px; color: var(--ink-faint); fill: none; stroke: currentColor; stroke-width: 1.6; }

.info-block {
  margin-bottom: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.018);
}
.info-block h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: var(--ink-soft); font-size: 10px; }
.info-block h4 .step-num { display: grid; place-items: center; width: 17px; height: 17px; border: 1px solid rgba(242,182,68,.25); border-radius: 50%; color: var(--gold); font-family: var(--mono); font-size: 7px; }
.info-block p { margin: 0; color: var(--ink-faint); font-size: 9px; line-height: 1.7; }
.info-block p b { color: var(--ink-soft); font-weight: 500; }

.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 13px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.settings-row:first-child { padding-top: 0; }
.settings-row:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-row-copy strong { display: block; color: var(--ink-soft); font-size: 10px; }
.settings-row-copy span { display: block; margin-top: 2px; color: var(--ink-faint); font-size: 8px; line-height: 1.5; }
.settings-value { color: var(--ink-dim); font-family: var(--mono); font-size: 9px; }

.settings-section-label {
  margin: 5px 0 0;
  padding: 9px 0 5px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.12em;
}
.settings-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.display-choice-row,
.theme-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.display-choice {
  min-width: 46px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: 8px;
  cursor: pointer;
}
.display-choice:hover,
.theme-choice:hover { border-color: rgba(242, 182, 68, 0.32); color: var(--gold); }
.display-choice.is-active,
.theme-choice.is-active {
  border-color: rgba(242, 182, 68, 0.48);
  background: rgba(242, 182, 68, 0.09);
  color: var(--gold-hot);
  box-shadow: inset 0 0 14px rgba(242, 182, 68, 0.05);
}
.theme-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.018);
  color: var(--ink-dim);
  font-size: 8px;
  cursor: pointer;
}
.theme-choice i {
  display: block;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: var(--theme-swatch, #07090c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.toggle {
  position: relative; width: 33px; height: 18px; flex: 0 0 auto;
  border: 1px solid var(--line-strong); border-radius: 99px; background: #182126;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink-faint); transition: transform .16s, background .16s; }
.toggle.is-on { border-color: rgba(242,182,68,.4); background: rgba(242,182,68,.15); }
.toggle.is-on::after { transform: translateX(14px); background: var(--gold); }

.account-badge-large {
  display: flex; align-items: center; gap: 13px; margin-bottom: 17px;
}
.account-badge-large .avatar { width: 47px; height: 47px; border-radius: 9px; font-size: 18px; }
.account-badge-large strong { display: block; font-size: 14px; }
.account-badge-large span { display: block; margin-top: 3px; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; }

.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.help-tile { padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.018); }
.help-tile span { display: grid; place-items: center; width: 22px; height: 22px; margin-bottom: 7px; border: 1px solid var(--line); border-radius: 4px; color: var(--gold); font-family: var(--mono); font-size: 8px; }
.help-tile strong { display: block; margin-bottom: 3px; font-size: 9.5px; }
.help-tile p { margin: 0; color: var(--ink-faint); font-size: 8px; line-height: 1.6; }
.help-shortcut-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.help-shortcut-row span { display: flex; align-items: center; gap: 4px; color: var(--ink-faint); font-size: 8px; }
kbd.key { display: inline-grid; place-items: center; min-width: 17px; height: 16px; padding: 0 4px; border: 1px solid var(--line-strong); border-radius: 3px; background: #11191c; font-family: var(--mono); font-size: 7px; color: var(--ink-soft); }

.factory-tip-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 13px;
  padding: 9px 12px;
  border: 1px solid rgba(242, 182, 68, 0.14);
  border-radius: 6px;
  background: rgba(242, 182, 68, 0.035);
  color: #a69d89;
  font-size: 8.5px;
  line-height: 1.55;
}
.factory-tip-banner svg { flex: 0 0 auto; width: 14px; height: 14px; color: var(--gold); fill: none; stroke: currentColor; stroke-width: 1.7; }
.factory-tip-banner strong { color: var(--gold); font-weight: 500; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1380px) {
  :root { --sidebar-w: 211px; }
  .page { padding: 22px 22px 44px; }
  .two-col { grid-template-columns: minmax(0, 1fr) 322px; gap: 16px; }
  .two-col.wide-rail { grid-template-columns: minmax(0, 1fr) 330px; }
  .market-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .auth-copy h1 { font-size: clamp(36px, 4.6vw, 62px); }
}

@media (max-width: 1180px) {
  .two-col,
  .two-col.wide-rail,
  .two-col.compact-rail { grid-template-columns: minmax(0, 1fr) 302px; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .warehouse-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .warehouse-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .hud-pill.ore-pill { display: none; }
  .market-hero { grid-template-columns: minmax(0, 1fr) 240px; }
}

@media (max-width: 1020px) {
  :root { --topbar-h: 64px; }
  body { overflow: auto; }
  .app-shell {
    position: relative;
    inset: auto;
    min-height: 100vh;
    display: block;
    padding-bottom: 64px;
  }
  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    height: 64px;
    flex-direction: row;
    align-items: stretch;
    border-right: 0;
    border-top: 1px solid var(--line-strong);
    background: rgba(9, 13, 16, 0.97);
    backdrop-filter: blur(14px);
  }
  .sidebar::after, .side-brand, .nav-label, .sidebar-spacer, .side-power, .side-account { display: none; }
  .side-nav {
    flex: 1;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-around;
    gap: 1px;
    padding: 6px 8px;
    min-width: 0;
    overflow-x: auto;
  }
  .nav-item {
    flex: 1;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
    min-width: 52px;
    min-height: 0;
    padding: 4px 3px;
    border: 0;
    border-radius: 5px;
  }
  .nav-item.is-active::before { display: none; }
  .nav-item.is-active { background: rgba(242, 182, 68, 0.08); }
  .nav-icon { width: 19px; height: 19px; }
  .nav-icon svg { width: 18px; height: 18px; }
  .nav-text span { font-size: 9px; text-align: center; }
  .nav-text small { display: none; }
  .nav-badge { position: absolute; right: 5px; top: 2px; min-width: 13px; height: 13px; font-size: 6px; }
  .main-shell { min-height: calc(100vh - 64px); }
  .view-root { overflow: visible; }
  .topbar { position: sticky; top: 0; gap: 10px; padding: 0 16px; }
  .topbar-title { display: none; }
  .topbar-mobile-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .topbar-mobile-brand .brand-mark { width: 30px; height: 30px; border-radius: 6px; }
  .topbar-mobile-brand .brand-mark svg { width: 19px; height: 19px; }
  .topbar-mobile-brand strong { font-size: 11px; letter-spacing: .08em; white-space: nowrap; }
  .hud-strip { margin-left: auto; }
  .hud-pill { min-height: 34px; padding: 0 9px; }
  .hud-pill.cash { min-width: 112px; }
  .hud-pill.cash .hud-pill-copy strong { font-size: 12px; }
  .hud-actions { display: none; }
  .page { padding: 18px 15px 32px; }
  .two-col, .two-col.wide-rail, .two-col.compact-rail { grid-template-columns: 1fr; }
  .rail-stack { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .rail-stack > .panel:first-child { grid-column: 1 / -1; }
  .factory-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .factory-help-card { grid-column: 1 / -1; }
  .market-hero { grid-template-columns: 1fr; }
  .market-report { display: none; }
  .shop-hero-art { right: -18px; opacity: .45; width: 180px; }
  .toast-stack { top: 75px; right: 14px; }
  .auth-screen { position: relative; min-height: 100vh; grid-template-columns: 1fr; overflow-y: auto; }
  .auth-hero { min-height: 380px; padding: 25px 25px 22px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-copy { margin: 45px 0 10px; padding-top: 0; }
  .auth-copy h1 { font-size: clamp(35px, 7.5vw, 58px); margin: 18px 0 14px; }
  .auth-copy > p { font-size: 13px; max-width: 520px; }
  .auth-landscape { height: 60%; opacity: .62; }
  .auth-side { padding: 34px 24px 60px; }
  .auth-card { width: min(100%, 500px); }
  .auth-legal { position: static; margin-top: 30px; }
}

@media (max-width: 760px) {
  .page-head { flex-direction: column; align-items: flex-start; gap: 13px; }
  .page-head-actions { width: 100%; flex-wrap: wrap; }
  .page-head-actions .btn { flex: 1 1 auto; }
  .page-head h2 { font-size: 25px; }
  .hud-pill { min-height: 32px; padding: 0 7px; gap: 5px; }
  .hud-pill .hud-icon, .hud-pill .hud-icon svg { width: 15px; height: 15px; }
  .hud-pill-copy small { display: none; }
  .hud-pill.cash { min-width: auto; }
  .hud-pill.cash .hud-pill-copy strong { font-size: 11px; }
  .hud-pill.power-pill .hud-pill-copy strong { font-size: 9.5px; }
  .hud-pill .hud-pill-copy { gap: 0; }
  .topbar { padding: 0 12px; }
  .topbar-mobile-brand strong { display: none; }
  .hud-strip { gap: 5px; }
  .mine-topbar { padding: 10px 11px; }
  .mine-seam { display: none; }
  .mine-field-wrap { padding: 11px 9px 13px; }
  .mine-field { gap: 3px; padding: 4px; }
  .mine-tile { min-height: 29px; border-radius: 1px; }
  .mine-surface { height: 61px; }
  .mine-skyline { bottom: 24px; height: 17px; }
  .mine-derrick { width: 55px; height: 54px; bottom: 23px; }
  .mine-surface::after { height: 24px; }
  .mine-surface-label, .mine-sun { display: none; }
  .mine-rig-bay { min-height: 39px; padding: 6px 8px; gap: 5px; }
  .rig-bay-label { display: none; }
  .rig-chip { padding: 2px 5px 2px 2px; font-size: 7px; }
  .rig-chip svg { width: 21px; height: 17px; }
  .rig-chip img.rig-art { width: 21px; height: 17px; }
  .mine-footer { gap: 9px; padding: 9px 11px; }
  .mine-hint { display: none; }
  .tool-banner { padding: 9px 11px; }
  .tool-banner-art { width: 35px; height: 32px; }
  .tool-tags { display: none; }
  .rail-stack { grid-template-columns: 1fr; }
  .panel-head { padding: 12px 13px; min-height: 48px; }
  .panel-body { padding: 13px; }
  .factory-head { padding: 10px 11px; }
  .factory-mode-switch { order: 3; width: 100%; }
  .factory-mode-switch .mode-btn { flex: 1; }
  .factory-stage { padding: 11px 8px 10px; }
  .factory-board { gap: 2px; padding: 4px; }
  .factory-cell { border-radius: 2px; }
  .factory-cell::before { inset: 1px; }
  .factory-items-layer { inset: 4px; }
  .factory-tips { gap: 8px; padding: 8px; font-size: 7px; }
  .factory-tips span:nth-child(3) { display: none; }
  .build-tray { padding: 8px; gap: 5px; }
  .build-card { flex-basis: 75px; padding: 7px 3px 6px; }
  .build-art { width: 44px; height: 28px; }
  .build-card strong { font-size: 7.5px; }
  .factory-side { grid-template-columns: 1fr; }
  .factory-help-card { display: none; }
  .power-source-list { gap: 0; }
  .shop-grid { grid-template-columns: 1fr; }
  .shop-hero { min-height: 108px; padding: 17px 18px; }
  .shop-hero h3 { font-size: 20px; }
  .shop-hero::after { display: none; }
  .shop-hero-art { display: none; }
  .industry-stats { grid-template-columns: 1fr 1fr; }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .market-tape-right { display: none; }
  .market-tape-scroll { gap: 15px; padding: 0 10px; }
  .market-insights { gap: 16px; }
  .warehouse-summary { grid-template-columns: 1fr 1fr; }
  .warehouse-layout { grid-template-columns: 1fr; }
  .warehouse-grid { grid-template-columns: 1fr 1fr; }
  .fuel-grid { grid-template-columns: 1fr; }
  .market-hero { padding: 16px; }
  .market-headline h3 { font-size: 19px; }
  .toast { font-size: 9px; }
  .modal-head { padding: 15px 14px 11px; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 11px 14px; flex-wrap: wrap; }
  .modal-foot .modal-foot-left { width: 100%; margin: 0 0 7px; }
  .help-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .auth-hero { min-height: 340px; padding: 20px 18px 18px; }
  .auth-brand strong { font-size: 14px; }
  .auth-brand span { font-size: 7px; }
  .auth-copy h1 { font-size: 36px; }
  .auth-copy > p { font-size: 11.5px; line-height: 1.8; }
  .auth-tags span { font-size: 8px; padding: 6px 8px; }
  .auth-tags span:nth-child(n+3) { display: none; }
  .auth-side { padding: 26px 17px 38px; }
  .auth-card h2 { font-size: 23px; }
  .auth-foot { gap: 8px 16px; font-size: 7.5px; }
  .auth-landscape { height: 48%; opacity: .5; }
  .auth-options { align-items: flex-start; flex-direction: column; gap: 8px; }
  .login-only + #auth-help-btn { align-self: flex-end; }
  .nav-item { min-width: 46px; }
  .nav-text span { font-size: 8px; }
  .hud-pill .hud-icon { display: none; }
  .hud-pill { border-radius: 5px; }
  .hud-actions { display: none; }
  .page { padding: 14px 10px 28px; }
  .mine-surface { height: 54px; }
  .mine-derrick { display: none; }
  .mine-tile { min-height: 23px; }
  .mine-field { gap: 2px; }
  .mine-location-copy strong { font-size: 10px; }
  .mine-location-copy span { font-size: 6.5px; }
  .mine-footer-stat:nth-child(n+3) { display: none; }
  .factory-title-copy span { display: none; }
  .factory-head { gap: 8px; }
  .factory-ruler { display: none; }
  .build-tray { gap: 4px; }
  .build-card { flex-basis: 67px; }
  .build-card strong { font-size: 7px; }
  .build-meta { font-size: 6px; }
  .market-actions .btn { font-size: 7px; }
  .market-grid { gap: 7px; }
  .market-card { padding: 9px; }
  .warehouse-grid { grid-template-columns: 1fr; }
  .toast-stack { left: 10px; right: 10px; top: 68px; max-width: none; align-items: stretch; }
  .toast { width: 100%; }
  .shop-card-top { gap: 8px; }
  .shop-art { width: 62px; height: 54px; }
  .shop-art svg { width: 59px; height: 51px; }
  .shop-card h4 { font-size: 11px; }
  .shop-card-stats { gap: 3px; }
  .shop-card-stats span { font-size: 6.5px; padding: 2px 4px; }
  .bulk-row .bulk-btn { font-size: 7px; }
}

/* ---------------------------------------------------------------------------
   Continuous open-pit mine
   --------------------------------------------------------------------------- */

.mine-field-wrap {
  padding: 14px 17px 17px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(242, 182, 68, 0.045), transparent 54%),
    linear-gradient(180deg, #0c1012, #0b0d0e 75%);
}

.mine-plot {
  position: relative;
  z-index: 2;
  width: 100%;
  height: clamp(300px, 42vw, 470px);
  border: 1px solid rgba(242, 182, 68, 0.12);
  border-radius: 7px;
  overflow: hidden;
  background: #312419;
  box-shadow:
    inset 0 4px 38px rgba(0, 0, 0, 0.62),
    inset 0 0 0 1px rgba(255, 226, 168, 0.035),
    0 7px 26px rgba(0, 0, 0, 0.3);
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M6 22 19 9' stroke='%23f2b644' stroke-width='4' stroke-linecap='round'/%3E%3Cpath d='M13 5c4-2 8 1 9 5l-5-1-4-4Z' fill='%23e7edf0' stroke='%23101416' stroke-width='1.4'/%3E%3C/svg%3E") 5 23, crosshair;
  touch-action: manipulation;
  isolation: isolate;
  outline: none;
  user-select: none;
}

.mine-plot:focus-visible {
  border-color: rgba(242, 182, 68, 0.5);
  box-shadow: inset 0 4px 38px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(242, 182, 68, 0.22);
}

.mine-plot-ground {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/4b331c3f41bea06ba14866bc9a21de213aedadd543ff4b0df8dc198b3f5651af/mine-ground.webp") center / cover no-repeat;
  filter: contrast(1.06) saturate(1.08) brightness(0.9);
  transform: scale(1.012);
  pointer-events: none;
}

.mine-plot-ambient {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 208, 128, 0.16), transparent 27%),
    radial-gradient(circle at 68% 72%, rgba(77, 211, 197, 0.07), transparent 32%),
    linear-gradient(180deg, rgba(7, 12, 12, 0.27), transparent 23%, transparent 76%, rgba(6, 9, 9, 0.38));
}

.mine-plot-ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    radial-gradient(circle, rgba(255, 225, 170, 0.5) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(126, 235, 217, 0.35) 0 1px, transparent 1.4px);
  background-size: 117px 89px, 181px 137px;
  background-position: 13px 21px, 71px 9px;
  animation: mineDustDrift 24s linear infinite;
  mix-blend-mode: screen;
}

@keyframes mineDustDrift {
  to { background-position: 130px 84px, 251px 146px; }
}

.mine-scars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.mine-scar {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--scar-rot));
  background: url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/c7274231b2213efbf93bd972652feb3c298dfb5c067b176a7d0a15ca9aa3ca09/mine-crater.webp") center / contain no-repeat;
  opacity: var(--scar-opacity);
  filter: sepia(0.9) saturate(0.65) brightness(0.58) contrast(1.12);
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.mine-scar.is-auto { filter: sepia(0.5) saturate(0.5) brightness(0.72); }
.mine-scar.is-faded { opacity: 0; }

.mine-plot .pulse-field-wash { z-index: 3; border-radius: inherit; }

.mine-plot-hud {
  position: absolute;
  z-index: 7;
  left: 10px;
  right: 10px;
  bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(236, 197, 126, 0.11);
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(12, 18, 18, 0.58), rgba(12, 18, 18, 0.18));
  color: rgba(205, 194, 169, 0.62);
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 1px 2px #000;
  backdrop-filter: blur(3px);
}

.mine-plot-hud b {
  color: #d9bd85;
  font-size: 6.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.mine-plot.is-cooling .mine-plot-hud b { color: #b8775a; }

.mine-plot-cool {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, transparent 48%, rgba(5, 8, 8, 0.12)),
    linear-gradient(180deg, rgba(214, 146, 74, 0.025), transparent);
  transition: opacity 0.12s ease;
}

.mine-plot.is-cooling .mine-plot-cool { opacity: 1; }

.mine-aim {
  position: absolute;
  z-index: 12;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(242, 195, 105, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.75);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease, transform 0.08s ease;
  box-shadow: 0 0 9px rgba(242, 182, 68, 0.12);
}

.mine-aim.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.mine-aim::before,
.mine-aim::after {
  content: "";
  position: absolute;
  background: rgba(250, 207, 123, 0.8);
  box-shadow: 0 0 4px rgba(255, 215, 133, 0.35);
}

.mine-aim::before { left: 50%; top: -4px; bottom: -4px; width: 1px; transform: translateX(-50%); }
.mine-aim::after { top: 50%; left: -4px; right: -4px; height: 1px; transform: translateY(-50%); }
.mine-aim i { position: absolute; inset: 9px; border: 1px solid rgba(111, 231, 215, 0.5); border-radius: 50%; }

.mine-aim span {
  position: absolute;
  left: 22px;
  top: 17px;
  padding: 1px 3px;
  color: rgba(222, 194, 143, 0.65);
  background: rgba(8, 12, 12, 0.5);
  font-family: var(--mono);
  font-size: 5px;
  letter-spacing: 0.08em;
}

.mine-impact {
  position: absolute;
  z-index: 9;
  width: 10px;
  height: 10px;
  border: 2px solid rgba(235, 201, 143, 0.88);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: mineImpact 0.82s cubic-bezier(0.12, 0.65, 0.26, 1) forwards;
  box-shadow: 0 0 12px rgba(234, 186, 100, 0.25);
}

.mine-impact::before,
.mine-impact::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(223, 187, 119, 0.4);
  border-radius: 50%;
  animation: mineImpactRing 0.76s ease-out forwards;
}

.mine-impact::after { animation-delay: 0.1s; }
.mine-impact.is-gold { border-color: #ffd271; box-shadow: 0 0 18px rgba(255, 186, 68, 0.55); }
.mine-impact.is-crystal { border-color: #9ffff0; box-shadow: 0 0 22px rgba(121, 255, 233, 0.6); }

@keyframes mineImpact {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.35); }
  60% { opacity: 0.7; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5); }
}

@keyframes mineImpactRing {
  0% { opacity: 0.8; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(2.8); }
}

.mine-auto-ping {
  position: absolute;
  z-index: 8;
  width: 28px;
  height: 28px;
  border: 1px dashed rgba(108, 229, 211, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: autoPing 0.86s ease-out forwards;
}

.mine-auto-ping::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: rgba(114, 243, 222, 0.12);
}

@keyframes autoPing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(0deg); }
  25% { opacity: 0.85; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.9) rotate(80deg); }
}

.mine-plot.is-shaking { animation: minePlotShake 0.3s ease; }
.mine-plot.is-denied { animation: minePlotDenied 0.2s ease; }

@keyframes minePlotShake {
  24% { transform: translate(2px, -1px); }
  52% { transform: translate(-2px, 1px); }
  78% { transform: translate(1px, 1px); }
}

@keyframes minePlotDenied {
  30% { transform: translateX(-2px); }
  70% { transform: translateX(2px); }
}

.mine-stage.is-pulse .mine-plot {
  border-color: rgba(117, 244, 224, 0.36);
  box-shadow:
    inset 0 0 50px rgba(65, 205, 190, 0.1),
    inset 0 0 0 1px rgba(138, 255, 238, 0.06),
    0 0 30px rgba(63, 219, 201, 0.1);
}

.mine-stage.is-pulse .mine-plot-ground { filter: contrast(1.1) saturate(1.18) brightness(0.94) hue-rotate(-4deg); }
.mine-stage.is-pulse .mine-plot-ambient { background: radial-gradient(circle at 50% 55%, rgba(92, 237, 218, 0.1), transparent 58%); }
.mine-stage.is-pulse .mine-scar { filter: sepia(0.35) saturate(0.85) brightness(0.7) hue-rotate(145deg); }
.loot-float.is-auto { font-size: 7px; opacity: 0.88; }

.resonance-gain-float {
  position: absolute;
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(121, 247, 222, 0.28);
  border-radius: 3px;
  background: rgba(5, 27, 28, 0.88);
  color: #a8fff0;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, 0);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), 0 0 16px rgba(87, 235, 214, 0.1);
  animation: resonanceGainFloat 1.45s ease-out forwards;
}

.resonance-gain-float i {
  width: 5px;
  height: 5px;
  border: 1px solid #affff0;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(151, 255, 236, 0.8);
}

@keyframes resonanceGainFloat {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(0.85); }
  16% { opacity: 1; transform: translate(-50%, -2px) scale(1); }
  72% { opacity: 1; transform: translate(-50%, -30px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -44px) scale(0.94); }
}

.resonance-gain-ring {
  position: absolute;
  z-index: 8;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(134, 255, 235, 0.55);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: resonanceGainRing 0.95s ease-out forwards;
}

@keyframes resonanceGainRing {
  0% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.25); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
}

/* ---------------------------------------------------------------------------
   Deep resonance / crystal anomaly
   --------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
   Deep resonance / crystal anomaly
   --------------------------------------------------------------------------- */

.hud-pulse-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 45px;
  padding: 0 10px 0 8px;
  border: 1px solid rgba(130, 244, 226, 0.3);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(32, 105, 105, 0.3), rgba(7, 24, 29, 0.58));
  color: var(--cyan);
  box-shadow: inset 0 0 20px rgba(93, 238, 219, 0.07), 0 0 22px rgba(81, 230, 211, 0.05);
  cursor: pointer;
  animation: hudPulseBreath 2.4s ease-in-out infinite;
}

.hud-pulse-chip[hidden] { display: none; }
.hud-pulse-chip > span:nth-child(2) { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.hud-pulse-chip small { font-family: var(--mono); font-size: 5.5px; letter-spacing: 0.15em; color: #6fb7ae; white-space: nowrap; }
.hud-pulse-chip strong { font-size: 9px; font-weight: 600; color: #ccfff7; white-space: nowrap; }
.hud-pulse-chip b { font-family: var(--mono); font-size: 10px; color: #9ffff0; font-weight: 500; }
.hud-pulse-chip:hover { border-color: rgba(140, 255, 237, 0.55); background: linear-gradient(180deg, rgba(41, 130, 128, 0.4), rgba(7, 24, 29, 0.65)); }

.hud-pulse-ring {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #aaffef;
  box-shadow: 0 0 10px rgba(143, 255, 236, 0.75);
  flex: 0 0 auto;
}

.hud-pulse-ring::before,
.hud-pulse-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(141, 255, 235, 0.5);
  border-radius: 50%;
  animation: pulseRing 2s ease-out infinite;
}

.hud-pulse-ring::after { animation-delay: 0.7s; }

@keyframes hudPulseBreath {
  0%, 100% { box-shadow: inset 0 0 20px rgba(93, 238, 219, 0.07), 0 0 16px rgba(81, 230, 211, 0.04); }
  50% { box-shadow: inset 0 0 24px rgba(93, 238, 219, 0.13), 0 0 26px rgba(81, 230, 211, 0.1); }
}

@keyframes pulseRing {
  0% { transform: scale(0.7); opacity: 0.75; }
  100% { transform: scale(1.8); opacity: 0; }
}

.pulse-screen-flash {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0;
  background:
    url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/2f46d8852af16ef45bde78925f3688d8266f538053639a4d5308ac18c544f112/fx/pulse-wash.webp") center / cover no-repeat,
    radial-gradient(circle at 50% 62%, rgba(123, 255, 232, 0.24), transparent 36%),
    linear-gradient(180deg, transparent 20%, rgba(72, 220, 205, 0.13) 52%, transparent 82%);
  mix-blend-mode: screen;
}

.pulse-screen-flash.is-active { animation: pulseScreenFlash 2.2s ease-out; }

@keyframes pulseScreenFlash {
  0% { opacity: 0; }
  12% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* Mine pulse scene ---------------------------------------------------------- */

.mine-stage { transition: box-shadow 0.4s ease, border-color 0.4s ease; }

.mine-stage.is-pulse {
  border-color: rgba(117, 244, 224, 0.36);
  box-shadow:
    0 0 0 1px rgba(104, 238, 220, 0.08),
    0 0 48px rgba(69, 218, 202, 0.13),
    0 24px 60px rgba(0, 0, 0, 0.34);
}

.mine-stage.is-pulse .mine-topbar { background: linear-gradient(90deg, rgba(9, 33, 38, 0.9), rgba(16, 48, 50, 0.7)); }
.mine-seam.is-live { color: #a7fff0; border-color: rgba(110, 244, 223, 0.35); }
.mine-seam.is-live i { background: #8dffe8; box-shadow: 0 0 9px rgba(125, 255, 232, 0.85); animation: livePulse 1.2s ease-in-out infinite; }

@keyframes livePulse {
  0%, 100% { opacity: 0.4; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.pulse-live-badge {
  position: absolute;
  z-index: 12;
  top: 52px;
  right: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid rgba(128, 247, 228, 0.34);
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(8, 33, 37, 0.9), rgba(15, 57, 56, 0.75));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(108, 250, 229, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.mine-stage.is-pulse .pulse-live-badge {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  animation: pulseBadgeGlow 2.6s ease-in-out infinite;
}

.pulse-live-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #bafff3;
  background: rgba(121, 247, 226, 0.11);
  border: 1px solid rgba(133, 255, 237, 0.25);
}

.pulse-live-icon svg { width: 13px; height: 13px; }
.pulse-live-copy { display: flex; flex-direction: column; gap: 1px; }
.pulse-live-copy strong { font-size: 8.5px; color: #d7fff8; letter-spacing: 0.06em; }
.pulse-live-copy small { font-family: var(--mono); font-size: 5.8px; color: #76b7ae; }
.pulse-live-badge b { font-family: var(--mono); font-size: 11px; font-weight: 500; color: #a6ffec; margin-left: 5px; }

@keyframes pulseBadgeGlow {
  0%, 100% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 0 18px rgba(108, 250, 229, 0.08); }
  50% { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 0 28px rgba(108, 250, 229, 0.18), 0 0 30px rgba(87, 240, 219, 0.12); }
}

.pulse-field-wash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 80%, rgba(117, 255, 231, 0.12), transparent 48%),
    repeating-linear-gradient(0deg, transparent 0 44px, rgba(122, 255, 235, 0.045) 44px 46px);
  mix-blend-mode: screen;
  transition: opacity 0.5s ease;
}

.mine-stage.is-pulse .pulse-field-wash { opacity: 1; animation: pulseFieldMove 7s linear infinite; }
.mine-stage.is-pulse .mine-field { filter: saturate(1.18) contrast(1.04); }
.mine-stage.is-pulse .mine-tile { outline-color: rgba(112, 232, 215, 0.28); }
.mine-stage.is-pulse .tile-glint { animation-duration: 1.4s; }

@keyframes pulseFieldMove {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 0, 0 -92px; }
}

.mine-stage.is-crystal-moment {
  box-shadow: 0 0 0 1px rgba(131, 255, 235, 0.18), 0 0 54px rgba(90, 246, 223, 0.2), 0 24px 60px rgba(0, 0, 0, 0.34);
}

.mine-tile.is-crystal-hit {
  animation: crystalHit 0.85s ease-out;
  z-index: 2;
}

@keyframes crystalHit {
  0% { filter: brightness(1); box-shadow: inset 0 0 0 rgba(135, 255, 236, 0); }
  22% { filter: brightness(2.1) saturate(1.4); box-shadow: inset 0 0 28px rgba(158, 255, 239, 0.65), 0 0 25px rgba(123, 255, 232, 0.75); }
  100% { filter: brightness(1); box-shadow: inset 0 0 0 rgba(135, 255, 236, 0); }
}

/* Resonance panel ---------------------------------------------------------- */

.resonance-panel {
  position: relative;
  overflow: hidden;
  border-color: rgba(121, 231, 214, 0.18);
  background:
    radial-gradient(circle at 94% 0%, rgba(91, 239, 219, 0.1), transparent 42%),
    radial-gradient(circle at 8% 100%, rgba(212, 156, 64, 0.055), transparent 45%),
    linear-gradient(150deg, rgba(11, 31, 35, 0.98), rgba(8, 19, 23, 0.98));
}

.resonance-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.08;
  background: url("https://renderfarm-1389434004.cos.ap-shanghai.myqcloud.com/deep-vein/assets/21301183bbc9db3f5c72ce1906d97148222e4dd7e04474ab0b3dd80b62104073/nebula.webp") center / cover no-repeat;
  mix-blend-mode: screen;
  pointer-events: none;
}

.resonance-panel > * { position: relative; z-index: 1; }
.resonance-panel.is-live { border-color: rgba(120, 249, 228, 0.38); box-shadow: 0 0 32px rgba(67, 218, 201, 0.1); }
.resonance-panel .panel-head { border-bottom-color: rgba(104, 208, 193, 0.12); }
.resonance-panel .panel-head h3 { color: #ccfff7; }
.resonance-panel-glow {
  position: absolute;
  z-index: 0;
  top: -80px;
  right: -30px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(94, 244, 222, 0.11), transparent 65%);
  opacity: 0.7;
  animation: resonanceGlow 5s ease-in-out infinite;
  pointer-events: none;
}

.resonance-panel.is-live .resonance-panel-glow { opacity: 1; animation-duration: 2.2s; }

@keyframes resonanceGlow {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.12); opacity: 0.95; }
}

.resonance-core {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 13px;
}

.resonance-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(130, 242, 225, 0.24);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58, 168, 158, 0.25), rgba(7, 27, 31, 0.8) 68%);
  box-shadow: inset 0 0 20px rgba(104, 241, 220, 0.1), 0 0 20px rgba(64, 215, 198, 0.06);
}

.resonance-orbit {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(135, 255, 237, 0.18);
  border-radius: 50%;
  border-left-color: transparent;
  border-bottom-color: transparent;
  animation: resonanceOrbit 8s linear infinite;
}

.resonance-orbit.orbit-2 {
  inset: 0;
  border-color: rgba(240, 196, 104, 0.14);
  border-right-color: transparent;
  border-top-color: transparent;
  animation-duration: 5.5s;
  animation-direction: reverse;
}

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

.resonance-crystal { position: relative; z-index: 1; width: 35px; height: 32px; }
.resonance-crystal svg { width: 100%; height: 100%; filter: drop-shadow(0 0 7px rgba(135, 255, 237, 0.34)); }
.resonance-panel.is-live .resonance-crystal svg { animation: crystalBreathe 1.8s ease-in-out infinite; }

@keyframes crystalBreathe {
  0%, 100% { filter: drop-shadow(0 0 5px rgba(135, 255, 237, 0.28)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 14px rgba(171, 255, 241, 0.7)); transform: scale(1.06); }
}

.resonance-core-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.resonance-core-copy strong { font-size: 8.5px; color: #c3eee7; letter-spacing: 0.03em; }
.resonance-core-copy span { font-size: 7.5px; line-height: 1.6; color: #6f9994; }
.resonance-crystal-stock { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; padding-left: 4px; }
.resonance-crystal-stock b { font-family: var(--mono); font-size: 18px; line-height: 1; color: #affff0; font-weight: 400; }
.resonance-crystal-stock span { font-size: 6px; color: #638f89; white-space: nowrap; }

.resonance-meter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 6.5px;
  letter-spacing: 0.1em;
  color: #688f8a;
}

.resonance-meter-head b { color: #b6fff3; font-size: 8px; font-weight: 500; }
.resonance-meter {
  position: relative;
  height: 8px;
  border: 1px solid rgba(109, 216, 202, 0.14);
  border-radius: 2px;
  background: rgba(3, 14, 17, 0.7);
  overflow: hidden;
}

.resonance-meter > i {
  display: block;
  height: 100%;
  border-radius: 1px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.13) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, #337c74, #75e5d4 55%, #d7fff7);
  box-shadow: 0 0 10px rgba(111, 242, 223, 0.38);
  transition: width 0.28s linear;
}

.resonance-meter.is-live > i {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px 7px),
    linear-gradient(90deg, #d5a850, #f5db8a 48%, #9ffff0);
  box-shadow: 0 0 12px rgba(246, 208, 120, 0.42);
}

.resonance-meter-scan {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 28px;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: meterScan 2.7s ease-in-out infinite;
  pointer-events: none;
}

@keyframes meterScan {
  0%, 100% { transform: translateX(-30px); opacity: 0; }
  30%, 70% { opacity: 1; }
  50% { transform: translateX(230px); }
}

.resonance-effects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.resonance-core-copy b { color: #a5efdf; font-weight: 500; }

.resonance-effects span {
  padding: 5px 4px;
  border: 1px solid rgba(104, 197, 184, 0.1);
  border-radius: 3px;
  background: rgba(8, 24, 27, 0.42);
  font-family: var(--mono);
  font-size: 5.8px;
  color: #6f9a94;
  text-align: center;
  white-space: nowrap;
}

.resonance-effects b { display: block; margin-bottom: 1px; color: #b6e9df; font-weight: 500; }
.resonance-panel.is-live .resonance-effects span { border-color: rgba(150, 255, 235, 0.16); color: #9dccc4; }

.resonance-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}

.resonance-actions .btn { flex: 1; justify-content: center; }
.resonance-actions > span { font-family: var(--mono); font-size: 6px; color: #658a85; white-space: nowrap; }
.resonance-actions > span b { color: #a8dcd2; font-weight: 500; }

/* Anomaly material cards */
.market-card[data-market-card="voidCrystal"],
.wh-item[data-material="voidCrystal"] {
  border-color: rgba(133, 249, 230, 0.25);
  background:
    radial-gradient(circle at 86% 15%, rgba(113, 248, 229, 0.1), transparent 40%),
    rgba(10, 28, 31, 0.66);
}

.market-card[data-market-card="voidCrystal"] .market-art svg,
.market-card[data-market-card="voidCrystal"] .market-art img,
.wh-item[data-material="voidCrystal"] .wh-item-art svg,
.wh-item[data-material="voidCrystal"] .wh-item-art img,
.market-tick:first-child .market-tick-name { filter: drop-shadow(0 0 8px rgba(139, 255, 236, 0.34)); }

.market-card[data-market-card="voidCrystal"] .market-name h4,
.wh-item[data-material="voidCrystal"] .wh-item-copy strong { color: #c7fff7; }

/* Power thresholds & upgrade previews ------------------------------------- */

.power-speed-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding: 7px 8px;
  border: 1px solid rgba(102, 212, 197, 0.13);
  border-radius: 3px;
  background: rgba(8, 25, 27, 0.4);
  font-family: var(--mono);
  font-size: 6.5px;
  color: #6f9690;
}

.power-speed-line span { display: flex; align-items: center; gap: 5px; }
.power-speed-line i { width: 5px; height: 5px; border-radius: 50%; background: #66d4c5; box-shadow: 0 0 6px rgba(102, 212, 197, 0.6); }
.power-speed-line strong { color: #c7f5ec; font-size: 10px; font-weight: 500; }
.power-speed-line.is-low strong { color: #e1a774; }
.power-speed-line.is-stopped strong { color: #f08c79; }
.power-speed-line.is-overclock { border-color: rgba(242, 182, 68, 0.22); background: rgba(48, 36, 18, 0.35); }
.power-speed-line.is-overclock i { background: #f2b644; box-shadow: 0 0 8px rgba(242, 182, 68, 0.65); }
.power-speed-line.is-overclock strong { color: #f7d381; }

.power-policy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 7px;
}

.power-policy-grid div {
  padding: 5px 4px;
  border: 1px solid rgba(94, 164, 156, 0.1);
  border-radius: 3px;
  background: rgba(8, 19, 22, 0.34);
  text-align: center;
}

.power-policy-grid span { display: block; margin-bottom: 2px; font-family: var(--mono); font-size: 5px; color: #5d7d77; }
.power-policy-grid strong { display: block; font-family: var(--mono); font-size: 6px; color: #9dbfb8; font-weight: 500; white-space: nowrap; }
.power-policy-note {
  margin-top: 7px;
  padding: 6px 7px;
  border-left: 2px solid rgba(102, 212, 197, 0.22);
  background: rgba(8, 22, 24, 0.3);
  color: #688c86;
  font-size: 7px;
  line-height: 1.55;
}

.hud-pill.power-pill.is-overclock {
  border-color: rgba(242, 182, 68, 0.4);
  background: linear-gradient(180deg, rgba(75, 57, 25, 0.38), rgba(20, 22, 18, 0.5));
  box-shadow: inset 0 0 16px rgba(242, 182, 68, 0.06);
}
.hud-pill.power-pill.is-overclock .hud-icon { color: #f4c76d; }
.hud-pill.power-pill.is-overclock .hud-pill-copy strong { color: #f7d78c; }

/* Upgrade preview in the factory inspector */
.upgrade-preview {
  margin-top: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(107, 216, 201, 0.16);
  border-radius: 4px;
  background:
    radial-gradient(circle at 90% 10%, rgba(97, 236, 216, 0.07), transparent 45%),
    rgba(7, 22, 25, 0.52);
}

.upgrade-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 7px;
  color: #a9d4ca;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.04em;
}

.upgrade-preview-head span { display: flex; align-items: center; gap: 4px; }
.upgrade-preview-head svg { width: 10px; height: 10px; color: #e0bc6d; }
.upgrade-preview-head strong { color: #f0d18a; font-size: 7.5px; font-weight: 500; }
.upgrade-preview-row {
  display: grid;
  grid-template-columns: 46px minmax(34px, 1fr) minmax(38px, 1fr) auto;
  gap: 3px 5px;
  padding: 4px 0;
  border-top: 1px solid rgba(94, 157, 149, 0.1);
  font-family: var(--mono);
  font-size: 7px;
  color: #809f98;
  align-items: center;
}
.upgrade-preview-row:first-of-type { border-top: 0; padding-top: 0; }
.upgrade-preview-row b { color: #c5ddd7; font-weight: 400; }
.upgrade-preview-row em { color: #e2c487; font-style: normal; }
.upgrade-preview-row i { font-style: normal; font-size: 6.5px; justify-self: end; padding: 1px 3px; border-radius: 2px; white-space: nowrap; }
.upgrade-preview-row i.up { color: #9fe3bf; background: rgba(80, 180, 136, 0.1); }
.upgrade-preview-row i.down { color: #e0a074; background: rgba(210, 117, 75, 0.1); }

/* Rig upgrade preview */
.rig-upgrade-preview {
  margin: 7px 0 1px;
  padding: 6px 7px;
  border: 1px solid rgba(105, 201, 187, 0.12);
  border-radius: 3px;
  background: rgba(7, 21, 24, 0.36);
}

.rig-upgrade-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
  font-family: var(--mono);
  font-size: 6.5px;
  color: #8aaba3;
}
.rig-upgrade-head strong { color: #e2c27a; font-weight: 500; }
.rig-upgrade-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 3px;
  border-top: 1px solid rgba(92, 156, 147, 0.1);
  font-family: var(--mono);
  font-size: 6.5px;
  color: #7e9e97;
}
.rig-upgrade-row span { min-width: 40px; color: #90aea6; }
.rig-upgrade-row b { color: #bdd5cf; font-weight: 400; }
.rig-upgrade-row em { color: #dfc183; font-style: normal; }
.rig-upgrade-row i { margin-left: auto; font-style: normal; color: #a8efc9; font-size: 6px; white-space: nowrap; }
.rig-upgrade-row i.down { color: #e1a77a; }

/* Daily assignments -------------------------------------------------------- */

.daily-panel {
  border-color: rgba(110, 201, 189, 0.15);
  background:
    radial-gradient(circle at 100% 0%, rgba(75, 193, 182, 0.07), transparent 38%),
    linear-gradient(160deg, rgba(12, 27, 29, 0.98), rgba(8, 18, 21, 0.98));
}

.daily-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(103, 191, 179, 0.1);
  border-radius: 3px;
  background: rgba(8, 25, 27, 0.38);
  font-family: var(--mono);
  font-size: 6px;
  color: #779b95;
  letter-spacing: 0.02em;
}

.daily-intro b { color: #b6e3d8; font-weight: 500; }
.daily-intro strong { font-size: 8px; color: #c8f1e8; font-weight: 500; letter-spacing: 0.06em; }
.daily-intro i { font-style: normal; color: #9be3d6; }

.daily-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-bottom: 7px;
  padding: 5px 8px;
  border-left: 2px solid rgba(242, 182, 68, 0.38);
  border-radius: 2px;
  background: rgba(242, 182, 68, 0.035);
  color: #7b8f89;
  font-family: var(--mono);
  font-size: 6px;
  letter-spacing: 0.03em;
}
.daily-scale b { color: #e4c982; font-weight: 600; }

.ranking-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.ranking-summary-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(103, 191, 179, 0.14);
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(23, 62, 63, 0.55), rgba(7, 20, 23, 0.5));
}
.ranking-summary-card > span { font-family: var(--mono); font-size: 6.5px; color: #6f958d; letter-spacing: 0.08em; }
.ranking-summary-card > strong { font-size: 18px; color: #e7f3ee; font-weight: 500; }
.ranking-summary-card > strong small { font-size: 8px; color: #8fb8ad; }
.ranking-summary-card > small { font-family: var(--mono); font-size: 6px; color: #56756e; }
.ranking-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.ranking-list { display: grid; gap: 4px; }
.ranking-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(103, 191, 179, 0.1);
  border-radius: 3px;
  background: rgba(7, 20, 23, 0.42);
}
.ranking-row.is-me { border-color: rgba(242, 182, 68, 0.4); background: rgba(242, 182, 68, 0.05); }
.ranking-rank { font-family: var(--mono); font-size: 9px; color: #6f968e; text-align: center; }
.ranking-rank.is-top1 { color: #f4d37e; }
.ranking-rank.is-top2 { color: #cbd9d4; }
.ranking-rank.is-top3 { color: #c49a66; }
.ranking-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: #c8e4dc; }
.ranking-name em { margin-left: 6px; padding: 1px 4px; border-radius: 2px; background: rgba(242, 182, 68, 0.14); color: #e9c985; font-style: normal; font-size: 6px; }
.ranking-value { font-family: var(--mono); color: #9fe0d2; font-size: 10px; font-weight: 500; white-space: nowrap; }
.ranking-row > small { font-family: var(--mono); color: #5d7f78; font-size: 6px; white-space: nowrap; }
@media (max-width: 680px) {
  .ranking-summary { grid-template-columns: 1fr; }
  .ranking-row { grid-template-columns: 25px minmax(0, 1fr) auto; }
  .ranking-row > small { display: none; }
}

.daily-list { display: grid; gap: 5px; }

.daily-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  padding: 7px 7px 6px;
  border: 1px solid rgba(93, 166, 158, 0.11);
  border-radius: 4px;
  background: rgba(7, 20, 23, 0.46);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.daily-row.is-complete {
  border-color: rgba(242, 182, 68, 0.25);
  background:
    linear-gradient(90deg, rgba(242, 182, 68, 0.045), transparent 60%),
    rgba(10, 24, 25, 0.56);
}

.daily-row.is-claimed { opacity: 0.62; }
.daily-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(109, 206, 192, 0.16);
  border-radius: 3px;
  background: rgba(62, 158, 146, 0.08);
  color: #8ad9ca;
}

.daily-icon svg { width: 14px; height: 14px; }
.daily-row.is-complete .daily-icon { color: #f2c269; border-color: rgba(242, 182, 68, 0.22); background: rgba(242, 182, 68, 0.06); }
.daily-main { min-width: 0; }
.daily-title-row { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.daily-title-row strong { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8.5px; color: #c5e8e1; }
.daily-reward { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: auto; font-family: var(--mono); font-size: 5.5px; color: #a58b5d; }
.daily-description { margin: 2px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 6.5px; color: #678a84; }

.daily-progress-row { display: flex; align-items: center; gap: 6px; }
.daily-bar {
  flex: 1;
  height: 3px;
  overflow: hidden;
  border-radius: 1px;
  background: rgba(59, 98, 92, 0.34);
}

.daily-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4e9b91, #9be3d5);
  transition: width 0.35s ease;
}

.daily-row.is-complete .daily-bar i { background: linear-gradient(90deg, #c88e40, #f7d27e); }
.daily-progress-row > span { flex: 0 0 auto; font-family: var(--mono); font-size: 5.5px; color: #749891; }
.daily-action { min-width: 48px; padding-top: 2px; }

.daily-claim {
  min-height: 24px;
  padding: 3px 5px !important;
  font-size: 6.5px !important;
  white-space: nowrap;
}

.daily-claim:disabled {
  border-color: rgba(103, 163, 154, 0.1);
  color: #536d68;
  background: rgba(8, 18, 19, 0.35);
  opacity: 0.8;
}

.daily-claimed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 22px;
  padding: 2px 4px;
  color: #82bdb1;
  font-family: var(--mono);
  font-size: 5.8px;
  white-space: nowrap;
}

.daily-claimed svg { width: 8px; height: 8px; }
.daily-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 5.8px;
  color: #5e807a;
}

.daily-foot svg { width: 9px; height: 9px; }
.daily-foot b { color: #9fc9c0; font-weight: 500; letter-spacing: 0.04em; }

@media (max-width: 680px) {
  .daily-row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; padding: 6px; }
  .daily-icon { width: 24px; height: 24px; }
  .daily-description { white-space: normal; line-height: 1.4; }
  .daily-reward { display: none; }
  .daily-action { min-width: 43px; }
  .daily-claim { font-size: 6px !important; }
}

/* Deep resonance research modal ------------------------------------------- */

.research-intro {
  display: flex;
  gap: 17px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(122, 236, 219, 0.18);
  border-radius: 5px;
  background:
    radial-gradient(circle at 14% 50%, rgba(84, 230, 211, 0.1), transparent 35%),
    linear-gradient(120deg, rgba(9, 29, 33, 0.96), rgba(14, 21, 22, 0.96));
}

.research-intro-art {
  flex: 0 0 88px;
  width: 88px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(128, 255, 237, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(90, 231, 211, 0.14), rgba(5, 19, 23, 0.6) 68%);
  box-shadow: inset 0 0 26px rgba(111, 241, 220, 0.08);
}

.research-intro-art svg { width: 70px; height: 58px; filter: drop-shadow(0 0 12px rgba(139, 255, 235, 0.3)); }
.research-intro-copy { min-width: 0; }
.research-intro-copy strong { display: block; margin-bottom: 5px; font-size: 13px; color: #d2fff8; }
.research-intro-copy p { max-width: 540px; font-size: 9px; line-height: 1.8; color: #789f9a; }

.research-wallet {
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 98px;
  padding: 9px 11px;
  border: 1px solid rgba(148, 255, 238, 0.18);
  border-radius: 4px;
  background: rgba(5, 20, 22, 0.55);
  text-align: right;
}

.research-wallet span { display: block; font-family: var(--mono); font-size: 6px; color: #688f8a; letter-spacing: 0.08em; }
.research-wallet b { display: block; margin: 2px 0 1px; font-family: var(--mono); font-size: 21px; font-weight: 400; color: #aaffef; }
.research-wallet small { display: block; font-size: 6px; color: #5a7c77; white-space: nowrap; }

.research-grid { display: grid; gap: 8px; margin-top: 13px; }

.research-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 10px 11px;
  border: 1px solid rgba(96, 171, 163, 0.14);
  border-radius: 4px;
  background: rgba(8, 18, 21, 0.48);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.research-card:hover { border-color: rgba(119, 224, 210, 0.26); background: rgba(10, 24, 27, 0.66); }
.research-card.is-maxed { opacity: 0.68; }
.research-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid color-mix(in srgb, var(--research-color) 28%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--research-color) 7%, transparent);
  color: var(--research-color);
}

.research-card-icon svg { width: 19px; height: 19px; }
.research-card-copy { min-width: 0; }
.research-card-copy strong { display: flex; align-items: center; gap: 6px; font-size: 10px; color: #c5ece5; }
.research-card-copy strong span { font-family: var(--mono); font-size: 6px; color: #678c86; font-weight: 400; }
.research-card-copy p { margin: 3px 0 6px; font-size: 8px; line-height: 1.55; color: #708f8b; }
.research-pips { display: flex; align-items: center; gap: 4px; }

.research-pips i {
  width: 20px;
  height: 3px;
  border-radius: 1px;
  background: rgba(100, 183, 170, 0.16);
}

.research-pips i.is-on { background: linear-gradient(90deg, #68c8b9, #bffcf1); box-shadow: 0 0 5px rgba(118, 236, 219, 0.32); }
.research-pips em { margin-left: 5px; font-family: var(--mono); font-size: 6.2px; font-style: normal; color: #6f9b94; }
.research-max { font-family: var(--mono); font-size: 6.5px; color: #a7d9cf; padding: 5px 8px; border: 1px solid rgba(126, 222, 208, 0.16); border-radius: 3px; white-space: nowrap; }

.research-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 13px;
  padding: 10px 12px;
  border-left: 2px solid rgba(134, 240, 224, 0.3);
  background: rgba(10, 28, 30, 0.4);
  font-size: 8px;
  line-height: 1.7;
  color: #6e9690;
}

.research-note .inline-note-icon svg { width: 13px; height: 13px; color: #8cd8ca; }

@media (max-width: 1180px) {
  .hud-pulse-chip { padding: 0 8px; }
  .hud-pulse-chip small { display: none; }
}

@media (max-width: 1020px) {
  .hud-pulse-chip { display: none; }
  .mine-planet { display: none; }
  .pulse-live-badge { top: 48px; right: 9px; padding: 6px 8px; }
  .pulse-live-copy small { display: none; }
}

@media (max-width: 680px) {
  .research-intro { flex-wrap: wrap; gap: 11px; padding: 12px; }
  .research-intro-art { flex-basis: 58px; width: 58px; height: 58px; }
  .research-intro-art svg { width: 50px; height: 42px; }
  .research-intro-copy { flex: 1; min-width: 160px; }
  .research-intro-copy strong { font-size: 11px; }
  .research-wallet { width: 100%; display: flex; align-items: center; gap: 8px; text-align: left; }
  .research-wallet b { margin: 0; font-size: 17px; }
  .research-wallet small { margin-left: auto; }
  .research-card { grid-template-columns: 36px minmax(0, 1fr); }
  .research-card-icon { width: 36px; height: 36px; }
  .research-card > .btn, .research-max { grid-column: 1 / -1; justify-self: stretch; text-align: center; justify-content: center; }
  .pulse-live-badge { top: 46px; right: 8px; padding: 4px 6px; gap: 5px; }
  .pulse-live-icon { width: 19px; height: 19px; }
  .pulse-live-icon svg { width: 10px; height: 10px; }
  .pulse-live-copy strong { font-size: 7px; }
  .pulse-live-copy small { display: none; }
  .pulse-live-badge b { font-size: 9px; margin-left: 2px; }
}

/* --------------------------------------------------------------------------
   Grey land / silicon industry
   -------------------------------------------------------------------------- */

.mine-site-switch {
  display: flex;
  gap: 8px;
  margin-bottom: 11px;
}

.mine-site-btn {
  position: relative;
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(117, 178, 171, 0.12);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(15, 32, 34, 0.72), rgba(7, 15, 17, 0.7));
  color: #829c96;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.mine-site-btn:hover { border-color: rgba(130, 213, 198, 0.3); transform: translateY(-1px); }
.mine-site-btn.is-active {
  border-color: rgba(242, 182, 68, 0.34);
  background:
    radial-gradient(circle at 8% 20%, rgba(242, 182, 68, 0.11), transparent 40%),
    linear-gradient(180deg, rgba(35, 36, 27, 0.86), rgba(12, 19, 19, 0.72));
  box-shadow: inset 0 0 20px rgba(242, 182, 68, 0.04);
}

.mine-site-btn.is-locked {
  border-style: dashed;
  color: #6b7b77;
  background: rgba(9, 16, 18, 0.5);
}

.mine-site-btn.is-overdue { border-color: rgba(224, 113, 79, 0.4); }
.mine-site-icon {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(127, 193, 183, 0.15);
  border-radius: 5px;
  background: rgba(10, 24, 25, 0.55);
  color: #8ec9bd;
}
.mine-site-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.mine-site-btn.is-active .mine-site-icon { color: #f2c76f; border-color: rgba(242, 182, 68, 0.24); }
.mine-site-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mine-site-copy strong { overflow: hidden; color: #cfddd8; font-size: 9px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.mine-site-copy small { overflow: hidden; color: #6d827d; font-family: var(--mono); font-size: 6px; text-overflow: ellipsis; white-space: nowrap; }
.mine-site-btn.is-active .mine-site-copy strong { color: #f1d48a; }
.mine-site-btn.is-active .mine-site-copy small { color: #a89362; }
.mine-site-dot { width: 5px; height: 5px; margin-left: auto; border-radius: 50%; background: #83d9c9; box-shadow: 0 0 7px rgba(131, 217, 201, 0.6); }
.mine-site-btn.is-overdue .mine-site-dot { background: #e0714f; box-shadow: 0 0 7px rgba(224, 113, 79, 0.55); }
.mine-site-lock { display: grid; place-items: center; width: 18px; height: 18px; margin-left: auto; color: #81745a; }
.mine-site-lock svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.6; }

/* Grey site palette */
.mine-stage.is-silicon {
  border-color: rgba(144, 177, 176, 0.2);
  background: #13191a;
}
.mine-stage.is-silicon .mine-topbar {
  background: linear-gradient(90deg, rgba(20, 31, 32, 0.94), rgba(28, 42, 42, 0.72));
}
.mine-stage.is-silicon .mine-field-wrap {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(174, 191, 194, 0.055), transparent 54%),
    linear-gradient(180deg, #101617, #0b0f10 75%);
}
.mine-stage.is-silicon .mine-field-wrap::before,
.mine-stage.is-silicon .mine-field-wrap::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.55), transparent),
    repeating-linear-gradient(180deg, #303a3b 0 22px, #252e2f 22px 26px);
}
.mine-stage.is-silicon .mine-plot {
  border-color: rgba(169, 190, 190, 0.2);
  background: #252d2e;
}
.mine-stage.is-silicon .mine-plot-ground {
  filter: grayscale(0.86) saturate(0.34) brightness(0.72) contrast(1.1);
}
.mine-stage.is-silicon .mine-plot-ambient {
  background:
    radial-gradient(circle at 48% 42%, rgba(196, 213, 211, 0.06), transparent 56%),
    linear-gradient(135deg, rgba(15, 24, 25, 0.26), transparent 48%);
}
.mine-stage.is-silicon .mine-surface { filter: grayscale(0.78) brightness(0.8) contrast(1.04); }
.mine-stage.is-silicon .mine-sun { background: #dfe8e4; box-shadow: 0 0 52px rgba(208, 226, 220, 0.32); }
.mine-stage.is-silicon .mine-planet { filter: grayscale(0.78) brightness(0.82); }
.mine-stage.is-silicon .mine-surface-label { color: #a4b6b0; border-color: rgba(172, 196, 188, 0.2); }
.mine-stage.is-silicon .mine-seam { color: #a5c4bc; border-color: rgba(143, 190, 181, 0.2); }
.mine-stage.is-silicon .mine-seam i { background: #9dbdb5; box-shadow: 0 0 6px rgba(157, 189, 181, 0.45); }
.mine-stage.is-silicon .mine-depth-scale { color: #778c86; }
.mine-stage.is-silicon .mine-plot-hud { border-color: rgba(170, 196, 188, 0.18); background: rgba(9, 17, 18, 0.66); }
.mine-stage.is-silicon .mine-plot-cool { background: linear-gradient(135deg, transparent 50%, rgba(200, 218, 213, 0.05) 50%); }
.mine-stage.is-silicon .mine-scar { filter: grayscale(0.8) brightness(0.72); }
.mine-stage.is-silicon .pulse-field-wash { display: none; }
.mine-stage.is-silicon .rig-bay-label { color: #9eb8b0; }
.mine-stage.is-silicon .tool-banner {
  border-color: rgba(150, 194, 190, 0.14);
  background: linear-gradient(90deg, rgba(26, 42, 43, 0.68), rgba(10, 18, 19, 0.3));
}

.silicon-site-badge {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  top: 76px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(158, 199, 194, 0.2);
  border-radius: 4px;
  background: rgba(9, 20, 21, 0.86);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  color: #a6c9c1;
}
.silicon-site-badge > span { display: grid; place-items: center; width: 17px; height: 17px; color: #d9b76f; }
.silicon-site-badge svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.silicon-site-badge div { display: flex; flex-direction: column; gap: 2px; }
.silicon-site-badge strong { font-family: var(--mono); font-size: 6.5px; font-weight: 500; letter-spacing: 0.04em; }
.silicon-site-badge small { color: #79948d; font-family: var(--mono); font-size: 5.5px; }

/* Silicon industry rail panel */
.silicon-panel .panel-head { border-bottom-color: rgba(159, 191, 187, 0.1); }
.silicon-panel .panel-head h3 svg { color: #c7b273; }
.silicon-stock-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.silicon-stock {
  padding: 7px 5px 6px;
  border: 1px solid rgba(133, 180, 175, 0.12);
  border-radius: 4px;
  background: rgba(7, 19, 21, 0.45);
  text-align: center;
}
.silicon-stock span { display: block; color: #7b9c94; font-family: var(--mono); font-size: 6px; }
.silicon-stock strong { display: block; margin: 2px 0; color: #c8e0d9; font-family: var(--mono); font-size: 15px; font-weight: 500; }
.silicon-stock small { color: #536d68; font-family: var(--mono); font-size: 5px; letter-spacing: 0.08em; }
.silicon-stock.is-cpu { border-color: rgba(226, 195, 123, 0.2); background: rgba(47, 37, 20, 0.32); }
.silicon-stock.is-cpu strong { color: #f0cf83; }
.silicon-ticker {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 8px;
  padding: 6px 7px;
  border-left: 2px solid rgba(105, 216, 200, 0.35);
  background: rgba(7, 21, 23, 0.4);
  font-family: var(--mono);
}
.silicon-ticker span { color: #72958e; font-size: 6px; }
.silicon-ticker strong { color: #f0d28b; font-size: 11px; font-weight: 500; }
.silicon-ticker em { margin-left: auto; color: #79b39e; font-size: 5.5px; font-style: normal; }
.silicon-upkeep {
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(112, 178, 169, 0.13);
  border-radius: 4px;
  background: rgba(8, 23, 24, 0.36);
}
.silicon-upkeep.is-overdue { border-color: rgba(220, 112, 79, 0.36); background: rgba(52, 22, 19, 0.34); }
.silicon-upkeep-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; font-family: var(--mono); font-size: 6.5px; color: #86a49d; }
.silicon-upkeep-head strong { color: #e4c481; font-size: 8px; font-weight: 500; }
.silicon-upkeep-track { height: 3px; margin-top: 5px; border-radius: 2px; background: rgba(126, 174, 166, 0.12); overflow: hidden; }
.silicon-upkeep-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5fb7a9, #d7bb6e); transition: width 0.3s linear; }
.silicon-upkeep.is-overdue .silicon-upkeep-track i { background: #e0714f; }
.silicon-upkeep-foot { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.silicon-upkeep-foot > span { color: #69847e; font-family: var(--mono); font-size: 5.5px; }
.silicon-upkeep-foot .btn { margin-left: auto; }
.silicon-upkeep-foot .btn[hidden] { display: none; }
.silicon-research {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid rgba(205, 177, 105, 0.16);
  border-radius: 4px;
  background:
    radial-gradient(circle at 90% 0%, rgba(242, 182, 68, 0.08), transparent 50%),
    rgba(30, 26, 18, 0.3);
}
.silicon-research-head { display: flex; justify-content: space-between; gap: 7px; color: #a88e5a; font-family: var(--mono); font-size: 6.5px; }
.silicon-research-head strong { color: #e7c97e; font-weight: 500; }
.silicon-research p { margin: 5px 0; color: #978e78; font-size: 7.5px; line-height: 1.55; }
.silicon-research-cost { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; font-family: var(--mono); color: #81765e; font-size: 5.5px; }
.silicon-research-cost b { color: #e3c27e; font-size: 8px; font-weight: 500; }
.silicon-research-cost em { color: #b9d3cb; font-style: normal; }
.silicon-links { display: flex; gap: 5px; margin-top: 8px; }
.silicon-links .btn { flex: 1; }
.silicon-note { margin-top: 7px; padding-top: 6px; border-top: 1px dashed rgba(133, 173, 166, 0.12); color: #627e77; font-size: 7px; line-height: 1.65; }
.silicon-note b { color: #b9d2c9; font-weight: 500; }
.mine-plot.is-blocked { filter: grayscale(0.55) brightness(0.76); cursor: not-allowed; }
.mine-plot.is-blocked .mine-aim,
.mine-plot.is-blocked .mine-plot-cool { display: none; }
.loot-float.silicon { color: #c8ece4; text-shadow: 0 0 8px rgba(110, 219, 202, 0.38); }
.loot-float.silicon i { background: #a9d8cf; box-shadow: 0 0 6px rgba(169, 216, 207, 0.5); }
.mine-impact.is-silicon { border-color: rgba(180, 215, 208, 0.5); box-shadow: 0 0 22px rgba(160, 208, 199, 0.18); }

/* Factory wear & silicon equipment */
.factory-cell .machine-wear {
  position: absolute;
  z-index: 4;
  left: 5px;
  right: 5px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: rgba(4, 13, 13, 0.7);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.factory-cell.is-worn .machine-wear,
.factory-cell.is-broken .machine-wear { opacity: 1; }
.factory-cell .machine-wear i { display: block; height: 100%; border-radius: inherit; background: #d8b35e; transition: width 0.25s linear; }
.factory-cell.is-worn .machine-wear i { background: #df9a5f; }
.factory-cell.is-broken .machine-wear i { background: #e0714f; }
.factory-cell.is-broken .machine-slot { filter: saturate(0.45) brightness(0.7); }
.factory-cell.is-broken { border-color: rgba(224, 113, 79, 0.36); }
.maintenance-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(127, 184, 175, 0.14);
  border-radius: 4px;
  background: rgba(7, 23, 24, 0.4);
}
.maintenance-card.is-warn { border-color: rgba(224, 166, 76, 0.25); }
.maintenance-card.is-danger { border-color: rgba(224, 113, 79, 0.36); background: rgba(52, 22, 19, 0.28); }
.maintenance-copy { display: flex; flex-direction: column; gap: 2px; font-family: var(--mono); }
.maintenance-copy span { color: #6f8f87; font-size: 5.5px; }
.maintenance-copy strong { color: #d3e2dc; font-size: 11px; font-weight: 500; }
.maintenance-copy small { color: #87a69e; font-size: 5.5px; }
.maintenance-card .btn { margin-left: auto; }
.build-card.is-locked { opacity: 0.62; border-style: dashed; }
.build-card.is-locked .build-art { filter: grayscale(1) brightness(0.66); }
.build-card.is-locked:hover { opacity: 0.82; }
.shop-card.is-locked { opacity: 0.68; border-style: dashed; }
.shop-card.is-locked .shop-art { filter: grayscale(1) brightness(0.65); }
.lock-note { color: #d8b16b; }
.is-danger-text { color: #e0714f !important; }

@media (max-width: 1020px) {
  .mine-site-switch { flex-direction: column; }
  .mine-site-btn { padding: 8px 10px; }
  .silicon-site-badge { top: 70px; right: 10px; }
  .factory-hotbar .build-card { flex-basis: 65px; min-width: 65px; max-width: 65px; }
}

/* Intake feed categories */
.intake-feed-panel {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid rgba(121, 176, 168, 0.14);
  border-radius: 4px;
  background: rgba(7, 21, 23, 0.34);
}

.intake-feed-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 7px;
  font-family: var(--mono);
}
.intake-feed-title span { color: #a4c4bc; font-size: 6.5px; letter-spacing: 0.05em; }
.intake-feed-title small { color: #5f7b75; font-size: 5.5px; }
.intake-feed-group {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 4px 0;
  border-top: 1px solid rgba(105, 157, 150, 0.08);
}
.intake-feed-group > b {
  flex: 0 0 38px;
  padding-top: 3px;
  color: #6c8b84;
  font-family: var(--mono);
  font-size: 5.5px;
  font-weight: 400;
}
.intake-feed-group > div { display: flex; flex-wrap: wrap; gap: 3px; }
.feed-chip {
  padding: 3px 5px;
  border: 1px solid rgba(113, 177, 169, 0.14);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
  color: #7f9d96;
  font-family: var(--mono);
  font-size: 6px;
  cursor: pointer;
}
.feed-chip:hover { color: #e2c477; border-color: rgba(242, 182, 68, 0.28); }
.feed-chip.is-active {
  color: #f0d188;
  border-color: rgba(242, 182, 68, 0.44);
  background: rgba(242, 182, 68, 0.09);
}
.feed-chip:disabled { opacity: 0.35; cursor: not-allowed; }

/* Uranium loot */
.loot-float.uranium { color: #d8ed91; text-shadow: 0 0 9px rgba(194, 237, 119, 0.45); }
.loot-float.uranium i { background: #c3df6f; box-shadow: 0 0 7px rgba(195, 223, 111, 0.55); }
.mine-impact.is-uranium { border-color: rgba(205, 239, 135, 0.55); box-shadow: 0 0 22px rgba(186, 228, 103, 0.2); }
.loot-float.coal { color: #c3cbc4; text-shadow: 0 0 8px rgba(120, 138, 132, 0.4); }
.loot-float.coal i { background: #59666a; box-shadow: 0 0 7px rgba(89, 102, 106, 0.65); }
.mine-impact.is-coal { border-color: rgba(150, 165, 153, 0.42); box-shadow: 0 0 18px rgba(89, 102, 106, 0.18); }

/* Nuclear facilities */
.factory-cell.is-pump { border-color: rgba(114, 190, 191, 0.22); }
.factory-cell.is-pump .machine-led { background: #8ce3dd; box-shadow: 0 0 7px rgba(140, 227, 221, 0.55); }
.factory-cell.is-oil-pump .machine-led { background: #d8b56b; box-shadow: 0 0 7px rgba(216, 181, 107, 0.55); }
.factory-cell.is-oil-pump { border-color: rgba(193, 157, 94, 0.25); }
.factory-cell.is-reactor {
  border-color: rgba(201, 219, 137, 0.28);
  background:
    radial-gradient(circle at 50% 70%, rgba(169, 208, 107, 0.09), transparent 60%),
    rgba(16, 31, 29, 0.72);
}
.factory-cell.is-reactor.is-running {
  box-shadow: inset 0 0 17px rgba(180, 230, 110, 0.1), 0 0 12px rgba(180, 230, 110, 0.06);
}
.factory-cell.is-server {
  border-color: rgba(159, 227, 214, 0.32);
  background:
    radial-gradient(circle at 50% 25%, rgba(111, 218, 202, 0.1), transparent 62%),
    rgba(12, 27, 29, 0.78);
}
.factory-cell.is-server.is-running {
  box-shadow: inset 0 0 18px rgba(117, 228, 210, 0.1), 0 0 12px rgba(117, 228, 210, 0.08);
}
.factory-cell .server-output {
  position: absolute;
  z-index: 4;
  right: 4px;
  bottom: 2px;
  padding: 1px 3px;
  border-radius: 2px;
  background: rgba(8, 21, 23, 0.72);
  color: #96e6d8;
  font-family: var(--mono);
  font-size: 5px;
  letter-spacing: 0.03em;
}
.factory-cell .server-output:empty { display: none; }
.factory-cell .reactor-buffers {
  position: absolute;
  z-index: 4;
  left: 5px;
  right: 5px;
  bottom: 6px;
  display: flex;
  gap: 2px;
}
.factory-cell .reactor-buffers i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #6d7d65;
}
.factory-cell .reactor-buffers i.fuel { flex: 1; background: #d6eb8a; }
.factory-cell .reactor-buffers i.water { flex: 1; background: #7bc9dc; }
.factory-cell .reactor-output {
  position: absolute;
  z-index: 4;
  right: 4px;
  bottom: 2px;
  color: #a7bf86;
  font-family: var(--mono);
  font-size: 5px;
}
.reactor-source .src-icon { color: #d7eb91; }

/* Permanent skill tree */
.skills-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 16px;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid rgba(130, 184, 174, 0.14);
  border-radius: 5px;
  background:
    radial-gradient(ellipse at 0 0, rgba(228, 184, 97, 0.08), transparent 55%),
    linear-gradient(135deg, rgba(11, 31, 31, 0.78), rgba(7, 20, 23, 0.74));
  position: relative;
  overflow: hidden;
}
.skills-summary::after {
  content: "R&D";
  position: absolute;
  right: 18px;
  bottom: -14px;
  font-family: var(--display, var(--mono));
  font-size: 76px;
  letter-spacing: 0.1em;
  color: rgba(218, 236, 218, 0.035);
  pointer-events: none;
}
.skills-summary-main { position: relative; z-index: 1; }
.skills-summary-main .eyebrow { color: #8baaa0; font-family: var(--mono); font-size: 7px; letter-spacing: 0.12em; }
.skills-summary-main > strong {
  display: block;
  margin: 8px 0 4px;
  color: #f0d38a;
  font-family: var(--display, var(--mono));
  font-size: 38px;
  line-height: 1;
}
.skills-summary-main > strong small { color: #6e8a81; font-size: 11px; font-weight: 400; }
.skills-summary-main p { margin: 8px 0 0; max-width: 560px; color: #9db6ad; font-size: 9px; line-height: 1.7; }
.skills-summary-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.skills-summary-stats > div {
  padding: 8px 9px;
  border: 1px solid rgba(126, 177, 166, 0.1);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
}
.skills-summary-stats span { display: block; color: #6e8d84; font-family: var(--mono); font-size: 6px; }
.skills-summary-stats strong { display: block; margin-top: 4px; color: #d0e3d7; font-size: 14px; font-weight: 500; }
.skills-summary-stats small { color: #718b82; font-size: 7px; }

.skill-tree { display: grid; gap: 13px; }
.skill-branch {
  border: 1px solid color-mix(in srgb, var(--branch-color) 22%, transparent);
  border-radius: 5px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--branch-color) 6%, transparent), transparent 50%),
    rgba(7, 20, 22, 0.55);
  overflow: hidden;
}
.skill-branch-head {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(125, 174, 162, 0.1);
  background: rgba(255, 255, 255, 0.012);
}
.skill-branch-icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--branch-color) 38%, transparent);
  border-radius: 4px;
  color: var(--branch-color);
  background: color-mix(in srgb, var(--branch-color) 8%, transparent);
}
.skill-branch-icon svg { width: 17px; height: 17px; }
.skill-branch-sub { color: color-mix(in srgb, var(--branch-color) 72%, #748e84); font-family: var(--mono); font-size: 6px; letter-spacing: 0.12em; }
.skill-branch-head h3 { margin: 2px 0 3px; color: #d9e8dc; font-size: 15px; font-weight: 500; }
.skill-branch-head p { margin: 0; color: #78968d; font-size: 8px; line-height: 1.5; }
.skill-branch-levels {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--branch-color);
  font-family: var(--mono);
  font-size: 7px;
  border: 1px solid color-mix(in srgb, var(--branch-color) 28%, transparent);
  border-radius: 2px;
  padding: 3px 6px;
}
.skill-branch-line { padding: 12px 14px 14px; display: grid; gap: 11px; position: relative; }
.skill-branch-line::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 22px;
  left: 31px;
  width: 1px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--branch-color) 28%, transparent), transparent);
  pointer-events: none;
}
.skill-node {
  position: relative;
  z-index: 1;
  padding: 11px 12px 10px;
  border: 1px solid rgba(122, 169, 158, 0.12);
  border-left: 2px solid color-mix(in srgb, var(--branch-color) 45%, transparent);
  border-radius: 4px;
  background: rgba(9, 25, 26, 0.7);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.skill-node:hover { border-color: color-mix(in srgb, var(--branch-color) 36%, transparent); background: rgba(13, 33, 33, 0.8); }
.skill-node.is-locked { opacity: 0.55; }
.skill-node.is-locked:hover { opacity: 0.72; }
.skill-node.is-maxed { border-color: color-mix(in srgb, var(--branch-color) 32%, transparent); }
.skill-node-top { display: flex; gap: 9px; align-items: flex-start; }
.skill-node-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--branch-color) 28%, transparent);
  border-radius: 3px;
  color: var(--branch-color);
  background: color-mix(in srgb, var(--branch-color) 7%, transparent);
}
.skill-node-icon svg { width: 15px; height: 15px; }
.skill-node-kicker { color: #68877e; font-family: var(--mono); font-size: 5.5px; letter-spacing: 0.08em; }
.skill-node h4 { margin: 2px 0 0; color: #d5e6dc; font-size: 12px; font-weight: 500; }
.skill-node-level { float: right; color: var(--branch-color); font-family: var(--mono); font-size: 8px; font-weight: 400; }
.skill-node-level small { color: #67837a; font-size: 6px; }
.skill-node-desc { margin: 8px 0 7px; color: #7f9d93; font-size: 8px; line-height: 1.55; }
.skill-levels { display: flex; gap: 3px; margin-bottom: 8px; }
.skill-levels i { display: block; height: 3px; flex: 1; border-radius: 2px; background: rgba(125, 166, 154, 0.15); }
.skill-levels i.is-on { background: var(--branch-color); box-shadow: 0 0 5px color-mix(in srgb, var(--branch-color) 45%, transparent); }
.skill-node-effect {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 7px;
  align-items: baseline;
  padding: 7px 8px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid rgba(120, 166, 154, 0.07);
}
.skill-node-effect span { color: #658279; font-family: var(--mono); font-size: 5.5px; }
.skill-node-effect strong { color: #cfe3d2; font-size: 8px; font-weight: 500; }
.skill-node-effect small { grid-column: 2; color: #718d83; font-size: 6.5px; }
.skill-node-req { margin-top: 6px; color: #7b968c; font-family: var(--mono); font-size: 5.5px; }
.skill-node-req.is-met { color: #93b49b; }
.skill-node-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.skill-node-cost { flex: 1; color: #e0c47d; font-family: var(--mono); font-size: 9px; }
.skill-node-foot .btn { min-height: 24px; padding: 4px 8px; font-size: 7px; }
.skill-tree-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(124, 171, 160, 0.1);
  border-radius: 3px;
  color: #749089;
  font-size: 7.5px;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.012);
}
.skill-tree-note span { display: flex; align-items: flex-start; gap: 5px; }
.skill-tree-note svg { width: 12px; height: 12px; flex: 0 0 auto; color: #a8c4b5; }

@media (max-width: 900px) {
  .skills-summary { grid-template-columns: 1fr; padding: 13px; }
  .skills-summary-main > strong { font-size: 30px; }
  .skills-summary-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-branch-head { padding: 10px; }
  .skill-branch-head p { display: none; }
  .skill-branch-line { padding: 10px; }
  .skill-branch-line::before { left: 25px; }
  .skill-node { padding: 9px; }
  .skill-node-desc { font-size: 7.5px; }
}
@media (max-width: 520px) {
  .skill-tree-note { display: block; }
  .skill-tree-note span + span { margin-top: 5px; }
  .skill-branch-levels { display: none; }
}

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

[hidden] { display: none !important; }

/* Authoritative-server connection banner */
.net-banner {
  position: fixed;
  left: 50%;
  top: max(10px, env(safe-area-inset-top));
  z-index: 22000;
  transform: translateX(-50%);
  max-width: min(92vw, 720px);
  padding: 9px 18px;
  border: 1px solid rgba(244, 182, 66, 0.45);
  border-radius: 999px;
  background: rgba(10, 13, 17, 0.94);
  color: #f4b642;
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  text-align: center;
  pointer-events: none;
}
.net-banner[data-tone="error"] {
  border-color: rgba(255, 92, 92, 0.55);
  color: #ff8b8b;
}
.net-banner[data-tone="warning"] {
  border-color: rgba(244, 182, 66, 0.55);
  color: #ffd27a;
}

/* ==========================================================================
   Feedback
   ========================================================================== */
.feedback-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.feedback-form label { display: grid; gap: 6px; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.08em; }
.feedback-form label.wide { grid-column: 1 / -1; }
.feedback-form input, .feedback-form select, .feedback-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(6, 11, 14, 0.72);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  outline: none;
}
.feedback-form textarea { resize: vertical; min-height: 120px; line-height: 1.65; }
.feedback-form input:focus, .feedback-form select:focus, .feedback-form textarea:focus {
  border-color: rgba(242, 182, 68, 0.65);
  box-shadow: 0 0 0 3px rgba(242, 182, 68, 0.1);
}
.feedback-note { color: var(--ink-faint); font-family: var(--mono); font-size: 8px; line-height: 1.7; }
.feedback-error { padding: 8px 10px; border: 1px solid rgba(255, 92, 92, 0.35); border-radius: 6px; color: #ff9b9b; background: rgba(255, 92, 92, 0.06); font-size: 10px; }
.feedback-error[hidden] { display: none; }
@media (max-width: 640px) {
  .feedback-form { grid-template-columns: 1fr; }
  .feedback-form label.wide { grid-column: auto; }
}

/* ==========================================================================
   Mailbox
   ========================================================================== */
.mail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 14px; align-items: start; }
.mail-panel { overflow: hidden; min-width: 0; }
.mail-list { display: grid; gap: 10px; padding: 16px; }
.mail-feedback-panel { min-width: 0; }
.mail-feedback-form { grid-template-columns: 1fr; }
.mail-feedback-form textarea { min-height: 132px; }
.mail-feedback-form button { width: 100%; justify-content: center; }
@media (max-width: 1100px) {
  .mail-layout { grid-template-columns: 1fr; }
}
.mail-item {
  position: relative;
  padding: 15px 16px 13px;
  border: 1px solid rgba(142, 170, 180, 0.14);
  border-radius: 10px;
  background: rgba(10, 16, 20, 0.55);
}
.mail-item.is-unread {
  border-color: rgba(244, 182, 66, 0.35);
  background: linear-gradient(135deg, rgba(244, 182, 66, 0.07), rgba(10, 16, 20, 0.55) 45%);
}
.mail-item.is-unread::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 2px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(244, 182, 66, 0.45);
}
.mail-item-head { display: flex; align-items: center; gap: 8px; }
.mail-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-faint); }
.mail-item.is-unread .mail-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.mail-item-head h4 { flex: 1; margin: 0; font-size: 12px; letter-spacing: 0.01em; }
.mail-item-head time { color: var(--ink-faint); font-family: var(--mono); font-size: 8px; }
.mail-body {
  margin: 9px 0 12px;
  color: var(--ink-soft, #aebac2);
  font-size: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.mail-item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mail-attachment { color: var(--ink-faint); font-family: var(--mono); font-size: 8px; display: inline-flex; align-items: center; gap: 4px; }
.mail-attachment.has-currency { color: var(--gold); }
.mail-item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mail-item-actions .mail-delete { color: var(--ink-faint); }
.mail-item-actions .mail-delete:hover { color: var(--red); border-color: rgba(255, 92, 92, 0.4); }
.mail-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 54px 20px;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 10px;
  text-align: center;
}
.mail-empty strong { color: var(--ink); font-size: 13px; }
.mail-empty.is-error { color: var(--red); }
.mail-footnote { margin: 0; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; line-height: 1.7; }
.nav-badge.is-mail { background: rgba(124, 199, 255, 0.14); color: var(--blue, #7cc7ff); }

/* ==========================================================================
   Zone select
   ========================================================================== */
.zone-screen {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 34px 22px 60px;
  background:
    radial-gradient(900px 520px at 14% 0%, rgba(244, 182, 66, 0.1), transparent 62%),
    radial-gradient(800px 600px at 94% 18%, rgba(56, 130, 132, 0.16), transparent 64%),
    #06090c;
}
.zone-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(142, 170, 180, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 170, 180, 0.05) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 34%, #000 0%, transparent 74%);
  pointer-events: none;
}
.zone-glow {
  position: absolute;
  width: 460px;
  height: 460px;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(244, 182, 66, 0.09), transparent 66%);
  filter: blur(22px);
  pointer-events: none;
}
.zone-shell { position: relative; width: min(1080px, 100%); }
.zone-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 52px;
}
.zone-brand { display: flex; align-items: center; gap: 12px; color: var(--gold); }
.zone-brand .brand-mark { width: 36px; height: 36px; margin: 0; }
.zone-brand .brand-mark svg { width: 100%; height: 100%; }
.zone-brand strong { display: block; color: var(--ink); font-size: 16px; letter-spacing: 0.02em; }
.zone-brand span { display: block; margin-top: 3px; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.16em; }
.zone-userbox { display: flex; align-items: center; gap: 14px; color: var(--ink-faint); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; }
.zone-userbox strong { color: var(--gold); font-weight: 500; }
.zone-logout {
  border: 1px solid var(--line, rgba(140, 160, 170, 0.25));
  border-radius: 7px;
  padding: 7px 11px;
  background: transparent;
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 9px;
}
.zone-logout:hover { border-color: var(--gold); color: var(--gold); }
.zone-copy { max-width: 760px; margin-bottom: 30px; }
.zone-copy .eyebrow { margin-bottom: 14px; }
.zone-copy h1 { margin: 0 0 14px; color: var(--ink); font-size: clamp(34px, 5vw, 62px); line-height: 0.98; letter-spacing: -0.055em; }
.zone-copy p { margin: 0; max-width: 680px; color: var(--ink-soft, #aebac2); font-size: 12px; line-height: 1.8; }
.zone-summary { margin-top: 12px; color: var(--gold); font-family: var(--mono); font-size: 9px; letter-spacing: 0.08em; }
.zone-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.zone-card {
  position: relative;
  overflow: hidden;
  display: block;
  width: 100%;
  padding: 20px 20px 17px;
  border: 1px solid rgba(142, 170, 180, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 48%),
    rgba(13, 20, 25, 0.9);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.zone-card::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -110px;
  top: -130px;
  border-radius: 50%;
  background: rgba(244, 182, 66, 0.07);
  filter: blur(18px);
  pointer-events: none;
}
.zone-card:hover:not(:disabled) { border-color: rgba(244, 182, 66, 0.5); transform: translateY(-2px); background: rgba(20, 30, 36, 0.95); }
.zone-card.is-disabled { cursor: not-allowed; opacity: 0.62; }
.zone-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.zone-index { color: var(--ink-faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; }
.zone-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid currentColor; border-radius: 999px; font-family: var(--mono); font-size: 8px; letter-spacing: 0.1em; }
.zone-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.zone-smooth .zone-status { color: var(--green, #63d8a0); }
.zone-busy .zone-status { color: var(--yellow, #f4d06f); }
.zone-crowded .zone-status { color: #ff9f5a; }
.zone-full .zone-status, .zone-maintenance .zone-status { color: #ff7b7b; }
.zone-card h3 { margin: 0 0 6px; font-size: 21px; letter-spacing: -0.03em; }
.zone-card p { margin: 0 0 18px; min-height: 32px; color: var(--ink-faint); font-size: 10px; line-height: 1.6; }
.zone-meter { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.zone-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4bbf8d, #f4b642); transition: width 0.4s ease; }
.zone-crowded .zone-meter i { background: linear-gradient(90deg, #f4b642, #ff8350); }
.zone-full .zone-meter i { background: #ff7b7b; }
.zone-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; }
.zone-meta strong { color: var(--ink); font-size: 12px; }
.zone-action { margin-top: 15px; padding-top: 12px; border-top: 1px solid rgba(142, 170, 180, 0.1); color: var(--gold); font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; }
.zone-card.is-disabled .zone-action { color: #ff7b7b; }
.zone-empty { grid-column: 1 / -1; padding: 46px 20px; border: 1px dashed rgba(142, 170, 180, 0.2); border-radius: 14px; color: var(--ink-faint); font-family: var(--mono); font-size: 10px; text-align: center; }
.zone-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; }
@media (max-width: 760px) {
  .zone-screen { align-items: flex-start; padding: 22px 14px 42px; }
  .zone-topbar { margin-bottom: 34px; }
  .zone-userbox span { display: none; }
  .zone-list { grid-template-columns: 1fr; }
  .zone-copy h1 { font-size: 42px; }
}

/* ==========================================================================
   Auction house
   ========================================================================== */
.auction-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; align-items: start; }
.auction-board { min-width: 0; overflow: hidden; }
.auction-list { display: grid; gap: 10px; padding: 14px; max-height: 720px; overflow: auto; }
.auction-card { padding: 13px 14px; border: 1px solid rgba(142, 170, 180, 0.14); border-radius: 10px; background: rgba(8, 15, 19, 0.62); }
.auction-card.is-mine { border-color: rgba(242, 182, 68, 0.28); background: linear-gradient(135deg, rgba(242, 182, 68, 0.06), rgba(8, 15, 19, 0.62) 55%); }
.auction-card-top { display: flex; gap: 10px; align-items: center; }
.auction-card-top .market-art { flex: 0 0 48px; width: 48px; height: 42px; }
.auction-card-copy { flex: 1; min-width: 0; }
.auction-card-copy strong { display: block; font-size: 12px; }
.auction-card-copy span { display: block; margin-top: 3px; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; }
.auction-card-numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 10px; padding: 9px 10px; border-radius: 7px; background: rgba(255, 255, 255, 0.025); }
.auction-card-numbers span { display: block; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; }
.auction-card-numbers strong { display: block; margin-top: 2px; font-size: 12px; }
.auction-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.auction-card-foot .text-faint { font-family: var(--mono); font-size: 7px; }
.auction-compose { min-width: 0; }
.auction-form { display: grid; gap: 11px; }
.auction-form label { display: grid; gap: 5px; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; letter-spacing: 0.06em; }
.auction-form select, .auction-form input { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(5, 11, 14, 0.72); color: var(--ink); font-size: 11px; outline: none; }
.auction-form select:focus, .auction-form input:focus { border-color: rgba(242, 182, 68, 0.6); }
.auction-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.auction-hint { color: var(--ink-faint); font-family: var(--mono); font-size: 8px; line-height: 1.6; }
.auction-preview { padding: 9px 10px; border: 1px dashed rgba(242, 182, 68, 0.2); border-radius: 7px; color: var(--ink-faint); font-size: 9px; line-height: 1.6; }
.auction-preview strong { color: var(--ink); }
@media (max-width: 1100px) { .auction-layout { grid-template-columns: 1fr; } }

/* ==========================================================================
   Fusion age
   ========================================================================== */
.fusion-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 230px; padding: 26px 28px; }
.fusion-hero-glow { position: absolute; inset: -60% -20% auto auto; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(106, 220, 255, 0.16), transparent 65%); pointer-events: none; }
.fusion-hero.is-built { border-color: rgba(120, 235, 222, 0.28); }
.fusion-hero-copy { position: relative; z-index: 1; max-width: 760px; }
.fusion-hero-copy h3 { margin: 6px 0 9px; font-size: clamp(20px, 2.4vw, 34px); letter-spacing: -0.03em; }
.fusion-hero-copy p { margin: 0; max-width: 720px; color: var(--ink-faint); font-size: 10px; line-height: 1.8; }
.fusion-progress { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--ink-faint); font-family: var(--mono); font-size: 8px; }
.fusion-progress-bar { flex: 1; height: 7px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.fusion-progress-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #55cdc0, #f4b642); transition: width 0.5s ease; }
.fusion-hero-stats { display: flex; gap: 28px; margin-top: 18px; }
.fusion-hero-stats span { display: block; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; letter-spacing: 0.08em; }
.fusion-hero-stats strong { display: block; margin-top: 3px; color: var(--gold); font-size: 17px; }
.fusion-reactor-art { position: relative; z-index: 1; flex: 0 0 150px; width: 150px; height: 150px; display: grid; place-items: center; border: 1px solid rgba(120, 235, 222, 0.2); border-radius: 50%; color: #7fe7dc; background: radial-gradient(circle, rgba(85, 205, 192, 0.18), transparent 65%); box-shadow: 0 0 60px rgba(85, 205, 192, 0.15); }
.fusion-reactor-art svg { width: 82px; height: 82px; }
.fusion-material-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.fusion-material { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 10px; border: 1px solid rgba(142, 170, 180, 0.13); border-radius: 9px; background: rgba(8, 15, 19, 0.55); }
.fusion-material.is-done { border-color: rgba(120, 235, 222, 0.26); }
.fusion-material-art { flex: 0 0 44px; width: 44px; height: 37px; }
.fusion-material-art.small { flex-basis: 36px; width: 36px; height: 30px; }
.fusion-material-art img, .fusion-material-art svg { width: 100%; height: 100%; object-fit: contain; }
.fusion-material-copy { flex: 1; min-width: 0; }
.fusion-material-copy strong { display: block; font-size: 10px; }
.fusion-material-copy span { display: block; margin-top: 2px; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }
.fusion-material-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.fusion-recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 10px; }
.fusion-recipe { display: flex; flex-direction: column; gap: 9px; padding: 12px; border: 1px solid rgba(142, 170, 180, 0.13); border-radius: 9px; background: rgba(8, 15, 19, 0.55); }
.fusion-recipe-head { display: flex; gap: 8px; align-items: center; }
.fusion-recipe-head strong { display: block; font-size: 11px; }
.fusion-recipe-head span { display: block; margin-top: 2px; color: var(--ink-faint); font-family: var(--mono); font-size: 7px; }
.fusion-recipe p { flex: 1; margin: 0; color: var(--ink-faint); font-size: 9px; line-height: 1.65; }
.fusion-inputs { display: flex; flex-wrap: wrap; gap: 4px; }
.fusion-inputs .pill { display: inline-flex; align-items: center; gap: 3px; padding: 2px 5px; font-size: 7px; }
.fusion-inputs .pill img, .fusion-inputs .pill svg { width: 17px; height: 14px; }
@media (max-width: 760px) {
  .auction-form-row { grid-template-columns: 1fr; }
  .fusion-hero { padding: 20px; }
  .fusion-reactor-art { display: none; }
  .fusion-hero-stats { gap: 18px; }
}
