:root {
  --bg: #0a0b10;
  --panel: #14161f;
  --panel-2: #1b1e2b;
  --line: #272b3a;
  --text: #e8eaf2;
  --muted: #8b90a6;
  --accent: #16e0a3;
  --accent-2: #ff5da2;
  --warn: #ffcf5c;
  --danger: #ff5d5d;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, #1a1330 0%, var(--bg) 55%);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
}

.view { padding: 0 16px 40px; }
[hidden] { display: none !important; }

/* ── Disclosure ─────────────────────────────────────────────── */
#disclosure {
  background: #2a230f;
  color: var(--warn);
  border-bottom: 1px solid #4a3c12;
  font-size: 13px;
  padding: 9px 40px 9px 16px;
  position: relative;
  line-height: 1.4;
}
#disclosure strong { color: #ffe39a; }
#disclosure-close {
  position: absolute; right: 8px; top: 6px;
  background: none; border: none; color: var(--warn);
  font-size: 20px; cursor: pointer; line-height: 1;
}

/* ── Logo / typography ──────────────────────────────────────── */
.logo { font-weight: 800; font-size: 40px; letter-spacing: -1px; margin: 0; }
.logo span { color: var(--accent-2); }
.logo.small { font-size: 22px; }
.tagline { color: var(--muted); margin: 6px 0 22px; }

/* ── Landing / Auth ─────────────────────────────────────────── */
#auth-view { display: grid; place-items: center; min-height: 88vh; }
.landing {
  display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center;
  max-width: 1020px; width: 100%; padding: 30px 16px;
}
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; max-width: 460px; gap: 24px; }
  .hero-girl { order: -1; }
}

.hero-girl { position: relative; display: flex; justify-content: center; }
.hero-img {
  width: 100%; max-width: 360px; max-height: 72vh; object-fit: cover; object-position: top center;
  border-radius: 20px; display: block; border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.speech-bubble {
  position: absolute; top: 5%; right: 2%; z-index: 2;
  background: #fff; color: #1a1330; font-weight: 800; font-size: 15px;
  padding: 10px 16px; border-radius: 16px; box-shadow: 0 10px 26px rgba(0,0,0,.4);
  animation: bob 2.6s ease-in-out infinite;
}
.speech-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 22px;
  border: 9px solid transparent; border-top-color: #fff; border-bottom: 0;
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.hero-copy { text-align: left; }
.hero-copy .logo { font-size: 54px; }
.hero-tagline { color: var(--text); font-size: 18px; line-height: 1.45; margin: 6px 0 18px; }
.hero-points { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; }
.hero-points li { color: var(--muted); font-size: 14px; line-height: 1.4; }
.hero-points strong { color: var(--text); }

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 24px; text-align: center;
}
.hero-copy .auth-card { margin: 0; }
.tabs { display: flex; gap: 6px; background: var(--panel-2); padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.tab {
  flex: 1; padding: 10px; border: none; border-radius: 8px;
  background: none; color: var(--muted); font-weight: 600; cursor: pointer;
}
.tab.active { background: var(--panel); color: var(--text); }
form { text-align: left; display: flex; flex-direction: column; gap: 14px; }
label { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
input {
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); padding: 12px; border-radius: 10px; font-size: 15px;
  font-family: 'JetBrains Mono', monospace;
}
input:focus { outline: none; border-color: var(--accent); }
.hint { font-size: 12px; color: var(--warn); margin: -4px 0 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.get-one { color: var(--accent); font-weight: 700; font-size: 12px; text-decoration: none; white-space: nowrap; }
.get-one:hover { text-decoration: underline; }
.fineprint { font-size: 11px; color: var(--muted); margin-top: 18px; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 0; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  border: none; border-radius: 10px; padding: 12px 16px; font-weight: 700;
  cursor: pointer; font-size: 14px; transition: transform .05s, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: #062018; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { background: #2a3a35; color: #6b8f83; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }

/* ── Game layout ────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; max-width: 1320px; margin: 0 auto;
}
.wallet { display: flex; align-items: center; gap: 12px; }
.addr { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted);
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid {
  display: grid; gap: 16px; max-width: 1320px; margin: 0 auto;
  /* miner | selected girl | character | rewards+claims+ads */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 260px 260px;
}
/* Wide-ish: drop the 4th column under the 3rd (two side panels share a row). */
@media (max-width: 1180px) {
  .grid { grid-template-columns: minmax(0, 1fr) 260px 260px; }
  .grid .miner { grid-column: 1 / -1; }
}
/* Tablet: miner + reveal on top, two side panels below side-by-side. */
@media (max-width: 880px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .grid .reveal { grid-column: 1 / -1; }
}
/* Mobile: single column. */
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px;
}
.panel h2 { margin: 0 0 14px; font-size: 16px; display: flex; align-items: center; justify-content: space-between; }
.panel h2.mt { margin-top: 24px; }
.sub { color: var(--muted); font-size: 12px; margin: -8px 0 14px; }

/* ── Miner ──────────────────────────────────────────────────── */
.status { color: var(--accent); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.status.off { color: var(--muted); }

/* hashrate allocation windows */
.alloc-label { font-size: 12px; color: var(--muted); margin: 0 0 8px; }
.mine-windows { display: flex; gap: 10px; margin-bottom: 14px; }
.mine-win {
  flex: 1; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; text-align: center;
}
.mine-win.win-zero { border-color: #1d4a3e; }
.mine-win.win-zems { border-color: #4a2348; }
.mine-head { font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.mine-pct { font-family: 'JetBrains Mono', monospace; font-size: 15px; }
.win-zero .mine-pct { color: var(--accent); }
.win-zems .mine-pct { color: var(--accent-2); }
.mine-hash { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; margin-top: 8px; }
.mine-yield { font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.mine-adj { display: flex; gap: 6px; margin-top: 10px; }
.adj {
  flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 8px; padding: 6px 0; font-size: 18px; font-weight: 800; cursor: pointer; line-height: 1;
}
.adj:hover { background: var(--line); }
.adj:disabled { opacity: .35; cursor: not-allowed; }

/* locked / preview in middle view */
.lock-badge {
  position: absolute; top: 10px; left: 10px; background: rgba(5,6,10,.75);
  color: var(--warn); font-size: 18px; padding: 4px 10px; border-radius: 99px;
}
.locked-note { color: var(--muted); font-size: 13px; text-align: center; margin: 14px 0 4px; line-height: 1.5; }
.locked-note strong { color: var(--text); }

/* inline gift area */
#gift-area { margin-top: 4px; }
.present-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 6px; }
.present-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 6px; text-align: center; cursor: pointer; transition: border-color .1s, transform .05s;
}
.present-card:hover:not(.disabled) { border-color: var(--accent-2); }
.present-card.disabled { opacity: .45; cursor: not-allowed; }
.present-card .emoji { font-size: 26px; }
.present-card .pname { font-size: 12px; font-weight: 700; margin-top: 2px; }
.present-card .pcost { font-size: 11px; color: #e98bd0; font-family: 'JetBrains Mono', monospace; margin-top: 2px; }
.present-card .ppts { font-size: 10px; color: var(--muted); }
.stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat { flex: 1; background: var(--panel-2); border-radius: 10px; padding: 10px; }
.stat .k { display: block; font-size: 11px; color: var(--muted); }
.stat .v { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 15px; }
.console {
  background: #05060a; border: 1px solid var(--line); border-radius: 10px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--accent);
  height: 150px; overflow: hidden; padding: 10px; margin: 0 0 14px; white-space: pre-wrap;
  line-height: 1.5;
}
.balance-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel-2); border-radius: 12px; padding: 14px;
}
.balance-box .k { font-size: 11px; color: var(--muted); }
.balance { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; color: var(--accent); }
.balance small { font-size: 12px; color: var(--muted); }
.claim-msg { font-size: 12px; color: var(--warn); min-height: 16px; margin: 10px 0 0; }

/* ── Reveal ─────────────────────────────────────────────────── */
.image-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #05060a; aspect-ratio: 2/3; }
.image-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
#reveal-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: #05060a; }
#reveal-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.reveal-done {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-weight: 800; font-size: 28px; color: var(--accent);
  background: rgba(5,6,10,.35); letter-spacing: 2px;
}
.reveal-ready {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center;
  font-weight: 800; font-size: 16px; color: #062018; letter-spacing: 1px;
  background: var(--accent); padding: 8px; animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .6; } }
.claim-girl-btn { flex: 1; animation: pulse 1.6s ease-in-out infinite; }
.reveal-actions { display: flex; gap: 8px; margin-top: 12px; }
.reveal-actions .btn { flex: 1; }
#donate-btn:disabled { opacity: .5; cursor: not-allowed; }
.progress { height: 8px; background: var(--panel-2); border-radius: 99px; margin: 14px 0 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .4s; }
.reveal-pct { font-size: 12px; color: var(--muted); margin: 0; }
.reveal-pct span { color: var(--text); font-weight: 700; }

/* ── Shop ───────────────────────────────────────────────────── */
.shop-item { background: var(--panel-2); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.shop-item .name { font-weight: 700; font-size: 14px; }
.shop-item .lvl { color: var(--muted); font-size: 12px; }
.shop-item .desc { color: var(--muted); font-size: 11px; margin: 4px 0 10px; }
.shop-item button { width: 100%; }
.shop-item .cost { font-family: 'JetBrains Mono', monospace; }

/* ── Character / traits ─────────────────────────────────────── */
.character { text-align: center; }
.char-img {
  width: auto; max-width: 100%; height: 340px; object-fit: contain;
  display: block; margin: 0 auto 8px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.5));
}
.char-stats { display: flex; flex-direction: column; gap: 10px; }
.trait { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: left; }
.trait-top { display: flex; align-items: center; gap: 8px; }
.trait-emoji { font-size: 18px; }
.trait-name { font-weight: 700; font-size: 13px; flex: 1; }
.trait-lvl { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.trait-bar { height: 8px; background: var(--panel); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.trait-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
.trait-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trait-bonus { font-size: 11px; color: var(--accent); }
.trait-plus {
  border: none; border-radius: 8px; background: var(--accent); color: #062018;
  font-weight: 800; font-size: 14px; padding: 5px 12px; cursor: pointer; white-space: nowrap;
}
.trait-plus:disabled { background: #2a3a35; color: #6b8f83; cursor: not-allowed; }
.trait-cost { font-family: 'JetBrains Mono', monospace; font-size: 10px; }

.claims { list-style: none; padding: 0; margin: 0; }
.claims li { display: flex; justify-content: space-between; font-size: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.claims .amt { font-family: 'JetBrains Mono', monospace; }
.badge { font-size: 10px; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; }
.badge.pending { background: #3a3413; color: var(--warn); }
.badge.paid { background: #0f3328; color: var(--accent); }
.badge.failed { background: #3a1414; color: var(--danger); }

/* ── Claim modal ────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5,6,10,.78); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 440px; position: relative;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; text-align: center;
}
.modal-card h2 { margin: 0 0 4px; font-size: 20px; }
.modal-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.modal-x {
  position: absolute; right: 12px; top: 10px; background: none; border: none;
  color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1;
}
.modal-ad { min-height: 100px; margin: 0 0 16px; }
.faucet-steps { display: flex; gap: 6px; justify-content: center; margin: 0 0 14px; }
.faucet-steps .dot { width: 9px; height: 9px; border-radius: 99px; background: var(--line); }
.faucet-steps .dot.done { background: var(--accent); }
.faucet-steps .dot.active { background: var(--accent-2); }
.captcha { text-align: left; margin-bottom: 12px; }
.captcha-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.captcha-target { width: 56px; height: 56px; border-radius: 8px; border: 2px solid var(--accent); object-fit: cover; }
.captcha-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.captcha-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer; transition: border-color .1s, transform .05s;
}
.captcha-grid img:hover { border-color: var(--line); }
.captcha-grid img.selected { border-color: var(--accent); transform: scale(.96); }
.claim-modal-msg { font-size: 12px; color: var(--danger); min-height: 16px; margin: 4px 0 10px; }
.modal-confirm { width: 100%; }

/* ── Zems panel ─────────────────────────────────────────────── */
.zems-box {
  background: linear-gradient(135deg, #2a1430, #1b1e2b);
  border: 1px solid #3a2348; border-radius: 12px; padding: 14px; margin-bottom: 18px;
}
.zems-bal { font-size: 22px; font-weight: 800; font-family: 'JetBrains Mono', monospace; color: #e98bd0; }
.zems-bal small { font-size: 12px; color: var(--muted); }
.zems-actions { display: flex; gap: 8px; margin-top: 10px; }
.zems-actions .btn { flex: 1; font-size: 13px; padding: 9px; }
.zems-actions .btn:disabled { opacity: .5; cursor: not-allowed; }
.zems-hint { font-size: 11px; color: var(--muted); margin: 10px 0 0; }

/* hearts meter */
.hearts { font-size: 15px; letter-spacing: 1px; line-height: 1; }
.hearts .on { color: var(--accent-2); }
.hearts .off { color: #3a3142; }
.hearts.small { font-size: 12px; }

/* ── Present modal ──────────────────────────────────────────── */
.present-head { display: flex; gap: 14px; align-items: center; text-align: left; margin-bottom: 14px; }
.present-girl { width: 80px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.present-head h2 { margin: 0 0 6px; font-size: 18px; }
.present-aff-line { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.present-list { display: grid; gap: 10px; margin: 14px 0 6px; }
.present-item {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.present-item .emoji { font-size: 26px; }
.present-item .info { flex: 1; }
.present-item .pname { font-weight: 700; font-size: 14px; }
.present-item .pdesc { color: var(--muted); font-size: 11px; }
.present-item .buy { white-space: nowrap; }
.present-item .buy .cost { font-family: 'JetBrains Mono', monospace; }
.present-msg { font-size: 12px; min-height: 16px; margin: 6px 0; color: var(--warn); }
.present-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; color: #e98bd0; font-family: 'JetBrains Mono', monospace; }
.present-foot .btn { font-weight: 600; }

/* gallery card affection bits */
.gcard .gift {
  position: absolute; bottom: 64px; right: 8px;
  background: var(--accent-2); color: #2a0a1c; border: none; border-radius: 99px;
  font-size: 12px; font-weight: 800; padding: 5px 10px; cursor: pointer;
}
.gcard .gcard-hearts { margin-top: 4px; }

/* ── Gallery ────────────────────────────────────────────────── */
.gallery-section { max-width: 1320px; margin: 24px auto 0; }
.gallery-section h2 { font-size: 18px; display: flex; align-items: baseline; gap: 10px; margin: 0 0 4px; }
.gallery-sub { font-size: 13px; color: var(--muted); font-weight: 400; }
.gallery-total { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.gallery-total strong { color: var(--accent); font-family: 'JetBrains Mono', monospace; }
.gallery {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.gallery-empty { color: var(--muted); font-size: 13px; grid-column: 1 / -1; padding: 20px; text-align: center;
  border: 1px dashed var(--line); border-radius: 12px; }
.gcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; position: relative; cursor: pointer; transition: border-color .12s, transform .08s;
}
.gcard:hover { transform: translateY(-2px); border-color: var(--muted); }
.gcard.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.gcard img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.gcard.locked img { filter: blur(12px) brightness(.6); transform: scale(1.05); }
.gcard .lock-pill {
  position: absolute; top: 8px; left: 8px; background: rgba(5,6,10,.72);
  color: var(--warn); font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
}
.gcard .num {
  position: absolute; top: 8px; left: 8px; background: rgba(5,6,10,.7);
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 2px 8px; border-radius: 99px;
}
.gcard .boost {
  position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #062018; font-weight: 800; font-size: 12px;
  padding: 3px 9px; border-radius: 99px;
}
.gcard .gbody { padding: 10px 12px; }
.gcard .gtitle { font-weight: 700; font-size: 13px; }
.gcard .ghashes { color: var(--muted); font-size: 11px; font-family: 'JetBrains Mono', monospace; margin-top: 2px; }

/* ── Heart / coin particles ─────────────────────────────────── */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.fx {
  position: absolute; font-size: 22px; will-change: transform, opacity;
  animation: floatUp var(--dur, 1.2s) ease-out forwards;
  transform: translate(-50%, -50%);
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(0deg); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - var(--rise, 140px))) scale(1.1) rotate(var(--rot, 0deg)); }
}

/* ── Ads / footer ───────────────────────────────────────────── */
.ad-slot {
  background: repeating-linear-gradient(45deg, #15171f, #15171f 10px, #181b25 10px, #181b25 20px);
  border: 1px dashed var(--line); border-radius: 12px; color: var(--muted);
  display: grid; place-items: center; font-size: 12px; min-height: 90px; margin-top: 16px;
}
.ad-banner { max-width: 1320px; margin: 16px auto 0; }
.footer { max-width: 1320px; margin: 22px auto 0; color: var(--muted); font-size: 11px; text-align: center; line-height: 1.6; }
