/* Emberfall Store. Palette: gold and red only (see STYLE.md). */
:root {
  --bg: #170c07;
  --bg-2: #22120a;
  --surface: #2b170e;
  --surface-2: #3a2014;
  --line: rgba(255, 179, 102, 0.14);
  --line-strong: rgba(255, 179, 102, 0.32);
  --text: #fff3e0;
  --muted: #d6b496;
  --dim: #a0806a;
  --gold: #ffc300;
  --amber: #ffaa00;
  --orange: #ff7a00;
  --red: #ff3d3d;
  --deep: #b71c1c;
  --grad: linear-gradient(100deg, #fff3b0 0%, #ffc300 30%, #ff7a00 65%, #ff3d3d 100%);
  --grad-btn: linear-gradient(135deg, #ffc300 0%, #ff7a00 55%, #ff3d3d 100%);
  --radius: 20px;
  --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(255, 122, 0, 0.28), transparent 70%),
    radial-gradient(700px 400px at 100% 100%, rgba(183, 28, 28, 0.18), transparent 70%),
    var(--bg);
  color: var(--text);
  font: 400 16px/1.55 "Fredoka", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#embers { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
header, main, footer { position: relative; z-index: 1; }
main { max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.92em; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* header */
.top {
  max-width: 1120px; margin: 0 auto; padding: 18px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { border-radius: 10px; image-rendering: pixelated; box-shadow: 0 0 0 1px var(--line-strong); }
.wordmark {
  font-weight: 700; letter-spacing: 0.08em; font-size: 1.3rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-tag {
  font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em;
  border: 1px solid var(--line-strong); padding: 2px 8px; border-radius: 999px;
}
.ip {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  padding: 8px 14px; border-radius: 999px; font: inherit; transition: border-color .2s, transform .2s;
}
.ip:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.ip-label { color: var(--muted); font-size: 0.85rem; }
.ip code { color: var(--gold); }
.ip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 10px var(--orange); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* hero */
.hero { text-align: center; padding: 40px 0 28px; }
.eyebrow { margin: 0 0 10px; color: var(--orange); font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: .8rem; }
h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1.05; font-weight: 700; letter-spacing: -0.01em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { max-width: 620px; margin: 18px auto 0; color: var(--muted); font-size: 1.05rem; }

.player {
  margin: 30px auto 0; max-width: 460px; text-align: left;
  display: flex; gap: 14px; align-items: center;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box;
  border: 1.5px solid transparent; border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.player-head { border-radius: 10px; image-rendering: pixelated; flex: none; background: var(--surface-2); }
.player-field { flex: 1; min-width: 0; }
.player label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.player input {
  width: 100%; margin: 4px 0 2px; padding: 8px 12px; font: 600 1.1rem "Fredoka", sans-serif; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: 12px;
}
.player input::placeholder { color: var(--dim); font-weight: 400; }
.player input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 195, 0, .18); }
.player input.bad { border-color: var(--red); }
.player small { color: var(--dim); font-size: .8rem; }
.player small.err { color: var(--red); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 36px 0 6px; }
.tab {
  font: 600 .95rem "Fredoka", sans-serif; color: var(--muted); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); padding: 9px 18px; border-radius: 999px;
  transition: color .2s, border-color .2s, background .2s;
}
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab[aria-selected="true"] { color: #2a1206; background: var(--grad-btn); border-color: transparent; }
.tab .snow { margin-left: 4px; }
.cat-blurb { text-align: center; color: var(--dim); margin: 10px 0 22px; min-height: 1.5em; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.loading, .empty { grid-column: 1 / -1; text-align: center; color: var(--dim); padding: 40px 0; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 55%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 20px;
  box-shadow: var(--shadow); transition: transform .25s, border-color .25s, box-shadow .25s;
  animation: rise .45s both;
}
.card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: 0 24px 60px -24px rgba(255, 90, 0, .45); }
.card.featured { background: linear-gradient(180deg, var(--surface-2), var(--surface) 55%) padding-box, var(--grad) border-box; border: 1.5px solid transparent; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.badge {
  position: absolute; top: -11px; right: 16px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #2a1206; background: var(--grad-btn); padding: 3px 10px; border-radius: 999px;
}
.card h3 { margin: 0; font-size: 1.45rem; font-weight: 700; }
.card .tagline { margin: 2px 0 14px; color: var(--muted); font-size: .95rem; }
.rank-name { -webkit-background-clip: text; background-clip: text; color: transparent; }
.rank-phoenix { background-image: linear-gradient(90deg, #ff3d3d, #ffb200); }
.rank-sunfire { background-image: linear-gradient(90deg, #fff3b0, #ffc300, #ff7a00); }
.rank-tag { font-size: .85rem; color: var(--dim); margin-bottom: 10px; }
.rank-tag b { font-weight: 700; }
.perks { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 7px; flex: 1; }
.perks li { position: relative; padding-left: 22px; font-size: .95rem; }
.perks li::before {
  content: ""; position: absolute; left: 3px; top: .5em; width: 9px; height: 9px; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); background: var(--grad-btn);
}
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.price { font-size: 1.6rem; font-weight: 700; }
.price small { font-size: .85rem; color: var(--dim); font-weight: 500; margin-left: 2px; }
.note { font-size: .78rem; color: var(--dim); margin: -8px 0 12px; }

.btn {
  font: 700 1rem "Fredoka", sans-serif; color: #2a1206; cursor: pointer; border: 0;
  background: var(--grad-btn); padding: 11px 20px; border-radius: 14px;
  box-shadow: 0 6px 20px -6px rgba(255, 90, 0, .6), inset 0 -3px 0 rgba(0, 0, 0, .18);
  transition: transform .15s, filter .15s;
}
.btn:hover { transform: translateY(-2px) scale(1.02); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--line-strong); }

/* how */
.how { margin-top: 56px; text-align: center; }
.how h2 { font-size: 1.5rem; margin: 0 0 18px; }
.how ol { list-style: none; counter-reset: s; padding: 0; margin: 0 auto; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); max-width: 960px; }
.how li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-align: left; color: var(--muted); }
.how li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 8px; border-radius: 50%; background: var(--grad-btn); color: #2a1206; font-weight: 700; }
.how li b { color: var(--text); }

.foot { border-top: 1px solid var(--line); text-align: center; color: var(--dim); font-size: .88rem; padding: 26px 16px 34px; }
.foot p { margin: 4px auto; max-width: 720px; }
.foot b { color: var(--muted); }
.fine { opacity: .7; }

/* checkout dialog */
dialog {
  width: min(440px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto;
  border: 1.5px solid transparent; border-radius: 24px; padding: 26px 24px 22px; color: var(--text);
  background: linear-gradient(180deg, var(--surface-2), var(--surface)) padding-box, var(--grad) border-box;
  box-shadow: 0 30px 90px -20px #000;
}
dialog::backdrop { background: rgba(10, 4, 2, .72); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.co-close-wrap { position: absolute; top: 10px; right: 12px; margin: 0; }
.co-close { background: none; border: 0; color: var(--muted); font-size: 1.6rem; cursor: pointer; line-height: 1; }
.co-close:hover { color: var(--text); }
.co-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.co-head img { border-radius: 10px; image-rendering: pixelated; }
.co-head h2 { margin: 0; font-size: 1.3rem; }
.co-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.co-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; margin-bottom: 16px; border-top: 1px dashed var(--line-strong); border-bottom: 1px dashed var(--line-strong); }
.co-total span { color: var(--muted); }
.co-total b { font-size: 1.5rem; }
.co-msg { text-align: center; padding: 6px 0 2px; }
.co-msg h2 { margin: 10px 0 6px; font-size: 1.5rem; }
.co-msg p { color: var(--muted); margin: 0 0 16px; }
.co-err { color: #ff8a80; background: rgba(255, 61, 61, .1); border: 1px solid rgba(255, 61, 61, .3); padding: 10px 12px; border-radius: 12px; font-size: .92rem; margin-bottom: 12px; }
.co-test { font-size: .8rem; color: var(--gold); background: rgba(255, 195, 0, .08); border: 1px solid rgba(255, 195, 0, .25); padding: 8px 10px; border-radius: 10px; margin-bottom: 14px; }
#paypal-buttons { min-height: 50px; }
.flame { font-size: 3rem; line-height: 1; filter: drop-shadow(0 0 18px rgba(255, 122, 0, .7)); animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker { 50% { transform: scale(1.06) rotate(-2deg); } }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 10;
  background: var(--surface-2); border: 1px solid var(--line-strong); padding: 10px 18px; border-radius: 999px;
  transition: opacity .25s, transform .25s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .ip-label { display: none; }
  .brand-tag { display: none; }
  .hero { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
