/* Abyss mine (深渊矿洞) site. Palette: dark rock base, warm lantern light as the accent, four ore colours that only ever mean rarity.
   Type matches the X images: brush script (Ma Shan Zheng) for headings, Song serif for text, Cinzel for numbers and Latin labels,
   and a red seal as the brand mark. No heavy sans headings or pixel/mono display type (those belong to Amber). */
:root {
  --rock: #121417;
  --rock-2: #1B1E23;
  --rock-3: #2B3038;
  --lamp: #F0A048;
  --lamp-hi: #FFC56B;
  --seal: #B8322A;
  --text: #E7E3DA;
  --text-dim: #9DA2AA;
  --common: #A9AFB8;
  --rare: #43C0AE;
  --epic: #B07CF0;
  --legend: #FFD45C;
  --ok: #7FCB8B;
  --warn: #F29A5C;
  --brush: "Ma Shan Zheng", "Noto Serif SC", serif;
  --serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --num: "Cinzel", "Noto Serif SC", serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --measure: 40em;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: radial-gradient(ellipse 70% 520px at 72% 0, rgba(240, 160, 72, .10), transparent 70%), linear-gradient(#17191d, var(--rock) 900px);
  background-color: var(--rock);
  color: var(--text);
  font: 400 16px/1.85 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lamp-hi); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--lamp-hi); outline-offset: 3px; border-radius: 2px; }
code, pre { font-family: var(--mono); font-size: .86em; }
code { color: var(--lamp-hi); overflow-wrap: anywhere; }
strong { font-weight: 600; }

.demo-bar { margin: 0; padding: .5rem 16px; background: #3A2A12; color: var(--lamp-hi); text-align: center; font-size: .9rem; }

/* Red seal: four characters read right column first, like a real chop */
.seal {
  display: inline-grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; grid-auto-flow: column; direction: rtl;
  background: var(--seal); border-radius: 4px; box-shadow: inset 0 0 0 2px #d9574d; transform: rotate(-3deg);
  flex: none; vertical-align: middle;
}
.seal i { font: 900 1em/1 var(--serif); font-style: normal; color: #f6e6d8; display: grid; place-items: center; }
.seal-sm { width: 1.9rem; height: 1.9rem; padding: .18rem; font-size: .68rem; margin-right: .6rem; }
.seal-lg { width: clamp(3.6rem, 9vw, 5.4rem); height: clamp(3.6rem, 9vw, 5.4rem); padding: .4rem; font-size: clamp(1.15rem, 2.9vw, 1.75rem); margin-left: .35em; vertical-align: .55em; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  max-width: 1080px; margin: 0 auto; padding: 1.25rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; font: 400 1.75rem/1 var(--brush); color: var(--text); text-decoration: none; letter-spacing: .06em; }
.brand:hover { color: var(--lamp-hi); }
.top nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.top nav a { color: var(--text-dim); text-decoration: none; font-size: .95rem; letter-spacing: .08em; }
.top nav a:hover { color: var(--lamp-hi); }

main { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; counter-reset: sec; }
section { padding: 3.75rem 0; border-top: 1px solid var(--rock-3); }
section > * { max-width: var(--measure); }
h1, h2 { font-family: var(--brush); font-weight: 400; color: var(--text); margin: 0 0 1rem; letter-spacing: .06em; }
h2 { font-size: 2.6rem; line-height: 1.2; text-shadow: 0 0 26px rgba(240, 160, 72, .18); }
/* Every section after the hero gets a Roman numeral, like the I–VI on the X images */
section:not(.hero) h2::before {
  counter-increment: sec; content: counter(sec, upper-roman);
  display: block; margin-bottom: .55rem; font: 700 .85rem/1 var(--num); letter-spacing: .12em; color: var(--lamp); text-shadow: none;
}
p { margin: 0 0 1rem; }
em { font-style: normal; }
/* Latin inside a brush heading reads badly in brush script */
h2 .lat { font: 700 .72em/1 var(--num); letter-spacing: .04em; }
.kicker { font: 700 .82rem/1 var(--num); letter-spacing: .34em; text-transform: uppercase; color: var(--lamp); margin-bottom: 1.1rem; }

/* Hero: the shaft is the one bold element on the page */
.hero {
  border-top: 0; padding-top: 2.5rem;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 3rem; align-items: center;
}
.hero > * { max-width: none; }
.hero h1 { font-size: clamp(4.4rem, 12.5vw, 8.6rem); line-height: 1; margin-bottom: 1.4rem; text-shadow: 0 0 40px rgba(240, 160, 72, .28); white-space: nowrap; }
.lede { font-size: 1.3rem; line-height: 1.7; max-width: 25em; }
.lede em { font: 900 1.15em/1 var(--num); color: var(--legend); }
.facts { color: var(--text-dim); max-width: 26em; }
.actions, .prompt-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.6rem 0 .5rem; }
.copied { min-height: 1.75em; color: var(--ok); font-size: .95rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .55rem 1.35rem;
  border: 1px solid var(--lamp); border-radius: 2px; background: transparent; color: var(--lamp-hi);
  font: 600 1rem/1.2 var(--serif); letter-spacing: .1em; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--rock-2); color: var(--text); }
.btn.primary { background: var(--lamp); color: var(--rock); border-color: var(--lamp); box-shadow: 0 0 28px rgba(240, 160, 72, .25); }
.btn.primary:hover { background: var(--lamp-hi); border-color: var(--lamp-hi); color: var(--rock); }

.shaft { margin: 0; text-align: center; }
.shaft svg { width: 100%; max-width: 340px; height: auto; }
.shaft figcaption { display: grid; gap: .2rem; margin-top: .5rem; }
.shaft-label { font: 400 1.9rem/1.2 var(--brush); color: var(--text); letter-spacing: .08em; }
.shaft-sub { color: var(--text-dim); font-size: .9rem; }
.marks text { fill: var(--text-dim); font: 500 13px var(--num); }
.marks text.here { fill: var(--lamp-hi); font-weight: 900; }
#lamp { transition: transform 1.2s ease; }
#gems .legend { animation: glint 2.8s ease-in-out infinite; }
@keyframes glint { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { #lamp { transition: none; } #gems .legend { animation: none; } }

/* Rarity colours, used for gems, rows and finds */
.r-common { --ore: var(--common); }
.r-rare { --ore: var(--rare); }
.r-epic { --ore: var(--epic); }
.r-legend { --ore: var(--legend); color: var(--legend); }
/* Faceted crystal (same silhouette as the X images): light left face, dark right face */
.gem {
  display: inline-block; width: .62em; height: 1.05em; margin-right: .55em; vertical-align: -.12em;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ore) 100%, #fff 25%) 0 46%, color-mix(in srgb, var(--ore) 70%, #000) 46%);
  clip-path: polygon(50% 0, 100% 28%, 100% 92%, 46% 100%, 0 92%, 0 28%);
}

/* Live status */
.now > .status { max-width: none; }
.countdown { font: 700 clamp(2.2rem, 6.5vw, 3.6rem)/1.15 var(--num); color: var(--lamp-hi); margin-bottom: 1.5rem; letter-spacing: .04em; }
.countdown small { display: block; font: 400 1rem/1.6 var(--serif); color: var(--text-dim); margin-top: .4rem; letter-spacing: 0; }
.status { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 0; margin: 0; border-top: 1px solid var(--rock-3); }
.status div { min-width: 0; padding: .95rem 1rem .95rem 0; border-bottom: 1px solid var(--rock-3); }
.status dt { color: var(--text-dim); font-size: .88rem; letter-spacing: .08em; }
.status dd { margin: .2rem 0 0; font: 700 1.2rem/1.4 var(--num); color: var(--text); overflow-wrap: anywhere; }
.status dd.bar { height: 3px; margin-top: .5rem; background: var(--rock-3); overflow: hidden; max-width: 11rem; }
.status dd.bar i { display: block; height: 100%; width: 0; background: var(--lamp); box-shadow: 0 0 10px var(--lamp); transition: width .6s ease; }
.note { color: var(--text-dim); font-size: .95rem; margin-top: 1rem; }

/* Recent finds */
.finds > .find-list { max-width: 44rem; }
.find-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rock-3); }
.find-list li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; gap: .5rem 1rem; align-items: baseline; padding: .65rem 0; border-bottom: 1px solid var(--rock-3); }
.find-list .tier { color: var(--ore); font-weight: 900; white-space: nowrap; }
.find-list .who { font-family: var(--mono); font-size: .86rem; color: var(--text-dim); overflow-wrap: anywhere; }
.find-list .amt { font: 700 1rem/1.4 var(--num); color: var(--text); white-space: nowrap; text-align: right; }
.find-list .amt small { display: block; font: 400 .8rem/1.4 var(--serif); color: var(--text-dim); }
.find-list .empty { display: block; color: var(--text-dim); }

/* Rarity table */
.odds { border-collapse: collapse; width: 100%; margin: .5rem 0 1.25rem; }
.odds th, .odds td { text-align: left; padding: .7rem 1rem .7rem 0; border-top: 1px solid var(--rock-3); white-space: nowrap; }
.odds thead th { color: var(--text-dim); font-weight: 400; font-size: .88rem; letter-spacing: .08em; border-top: 0; }
.odds tbody th { color: var(--ore); font-weight: 900; letter-spacing: .1em; }
.odds tbody td { color: var(--text); }
.odds tbody td:nth-child(3), .odds tbody td:nth-child(5) { font-family: var(--num); font-weight: 700; }
.odds tbody td:nth-child(4) { font: 900 1.35rem/1 var(--num); color: var(--ore); }
.rarity > .odds { max-width: 44rem; }

/* Wallet check */
.check-form label { display: block; color: var(--text-dim); font-size: .9rem; margin-bottom: .35rem; }
.field { display: flex; gap: .5rem; }
.field input {
  flex: 1; min-width: 0; min-height: 46px; padding: .5rem .9rem; border-radius: 2px;
  border: 1px solid var(--rock-3); background: var(--rock-2); color: var(--text); font: 400 1rem/1.2 var(--mono);
}
.field input::placeholder { color: var(--text-dim); }
.result { margin-top: 1rem; min-height: 1.75em; }
.result.ok { color: var(--ok); }
.result.bad { color: var(--warn); }

/* Steps are a real sequence, so they are numbered (Roman, like the X images) */
.steps { padding: 0; margin: 0 0 1.5rem; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 0 0 1.4rem 4.2rem; }
.steps li::before {
  content: counter(s, upper-roman); position: absolute; left: 0; top: -.15rem; width: 3rem; text-align: right;
  font: 900 1.7rem/1 var(--num); color: var(--lamp);
}
.steps li::after { content: ""; position: absolute; left: 3.55rem; top: .2rem; bottom: 1.1rem; border-left: 1px solid var(--rock-3); }
.steps strong { display: block; color: var(--text); font-size: 1.08rem; letter-spacing: .04em; }
.plain { padding-left: 1.2rem; margin: 0 0 1rem; }
.plain li { margin-bottom: .5rem; }

.warn { color: var(--warn); font-weight: 900; font-size: 1.15rem; letter-spacing: .04em; }
.warn-soft { color: var(--warn); padding-left: 1rem; border-left: 2px solid var(--seal); }

.curve { margin: 1.5rem 0; max-width: 40rem; }
.curve svg { width: 100%; height: auto; }
.curve .axis line { stroke: var(--rock-3); stroke-width: 1.5; }
.curve .axis text { fill: var(--text-dim); font: 500 13px var(--num); }
.curve .line { fill: none; stroke: var(--lamp); stroke-width: 3; stroke-linejoin: round; }
.curve .dot { fill: var(--lamp-hi); stroke: var(--rock); stroke-width: 3; }
.curve figcaption { color: var(--text-dim); font-size: .95rem; margin-top: .5rem; }

.chain { background: var(--rock-2); border-left: 2px solid var(--lamp); padding: 1rem 1.25rem; margin: 0 0 1rem; overflow-x: auto; line-height: 1.7; }
.chain code { color: var(--text); }

.alloc { border-collapse: collapse; width: 100%; margin-bottom: 1.25rem; }
.alloc caption { text-align: left; color: var(--text-dim); font-size: .95rem; padding-bottom: .5rem; }
.alloc th, .alloc td { text-align: left; vertical-align: top; padding: .8rem 1rem .8rem 0; border-top: 1px solid var(--rock-3); }
.alloc th { color: var(--lamp-hi); font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.alloc td:nth-child(2) { font: 900 1.4rem/1.3 var(--num); color: var(--text); white-space: nowrap; }
.alloc td:last-child { color: var(--text-dim); }

.risk ul { padding-left: 1.2rem; margin: 0 0 1.25rem; }
.risk li { margin-bottom: .5rem; }

.addrs { margin: 0 0 1rem; max-width: 44rem; }
.addrs div { padding: .75rem 0; border-top: 1px solid var(--rock-3); }
.addrs dt { color: var(--text-dim); font-size: .9rem; }
.addrs dd { margin: .2rem 0 0; display: flex; gap: .75rem; align-items: baseline; flex-wrap: wrap; }
.addrs .mono { font: 400 .92rem/1.5 var(--mono); overflow-wrap: anywhere; color: var(--text); }
.addrs .tbd { color: var(--text-dim); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--lamp-hi); font: inherit; font-size: .9rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.small { font-size: .9rem; color: var(--text-dim); }

.foot { max-width: 1080px; margin: 0 auto; padding: 2rem 1.5rem 3rem; border-top: 1px solid var(--rock-3); color: var(--text-dim); font-size: .9rem; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  main, .top, .foot { padding-left: 16px; padding-right: 16px; }
  .top nav { gap: .4rem 1rem; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .hero h1 { font-size: clamp(3.6rem, 17vw, 5rem); }
  .shaft { order: -1; }
  .shaft svg { max-width: 220px; }
  .status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status dd { font-size: 1.05rem; }
  section { padding: 2.6rem 0; }
  h2 { font-size: 2.1rem; }
  .field { flex-direction: column; }
  .odds th, .odds td { padding-right: .6rem; font-size: .9rem; }
  .odds thead th:nth-child(2), .odds tbody td:nth-child(2) { display: none; }
  .find-list li { grid-template-columns: 6.6rem minmax(0, 1fr) auto; gap: .25rem .6rem; }
  .steps li { padding-left: 3.4rem; }
  .steps li::before { width: 2.4rem; font-size: 1.35rem; }
  .steps li::after { left: 2.85rem; }
}
