:root {
  --bg: #f6f2ea; --card: #fff; --ink: #241a12; --muted: #766858; --line: #e8dcc6;
  --gold: #c08a2e; --gold-dark: #8f6214; --gold-soft: #fff6e2; --brown: #1f130b; --brown-2: #3a2312;
  --ok: #2e7d4f; --bad: #b3261e; --radius: 16px;
  --shadow: 0 1px 2px rgba(50,32,8,.06), 0 6px 18px rgba(50,32,8,.06);
  --shadow-lg: 0 14px 34px rgba(50,32,8,.16);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--gold-dark); }
h1 { font-size: 1.8rem; line-height: 1.22; margin: .2em 0 .5em; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: .2em 0 .6em; letter-spacing: -.005em; }
h3 { margin: 1em 0 .4em; }
code { background: #f2ebdf; padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 26px; padding-bottom: 56px; flex: 1 0 auto; width: 100%; }
.muted { color: var(--muted); }
small { color: var(--muted); display: block; font-size: .82rem; margin-top: 3px; }
:focus-visible { outline: 3px solid rgba(192,138,46,.45); outline-offset: 2px; }

/* ---------- header / footer ---------- */
header.site { background: linear-gradient(180deg, var(--brown), #2a1a0e); color: #f6e7c8; border-bottom: 1px solid rgba(192,138,46,.35); position: sticky; top: 0; z-index: 10; }
header.site .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: .01em; }
.brand .logo { width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; box-shadow: 0 4px 14px rgba(192,138,46,.35), 0 1px 2px rgba(0,0,0,.4); transition: transform .2s ease; }
nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
nav a, nav .link { color: #e9d6ad; text-decoration: none; padding: 8px 14px; border-radius: 999px; font: inherit; font-size: .95rem; transition: background .15s, color .15s; }
nav a.on, nav a:hover, nav .link:hover { background: rgba(255,255,255,.12); color: #fff; }
nav a.on { background: rgba(192,138,46,.28); }
body.admin header.site { background: linear-gradient(180deg, #17222a, #1d2a33); border-bottom-color: rgba(255,255,255,.12); }
body.admin .brand .logo { box-shadow: 0 1px 2px rgba(0,0,0,.4); }
body.admin .brand .logo .s1 { stop-color: #a9d0ea; } body.admin .brand .logo .s2 { stop-color: #5f97c0; } body.admin .brand .logo .s3 { stop-color: #2c5d82; }
body.admin .brand .logo .f1 { fill: #13222d; } body.admin .brand .logo .f2 { fill: #08121a; }
body.admin .brand .word b { background: linear-gradient(180deg, #cfe6f5, #7fb2d6); -webkit-background-clip: text; background-clip: text; }
footer.site { flex-shrink: 0; background: var(--brown); color: #cdb98f; padding: 26px 0; font-size: .9rem; }
footer.site b { color: #fff; }
footer.site a { color: #e6c47a; }
footer.site .wrap { display: flex; flex-direction: column; gap: 4px; }
footer.site .muted { color: #a8946c; }

/* ---------- cards, notices, buttons, forms ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card.narrow { max-width: 520px; margin: 0 auto; }
.card.center { max-width: 560px; margin: 40px auto; text-align: center; }
.notice { background: #eef6ee; border: 1px solid #cfe5d2; color: #1f5e37; padding: 11px 16px; border-radius: 12px; margin-bottom: 16px; }
.error { background: #fdecea; border: 1px solid #f5c6c2; color: var(--bad); padding: 11px 16px; border-radius: 12px; margin-bottom: 14px; }
.warn { background: #fff6e0; border: 1px solid #f1dca6; padding: 11px 16px; border-radius: 12px; }

button, .button { display: inline-block; font: inherit; font-weight: 600; padding: 10px 20px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s, box-shadow .15s, transform .05s; }
button:hover, .button:hover { border-color: var(--gold); box-shadow: 0 2px 8px rgba(50,32,8,.08); }
button:active, .button:active { transform: translateY(1px); }
button.primary, .button.primary { background: linear-gradient(180deg, #d19a3a, var(--gold)); border-color: var(--gold-dark); color: #fff; box-shadow: 0 2px 6px rgba(143,98,20,.3); }
button.primary:hover, .button.primary:hover { background: linear-gradient(180deg, var(--gold), var(--gold-dark)); }
button.link { background: none; border: 0; padding: 8px 14px; font-weight: 400; box-shadow: none; border-radius: 999px; }
button.mini { padding: 2px 10px; font-size: .8rem; border-radius: 8px; }
form.inline { display: inline; margin: 0; }

label { display: block; margin: 0 0 14px; font-weight: 600; font-size: .93rem; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 11px 13px; font: inherit; font-weight: 400; border: 1px solid #d9cbb4; border-radius: 12px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(192,138,46,.22); }
input[type=file] { padding: 9px; background: #fbf8f2; border-style: dashed; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-input { display: inline-block; width: 180px; padding: 4px 9px; font-size: .8rem; margin: 0; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; text-align: center; padding: 56px 24px 44px; margin-bottom: 30px; border-radius: 24px; color: #fff;
  background: radial-gradient(600px 260px at 15% 0%, rgba(224,169,74,.35), transparent 70%), radial-gradient(520px 260px at 90% 100%, rgba(192,138,46,.28), transparent 70%), linear-gradient(135deg, #1f130b, #4a2c14); box-shadow: var(--shadow-lg); }
.hero h1 { font-size: 2.5rem; margin: 0 0 .35em; letter-spacing: -.02em; }
.hero p { color: #ecd9b3; font-size: 1.12rem; max-width: 640px; margin: 0 auto; }
.steps { list-style: none; display: flex; justify-content: center; gap: 14px; padding: 0; margin: 30px 0 0; flex-wrap: wrap; counter-reset: s; }
.steps li { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(4px); border-radius: 14px; padding: 13px 20px; min-width: 180px; text-align: left; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #e0a94a, var(--gold)); color: #2a1a0e; font-size: .82rem; font-weight: 800; margin-right: 8px; }
.steps span { display: block; color: #d6c298; font-size: .88rem; margin-left: 34px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.card.game { padding: 0; overflow: hidden; text-decoration: none; color: inherit; transition: transform .18s, box-shadow .18s, border-color .18s; }
.card.game:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #d8bd85; }
.card.game .body { padding: 18px 20px 20px; }
.card.game h2 { margin-bottom: .3em; }
.card.game p { color: var(--muted); margin: 0 0 12px; font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thumb { aspect-ratio: 16 / 10; background: linear-gradient(135deg, #3a2414, #6b4520); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; transition: transform .4s; }
.card.game:hover .thumb img { transform: scale(1.05); }
.thumb > span:not(.hot-badge):not(.new-badge):not(.web-badge) { font-size: 3rem; color: var(--gold); }
.thumb.big { border-radius: var(--radius); margin-bottom: 20px; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.price { display: inline-block; background: var(--gold-soft); border: 1px solid #f0dca8; border-radius: 999px; padding: 3px 14px; font-size: .92rem; }
.price b { color: var(--gold-dark); font-size: 1.1rem; }

/* ---------- game detail ---------- */
.crumbs { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.detail { display: grid; grid-template-columns: 1fr 390px; gap: 30px; align-items: start; }
.lead { font-size: 1.1rem; color: var(--muted); }
.desc { white-space: pre-line; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.buy { position: sticky; top: 82px; border-top: 4px solid var(--gold); }
.plans { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.plan { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "r n c" "r p p"; column-gap: 12px; align-items: center; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; margin: 0; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.plan:hover { border-color: #d8bd85; }
.plan:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px rgba(192,138,46,.18); }
.plan input { grid-area: r; width: auto; margin: 0; accent-color: var(--gold-dark); }
.plan .name { grid-area: n; }
.plan .cost { grid-area: c; color: var(--gold-dark); font-size: 1.05rem; }
.plan .per { grid-area: p; color: var(--muted); font-weight: 400; font-size: .82rem; }
.buy button.primary { width: 100%; padding: 14px; font-size: 1.05rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin: 10px 0 20px; }
.gallery a { display: block; overflow: hidden; border-radius: 12px; }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); display: block; transition: transform .25s, box-shadow .25s; }
.gallery a:hover img { transform: scale(1.04); box-shadow: var(--shadow); }
.gallery.admin form { display: grid; gap: 6px; }
.upload-status { white-space: pre-line; margin-top: 8px; }
.upload-status:empty { display: none; }

/* ---------- order / payment ---------- */
.pay { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; margin-bottom: 16px; }
.qr { text-align: center; }
.qr img { max-width: 100%; height: auto; border-radius: 12px; }
table.info { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
table.info th { text-align: left; color: var(--muted); font-weight: 400; padding: 8px 12px 8px 0; width: 38%; vertical-align: top; }
table.info td { padding: 8px 0; border-bottom: 1px dashed var(--line); word-break: break-word; }
.big { font-size: 1.25rem; font-weight: 700; color: var(--gold-dark); }
.waiting { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dev { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.dev button { background: #fff3cd; }
.card.ok { border-color: #bfe0c9; border-top: 4px solid var(--ok); }
.card.ok h1 { color: var(--ok); }
pre.key { white-space: pre-wrap; word-break: break-all; background: #f6f0e4; border: 1px solid var(--line); padding: 14px; border-radius: 12px; font-size: .85rem; margin: 0 0 10px; }
.howto { padding-left: 20px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.two.wide-left { grid-template-columns: 3fr 2fr; }
.two > div > .card + .card { margin-top: 20px; }
.prose { max-width: 820px; margin: 0 auto; }
.prose h2 { margin-top: 1.4em; }

/* ---------- admin lists ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { border-left: 4px solid var(--gold); }
.stat span { display: block; color: var(--muted); font-size: .85rem; }
.stat b { font-size: 1.55rem; }
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.filters input, .filters select { width: auto; margin: 0; }
.filters input { flex: 1; min-width: 200px; }
.filters h1 { margin: 0; flex: 1; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.list th { text-align: left; background: #f6f0e4; padding: 11px 14px; white-space: nowrap; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.list td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
table.list tbody tr:hover { background: #fcf9f3; }
.status { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.status.paid { background: #e3f3e8; color: var(--ok); }
.status.pending { background: #fff3d6; color: #8a5a00; }
.status.cancelled { background: #f6e1df; color: var(--bad); }
.tag { display: inline; background: #eee; border-radius: 6px; padding: 0 6px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions form { margin: 0; }

.detail > *, .pay > *, .two > * { min-width: 0; }

@media (max-width: 860px) {
  .detail, .pay, .two, .two.wide-left { grid-template-columns: 1fr; }
  .buy { position: static; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hero { padding: 38px 18px 30px; border-radius: 18px; }
  .hero h1 { font-size: 1.8rem; }
  .row { grid-template-columns: 1fr; }
  header.site { position: static; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }
.dl { margin: 16px 0 24px; }
.dl .button { padding: 12px 26px; font-size: 1.05rem; }
.desc.guide { margin-bottom: 20px; }
.danger { color: var(--bad); }
button.danger:hover { border-color: var(--bad); background: #fdecea; }
.trial { font-style: normal; font-size: .72rem; font-weight: 700; background: #e3f3e8; color: var(--ok); border-radius: 99px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.thumb { position: relative; }
.hot-badge, .thumb .hot-badge { position: absolute; top: 10px; right: 10px; left: auto; z-index: 1; display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .72rem; line-height: 1.4; font-weight: 800; letter-spacing: .04em; color: #fff; background: linear-gradient(135deg, #ff6a3d, #e0262b); box-shadow: 0 3px 10px rgba(224,38,43,.4); animation: hot-pulse 2s ease-in-out infinite; transform-origin: top right; }
.hot-badge.inline { position: static; vertical-align: 6px; font-size: .75rem; margin-left: 6px; }
.thumb .web-badge { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 2px 8px; border-radius: 99px; font-size: .66rem; line-height: 1.4; font-weight: 800; color: #fff; background: linear-gradient(135deg, #2bb673, #138a52); box-shadow: 0 3px 10px rgba(19,138,82,.35); }
.hot-badge.small { position: static; animation: none; padding: 1px 8px; font-size: .7rem; box-shadow: none; }
@keyframes hot-pulse { 50% { transform: scale(1.07); } }
.trial.forever { background: #fde7c4; color: var(--gold-dark); }
.card.game .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.price.forever { background: #fde7c4; border-color: #f0c98a; }
.sold { color: var(--muted); font-size: .88rem; white-space: nowrap; }
.card.game .stats { flex-basis: 100%; display: flex; flex-wrap: nowrap; align-items: center; gap: 14px; }
p.sold { margin: -4px 0 16px; }
p.sold b { color: var(--ink); }
.plan .per .trial.gmail { margin-left: 0; }
.brand:hover .logo { transform: translateY(-1px) rotate(-3deg); }
.brand .word { font-size: 1.42rem; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.brand .word b { font-weight: 800; background: linear-gradient(180deg, #ffe3a0, #d39a3a); -webkit-background-clip: text; background-clip: text; color: transparent; }
body.admin .brand .logo .gem { fill: #eaf5fc; }
/* ---------- admin theme: cool slate/blue, so it never looks like the shop ---------- */
body.admin {
  --bg: #eef2f6; --ink: #16212b; --muted: #5d6d7b; --line: #dbe3ea;
  --gold: #2f6fa3; --gold-dark: #1d5584; --gold-soft: #eaf3fb; --brown: #141e26; --brown-2: #213040;
  --shadow: 0 1px 2px rgba(15,30,45,.06), 0 6px 18px rgba(15,30,45,.06);
  --shadow-lg: 0 14px 34px rgba(15,30,45,.16);
}
body.admin :focus-visible { outline-color: rgba(47,111,163,.45); }
body.admin code { background: #e6edf3; }
body.admin nav a, body.admin nav .link { color: #c4d4e2; }
body.admin nav a.on { background: rgba(127,178,214,.22); color: #fff; }
body.admin .brand .admin-tag { display: inline-block; margin-left: 2px; padding: 2px 9px; border-radius: 99px; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #cfe6f5; background: rgba(127,178,214,.18); border: 1px solid rgba(127,178,214,.35); }
body.admin footer.site { color: #9fb2c2; }
body.admin footer.site a { color: #8cc0e6; }
body.admin footer.site .muted { color: #7a8fa1; }
body.admin button.primary, body.admin .button.primary { background: linear-gradient(180deg, #3f86c1, var(--gold)); box-shadow: 0 2px 6px rgba(29,85,132,.3); }
body.admin button:hover, body.admin .button:hover { box-shadow: 0 2px 8px rgba(15,30,45,.08); }
body.admin input, body.admin select, body.admin textarea { border-color: #cbd6e0; }
body.admin input:focus, body.admin select:focus, body.admin textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(47,111,163,.2); }
body.admin input[type=file] { background: #f5f8fb; }
body.admin .price { border-color: #cfe1f0; }
body.admin pre.key { background: #f0f4f8; }
body.admin table.list th { background: #eef3f7; }
body.admin table.list tbody tr:hover { background: #f6f9fc; }
.new-badge, .thumb .new-badge { position: absolute; top: 10px; right: 10px; z-index: 1; display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .72rem; line-height: 1.4; font-weight: 800; letter-spacing: .04em; color: #fff; background: linear-gradient(135deg, #4f8cff, #6a3df0); box-shadow: 0 3px 10px rgba(79,92,240,.4); }
.thumb .new-badge.below { top: 40px; }
.new-badge.inline { position: static; vertical-align: 6px; font-size: .75rem; margin-left: 6px; }
.new-badge.small { position: static; padding: 1px 8px; font-size: .7rem; box-shadow: none; }
