/* Tiamat store — mirrors the approved Tebex storefront (dark, purple + gold). */
:root {
  --bg: #0e0b16;
  --bg-2: #15101f;
  --surface: #221a34;
  --surface-2: #2b2142;
  --line: rgba(237, 230, 214, .10);
  --text: #ede6d6;
  --muted: #b9b0c9;
  --primary: #8c3fd6;
  --primary-hover: #9d55e3;
  --gold: #f2c14e;
  --gold-hover: #f7cf6d;
  --on-gold: #1b1206;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 18px 48px rgba(0, 0, 0, .45);
  --container: 1152px;
  --gutter: 16px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: 'Syne', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-hover); }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.1; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
.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; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--gold); color: var(--on-gold); padding: 10px 14px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
main { flex: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 0; border-radius: 10px;
  font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none; cursor: pointer;
  transition: background-color .18s var(--ease), transform .12s var(--ease), box-shadow .18s var(--ease);
  touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-gold { background: var(--gold); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-hover); color: var(--on-gold); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.btn-discord { background: #5865f2; color: #fff; }
.btn-discord:hover { background: #6b76f5; color: #fff; }
.btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* Header */
.site-header { background: #1e1730; border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.brand { display: flex; align-items: center; flex: none; }
.brand img { height: 40px; width: auto; }
.nav { display: flex; gap: 20px; margin-right: auto; }
.nav a { color: var(--text); text-decoration: none; font-weight: 600; padding: 10px 2px; }
.nav a:hover { color: var(--gold); }
.header-cta { margin-left: auto; gap: 0; }

/* Hero */
.hero { padding: 16px 0 8px; }
.hero-card {
  position: relative; overflow: hidden; border-radius: var(--radius-lg);
  min-height: 460px; display: flex; align-items: flex-end;
  background: var(--surface) center/cover no-repeat;
  box-shadow: var(--shadow);
}
.hero-card picture, .hero-card picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 50%; }
.hero-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 11, 22, .85) 0%, rgba(14, 11, 22, .55) 40%, rgba(14, 11, 22, 0) 70%), linear-gradient(0deg, rgba(14, 11, 22, .7) 0%, rgba(14, 11, 22, 0) 45%); }
.hero-body { position: relative; z-index: 1; padding: 32px; max-width: 700px; }
.hero-body .emblem { width: 64px; height: 64px; margin-bottom: 14px; }
.hero-body h1 { font-size: clamp(36px, 6vw, 56px); margin-bottom: 14px; }
.hero-body p { color: #ddd5e8; font-size: 17px; margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.ip-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-radius: 10px; background: rgba(14, 11, 22, .6); box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .45); color: var(--text); font-weight: 700; cursor: pointer; border: 0; }
.ip-chip span { color: var(--gold); }
.ip-chip small { color: var(--muted); font-weight: 600; font-size: 13px; }

/* Sections */
.section { padding: 56px 0 8px; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(28px, 4.2vw, 40px); }
.section-head p { color: var(--muted); margin-top: 10px; }

/* Pack grid */
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.pack {
  position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.pack:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(140, 63, 214, .55), var(--shadow); }
.pack.welcome { box-shadow: inset 0 0 0 2px rgba(242, 193, 78, .6); }
.pack-img { aspect-ratio: 4 / 3; background: radial-gradient(60% 55% at 50% 50%, rgba(140, 63, 214, .16), transparent 70%); }
.pack-img img { width: 100%; height: 100%; object-fit: contain; }
.pack-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.pack-body h3 { font-size: 22px; }
.pack-escamas { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 700; }
.pack-escamas img { width: 22px; height: 22px; }
.badge { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--gold); color: var(--on-gold); }
.badge.bonus { background: rgba(140, 63, 214, .9); color: #fff; left: auto; right: 12px; }
.pack-sum { color: var(--muted); font-size: 15px; }
.pack-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 10px; }
.price { font-family: var(--body); font-weight: 700; font-size: 26px; letter-spacing: -.01em; color: var(--gold); font-variant-numeric: tabular-nums; white-space: nowrap; }
.no-card { text-align: center; margin-top: 22px; color: var(--muted); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.step { background: var(--bg-2); border-radius: var(--radius-lg); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.step img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.step .fit { object-fit: contain; background: radial-gradient(60% 60% at 50% 50%, rgba(140, 63, 214, .18), transparent 70%); }
.step div { padding: 18px 20px 22px; }
.step h3 { font-size: 21px; margin-bottom: 8px; }
.step p { color: var(--muted); }
.step b { color: var(--text); }

/* Featured */
.featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: center; background: var(--surface); border-radius: var(--radius-lg); padding: 24px 32px; box-shadow: inset 0 0 0 1px var(--line); }
.featured img { width: 100%; max-width: 420px; margin: 0 auto; }
.featured .kicker { color: var(--gold); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin-bottom: 8px; }
.featured h2 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 14px; }
.featured p { color: var(--muted); margin-bottom: 10px; }
.featured .pack-foot { justify-content: flex-start; gap: 18px; margin-top: 12px; }

/* About */
.about { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.about h2 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 14px; }
.about p { color: #d8d0e3; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; padding: 0; list-style: none; }
.chips li { padding: 6px 12px; border-radius: 999px; background: rgba(140, 63, 214, .18); box-shadow: inset 0 0 0 1px rgba(140, 63, 214, .45); }
.info-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .3); }
.info-card + .info-card { margin-top: 12px; box-shadow: inset 0 0 0 1px rgba(140, 63, 214, .45); }
.info-card .label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.info-card .ip { font-size: 22px; font-weight: 700; color: var(--gold); }
.info-card p { color: var(--muted); margin: 6px 0 12px; }

/* Footer */
.site-footer { margin-top: 64px; background: #1e1730; border-top: 1px solid var(--line); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: center; justify-content: space-between; padding-top: 28px; padding-bottom: 28px; }
.foot-brand img { height: 32px; width: auto; }
.foot-brand p { color: var(--muted); font-size: 14px; margin-top: 8px; }
.pay { display: flex; gap: 14px; align-items: center; }
.pay img { width: 34px; height: 34px; opacity: .85; filter: invert(1); }
.legal-links { display: flex; flex-wrap: wrap; gap: 6px 18px; width: 100%; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.legal-links a { color: var(--muted); }
.legal-links a:hover { color: var(--text); }
.legal-links span { color: var(--muted); margin-left: auto; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 3, 10, .72); backdrop-filter: blur(4px); animation: fade .2s var(--ease); }
.modal-card {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
  animation: pop .22s var(--ease);
}
.modal-top { display: flex; gap: 16px; align-items: center; padding: 20px 20px 0; }
.modal-top img { width: 104px; height: 104px; flex: none; }
.modal-top h2 { font-size: 24px; }
.modal-top .price { font-size: 22px; display: block; margin-top: 6px; }
.modal-close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 26px; line-height: 1; }
.modal-close:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.modal-body { padding: 16px 20px 22px; }
.modal-body .pack-sum { margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(237, 230, 214, .22);
  background: var(--bg); color: var(--text); font: 600 17px/1.2 var(--body);
}
.field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 193, 78, .25); }
.field input[aria-invalid="true"] { border-color: #ff8a7a; }
.help { color: var(--muted); font-size: 14px; margin-top: 6px; }
.error { color: #ff9d8f; font-size: 14px; margin-top: 6px; min-height: 0; }
.notice { background: rgba(242, 193, 78, .1); box-shadow: inset 0 0 0 1px rgba(242, 193, 78, .35); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #ead9b0; margin-bottom: 14px; }
.modal-body .btn { width: 100%; }
.secure { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 10px; }
.secure svg { width: 14px; height: 14px; fill: currentColor; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1100; background: var(--gold); color: var(--on-gold); font-weight: 700; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.toast.show { opacity: 1; }

/* Simple pages (legal, thanks) */
.page { padding: 40px 0 0; }
.page .container { max-width: calc(780px + 2 * var(--gutter)); }
.page h1 { font-size: clamp(30px, 5vw, 44px); margin-bottom: 20px; }
.page h2 { font-size: 22px; margin: 28px 0 10px; }
.page p, .page li { color: #d8d0e3; margin-bottom: 10px; }
.page ul { padding-left: 22px; }
.page .updated { color: var(--muted); font-size: 14px; }
.thanks { text-align: center; }
.thanks img { width: 160px; margin: 0 auto 16px; }
.thanks .btn { margin-top: 18px; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (max-width: 900px) {
  .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .featured, .about { grid-template-columns: 1fr; }
  .featured { padding: 20px; }
}
@media (max-width: 640px) {
  .packs { grid-template-columns: 1fr; }
  .pack-img { aspect-ratio: 16 / 10; }
  .hide-sm { display: none; }
  .site-header .container { min-height: 64px; gap: 12px; }
  .brand img { height: 30px; }
  .nav { display: none; }
  .header-cta { padding: 8px 12px; }
  .hero-card { min-height: 520px; }
  .hero-card picture img { object-position: 70% 30%; }
  .hero-card::after { background: linear-gradient(0deg, rgba(14, 11, 22, .92) 0%, rgba(14, 11, 22, .6) 45%, rgba(14, 11, 22, .1) 75%); }
  .hero-body { padding: 22px; }
  .hero-body p { font-size: 16px; }
  .section { padding-top: 44px; }
  .modal { align-items: flex-end; padding: 0; }
  .modal-card { max-width: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92dvh; }
  .modal-top img { width: 80px; height: 80px; }
  .legal-links span { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Server status */
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 600; margin: 0; }
.status i { width: 9px; height: 9px; border-radius: 50%; background: #6b6478; box-shadow: 0 0 0 3px rgba(107, 100, 120, .25); }
.status.on i { background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .22); }
.status.on span { color: var(--text); }
.hero-actions .status { align-self: center; padding-left: 4px; }
.info-card .status { margin: 4px 0 12px; }

/* Recent purchases */
.recent { margin-top: 26px; text-align: center; }
.recent .label { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.recent ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.recent li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.recent li img { width: 24px; height: 24px; border-radius: 6px; image-rendering: pixelated; }
.recent li b { color: var(--text); }
.recent li span { color: var(--muted); }

/* Ranks */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 22px; }
.tab { min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 0; cursor: pointer; background: var(--surface); color: var(--muted); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .18s var(--ease), color .18s var(--ease); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--primary); color: #fff; box-shadow: none; }
.ranks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.rank { position: relative; background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: inset 0 3px 0 var(--rank), inset 0 0 0 1px var(--line); }
.rank.popular { box-shadow: inset 0 3px 0 var(--rank), inset 0 0 0 2px rgba(242, 193, 78, .55); }
.rank h3 { font-size: 22px; color: var(--rank); margin-bottom: 8px; }
.rank-pop { left: auto; right: 12px; top: 12px; font-size: 12px; }
.rank-price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 10px; }
.rank-price img { width: 20px; height: 20px; image-rendering: pixelated; }
.rank-pack { flex-basis: 100%; font-weight: 500; font-size: 13px; color: var(--muted); }
.rank-inh { font-size: 14px; color: var(--gold); margin-bottom: 6px; }
.rank ul { margin: 0; padding-left: 18px; color: #d8d0e3; font-size: 14px; }
.rank li { margin-bottom: 4px; }

/* FAQ */
.faq { max-width: calc(820px + 2 * var(--gutter)); }
.faq details { background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; font-weight: 700; position: relative; min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--gold); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 18px 16px; color: #d8d0e3; }

/* Modal fine print */
.fine { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 8px; }
.fine a { color: var(--muted); }
.ranks[hidden] { display: none; }
.rank .rank-pop { position: static; display: inline-block; margin-bottom: 8px; }
