:root {
  --red: #d81f26;
  --red-dark: #b5161c;
  --red-soft: #fdeeee;
  --text: #222;
  --text2: #555;
  --muted: #999;
  --line: #e5e5e5;
  --bg: #f4f4f4;
  --card: #fff;
  --yellow: #ffcc33;
  --radius: 6px;
  --bar-h: 72px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: #fff;
  font-size: 14px;
  line-height: 1.4;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
.hidden { display: none !important; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.header { position: sticky; top: 0; z-index: 50; background: #fff; box-shadow: 0 1px 0 var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 34px; height: 34px; object-fit: contain; }
.brand-divider { width: 1px; height: 26px; background: var(--line); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 13px; font-weight: 700; }
.brand-text small { font-size: 12px; color: var(--text2); }
.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 22px; fill: #777; }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; background: #c8c8c8; display: grid; place-items: center; overflow: hidden; font-weight: 700; color: #fff; font-size: 15px; }
.avatar-btn svg { width: 22px; fill: #fff; margin-top: 6px; }
.avatar-btn.logged { background: var(--red); }

/* Search */
.search-panel { display: none; position: absolute; left: 0; right: 0; top: 0; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.08); padding: 8px 0 10px; }
.search-panel.open { display: block; }
.search-box { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 0 0 12px; background: var(--bg); border-radius: 20px; }
.search-box svg { width: 18px; fill: var(--muted); flex-shrink: 0; }
.search-box input { flex: 1; border: 0; outline: 0; background: none; height: 100%; font-size: 15px; min-width: 0; }
.search-close { color: var(--red); font-weight: 500; padding: 0 14px; height: 100%; }
.suggestions { list-style: none; max-height: 60vh; overflow-y: auto; margin-top: 6px; }
.suggestions li { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 4px; }
.suggestions li:hover, .suggestions li.active { background: var(--red-soft); }
.suggestions li img { width: 36px; height: 36px; object-fit: contain; }
.suggestions .s-name { flex: 1; font-weight: 500; }
.suggestions .s-name small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.suggestions mark { background: none; color: var(--red); font-weight: 700; }
.suggestions .s-price { color: var(--red); font-weight: 700; }
.suggestions .empty { color: var(--muted); justify-content: center; cursor: default; }
.suggestions .empty:hover { background: none; }

/* Notice */
.notice { background: #fff8e1; border-bottom: 1px solid #ffe8a3; color: #8a5a00; font-size: 13px; overflow: hidden; white-space: nowrap; }
.notice .wrap { overflow: hidden; }
.notice-track { display: inline-block; padding: 7px 0 7px 100%; animation: marquee 28s linear infinite; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Slider ---------- */
.slider { position: relative; overflow: hidden; background: #1a0b33; aspect-ratio: 2 / 1; margin: 12px 0; border-radius: 14px; touch-action: pan-y; container-type: inline-size; box-shadow: 0 6px 20px rgba(40,10,80,.25); }
.slides { display: flex; height: 100%; transition: transform .5s ease; }
.slide { position: relative; display: block; min-width: 100%; height: 100%; overflow: hidden; }
.slide img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.dots { position: absolute; right: 14px; bottom: 10px; display: flex; gap: 5px; z-index: 3; }
.dots button { width: 6px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.5); transition: .3s; }
.dots button.active { background: #fff; width: 16px; }
.slide-arrow { position: absolute; top: 50%; z-index: 3; width: 32px; height: 32px; margin-top: -16px; border-radius: 50%; background: rgba(0,0,0,.45); display: none; place-items: center; transition: background .2s; }
.slide-arrow:hover { background: rgba(0,0,0,.7); }
.slide-arrow svg { width: 22px; fill: #fff; }
.slide-arrow.prev { left: 8px; }
.slide-arrow.next { right: 8px; }

/* Promo banner (HTML) */
.promo { --bg1: #3b1670; --bg2: #12062a; --glow: rgba(170, 90, 255, .55); background: radial-gradient(circle at 72% 45%, var(--glow), transparent 55%), linear-gradient(110deg, var(--bg2) 20%, var(--bg1)); color: #fff; }
.promo.theme-red { --bg1: #7a1010; --bg2: #1c0404; --glow: rgba(255, 70, 50, .5); }
.promo.theme-blue { --bg1: #0f3a7a; --bg2: #050f24; --glow: rgba(60, 160, 255, .5); }
.promo.theme-gold { --bg1: #6b4208; --bg2: #1a0f02; --glow: rgba(255, 190, 60, .5); }
.promo::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(115deg, transparent 0 18%, rgba(255,255,255,.04) 18% 19%, transparent 19% 32%); pointer-events: none; }
.promo .promo-art {
  position: absolute; top: 0; right: 0; width: 64%; height: 100%; object-fit: cover; object-position: right center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28%); mask-image: linear-gradient(90deg, transparent, #000 28%);
}
.promo .promo-art.contain { width: 52%; right: 4%; object-fit: contain; object-position: center; padding: 6% 0; filter: drop-shadow(0 10px 24px rgba(0,0,0,.5)); -webkit-mask-image: none; mask-image: none; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4%); } }
.promo-text { position: relative; z-index: 2; height: 100%; width: 58%; display: flex; flex-direction: column; justify-content: center; padding: 0 0 0 5.5cqw; }
.promo-logo {
  align-self: flex-start; font-weight: 900; font-style: italic; letter-spacing: -.02em; line-height: .9; font-size: clamp(14px, 3.6cqw, 30px);
  background: linear-gradient(180deg, #fff3b0, #f5b83d 55%, #c8811b); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 3cqw; filter: drop-shadow(0 1px 1px rgba(0,0,0,.4));
}
.promo-logo small { display: block; text-align: right; font-size: .45em; letter-spacing: .25em; }
.promo h3 { font-size: clamp(17px, 4.4cqw, 38px); font-weight: 900; line-height: 1.15; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.promo p { margin-top: 1.6cqw; font-size: clamp(11px, 2.5cqw, 21px); color: rgba(255,255,255,.85); line-height: 1.3; }
.promo-cta { display: flex; align-items: center; margin-top: 4cqw; }
.promo-btn {
  position: relative; z-index: 1; padding: clamp(7px, 1.7cqw, 14px) clamp(16px, 4cqw, 36px); border-radius: 40px; font-weight: 700; font-size: clamp(12px, 2.4cqw, 20px);
  color: #2a1600; background: linear-gradient(180deg, #fff1b8, #f2c35a); box-shadow: 0 4px 14px rgba(242, 195, 90, .35); white-space: nowrap;
}
.promo-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-left: -18px; padding: clamp(5px, 1.2cqw, 10px) clamp(10px, 2.4cqw, 20px) clamp(5px, 1.2cqw, 10px) 26px;
  border-radius: 0 30px 30px 0; background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.04)); font-weight: 700; font-size: clamp(10px, 1.9cqw, 16px); white-space: nowrap;
}
.promo-badge i { width: 1.4em; height: 1.4em; border-radius: 50%; background: #f2c35a; color: #2a1600; font-style: normal; display: grid; place-items: center; font-size: .85em; }
.slide:hover .promo-btn { filter: brightness(1.06); }

/* ---------- Game selection ---------- */
.games { position: relative; margin: 0 -16px; padding: 14px 16px 16px; background: linear-gradient(180deg, #f2f2f2, #f7f7f7); overflow: hidden; }
.games::before { content: ''; position: absolute; top: 0; right: 0; width: 55%; height: 22px; background: linear-gradient(90deg, transparent, var(--yellow)); clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%); opacity: .9; }
.games::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(120deg, rgba(255,255,255,.55) 0 60px, transparent 60px 120px); pointer-events: none; }
.games > * { position: relative; z-index: 1; }
.games-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.games-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; }
.game { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; cursor: pointer; }
.game-icon { position: relative; width: 56px; height: 56px; border-radius: 12px; border: 2px solid transparent; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: transform .15s; }
.game-icon img { width: 100%; height: 100%; border-radius: 10px; object-fit: cover; }
.game:hover .game-icon { transform: translateY(-2px); }
.game.active .game-icon { border-color: var(--red); }
.game.active .game-icon::before {
  content: ''; position: absolute; left: -2px; top: -2px; width: 18px; height: 18px; z-index: 2;
  background: var(--red) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center / 12px no-repeat;
  border-radius: 10px 0 8px 0;
}
.game span { font-size: 11px; color: var(--text2); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 80px; }
.game.active span { color: var(--red); font-weight: 700; }

/* Game strip */
.game-strip { position: relative; margin: 10px 0 0; height: 74px; border-radius: 4px; overflow: hidden; background: #c66a3e; }
.game-strip-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.game-strip-content { position: relative; display: flex; align-items: center; gap: 12px; height: 100%; padding: 0 14px; color: #fff; background: linear-gradient(90deg, rgba(0,0,0,.35), transparent 70%); }
.game-strip-icon { width: 46px; height: 46px; border-radius: 8px; border: 2px solid #fff; }
.game-strip h3 { font-size: 16px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.secure-badge { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 8px; border-radius: 3px; background: rgba(0,0,0,.55); font-size: 11px; font-weight: 500; }
.secure-badge svg { width: 12px; fill: #fff; }

/* ---------- Steps ---------- */
.step { padding-top: 22px; }
.step-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.step-no { width: 22px; height: 22px; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 14px; border-radius: 3px; }
.step-box { background: var(--bg); border-radius: var(--radius); padding: 14px; }
.step-hint { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }
.label { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.label .q { width: 14px; height: 14px; border: 1px solid #888; border-radius: 50%; font-size: 10px; display: grid; place-items: center; color: #666; cursor: help; }

.input-group { display: flex; height: 40px; }
.input-group input { flex: 1; min-width: 0; border: 1px solid #ddd; border-right: 0; border-radius: 4px 0 0 4px; padding: 0 12px; outline: 0; background: #fff; font-size: 14px; }
.input-group input:focus { border-color: var(--red); }
.input-group input::placeholder { color: #bbb; }
.input-group button { padding: 0 22px; background: var(--red); color: #fff; font-weight: 700; border-radius: 0 4px 4px 0; }
.input-group button:hover { background: var(--red-dark); }
.input-group button[disabled] { opacity: .6; }
.field-error { color: var(--red); font-size: 12px; margin-top: 6px; min-height: 0; }
.login-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 12px; }

.player { display: flex; align-items: center; gap: 12px; }
.player-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700; flex-shrink: 0; }
.player-info { flex: 1; min-width: 0; }
.player-info b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-info small { color: var(--text2); }
.link-btn { color: var(--red); font-weight: 500; padding: 6px 4px; }

.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-check { animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
.pc-status { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.pc-status span { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.pc-status span .ico { width: 12px; height: 12px; fill: currentColor; }
.pc-status.ok { color: #138a3e; }
.pc-status.ok span { background: #16a34a; }
.pc-status.warn { color: #a15c00; }
.pc-status.warn span { background: #f59e0b; }
.player-check .player { background: #fff; border: 1px solid #e6e6e6; border-radius: 8px; padding: 12px; }
.player-check .player-info b { font-size: 17px; }
.player-check .player-info small { display: block; font-size: 12px; }
.pc-uid { font-size: 13px; color: var(--text2); margin-bottom: 12px; }
.pc-name { width: 100%; height: 40px; border: 1px solid #ddd; border-radius: 4px; padding: 0 12px; outline: 0; font-size: 14px; background: #fff; }
.pc-name:focus { border-color: var(--red); }
.pc-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: 12px; }
.pc-actions .btn-line, .pc-actions .btn-red { margin: 0; height: 42px; padding: 0 10px; }

/* Pills */
.pill-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.pill { padding: 4px 12px; border: 1px solid #ccc; border-radius: 20px; font-size: 13px; color: var(--text2); background: #fff; }
.pill.active { border-color: var(--red); color: var(--red); background: var(--red-soft); }

.subhead { display: flex; align-items: center; gap: 10px; color: var(--text2); font-size: 14px; font-weight: 500; margin: 18px 0 10px; }
.subhead::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.pay-switch { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.pay-switch button { height: 52px; border: 1px solid #ddd; border-radius: 8px; background: #fff; display: grid; place-items: center; padding: 6px 8px; }
.pay-switch button img { max-height: 34px; max-width: 100%; width: auto; object-fit: contain; background: #fff; border-radius: 4px; }
.pay-switch button.active { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 2px rgba(216,31,38,.15); }
.field-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* Store toolbar */
.store-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.store-search { flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; background: var(--bg); border: 1px solid transparent; border-radius: 20px; min-width: 0; }
.store-search:focus-within { border-color: var(--red); background: #fff; }
.store-search svg { width: 17px; fill: var(--muted); flex-shrink: 0; }
.store-search input { flex: 1; border: 0; outline: 0; background: none; height: 100%; min-width: 0; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 14px; padding: 0 16px; }
.cat-chips::-webkit-scrollbar { display: none; }
.cat-chip { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 32px; padding: 0 12px 0 4px; border: 1px solid #ddd; border-radius: 16px; background: #fff; font-size: 13px; color: var(--text2); white-space: nowrap; }
.cat-chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.cat-chip.all { padding-left: 12px; }
.cat-chip.active { border-color: var(--red); color: var(--red); background: var(--red-soft); font-weight: 500; }
.cat-chip small { color: var(--muted); font-size: 11px; }

/* Store cards */
.store-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.item-card { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid #e3e3e3; border-radius: 10px; overflow: hidden; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.item-card:hover { border-color: #ccc; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.item-card.active { border-color: var(--red); box-shadow: 0 0 0 2px rgba(216, 31, 38, .2); }
.ic-media { position: relative; aspect-ratio: 16 / 9; background: #f1f1f1; overflow: hidden; }
.ic-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.item-card:hover .ic-media img { transform: scale(1.04); }
.item-card.out .ic-media img { filter: grayscale(.7); opacity: .75; }
.ic-ribbon { position: absolute; top: 14px; right: -36px; width: 130px; transform: rotate(45deg); padding: 3px 0; text-align: center; color: #fff; font-size: 9px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; box-shadow: 0 2px 6px rgba(0,0,0,.25); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; z-index: 1; }
.ic-ribbon::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-100%); animation: ray 2.6s ease-in-out infinite; }
@keyframes ray { 60%, 100% { transform: translateX(100%); } }
.c-green { background: #16a34a; }
.c-red { background: var(--red); }
.c-orange { background: #ea580c; }
.c-blue { background: #2563eb; }
.c-purple { background: #7c3aed; }
.c-gold { background: linear-gradient(90deg, #d4a017, #f5c542); color: #3b2a00; }
.c-black { background: #222; }
.ic-timer { position: absolute; left: 6px; bottom: 6px; right: 6px; display: flex; align-items: center; gap: 4px; width: max-content; max-width: calc(100% - 12px); padding: 3px 7px; border-radius: 12px; background: rgba(0,0,0,.72); color: #fff; font-size: 10px; white-space: nowrap; overflow: hidden; }
.ic-timer .ico { width: 11px; height: 11px; fill: #ffcc33; flex-shrink: 0; }
.ic-timer b { font-weight: 700; font-variant-numeric: tabular-nums; color: #ffcc33; }
.ic-body { display: flex; flex-direction: column; flex: 1; gap: 2px; padding: 8px 8px 10px; }
.ic-body h3 { font-size: 13px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ic-qty { font-size: 12px; color: var(--text2); }
.ic-stat { font-size: 11px; color: #16a34a; font-weight: 500; }
.ic-stat.bought { color: var(--text2); }
.ic-buy { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; border-radius: 6px; background: var(--red); color: #fff; font-weight: 700; font-size: 13px; white-space: nowrap; transition: background .15s; }
.ic-buy:hover { background: var(--red-dark); }
.ic-buy s { font-weight: 400; font-size: 11px; opacity: .75; }
.ic-buy:disabled { background: #bbb; cursor: not-allowed; }
.ic-spacer { flex: 1; min-height: 8px; }
.store-empty { grid-column: 1 / -1; }

/* Payment grid */
.pay-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pay { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 76px; padding: 12px 14px; background: #fff; border: 1px solid #ddd; border-radius: 4px; text-align: left; transition: border-color .15s, background .15s; }
.pay .pay-logo { width: 118px; height: 34px; object-fit: contain; object-position: center; flex-shrink: 0; }
.pay .pay-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay .pay-price { font-size: 14px; font-weight: 500; }
.pay .pay-amt { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text2); }
.pay .pay-amt img { width: 11px; height: 11px; }
.pay .pay-name { font-size: 12px; color: var(--text2); }
.pay.active { border-color: var(--red); background: var(--red-soft); }
.pay[disabled] { cursor: not-allowed; }

/* ---------- Footer ---------- */
/* ---------- Buy bar ---------- */
.buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; box-shadow: 0 -2px 10px rgba(0,0,0,.08); padding-bottom: env(safe-area-inset-bottom); }
.buy-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--bar-h); }
.buy-info { min-width: 0; }
.buy-info b { display: flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buy-info b img { width: 15px; height: 15px; flex-shrink: 0; }
.buy-info small { display: block; color: var(--text2); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.buy-info small strong { color: var(--red); font-size: 14px; }
.buy-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 22px; border-radius: 4px; background: var(--red); color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.buy-btn svg { width: 16px; fill: none; stroke: #fff; stroke-width: 2; }
.buy-btn:hover { background: var(--red-dark); }
.buy-btn[disabled] { background: #f0a5a8; cursor: not-allowed; }

/* ---------- Bottom sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.sheet.open { opacity: 1; visibility: visible; }
.sheet-box { position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 12px 12px 0 0; transform: translateY(100%); transition: transform .3s ease; padding-bottom: env(safe-area-inset-bottom); }
.sheet.open .sheet-box { transform: none; }
.sheet-close { position: absolute; top: 8px; left: 8px; z-index: 3; width: 32px; height: 32px; color: #fff; font-size: 28px; line-height: 1; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.sheet-close.dark { color: #666; text-shadow: none; left: auto; right: 8px; }
.sheet-close svg { width: 24px; height: 24px; fill: currentColor; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.sheet-close.dark svg { filter: none; }
.sheet-hero { height: 90px; overflow: hidden; }
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; }
.sheet-game { display: flex; align-items: flex-end; gap: 12px; padding: 0 16px; margin-top: -26px; position: relative; }
.sheet-game img { width: 60px; height: 60px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.15); background: #fff; }
.sheet-game div { padding-bottom: 2px; }
.sheet-game b { font-size: 16px; }
.sheet-game small { display: block; color: var(--text2); font-size: 12px; }
.sheet-body { padding: 16px; }
.sheet-title { font-size: 18px; font-weight: 700; padding: 16px 48px 4px 16px; }

/* Checkout */
.summary { border: 1px solid var(--line); border-radius: 6px; padding: 4px 12px; margin-bottom: 14px; }
.summary-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row span { color: var(--text2); }
.summary-row b { text-align: right; }
.summary-row.total b { color: var(--red); font-size: 16px; }
.qr-wrap { display: flex; gap: 14px; align-items: center; background: var(--bg); border-radius: 6px; padding: 12px; margin-bottom: 14px; }
.qr-wrap .qr { width: 130px; height: 130px; flex-shrink: 0; background: #fff; padding: 6px; border-radius: 6px; border: 1px solid var(--line); }
.qr-wrap .qr img { width: 100%; height: 100%; object-fit: contain; }
.qr-info { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text2); }
.qr-info .amt { font-size: 22px; font-weight: 900; color: var(--red); }
.upi-line { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px dashed #ccc; border-radius: 4px; padding: 6px 8px; color: var(--text); font-weight: 500; word-break: break-all; }
.upi-line button { margin-left: auto; color: var(--red); font-weight: 700; font-size: 12px; flex-shrink: 0; }
.btn-red, .btn-line { display: flex; align-items: center; justify-content: center; width: 100%; height: 42px; border-radius: 4px; font-weight: 700; font-size: 15px; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-dark); }
.btn-red[disabled] { background: #f0a5a8; }
.btn-line { border: 1px solid var(--red); color: var(--red); background: #fff; margin-bottom: 10px; }
.field { margin-bottom: 12px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #ddd; border-radius: 4px; padding: 10px 12px; outline: 0; font-size: 14px; background: #fff; font: inherit; }
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--red); }

.success { text-align: center; padding: 26px 16px 20px; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: #1fb35b; color: #fff; display: grid; place-items: center; font-size: 34px; margin: 0 auto 12px; animation: pop .35s ease; }
.success .tick .ico { width: 36px; height: 36px; fill: currentColor; }
@keyframes pop { from { transform: scale(0); } }
.success h3 { font-size: 20px; margin-bottom: 6px; }
.success p { color: var(--text2); margin-bottom: 6px; }
.success .oid { color: var(--red); font-weight: 700; }

/* Orders */
.orders { display: flex; flex-direction: column; gap: 8px; }
button.order { width: 100%; text-align: left; background: #fff; cursor: pointer; font: inherit; color: inherit; }
.order { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.order small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.order .note { margin-top: 6px; font-size: 12px; color: #8a5a00; background: #fff8e1; padding: 5px 8px; border-radius: 4px; }
.account-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.account-tabs button { flex: 1; height: 38px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-weight: 700; color: var(--text2); }
.account-tabs button.active { background: var(--red); border-color: var(--red); color: #fff; }
.text-back { color: var(--red); font-weight: 700; font-size: 13px; margin-bottom: 10px; }
.shot-preview { width: 100%; max-height: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fafafa; }
.file-name { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; text-transform: capitalize; white-space: nowrap; }
.status.pending { background: #fff4d6; color: #b07800; }
.status.processing { background: #e3f0ff; color: #1967d2; }
.status.completed { background: #e3f7ea; color: #1a8f4a; }
.status.rejected { background: var(--red-soft); color: var(--red); }
.empty-box { text-align: center; color: var(--muted); padding: 30px 10px; }
.account-head { display: flex; align-items: center; gap: 12px; padding: 18px 16px 6px; }
.account-actions { display: flex; gap: 8px; margin: 12px 0 16px; }
.account-actions > * { flex: 1; margin: 0; }
.info-text { color: var(--text2); font-size: 13px; line-height: 1.6; }
.info-text h4 { color: var(--text); margin: 12px 0 4px; font-size: 14px; }
.info-text ol { padding-left: 18px; }

/* ---------- Popup ---------- */
.popup { position: fixed; inset: 0; z-index: 110; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; visibility: hidden; transition: .25s; }
.popup.open { opacity: 1; visibility: visible; }
.popup-box { position: relative; width: 100%; max-width: 380px; background: #fff; border-radius: 14px; transform: scale(.9); transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.popup.open .popup-box { transform: none; }
.popup-img { display: block; border-radius: 14px 14px 0 0; overflow: hidden; }
.popup-img img { width: 100%; max-height: 300px; object-fit: cover; }
.popup.image-only .popup-box { max-width: 520px; background: none; }
.popup.image-only .popup-img { border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.popup.image-only .popup-img img { max-height: none; }
.popup-close {
  position: absolute; top: -14px; right: -10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(0,0,0,.35); transition: transform .2s;
}
.popup-close svg { width: 20px; fill: #222; }
.popup-close:hover { transform: rotate(90deg); }
.popup-close:hover svg { fill: var(--red); }
.popup-content { padding: 16px; text-align: center; }
.popup-content h3 { font-size: 18px; margin-bottom: 6px; }
.popup-content p { color: var(--text2); font-size: 13px; margin-bottom: 14px; }

/* Maintenance */
.maintenance { position: fixed; inset: 0; z-index: 200; background: #fff; display: grid; place-items: center; text-align: center; padding: 20px; }
.maintenance img { width: 70px; margin: 0 auto 12px; }
.maintenance h2 { margin-bottom: 6px; }
.maintenance p { color: var(--text2); }

/* Toast */
.toast { position: fixed; left: 50%; top: 70px; z-index: 300; transform: translate(-50%, -10px); background: rgba(0,0,0,.82); color: #fff; padding: 10px 16px; border-radius: 6px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }
.toast.success { background: #1a8f4a; }

.skeleton { border-radius: 4px; background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.flash { animation: flash 1s ease 2; }
@keyframes flash { 50% { box-shadow: 0 0 0 3px rgba(216, 31, 38, .35); } }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  body { background: var(--bg); }
  .main { background: #fff; padding: 0 24px 24px; box-shadow: 0 0 0 1px var(--line); }
  .slider { margin: 18px 0; aspect-ratio: 2.4 / 1; border-radius: 16px; }
  .slide-arrow { display: grid; width: 40px; height: 40px; margin-top: -20px; }
  .slide-arrow.prev { left: 14px; }
  .slide-arrow.next { right: 14px; }
  .pc-actions { max-width: 520px; }
  .games { margin: 0 -24px; padding: 18px 24px 20px; }
  .games-grid { grid-template-columns: repeat(8, 1fr); }
  .game-icon { width: 68px; height: 68px; }
  .game span { font-size: 12px; max-width: 100px; }
  .game-strip { height: 96px; margin-top: 16px; }
  .game-strip-icon { width: 60px; height: 60px; }
  .game-strip h3 { font-size: 20px; }
  .step-box { padding: 18px; }
  .input-group { max-width: 520px; height: 42px; }
  .store-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .cat-chips { margin: 0 0 16px; padding: 0; flex-wrap: wrap; }
  .ic-body { padding: 10px 12px 12px; }
  .ic-body h3 { font-size: 14px; }
  .ic-buy { height: 38px; font-size: 14px; }
  .ic-ribbon { font-size: 10px; }
  .pay-grid { grid-template-columns: repeat(4, 1fr); }
  .sheet { align-items: center; }
  .sheet-box { border-radius: 12px; transform: translateY(30px); opacity: 0; transition: transform .3s, opacity .3s; }
  .sheet.open .sheet-box { opacity: 1; }
  .buy-btn { padding: 0 34px; }
}
@media (min-width: 1000px) {
  .store-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 360px) {
  .store-grid { gap: 8px; }
  .ic-buy s { display: none; }
  .games-grid { gap: 12px 4px; }
  .game-icon { width: 50px; height: 50px; }
}
