/* ============================================================
   AMARKET — within the walls of Selius
   Stone, gold, honest grades. No neon. No mystery.
   ============================================================ */

:root {
  --obsidian: #0a0c10;
  --stone-900: #10131a;
  --stone-800: #14181f;
  --stone-700: #1a1f28;
  --line: rgba(232, 201, 106, .16);
  --line-strong: rgba(232, 201, 106, .34);
  --gold: #e8c96a;
  --gold-bright: #f4dd9a;
  --gold-deep: #b8942f;
  --parchment: #ece5d3;
  --slate: #a7adb8;
  --dim: #6f7682;
  --a-glow: rgba(232, 201, 106, .38);
  --b-glow: rgba(158, 190, 224, .32);
  --c-glow: rgba(217, 142, 74, .32);
  --serif: "Cinzel", "Times New Roman", serif;
  --sans: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--obsidian);
  color: var(--parchment);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* castle-stone grain over everything, very quiet */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

::selection { background: rgba(232, 201, 106, .3); }

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

img { max-width: 100%; }

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: rgba(10, 12, 16, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 50%; box-shadow: 0 0 14px rgba(232, 201, 106, .35); }
.brand-word {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: .12em;
  color: var(--parchment);
}
.brand-word em { font-style: normal; color: var(--gold); }

.topnav { display: flex; gap: 18px; margin-left: auto; flex-wrap: wrap; }
.topnav a {
  color: var(--slate);
  font-size: .86rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 2px;
  border-bottom: 1px solid transparent;
}
.topnav a:hover { color: var(--gold-bright); border-bottom-color: var(--line-strong); }

.topbar-cta { margin-left: 8px; }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 12px 22px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--gold-bright);
  background: transparent;
  transition: all .25s ease;
  cursor: pointer;
}
.btn:hover {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1c1405;
  border-color: var(--gold);
  box-shadow: 0 0 26px rgba(232, 201, 106, .35);
}
.btn-lg { padding: 15px 30px; font-size: .92rem; }

/* ---------------- rooms ---------------- */

.room {
  position: relative;
  padding: clamp(56px, 9vw, 110px) clamp(16px, 5vw, 56px);
  max-width: 1240px;
  margin: 0 auto;
}

.room-gate {
  max-width: none;
  text-align: center;
  padding-top: clamp(80px, 12vw, 150px);
  background:
    radial-gradient(900px 420px at 50% -80px, rgba(232, 201, 106, .12), transparent 70%),
    radial-gradient(1200px 700px at 50% 110%, rgba(232, 201, 106, .05), transparent 70%);
}

.room-vault    { background: radial-gradient(1000px 500px at 70% 0%, rgba(46, 74, 118, .16), transparent 65%); }
.room-workshop { background: radial-gradient(1000px 500px at 30% 0%, rgba(122, 92, 44, .14), transparent 65%); }
.room-forge    { background: radial-gradient(1000px 520px at 60% 10%, rgba(140, 62, 30, .15), transparent 65%); }
.room-tower    { background: radial-gradient(1000px 520px at 40% 0%, rgba(84, 58, 130, .16), transparent 65%); }
.room-treasury { background: radial-gradient(1000px 500px at 50% 0%, rgba(120, 120, 130, .10), transparent 65%); }

.overline {
  font-size: .78rem;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 18px;
}

.gate-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(3rem, 8vw, 5.4rem);
  letter-spacing: .04em;
  margin: 0 0 20px;
  background: linear-gradient(180deg, #f7ead0 8%, var(--gold) 55%, #9a7c26 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px rgba(232, 201, 106, .22));
}

.gate-sub {
  max-width: 720px;
  margin: 0 auto 26px;
  color: var(--slate);
  font-size: 1.06rem;
}
.gate-sub strong { color: var(--parchment); font-weight: 600; }

.gate-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.chip {
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--slate);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  background: rgba(232, 201, 106, .04);
}

.legend {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  max-width: 920px;
  margin: 0 auto 44px;
  text-align: left;
}
.legend-item {
  display: flex;
  gap: 14px;
  align-items: center;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.legend-item p { margin: 0; font-size: .88rem; color: var(--slate); }
.legend-item strong { color: var(--parchment); }

/* room plates */
.roomplate { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.room-num {
  font-size: .74rem;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 8px;
}
.roomplate h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: .05em;
  margin: 0 0 10px;
  color: var(--parchment);
  text-shadow: 0 2px 22px rgba(232, 201, 106, .14);
}
.room-sub { margin: 0; color: var(--slate); font-size: .98rem; }

/* arch dividers between rooms */
.arch {
  width: 240px;
  height: 120px;
  margin: -30px auto -30px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 120px 120px 0 0;
  position: relative;
  pointer-events: none;
}
.arch::after {
  content: "";
  position: absolute;
  inset: 14px 14px 0;
  border: 1px solid rgba(232, 201, 106, .08);
  border-bottom: none;
  border-radius: 106px 106px 0 0;
}

/* ---------------- product tiles (glowing, 3D) ---------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 22px;
  perspective: 1200px;
}

.tile {
  position: relative;
  border-radius: 14px;
  padding: 24px 22px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0) 32%),
    linear-gradient(180deg, var(--stone-700), var(--stone-900));
  border: 1px solid var(--line);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 18px 44px -22px rgba(0, 0, 0, .85);
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
  transform-style: preserve-3d;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 230px;
}
.tile:hover {
  transform: perspective(900px) rotateX(2.5deg) rotateY(-2.5deg) translateY(-7px);
  border-color: var(--line-strong);
}
.tile::before {
  content: "";
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 201, 106, .55), transparent);
}

.tile-b { --tile-glow: var(--b-glow); }
.tile-c { --tile-glow: var(--c-glow); }
.tile-g { --tile-glow: var(--a-glow); }
.tile-g {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 18px 44px -22px rgba(0, 0, 0, .85),
    0 0 34px -8px var(--tile-glow);
}
.tile:hover { box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 26px 60px -24px rgba(0,0,0,.9), 0 0 44px -6px var(--tile-glow, var(--a-glow)); }

.tile h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: .03em;
  margin: 0;
  color: var(--parchment);
  padding-right: 52px;
}
.tile .tag { margin: 0; color: var(--slate); font-size: .92rem; flex: 1; }
.tile .path {
  margin: 0;
  font-size: .78rem;
  color: var(--dim);
  border-top: 1px dashed rgba(255, 255, 255, .08);
  padding-top: 10px;
}
.tile .path strong { color: var(--slate); font-weight: 600; }

.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(232, 201, 106, .3);
}
.price small { font-size: .95rem; color: var(--gold-deep); }
.tile .btn { padding: 9px 14px; font-size: .72rem; }

/* ---------------- grade seals ---------------- */

.seal {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1;
  flex: none;
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, .4), 0 0 16px rgba(0, 0, 0, .4);
}
.seal b { font-size: 1.15rem; }
.seal small { font-size: .5rem; font-weight: 600; letter-spacing: .02em; opacity: .85; }
.seal-a { background: radial-gradient(circle at 32% 28%, #f9ecc4, #d9b44a 52%, #8a6d1d); color: #241b05; box-shadow: 0 0 20px rgba(232, 201, 106, .5), inset 0 -3px 8px rgba(0,0,0,.35); }
.seal-b { background: radial-gradient(circle at 32% 28%, #f2f7ff, #a9bed8 52%, #5d7188); color: #10161f; box-shadow: 0 0 18px rgba(158, 190, 224, .4), inset 0 -3px 8px rgba(0,0,0,.35); }
.seal-c { background: radial-gradient(circle at 32% 28%, #f6cfa4, #b06a2c 52%, #6e3c12); color: #1d0f04; box-shadow: 0 0 18px rgba(217, 142, 74, .4), inset 0 -3px 8px rgba(0,0,0,.35); }

.seal-sm { width: 34px; height: 34px; }
.seal-sm b { font-size: .85rem; }
.seal-sm small { font-size: .42rem; }

.tile .seal { position: absolute; top: 20px; right: 20px; }

/* ---------------- chests ---------------- */

.chest-section { padding: clamp(30px, 5vw, 60px) clamp(16px, 5vw, 56px); }
.chest-final { padding-bottom: clamp(70px, 10vw, 130px); }

.chest-scene {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}

.chest-wrap { text-align: center; }
.chest-wrap svg { width: 100%; max-width: 300px; height: auto; overflow: visible; }
.chest-glowellipse { animation: chestpulse 4.5s ease-in-out infinite; }
@keyframes chestpulse {
  0%, 100% { opacity: .5; }
  50% { opacity: .95; }
}
.chest-wrap .chest-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: .05em;
  color: var(--parchment);
  margin: 14px 0 4px;
}
.chest-wrap .chest-tag { color: var(--slate); font-size: .9rem; margin: 0 auto; max-width: 300px; }

.chest-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 26%),
    linear-gradient(180deg, var(--stone-800), var(--stone-900));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 30px 70px -30px rgba(0,0,0,.9), 0 0 60px -18px rgba(232,201,106,.16);
  overflow: hidden;
}
.chest-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

.brow {
  display: grid;
  grid-template-columns: 1.1fr 1.6fr auto 40px;
  gap: 14px;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.brow:last-of-type { border-bottom: none; }
.brow .seal { justify-self: end; }
.brow-main > small { display: block; color: var(--dim); font-size: .72rem; letter-spacing: .06em; }
.bname small { color: var(--gold-deep); font-weight: 600; }
.bname-free { color: var(--gold-bright); font-size: .78rem; letter-spacing: .04em; }
.brow .bname { font-weight: 600; color: var(--parchment); font-size: .95rem; }
.brow .bdesc { color: var(--slate); font-size: .84rem; line-height: 1.45; }
.brow .bprice { font-family: var(--serif); color: var(--gold); font-weight: 600; white-space: nowrap; }
.brow .bprice.free { color: var(--gold-bright); }

.chest-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  background: rgba(232, 201, 106, .05);
  border-top: 1px solid var(--line);
}
.chest-value { color: var(--dim); text-decoration: line-through; font-size: 1rem; }
.chest-price { font-family: var(--serif); font-weight: 700; font-size: 2rem; color: var(--gold-bright); text-shadow: 0 0 24px rgba(232, 201, 106, .4); }
.savebadge {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #1c1405;
  border-radius: 4px;
  padding: 6px 10px;
  box-shadow: 0 0 18px rgba(232, 201, 106, .35);
}
.chest-foot .btn { margin-left: auto; }

/* ---------------- tower spotlight ---------------- */

.tower-spot {
  max-width: 860px;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: clamp(28px, 4vw, 46px);
  background:
    radial-gradient(600px 260px at 50% -60px, rgba(84, 58, 130, .3), transparent 70%),
    linear-gradient(180deg, var(--stone-800), var(--stone-900));
  box-shadow: 0 0 80px -20px rgba(84, 58, 130, .4), inset 0 1px 0 rgba(255,255,255,.05);
  text-align: center;
}
.tower-spot .overline { margin-bottom: 10px; }
.tower-spot h3 { font-family: var(--serif); font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 0 0 14px; color: var(--parchment); }
.tower-spot p.lead { color: var(--slate); max-width: 640px; margin: 0 auto 22px; }
.tower-status { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.tower-status .chip.ok { border-color: rgba(158, 190, 224, .4); color: #cfe0f4; }
.tower-status .chip.wip { border-color: rgba(232, 201, 106, .45); color: var(--gold-bright); }
.tower-price { font-family: var(--serif); font-weight: 700; font-size: 2.2rem; color: var(--gold-bright); text-shadow: 0 0 26px rgba(232, 201, 106, .4); }

/* ---------------- treasury ---------------- */

.treasury-wrap {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, .015);
}
.treasury { width: 100%; border-collapse: collapse; font-size: .92rem; }
.treasury th {
  text-align: left;
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(232, 201, 106, .05);
}
.treasury td { padding: 13px 18px; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: middle; }
.treasury tr:last-child td { border-bottom: none; }
.treasury .tname { font-weight: 600; color: var(--parchment); }
.treasury .tdesc { color: var(--slate); font-size: .84rem; }
.treasury .tprice { font-family: var(--serif); font-weight: 600; color: var(--gold); text-align: right; white-space: nowrap; }
.th-price { text-align: right; }
.treasury .seal { display: inline-flex; }

/* ---------------- footer ---------------- */

.gate-footer {
  text-align: center;
  padding: 60px 20px 80px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(232, 201, 106, .04));
}
.gate-footer img { border-radius: 50%; box-shadow: 0 0 22px rgba(232, 201, 106, .3); }
.foot-line { color: var(--slate); margin: 16px 0 6px; }
.foot-grades { color: var(--dim); font-size: .84rem; margin: 0 0 14px; }
.foot-grades strong { color: var(--slate); }
.foot-links { font-size: .88rem; }

/* ---------------- responsive ---------------- */

@media (max-width: 900px) {
  .chest-scene { grid-template-columns: 1fr; }
  .chest-wrap svg { max-width: 220px; }
  .topnav { display: none; }
  .brow { grid-template-columns: 1fr; gap: 6px; }
  .brow .seal { display: none; }
  .brow .brow-main { padding-right: 0; }
  .chest-foot .btn { margin-left: 0; width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chest-glowellipse { animation: none; }
  .tile, .btn { transition: none; }
}
