/* CrypMine — ระบบขุดคริปโตแบบเลือกพัดลม (ต้นแบบ)
   ธีม 3D โทนม่วงฟ้า: อวกาศสีครามเข้ม พื้นตารางมุมมอง 3D การ์ดกระจกที่เอียงตามเมาส์
   ปุ่มนูนกดยุบได้ และการ์ดจอวางบนแท่นเรืองแสงในมุมมอง 3D */

:root {
  color-scheme: dark;
  --bg: #0A0A0B;
  --bg-2: #120C33;
  --surface: rgba(255, 255, 255, .05);
  --surface-2: rgba(255, 255, 255, .08);
  --surface-base: rgba(10, 10, 12, .9);
  --line: rgba(255, 255, 255, .09);
  --line-soft: rgba(255, 255, 255, .06);
  --ink: #F4F4F7;
  --ink-2: #D6D6E0;
  --muted: #9E9EB2;
  --faint: #5E5E74;

  --violet: #8B5CF6;
  --violet-hi: #A78BFA;
  --violet-lo: #6D3FE6;
  --violet-deep: #3B1D8F;
  --indigo: #6366F1;
  --cyan: #22D3EE;
  --cyan-hi: #67E8F9;
  --pink: #F472B6;
  --accent: var(--violet);
  --accent-soft: rgba(139, 92, 246, .18);
  --glow: var(--cyan);
  --focus: #67E8F9;
  --grad: linear-gradient(135deg, #8B5CF6 0%, #6366F1 52%, #22D3EE 100%);
  --grad-btn: linear-gradient(180deg, #A07CFF 0%, #8B5CF6 45%, #6D3FE6 100%);
  --glass: linear-gradient(to bottom right, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));

  /* แท่นขุด */
  --chassis: #09090C;
  --chassis-2: #121218;
  --chassis-line: rgba(255, 255, 255, .09);
  --chassis-text: #9E9EB2;
  --chassis-ink: #F4F4F7;

  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, .07), 0 30px 60px -32px rgba(0, 0, 0, .95);
  --shadow-rig: inset 0 1px 0 rgba(255, 255, 255, .07), 0 9px 0 -1px #0F0F16, 0 9px 0 0 rgba(124, 58, 237, .3), 0 50px 90px -40px rgba(0, 0, 0, .95), 0 0 70px -30px rgba(0, 102, 255, .35);
  --extrude: 0 1px 0 #B9A6FF, 0 2px 0 #8F74F0, 0 3px 0 #6D4FD6, 0 4px 0 #5638B8, 0 5px 0 #43299A, 0 9px 16px rgba(20, 8, 70, .65), 0 0 34px rgba(139, 92, 246, .35);

  /* Inter ทั้งหน้า — ตัวเลขใช้แบบความกว้างเท่ากัน (tabular) เพื่อไม่ให้ค่าที่วิ่งอยู่สั่น */
  --f-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------- พื้นฐาน ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* พื้นหลังแบบ dancore.io: ดำ + ตาราง 32px + แสงฟุ้งน้ำเงิน/ม่วง/มิ้นต์ (ตรึงไว้หลังทุกหน้าจอ) */
.bgfx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bgfx i { position: absolute; display: block; }
.bgfx__grid {
  inset: 0; opacity: .6;
  background-image:
    linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px);
  background-size: 32px 32px;
}
.bgfx__glow {
  top: -300px; left: 50%; width: 1200px; height: 800px; margin-left: -600px;
  border-radius: 50%;
  background: linear-gradient(to bottom right, rgba(0, 102, 255, .3), rgba(124, 58, 237, .2), rgba(0, 255, 209, .2));
  filter: blur(120px);
  animation: pulseGlow 4s ease-in-out infinite;
  will-change: opacity;
}
.bgfx__blob { border-radius: 50%; filter: blur(80px); }
.bgfx__blob--blue { top: 20%; right: 15%; width: 400px; height: 400px; background: rgba(0, 102, 255, .2); }
.bgfx__blob--teal { bottom: 10%; left: 10%; width: 300px; height: 300px; background: rgba(0, 255, 209, .15); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
p { margin: 0; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.nw { white-space: nowrap; }
.icon { width: 1.1em; height: 1.1em; flex: none; }
.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 28px; } }

/* ---------- ปุ่มนูน 3D ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .03));
  color: var(--ink);
  font-weight: 600; font-size: 15px; line-height: 1.2;
  cursor: pointer; text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 3px 0 #060609, 0 10px 20px -12px rgba(0, 0, 0, .8);
  transition: background-color .2s, border-color .2s, color .2s, transform .12s, box-shadow .12s, filter .2s;
}
.btn:hover { border-color: var(--violet-hi); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 1px 0 #060609; }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.btn--primary {
  border-color: rgba(196, 181, 253, .55);
  background: var(--grad-btn);
  color: #FFFFFF; text-shadow: 0 1px 0 rgba(40, 10, 110, .5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -2px 0 rgba(40, 10, 110, .35), 0 4px 0 var(--violet-deep), 0 14px 26px -10px rgba(124, 58, 237, .75);
}
.btn--primary:hover { filter: brightness(1.08); }
.btn--primary:active { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 1px 0 var(--violet-deep), 0 6px 14px -8px rgba(124, 58, 237, .7); }
.btn--outline {
  border-color: rgba(167, 139, 250, .5);
  background: rgba(139, 92, 246, .1); color: #DCD3FF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 3px 0 #1E0F55, 0 10px 20px -12px rgba(0, 0, 0, .8);
}
.btn--outline:hover { background: rgba(139, 92, 246, .2); border-color: var(--violet-hi); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.btn--ghost:hover { color: var(--ink); border-color: var(--line); }
.btn--block { width: 100%; }
.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}

/* ---------- แถบบน ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(10, 10, 11, .7);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 12px 30px -22px rgba(0, 0, 0, .9);
}
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand__mark {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: var(--grad); color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -3px 0 rgba(30, 10, 90, .35), 0 4px 0 #2A1676, 0 10px 18px -6px rgba(99, 102, 241, .65);
}
.brand__mark svg { width: 22px; height: 22px; filter: drop-shadow(0 1px 0 rgba(30, 10, 90, .5)); }
.is-mining .brand__mark svg { animation: spin .8s linear infinite; }
.brand__name {
  font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: .005em;
  text-shadow: 0 1px 0 #8F74F0, 0 2px 0 #5638B8, 0 6px 12px rgba(20, 8, 70, .6);
}
.brand__tag { font-size: 13px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); line-height: 1.3; white-space: nowrap; }
.topbar__meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.chip--demo { border-style: dashed; background: transparent; color: var(--muted); }
.chip__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; transition: background-color .3s, box-shadow .3s; }
.is-mining .chip__dot { background: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .22), 0 0 10px rgba(34, 211, 238, .8); }

/* ปุ่ม Connect Wallet — เมื่อเชื่อมต่อแล้วแสดงที่อยู่กระเป๋าแบบย่อ */
.wbtn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px 0 11px; border-radius: 999px;
  border: 1px solid rgba(196, 181, 253, .55);
  background: linear-gradient(135deg, #9B76FF, #6366F1);
  color: #FFFFFF; text-shadow: 0 1px 0 rgba(30, 10, 90, .5);
  font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .38), 0 3px 0 var(--violet-deep), 0 10px 20px -8px rgba(99, 102, 241, .7);
  transition: transform .12s, box-shadow .12s, filter .2s, background-color .2s;
}
.wbtn:hover { filter: brightness(1.08); }
.wbtn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 1px 0 var(--violet-deep); }
.wbtn .icon { width: 17px; height: 17px; }
.wbtn__dot { display: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .22), 0 0 10px rgba(34, 211, 238, .8); }
.wbtn[data-connected] {
  border-color: var(--line); background: var(--surface-2); color: var(--ink); text-shadow: none;
  font-family: var(--f-mono); font-weight: 500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 3px 0 #060609;
}
.wbtn[data-connected] .icon { display: none; }
.wbtn[data-connected] .wbtn__dot { display: block; }
.wbtn[data-busy] { opacity: .75; cursor: progress; }

@media (max-width: 900px) { .brand__tag { display: none; } }
@media (max-width: 760px) { .chip--demo { display: none; } }
@media (max-width: 520px) { .chip--pkg { display: none; } }

/* ---------- การ์ด 3D แบบ dancore.io (ใช้ร่วมกัน) ----------
   หน้าการ์ดดำโปร่งขอบขาวจาง + แผ่นหลังสีตาม --accent ลอยอยู่ด้านหลัง (เห็นเป็นความหนา)
   การ์ดเอียงตามเมาส์ (--rx/--ry/--mx/--my จาก app.js) และเนื้อหาแต่ละชั้นลอยออกจากหน้าการ์ด */
.ov-card, .plan, .panel {
  --accent: #7C3AED;
  border: 1px solid var(--line);
  background: var(--glass), var(--surface-base);
  box-shadow: var(--shadow-card);
}
.panel {
  box-shadow: var(--shadow-card), 0 9px 0 -1px #0E0E14, 0 9px 0 0 color-mix(in srgb, var(--accent) 35%, transparent),
    0 28px 54px -26px color-mix(in srgb, var(--accent) 45%, transparent);
}
.ov-card, .plan {
  --lift: 1;
  position: relative;
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.2, .9, .25, 1), box-shadow .5s ease, border-color .4s ease;
}
.ov-card.is-tracking, .plan.is-tracking { transition: transform .15s ease-out, box-shadow .5s ease, border-color .4s ease; }
/* แผ่นหลัง: ให้การ์ดมีความหนาและขยับตามมุมเอียง */
.ov-card::before, .plan::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  transform: translateZ(-18px) translateY(9px);
  border: 1px solid transparent;
  border-bottom-color: color-mix(in srgb, var(--accent) 70%, transparent);
  background: linear-gradient(180deg, transparent 45%, color-mix(in srgb, var(--accent) 38%, #0A0A0D));
  box-shadow: 0 20px 40px -18px color-mix(in srgb, var(--accent) 50%, transparent);
}
/* แสงสะท้อนตามเมาส์ */
.ov-card::after, .plan::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .09), transparent 55%);
  opacity: var(--glare, 0); transition: opacity .45s ease;
}
.ov-card:hover, .plan:hover, .ov-card.is-tracking, .plan.is-tracking {
  --lift: 2;
  z-index: 5;
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: var(--shadow-card), 0 38px 70px -28px rgba(0, 0, 0, .9), 0 0 46px -14px color-mix(in srgb, var(--accent) 55%, transparent);
}
/* ชั้นเนื้อหาลอยออกจากหน้าการ์ด — ชี้แล้วลอยสูงขึ้นอีกเท่าตัว */
.ov-card__head, .ov-card__sub, .ov-card__foot, .plan__top, .plan__specs,
.ov-card__value, .spark, .ov-gpus, .ov-bar, .plan__fans, .plan__price,
.plan__map, .plan__note { transition: transform .7s cubic-bezier(.2, .9, .25, 1); }
.ov-card__head, .ov-card__sub, .ov-card__foot, .plan__top, .plan__specs { transform: translateZ(calc(var(--lift) * 8px)); }
.ov-card__value, .spark, .ov-gpus, .ov-bar, .plan__fans, .plan__price { transform: translateZ(calc(var(--lift) * 16px)); }
.ov-cta, .plan__map, .plan > .btn, .plan__note { transform: translateZ(calc(var(--lift) * 26px)); }
/* ปุ่มที่ลอยอยู่ยังยุบได้เวลากด โดยไม่หลุดลงไปติดหน้าการ์ด */
.ov-cta:active, .plan > .btn:active { transform: translateZ(calc(var(--lift) * 26px)) translateY(2px); }
.ov-cta.btn--primary:active, .plan > .btn--primary:active { transform: translateZ(calc(var(--lift) * 26px)) translateY(3px); }
.ov-cta:disabled, .plan > .btn:disabled { transform: translateZ(calc(var(--lift) * 26px)); }
/* แพ็กเกจปัจจุบันใช้ขอบไล่สี — ไม่ให้สีขอบตอนชี้ทับ */
.plan--current:hover, .plan--current.is-tracking { border-color: transparent; }

/* หัวข้อแบบตัวอักษรนูน 3D */
.overview__title, .plans__title { color: #F5F3FF; text-shadow: var(--extrude); }

/* ---------- การ์ดสรุปของผู้ใช้ ---------- */
.overview { padding: 30px 0 26px; }
.overview__title {
  margin: 0 0 18px;
  font-family: var(--f-display); font-weight: 700;
  font-size: clamp(25px, 3.1vw, 34px); line-height: 1.2; letter-spacing: -.01em;
}
.ov-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ov-grid { gap: 10px; } }
.ov-card {
  min-width: 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px;
  border-radius: 20px;
}
@media (max-width: 560px) { .ov-card { padding: 14px; border-radius: 16px; } }
.ov-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.ov-card__label { margin: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
.ov-card__value {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 7px;
  font-size: clamp(23px, 2.3vw, 30px); font-weight: 500; line-height: 1.15; letter-spacing: -.01em;
  color: #FFFFFF; text-shadow: 0 2px 0 rgba(60, 30, 150, .55), 0 8px 18px rgba(99, 102, 241, .35);
}
.ov-card__value small { font-family: var(--f-display); font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--muted); text-shadow: none; }
.ov-card__value--name { font-family: var(--f-display); font-weight: 700; letter-spacing: 0; }
.ov-card__sub { font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ov-card__foot {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px 12px;
  margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--line);
}
.ov-card__foot dt { font-size: 11.5px; color: var(--muted); }
.ov-card__foot dd { margin: 0; font-size: 14px; color: var(--ink); }

/* สถานะการขุด */
.ov-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap;
}
.ov-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.is-mining .ov-pill { border-color: rgba(34, 211, 238, .45); color: var(--cyan-hi); background: rgba(34, 211, 238, .08); }
.is-mining .ov-pill i { background: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .22), 0 0 10px rgba(34, 211, 238, .8); }

/* กราฟแรงขุด 60 วินาทีล่าสุด */
.spark { display: block; width: 100%; height: 34px; overflow: visible; }
.spark__area { fill: url(#g-spark-area); }
.spark__line { fill: none; stroke: url(#g-spark); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px rgba(34, 211, 238, .55)); }

/* พัดลมรายการ์ด — แตะเพื่อเปิดแท็บการ์ดใบนั้น */
.ov-gpus { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ov-gpu {
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 7px 2px 5px; border-radius: 10px;
  border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .35); color: var(--muted);
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 3px 0 rgba(0, 0, 0, .9);
  transition: border-color .2s, color .2s, transform .12s, box-shadow .12s;
}
.ov-gpu:hover { border-color: var(--violet-hi); color: var(--ink); }
.ov-gpu:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 0 rgba(0, 0, 0, .9); }
.ov-gpu__fans { display: flex; gap: 3px; }
.ov-gpu__fans i { width: 7px; height: 15px; border-radius: 2px; border: 1.5px solid rgba(167, 139, 250, .3); }
.ov-gpu__fans i[data-s="installed"] { border-color: transparent; background: linear-gradient(180deg, var(--cyan), var(--violet)); }
.ov-gpu__fans i[data-s="empty"] { border-color: rgba(167, 139, 250, .65); }
.ov-gpu__fans i[data-s="locked"] { border-color: transparent; background: repeating-linear-gradient(135deg, rgba(167, 139, 250, .3) 0 2px, transparent 2px 4px); }
.is-mining .ov-gpu__fans i[data-s="installed"] { box-shadow: 0 0 8px rgba(34, 211, 238, .7); }
.ov-gpu__name { font-family: var(--f-mono); font-size: 10.5px; white-space: nowrap; }
@media (max-width: 560px) {
  .ov-gpu__pre { display: none; }
  .ov-gpu__fans { gap: 2px; }
  .ov-gpu__fans i { width: 6px; height: 13px; }
}

/* แพ็กเกจ */
.ov-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.ov-bar i { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: 0 0 10px rgba(34, 211, 238, .5); }
.ov-cta { margin-top: auto; min-height: 40px; padding: 0 12px; font-size: 14px; }
.ov-cta__short { display: none; }
@media (max-width: 560px) {
  .ov-cta__long { display: none; }
  .ov-cta__short { display: inline; }
}

/* ---------- พื้นที่หลัก: แท่นขุด + แผงควบคุม ---------- */
.station { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.station > * { min-width: 0; }
@media (min-width: 1040px) { .station { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; } }

/* ---------- แท่นขุด ---------- */
.rig {
  position: relative;
  padding: 14px 12px 8px;
  border-radius: 26px;
  border: 1px solid var(--chassis-line);
  background: var(--glass), linear-gradient(180deg, var(--chassis-2), var(--chassis));
  box-shadow: var(--shadow-rig);
  color: var(--chassis-ink);
}
@media (min-width: 720px) { .rig { padding: 20px 22px 12px; } }
.rig :focus-visible { outline-color: var(--cyan); }
.rig__screw {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #E4E4EE, #4A4A5C 70%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .08), 0 0 0 1px rgba(0, 0, 0, .3);
}
.rig__screw::after {
  content: ""; position: absolute; left: 1.5px; right: 1.5px; top: 50%;
  height: 1.2px; margin-top: -.6px; background: #16161E; transform: rotate(35deg);
}
.rig__screw--tl { top: 8px; left: 8px; }
.rig__screw--tr { top: 8px; right: 8px; }
.rig__screw--bl { bottom: 8px; left: 8px; }
.rig__screw--br { bottom: 8px; right: 8px; }

.rig__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 0 8px 14px; }
.rig__plate {
  font-family: var(--f-display); font-weight: 600; font-size: 12.5px; letter-spacing: .22em;
  color: var(--ink-2);
  padding: 3px 6px 3px 9px; border-radius: 6px;
  border: 1px solid var(--chassis-line); background: rgba(0, 0, 0, .28);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .05);
}
.rig__status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.led { width: 8px; height: 8px; border-radius: 50%; background: #3A3A4A; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .4); transition: background-color .3s, box-shadow .3s; }
.rig[data-phase="spinup"] .led,
.rig[data-phase="spindown"] .led { background: var(--violet-hi); box-shadow: 0 0 10px rgba(167, 139, 250, .8); animation: blink .7s steps(2, jump-none) infinite; }
.rig[data-phase="mining"] .led { background: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, .2), 0 0 12px rgba(34, 211, 238, .9); }
.rig__count { margin-left: auto; font-size: 13px; color: var(--chassis-text); }
.rig__count b { color: var(--chassis-ink); font-weight: 500; }

/* การ์ดจอ 4 ใบ ใบละ 3 พัดลม = 12 พัดลม — เลือกดูทีละใบด้วยแท็บ */
.gpu-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
  margin-bottom: 12px; padding: 4px;
  border-radius: 14px; background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .05);
}
.gtab {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 4px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--chassis-text); cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .2s;
}
.gtab:hover { color: var(--chassis-ink); background: rgba(255, 255, 255, .04); }
.gtab[aria-selected="true"] {
  border-color: rgba(0, 102, 255, .45);
  background: linear-gradient(180deg, rgba(0, 102, 255, .22), rgba(124, 58, 237, .14));
  color: var(--chassis-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 3px 0 #08080C, 0 10px 18px -8px rgba(0, 102, 255, .5);
}
.gtab[aria-selected="true"]::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px;
  height: 2px; border-radius: 2px; background: var(--grad); box-shadow: 0 0 8px rgba(34, 211, 238, .7);
}
.gtab__chip { display: flex; gap: 3px; padding: 3px 5px; border-radius: 4px; background: #050507; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.gtab__chip i { width: 8px; height: 8px; border-radius: 50%; background: #1C1C26; transition: background-color .3s, box-shadow .3s; }
.gtab__chip i[data-s="installed"] { background: var(--cyan); }
.gtab__chip i[data-s="empty"] { background: transparent; box-shadow: inset 0 0 0 1.5px #7C6FD1; }
.is-mining .gtab__chip i[data-s="installed"] { box-shadow: 0 0 7px rgba(34, 211, 238, .95); }
.gtab__name { font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
.gtab__state { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; white-space: nowrap; }
.gtab__state .icon { width: 12px; height: 12px; }
.gtab[data-state="ghost"] .gtab__chip,
.gtab[data-state="ghost"] .gtab__name { opacity: .55; }
/* แท็บที่ยังล็อก: กรอบจางๆ สีของแพ็กเกจที่ปลดล็อกการ์ดใบนั้น (สีเดียวกับการ์ดแพ็กเกจ) */
.gtab[data-state="ghost"]:not([aria-selected="true"]) { border-color: color-mix(in srgb, var(--accent) 32%, transparent); }
.gtab[data-state="ghost"]:not([aria-selected="true"]):hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
@media (min-width: 720px) {
  .gtab { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; }
  .gtab__state { margin-left: auto; }
}

/* เวทีแสดงการ์ดใบที่เลือก: แท่นเรืองแสง + พื้นตาราง 3D */
.stage {
  position: relative; overflow: hidden; isolation: isolate;
  padding: 26px 14px 14px; border-radius: 18px;
  background:
    radial-gradient(ellipse 60% 55% at 50% 40%, rgba(0, 102, 255, .3) 0%, rgba(124, 58, 237, .16) 45%, transparent 72%),
    linear-gradient(180deg, #0D0D14 0%, #060608 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 2px 12px rgba(0, 0, 0, .6);
}
.stage::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  left: -40%; right: -40%; bottom: -8%; height: 62%;
  background-image:
    linear-gradient(rgba(0, 255, 209, .28) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 255, .32) 1px, transparent 1px);
  background-size: 38px 38px;
  transform: perspective(420px) rotateX(66deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 88%);
  mask-image: linear-gradient(to top, #000 0%, transparent 88%);
}
@media (min-width: 720px) { .stage { padding: 38px 34px 16px; } }
.gpanel:not([hidden]) { animation: card-in .45s cubic-bezier(.2, .8, .2, 1); }

/* การ์ดจอแสดงตรง ไม่เอียง (ตามที่ผู้ใช้ขอ) */
.card3 {
  --g: 0;
  position: relative; max-width: 740px; margin: 0 auto; aspect-ratio: 800 / 340;
}
.card3::before {
  content: ""; position: absolute; left: 6%; right: 4%; bottom: -7%; height: 11%;
  border-radius: 50%; background: rgba(4, 2, 16, .75); filter: blur(12px);
}
/* แสงสะท้อนใต้การ์ด สว่างขึ้นตามรอบพัดลม */
.card3::after {
  content: ""; position: absolute; left: 12%; right: 10%; bottom: -10%; height: 7%;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(34, 211, 238, .6), rgba(168, 85, 247, .4) 55%, rgba(244, 114, 182, .2) 75%, transparent);
  filter: blur(6px);
  opacity: calc(.2 + var(--g) * .8);
}
.card3__art {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible;
  transition: opacity .4s ease, filter .4s ease;
}
.gpanel[data-state="ghost"] .card3__art { opacity: .32; filter: grayscale(.85) brightness(.85); }
.card3__trim { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linejoin: round; }
.card3__trim-glow { fill: none; stroke: var(--cyan); stroke-width: 12; stroke-linejoin: round; opacity: calc(.14 + var(--g) * .4); }
.card3__plate-glow { fill: none; stroke: var(--violet-hi); stroke-width: 3; stroke-linecap: round; opacity: calc(.35 + var(--g) * .65); }
.gpanel__stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px;
  margin-top: 24px; font-family: var(--f-mono); font-size: 12px; color: var(--chassis-text);
}
.gpanel__stats b { font-weight: 500; color: var(--chassis-ink); }

/* การ์ดที่ยังล็อกทั้งใบ */
.card3__lock {
  position: absolute; inset: 0; z-index: 2;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 0 10%; text-align: center;
}
.gpanel[data-state="ghost"] .card3__lock { display: flex; }
.card3__lock-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(167, 139, 250, .45); background: rgba(12, 12, 16, .9); color: var(--chassis-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 0 #060609, 0 0 20px rgba(139, 92, 246, .4);
}
.card3__lock-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(15px, 2vw, 20px); line-height: 1.3; color: #F5F3FF; text-shadow: 0 2px 0 #43299A, 0 6px 14px rgba(20, 8, 70, .8); }
.card3__lock-text { max-width: 36ch; font-size: clamp(12px, 1.4vw, 14px); color: var(--ink-2); }
.card3__lock .btn { margin-top: 6px; min-height: 40px; }
@media (max-width: 560px) {
  .card3__lock { gap: 4px; }
  .card3__lock-icon { width: 30px; height: 30px; }
  .card3__lock-text { display: none; }
  .card3__lock .btn { min-height: 34px; padding: 0 12px; font-size: 13px; }
}

/* ช่องพัดลม 3 ช่องบนการ์ด (ตาม viewBox 800×340: จุดกึ่งกลาง x = 174, 410, 646 · y = 198 · รัศมี 108) */
.sock { --s: 0; position: absolute; top: 26.47%; width: 27%; height: 63.53%; z-index: 1; }

/* ตัวพัดลม — วงแหวนเรืองแสงสีฟ้าตามรอบ */
.fan {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible;
  will-change: transform;
  transition: opacity .35s ease, transform .55s cubic-bezier(.2, .8, .2, 1);
}
.sock:not([data-state="installed"]) .fan { opacity: 0; transform: scale(.8) rotate(-40deg); }
/* วงแหวนนีออนไล่สี ฟ้า → ม่วง → ชมพู สว่างขึ้นตามรอบพัดลม */
.fan__led { fill: none; stroke: url(#g-ring); stroke-width: 3; opacity: calc(.18 + var(--s) * .82); }
.fan__halo { fill: none; stroke: url(#g-ring); stroke-width: 14; opacity: calc(var(--s) * .3); }
.fan__blades { opacity: calc(1 - var(--s) * .4); }
.fan__ghost1 { opacity: calc(max(0, var(--s) - .3) * .7); }
.fan__ghost2 { opacity: calc(max(0, var(--s) - .5) * .55); }
.fan__blur { opacity: calc(var(--s) * .8); }

/* แผ่นบนช่องพัดลม: ว่าง (ติดตั้งได้) / ล็อก (ต้องอัปเกรด) / รับฟรี */
.sock__plate {
  position: absolute; inset: 2%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--chassis-text); cursor: pointer;
  font-family: var(--f-display); font-weight: 600; font-size: clamp(9px, 1.25vw, 14px); letter-spacing: .08em;
  transition: opacity .3s ease, color .2s, background-color .2s, box-shadow .2s, visibility 0s linear 0s;
}
.sock__plate .icon { width: clamp(14px, 2.2vw, 26px); height: clamp(14px, 2.2vw, 26px); }
.sock[data-state="installed"] .sock__plate,
.gpanel[data-state="ghost"] .sock__plate { opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
.sock[data-state="empty"] .sock__plate { background: rgba(9, 6, 28, .6); box-shadow: inset 0 0 0 1.5px rgba(167, 139, 250, .6); color: #DCD3FF; }
.sock[data-state="empty"] .sock__plate:hover { color: var(--cyan-hi); background: rgba(9, 6, 28, .4); box-shadow: inset 0 0 0 1.5px var(--cyan), 0 0 18px rgba(34, 211, 238, .35); }
.sock[data-state="locked"] .sock__plate { background: rgba(9, 6, 28, .82); box-shadow: inset 0 0 0 1px rgba(167, 139, 250, .32); color: var(--chassis-text); }
.sock[data-state="locked"] .sock__plate:hover { color: var(--chassis-ink); box-shadow: inset 0 0 0 1px var(--violet-hi); }
.sock[data-free] .sock__plate { background: rgba(9, 6, 28, .6); box-shadow: inset 0 0 0 2px rgba(34, 211, 238, .75), 0 0 22px rgba(34, 211, 238, .3); color: var(--cyan-hi); }
.sock[data-free] .sock__plate:hover { color: #FFFFFF; box-shadow: inset 0 0 0 2px var(--cyan), 0 0 26px rgba(34, 211, 238, .5); }
@media (max-width: 560px) { .sock__plate { letter-spacing: .02em; } }

/* วงแหวนพัดลมกะพริบเป็นสีขาวม่วงเมื่อพัดลมตัวนั้นส่ง share สำเร็จ */
.sock.is-share .fan__led { animation: share .7s ease-out; }

/* ค่าที่วัดได้ */
.readouts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 14px 0 0;
  border-top: 1px solid var(--chassis-line); border-bottom: 1px solid var(--chassis-line);
}
.readout { padding: 12px 12px 12px 14px; border-left: 1px solid var(--chassis-line); min-width: 0; }
.readout:first-child { border-left: 0; }
.readout dt { font-size: 12px; color: var(--chassis-text); white-space: nowrap; }
.readout dd {
  margin: 2px 0 0; white-space: nowrap;
  font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-weight: 500;
  font-size: clamp(18px, 1.9vw, 24px); color: var(--chassis-ink);
}
.readout small { margin-left: 5px; font-size: 12px; font-weight: 400; color: var(--chassis-text); }
.rig[data-phase="mining"] #roHash { color: var(--cyan-hi); text-shadow: 0 0 14px rgba(34, 211, 238, .55); }
@media (max-width: 640px) {
  .readouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout:nth-child(3) { border-left: 0; }
  .readout:nth-child(n+3) { border-top: 1px solid var(--chassis-line); }
}

/* บันทึกการทำงาน (หน้าจอเล็กบนแท่น) */
.console {
  list-style: none; margin: 0; padding: 10px 8px 6px;
  min-height: calc(4 * 1.8em + 16px);
  overflow: hidden;
  font-family: var(--f-mono); font-size: 12px; line-height: 1.8; color: var(--chassis-text);
}
.console li { display: flex; gap: 12px; min-width: 0; }
.console li:last-child { color: var(--chassis-ink); }
.console time { flex: none; color: var(--faint); }
.console span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console .ok span { color: var(--cyan-hi); }
.console .warn span { color: var(--pink); }

/* ---------- แผงควบคุม ---------- */
.panel {
  border-radius: 24px;
  overflow: hidden;
}
@media (min-width: 1040px) { .panel { position: sticky; top: 84px; } }
.panel__section { padding: 20px; }
.panel__section + .panel__section { border-top: 1px solid var(--line-soft); }
.label { font-size: 13px; font-weight: 500; color: var(--muted); }

/* ปุ่ม Mining — ปุ่มนูน 3D กดแล้วยุบ */
.power {
  width: 100%; min-height: 90px;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 18px 14px 14px;
  border-radius: 20px; border: 1px solid rgba(196, 181, 253, .55);
  background: linear-gradient(180deg, #9F7BFF 0%, #8452F5 45%, #6A3BE0 100%);
  color: #FFFFFF; text-align: left; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -3px 0 rgba(40, 10, 110, .35), 0 6px 0 var(--violet-deep), 0 20px 36px -12px rgba(124, 58, 237, .8);
  transition: background .3s, box-shadow .15s, border-color .3s, color .3s, transform .15s, filter .2s;
}
.power:hover:not(:disabled) { filter: brightness(1.07); }
.power:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--violet-deep), 0 8px 18px -10px rgba(124, 58, 237, .7); }
.power[aria-pressed="true"] {
  border-color: rgba(34, 211, 238, .45);
  background: linear-gradient(180deg, #1F1757 0%, #120C34 100%);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 6px 0 #06041A, 0 0 0 1px rgba(34, 211, 238, .12), 0 20px 36px -14px rgba(34, 211, 238, .45);
}
.power[aria-pressed="true"]:active { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 2px 0 #06041A; }
.power:disabled { cursor: not-allowed; border-color: var(--line); background: rgba(255, 255, 255, .05); color: var(--muted); box-shadow: 0 4px 0 #060609; }
.power__key {
  position: relative; flex: none;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #4B3F9E, #160F3D 72%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -2px 4px rgba(0, 0, 0, .4);
  color: #CFC8F6;
  transition: color .3s;
}
.power__key svg { width: 24px; height: 24px; }
.power__key::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.power[aria-pressed="true"] .power__key { color: var(--cyan); }
.power[aria-pressed="true"] .power__key::after {
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(34, 211, 238, .7);
  animation: breathe 2.4s ease-in-out infinite;
}
.power:disabled .power__key { background: rgba(255, 255, 255, .06); box-shadow: none; color: var(--muted); }
.power__text { min-width: 0; }
.power__label { display: block; font-family: var(--f-display); font-weight: 700; font-size: 23px; line-height: 1.2; text-shadow: 0 2px 0 rgba(40, 10, 110, .45); }
.power__sub { display: block; margin-top: 3px; font-size: 13.5px; opacity: .9; }
.power.is-nudge { animation: nudge 1.1s ease-out 2; }

/* ปุ่ม Mining แบบติดขอบล่าง (จอเล็ก) */
.dock { display: none; }
.power--dock { min-height: 64px; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 18px; }
.power--dock .power__key { width: 46px; height: 46px; }
.power--dock .power__key svg { width: 20px; height: 20px; }
.power--dock .power__label { font-size: 18px; }
.power--dock .power__sub { margin-top: 1px; font-size: 12.5px; }
@media (max-width: 1039.98px) {
  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: block;
    padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, rgba(10, 10, 11, .94) 40%);
    transform: translateY(110%); visibility: hidden;
    transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .3s;
  }
  .show-dock .dock { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
  .show-dock .toasts { bottom: 108px; }
  .foot { padding-bottom: 116px; }
}

/* ตัวเลือกจำนวนพัดลม */
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.field-head__aside { font-size: 13px; color: var(--muted); text-align: right; }
.stepper { display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; gap: 10px; }
.stepper__btn {
  position: relative; height: 54px;
  display: grid; place-items: center;
  border-radius: 14px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03));
  color: var(--ink);
  font-size: 20px; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 0 #060609, 0 12px 20px -12px rgba(0, 0, 0, .8);
  transition: border-color .2s, transform .12s, box-shadow .12s;
}
.stepper__btn:hover:not(:disabled) { border-color: var(--violet-hi); }
.stepper__btn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 0 #060609; }
.stepper__btn:disabled { opacity: .4; cursor: not-allowed; }
.stepper__lock {
  position: absolute; top: -7px; right: -7px;
  width: 22px; height: 22px; border-radius: 50%;
  display: none; place-items: center;
  background: var(--grad); color: #FFFFFF; font-size: 11px;
  box-shadow: 0 0 0 2px #140E3A, 0 0 12px rgba(139, 92, 246, .6);
}
.stepper__btn[data-locked] .stepper__lock { display: grid; }
.stepper__value {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  font-family: var(--f-display); font-weight: 700; font-size: 42px; line-height: 1;
  color: #F5F3FF; text-shadow: 0 1px 0 #B9A6FF, 0 2px 0 #8F74F0, 0 3px 0 #6D4FD6, 0 4px 0 #43299A, 0 8px 14px rgba(20, 8, 70, .6);
}
.stepper__value small { font-family: var(--f-mono); font-size: 14px; font-weight: 400; color: var(--muted); text-shadow: none; }

.meter { display: flex; gap: 4px; margin-top: 18px; }
.meter__seg { flex: 1; height: 10px; border-radius: 3px; border: 1.5px solid rgba(167, 139, 250, .25); transition: background .3s, border-color .3s, box-shadow .3s; }
.meter__seg[data-break] { margin-left: 6px; }
.meter__seg[data-s="installed"] { border-color: transparent; background: var(--grad); background-size: 1200% 100%; box-shadow: 0 0 8px rgba(99, 102, 241, .5); }
.meter__seg[data-s="empty"] { border-color: rgba(167, 139, 250, .7); }
.meter__seg[data-s="locked"] { border-color: transparent; background: repeating-linear-gradient(135deg, rgba(167, 139, 250, .28) 0 2px, transparent 2px 4px); }
.hint { margin-top: 12px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.hint b { color: var(--ink); font-weight: 600; }
.linkbtn {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--cyan-hi); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}

/* ผลการขุดรอบนี้ */
.earn { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; }
.earn__value { font-size: clamp(30px, 3vw, 36px); font-weight: 500; letter-spacing: -.02em; line-height: 1.2; color: #FFFFFF; text-shadow: 0 2px 0 rgba(60, 30, 150, .55), 0 8px 18px rgba(99, 102, 241, .35); }
.earn__unit { font-family: var(--f-display); font-weight: 600; color: var(--muted); }
.earn__sub { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 0; padding-top: 14px; border-top: 1px dashed var(--line); }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-size: 15px; }
.trial { margin-top: 16px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line-soft); background: rgba(0, 0, 0, .3); }
.trial__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13.5px; }
.trial__row b { font-size: 16px; font-weight: 500; }
.trial__bar { height: 6px; margin-top: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.trial__fill { height: 100%; width: 100%; border-radius: inherit; background: var(--grad); box-shadow: 0 0 10px rgba(34, 211, 238, .5); }
.trial__cta { margin-top: 12px; }
.trial[data-expired] .trial__row b { color: var(--pink); }

/* ---------- แพ็กเกจ ---------- */
.plans { padding: 76px 0 8px; }
.plans__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 32px; margin-bottom: 24px; }
.plans__title { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: clamp(27px, 3vw, 36px); line-height: 1.2; }
.plans__lede { max-width: 52ch; color: var(--muted); }
.plans__grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
@media (min-width: 1100px) { .plans__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.plan {
  min-width: 0;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px;
  border-radius: 22px;
}
.plan--current {
  border-color: transparent;
  background:
    var(--glass) padding-box,
    linear-gradient(rgba(12, 12, 16, .94), rgba(12, 12, 16, .94)) padding-box,
    var(--grad) border-box;
  box-shadow: var(--shadow-card), 0 0 44px -12px rgba(99, 102, 241, .7);
}
.plan__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.plan__name { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 20px; line-height: 1.3; color: #F5F3FF; text-shadow: 0 2px 0 #43299A, 0 6px 12px rgba(20, 8, 70, .6); }
.plan__badge { padding: 3px 10px; border-radius: 999px; background: var(--grad); color: #FFFFFF; font-size: 12px; font-weight: 600; white-space: nowrap; box-shadow: 0 2px 0 var(--violet-deep), 0 0 14px rgba(99, 102, 241, .6); }
/* แผนผังย่อ: การ์ดจอ 4 ใบ ใบละ 3 พัดลม เรียงตามลำดับบนแท่นขุด */
.plan__map {
  display: grid; grid-template-columns: repeat(2, auto); gap: 5px 6px;
  width: max-content; padding: 9px;
  border-radius: 12px; background: #050507;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
}
.pm { display: flex; gap: 4px; padding: 3px 6px; border-radius: 4px; background: #15151D; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.pm i { width: 10px; height: 10px; border-radius: 50%; background: #0A0A0E; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.pm i[data-s="base"] { background: #6D5BD0; }
.pm i[data-s="new"] { background: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, .8); }
.plan__map--lg { gap: 7px 8px; padding: 12px; }
.plan__map--lg .pm { gap: 5px; padding: 4px 8px; }
.plan__map--lg .pm i { width: 13px; height: 13px; }
.plan__fans { color: var(--ink-2); font-size: 15px; }
.plan__fans b { margin-right: 6px; font-family: var(--f-display); font-size: 30px; line-height: 1; color: #FFFFFF; text-shadow: 0 2px 0 #43299A, 0 8px 14px rgba(20, 8, 70, .55); }
.plan__gpus { font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.plan__specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.plan__specs li { display: flex; justify-content: space-between; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line-soft); color: var(--muted); }
.plan__specs b { font-family: var(--f-mono); font-weight: 500; color: var(--ink); white-space: nowrap; }
.plan__price { margin-top: auto; display: flex; align-items: baseline; gap: 4px; }
.plan__price b { font-family: var(--f-display); font-size: 27px; line-height: 1.1; color: #FFFFFF; text-shadow: 0 2px 0 #43299A, 0 8px 14px rgba(20, 8, 70, .55); }
.plan__price span { font-size: 13.5px; color: var(--muted); }
.plan__note {
  min-height: 46px; display: flex; align-items: center; justify-content: center;
  border-radius: 12px; border: 1px dashed var(--line);
  font-size: 13.5px; color: var(--muted); text-align: center; padding: 6px 10px;
}
.plan--current .plan__note { border-style: solid; border-color: rgba(34, 211, 238, .45); color: var(--cyan-hi); font-weight: 600; background: rgba(34, 211, 238, .06); }
@media (max-width: 560px) {
  .plans__grid { grid-template-columns: minmax(0, 1fr); }
  .plan { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 16px; padding: 16px; }
  .plan__top, .plan__price, .plan > .btn, .plan__note { grid-column: 1 / -1; }
  .plan__map { grid-row: span 2; align-self: start; }
  .plan__fans { align-self: end; }
  .plan__price { margin-top: 2px; }
}

/* ---------- หน้าต่างอัปเกรด ---------- */
.modal {
  width: 100%; max-width: min(540px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0; border: 0; background: transparent; color: var(--ink);
}
.modal::backdrop { background: rgba(0, 0, 0, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { animation: modal-in .3s cubic-bezier(.2, .8, .2, 1); }
.modal__card {
  display: grid; gap: 18px; margin: 0; padding: 22px;
  border-radius: 24px; border: 1px solid rgba(255, 255, 255, .1);
  background: var(--glass), rgba(12, 12, 16, .97);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 40px 90px -28px rgba(0, 0, 0, .9), 0 0 60px -20px rgba(139, 92, 246, .55);
}
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal__title { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 25px; line-height: 1.25; color: #F5F3FF; text-shadow: 0 2px 0 #43299A, 0 8px 16px rgba(20, 8, 70, .6); }
.modal__close {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 3px 0 #060609;
  cursor: pointer;
}
.modal__close:hover { border-color: var(--violet-hi); }
.modal__reason {
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, .35);
  background: rgba(139, 92, 246, .14);
  color: var(--ink-2); font-size: 14.5px;
}
.modal__reason[hidden] { display: none; }
.choices { margin: 0; padding: 0; border: 0; min-width: 0; }
.choices[hidden] { display: none; }
.choices legend { padding: 0; margin-bottom: 8px; }
.choices__list { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: 14.5px; cursor: pointer;
  box-shadow: 0 3px 0 #060609;
  transition: background .2s, border-color .2s, color .2s;
}
.choice span small { font-weight: 500; font-size: 12.5px; opacity: .8; }
.choice span:hover { border-color: var(--violet-hi); }
.choice input:checked + span { border-color: rgba(196, 181, 253, .55); background: var(--grad-btn); color: #FFFFFF; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 0 var(--violet-deep); }
.choice input:focus-visible + span { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.modal__body { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 9px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; }
.compare thead th { padding-top: 0; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.compare tbody th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.compare td { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare td.up { color: var(--cyan-hi); font-weight: 600; }
.modal__note { font-size: 12.5px; color: var(--muted); }
.modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
@media (max-width: 520px) {
  .modal__card { padding: 18px; }
  .modal__body { grid-template-columns: 1fr; }
  .modal__body .plan__map { justify-self: center; }
  .modal__actions { flex-direction: column-reverse; }
  .modal__actions .btn { width: 100%; }
}

/* ---------- แจ้งเตือน ---------- */
.toasts {
  position: fixed; left: 50%; bottom: 20px; z-index: 60;
  width: min(440px, calc(100vw - 32px)); transform: translateX(-50%);
  display: grid; gap: 8px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: var(--glass), rgba(12, 12, 16, .97); color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 20px 44px -16px rgba(0, 0, 0, .85), 0 0 30px -12px rgba(139, 92, 246, .6);
  font-size: 14.5px; line-height: 1.5;
  animation: toast-in .32s cubic-bezier(.2, .8, .2, 1);
}
.toast.is-leaving { animation: toast-out .25s ease forwards; }
.toast__icon {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: #FFFFFF; font-size: 13px;
  box-shadow: 0 0 12px rgba(99, 102, 241, .7);
}

/* ---------- ท้ายหน้า ---------- */
.foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  margin-top: 56px; padding-top: 22px; padding-bottom: 40px;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px; color: var(--muted);
}

/* ---------- โหมดแอปบนมือถือ: ทีละหน้าจอ + แถบแท็บด้านล่าง ---------- */
.appnav { display: none; }
@media (max-width: 760px) {
  .topbar__meta .wbtn { display: none; }              /* ปุ่มกระเป๋าย้ายไปอยู่ในแถบแท็บ */
  .chip--pkg { display: inline-flex; }

  /* แสดงทีละหน้าจอตาม body[data-screen] */
  body[data-screen="home"] .screen:not(#home),
  body[data-screen="mine"] .screen:not(#mine),
  body[data-screen="plans"] .screen:not(#plans) { display: none; }
  body:not([data-screen="plans"]) .foot { display: none; }
  .screen { animation: screen-in .35s cubic-bezier(.2, .8, .2, 1); }
  /* เว้นที่ด้านล่างไว้ให้แถบควบคุมการขุดและแถบแท็บ (หน้า Plans ให้ท้ายหน้าเป็นคนเว้นแทน) */
  main.wrap { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
  body[data-screen="plans"] main.wrap { padding-bottom: 0; }
  .overview { padding-top: 18px; }
  .station { padding-top: 16px; }
  .plans { padding-top: 20px; }
  .foot { margin-top: 32px; padding-bottom: calc(170px + env(safe-area-inset-bottom)); }

  .appnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px;
    padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
    background: rgba(12, 12, 16, .88);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--line-soft);
    box-shadow: 0 -14px 30px -18px rgba(0, 0, 0, .9);
  }
  .appnav__item {
    position: relative; isolation: isolate; min-width: 0;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 7px 2px 5px; border: 0; border-radius: 14px;
    background: none; color: var(--muted);
    font-size: 11px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .appnav__item .icon { width: 23px; height: 23px; }
  .appnav__item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .appnav__item[aria-current="page"] { color: #FFFFFF; }
  .appnav__item[aria-current="page"] .icon { color: var(--cyan-hi); filter: drop-shadow(0 0 6px rgba(34, 211, 238, .7)); }
  .appnav__item[aria-current="page"]::before {
    content: ""; position: absolute; z-index: -1; inset: 1px 14%;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(139, 92, 246, .32), rgba(99, 102, 241, .1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
  }
  .appnav__live { display: none; position: absolute; top: 5px; right: calc(50% - 17px); width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, .9); }
  .is-mining .appnav__live:not(.appnav__live--wallet) { display: block; }
  .appnav__item[data-connected] .appnav__live--wallet { display: block; }
  .appnav__item[data-busy] { opacity: .7; }

  /* แถบควบคุมการขุดลอยอยู่เหนือแถบแท็บ */
  .dock {
    bottom: calc(64px + env(safe-area-inset-bottom));
    padding: 10px 12px 8px;
    background: none;
    transform: translateY(calc(100% + 90px));
  }
  .toasts { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .show-dock .toasts { bottom: calc(158px + env(safe-area-inset-bottom)); }
}

/* ---------- แอนิเมชัน ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes pulseGlow { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes breathe { 50% { box-shadow: 0 0 30px rgba(34, 211, 238, .95); } }
@keyframes share {
  0%, 25% { stroke: #F3E8FF; opacity: 1; stroke-width: 4; }
}
@keyframes nudge {
  0% { box-shadow: 0 0 0 0 rgba(167, 139, 250, .6), 0 6px 0 var(--violet-deep), 0 20px 36px -12px rgba(124, 58, 237, .8); }
  100% { box-shadow: 0 0 0 18px rgba(167, 139, 250, 0), 0 6px 0 var(--violet-deep), 0 20px 36px -12px rgba(124, 58, 237, .8); }
}
@keyframes card-in { from { opacity: 0; transform: translateX(16px); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fan__ghost1, .fan__ghost2, .fan__blur { display: none; }
  .is-mining .brand__mark svg,
  .power[aria-pressed="true"] .power__key::after,
  .power.is-nudge,
  .sock.is-share .fan__led,
  .rig[data-phase] .led { animation: none; }
  .fan, .card3, .card3__art, .sock__plate, .dock, .show-dock .dock, .ov-card, .plan { transition: none; }
  .gpanel:not([hidden]), .screen, .bgfx__glow { animation: none; }
  .modal[open], .toast, .toast.is-leaving { animation: none; }
}
