/* ==========================================================================
   VISION II · ITEM-SHOP  —  shop.css
   Dark + gold theme. One stylesheet for the whole shop.

   Targets: desktop browsers, phones and the in-game WebView2 window
   (~740x550 px, no address bar, no back button).

   Public pages use only the classes below (no framework).
   Bootstrap is loaded on ADMIN pages only and themed at the very bottom.
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  --bg: #0b0c12;
  --surface: #151827;
  --surface-2: #1b1f32;
  --glass: rgba(255, 255, 255, .045);
  --glass-2: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .17);
  --text: #eef0f7;
  --muted: #9ba4ba;
  --faint: #69718a;

  --gold: #f6b93b;
  --gold-2: #ffd978;
  --gold-3: #dd8a14;
  --crimson: #e5483f;
  --crimson-2: #ff7d73;
  --green: #34c98a;
  --teal: #4fd1c5;

  --r: 14px;
  --r-sm: 10px;
  --shadow: 0 14px 38px rgba(0, 0, 0, .5);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-d: 'Rajdhani', 'Inter', 'Segoe UI', Arial, sans-serif;
}

/* ---------- 2. Base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #384059 transparent;
}
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #384059; border-radius: 9px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #4a5476; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--bg);
  font: 400 14px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ambient glow — fixed pseudo element (cheap to scroll, no bg-attachment) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 10% -8%, rgba(246, 185, 59, .11), transparent 62%),
    radial-gradient(760px 480px at 100% 0%, rgba(229, 72, 63, .09), transparent 58%),
    linear-gradient(180deg, #0e1018 0%, #090a0f 100%);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; border: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0 0 12px; }
ul { margin: 0; padding: 0; list-style: none; }
b, strong { font-weight: 700; }
small { font-size: 85%; }
.px { image-rendering: crisp-edges; image-rendering: pixelated; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.ico {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -.2em;
}

/* ---------- 3. Layout ---------------------------------------------------- */
.wrap { width: 100%; max-width: 1120px; margin-left: auto; margin-right: auto; padding-left: 20px; padding-right: 20px; }
.page { flex: 1 0 auto; padding: 22px 0 56px; }

/* ---------- 4. Topbar ---------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 12, 18, .88);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 185, 59, .6), transparent);
  pointer-events: none;
}
.topbar__in { display: flex; align-items: center; gap: 14px; min-height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand img { display: block; height: 44px; width: auto; filter: drop-shadow(0 2px 10px rgba(246, 185, 59, .28)); }
.brand__tag {
  font: 700 11px/1 var(--font-d); letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold); padding: 5px 8px 5px 10px;
  border: 1px solid rgba(246, 185, 59, .38); border-radius: 6px;
}

.nav { display: flex; gap: 2px; margin-left: 6px; min-width: 0; }
.nav__link {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px;
  border-radius: 10px; color: var(--muted);
  font: 700 13px/1 var(--font-d); letter-spacing: .08em; text-transform: uppercase;
  transition: color .15s, background .15s; white-space: nowrap;
}
.nav__link:hover { color: var(--text); background: var(--glass); }
.nav__link.is-active { color: var(--gold-2); background: rgba(246, 185, 59, .1); }

.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px 0 10px;
  border-radius: 999px; background: var(--glass); border: 1px solid var(--line);
  font: 700 15px/1 var(--font-d); letter-spacing: .02em; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.chip img { width: 16px; height: 16px; image-rendering: pixelated; }
a.chip:hover { border-color: var(--line-2); background: var(--glass-2); }
.chip--md { color: var(--gold-2); }
.chip--jd { color: var(--teal); }
.chip--btn { cursor: pointer; color: var(--text); padding: 0 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.chip--btn .ico { color: var(--muted); }
.chip--user { color: var(--muted); font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.chip--user span { overflow: hidden; text-overflow: ellipsis; }

/* dropdown (language) */
.dd { position: relative; }
.dd__btn { background: var(--glass); border: 1px solid var(--line); }
.dd__btn:hover { border-color: var(--line-2); }
.dd__btn .ico--chev { width: 14px; height: 14px; transition: transform .2s; }
.dd.open .dd__btn .ico--chev { transform: rotate(180deg); }
.dd__menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow); display: none;
}
.dd.open .dd__menu { display: block; }
.dd__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); font-weight: 500; }
.dd__item:hover { background: var(--glass-2); color: var(--text); }
.dd__item.is-active { color: var(--gold-2); }
.dd__item img { width: 22px; height: auto; border-radius: 3px; }

/* ---------- 5. Buttons, forms, alerts ----------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 10px;
  font: 700 13px/1 var(--font-d); letter-spacing: .09em; text-transform: uppercase; text-align: center;
  white-space: nowrap; vertical-align: middle; cursor: pointer; user-select: none;
  color: var(--text); background: var(--glass-2); border-color: var(--line-2);
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, filter .2s;
}
.btn:hover, .btn:focus { color: var(--text); text-decoration: none; transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.disabled { opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.35); }

.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
  color: #1d1303; border-color: transparent;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-3));
  box-shadow: 0 6px 20px rgba(246, 185, 59, .26), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-primary:hover { filter: brightness(1.07); box-shadow: 0 10px 28px rgba(246, 185, 59, .38), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-success, .btn-success:hover, .btn-success:focus, .btn-success:active {
  color: #04180f; border-color: transparent; background: linear-gradient(180deg, #5fe0ab, var(--green));
  box-shadow: 0 6px 18px rgba(52, 201, 138, .25);
}
.btn-danger, .btn-danger:hover, .btn-danger:focus, .btn-danger:active {
  color: #fff; border-color: transparent; background: linear-gradient(180deg, #f2645b, #c4312a);
  box-shadow: 0 6px 18px rgba(229, 72, 63, .25);
}
.btn-info, .btn-info:hover, .btn-info:focus, .btn-info:active {
  color: #031a18; border-color: transparent; background: linear-gradient(180deg, #7fe6dc, var(--teal));
  box-shadow: 0 6px 18px rgba(79, 209, 197, .22);
}
.btn-ghost { background: transparent; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12px; }
.btn-lg { min-height: 50px; padding: 0 26px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }

.field { display: block; margin: 0 0 14px; }
.field > label, .form-group > label, .control-label {
  display: block; margin: 0 0 6px;
  font: 700 11px/1.2 var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.input, .form-control, select.input, textarea.input {
  display: block; width: 100%; height: 44px; padding: 0 14px;
  background: rgba(255, 255, 255, .055); border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--text); outline: none; font-size: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea.input, textarea.form-control { height: auto; padding: 10px 14px; }
.input::placeholder, .form-control::placeholder { color: var(--faint); }
.input:hover, .form-control:hover { border-color: rgba(255, 255, 255, .28); }
.input:focus, .form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246, 185, 59, .18); background: rgba(255, 255, 255, .08); color: var(--text); }
select.input, select.form-control { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ba4ba' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; }
select.input option, select.form-control option { background: #1b1f32; color: var(--text); }
select.input:disabled, .input:disabled { opacity: .5; cursor: not-allowed; }
input:-webkit-autofill { -webkit-text-fill-color: var(--text); caret-color: var(--text); box-shadow: 0 0 0 40px #1c2033 inset; }

.input-wrap { position: relative; }
.input-wrap > .ico { position: absolute; left: 13px; top: 50%; margin-top: -.575em; color: var(--faint); pointer-events: none; }
.input-wrap > .input { padding-left: 40px; }
.input-wrap .pw-toggle {
  position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px; color: var(--faint); cursor: pointer;
}
.input-wrap .pw-toggle:hover { color: var(--text); background: var(--glass-2); }
.input-wrap .pw-toggle + .input, .input-wrap > .input.has-toggle { padding-right: 46px; }

.alert {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 44px 13px 14px; margin: 0 0 16px;
  border: 1px solid; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
}
.alert > .ico { margin-top: 2px; font-size: 18px; }
.alert strong { font-weight: 700; }
.alert--static { padding-right: 14px; }
.alert-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.alert-success { background: rgba(52, 201, 138, .1); border-color: rgba(52, 201, 138, .38); color: #a6f1d0; }
.alert-danger { background: rgba(229, 72, 63, .11); border-color: rgba(229, 72, 63, .42); color: #ffb4ae; }
.alert-warning { background: rgba(246, 185, 59, .1); border-color: rgba(246, 185, 59, .4); color: var(--gold-2); }
.alert-info { background: rgba(79, 209, 197, .1); border-color: rgba(79, 209, 197, .36); color: #9cf0e8; }
.alert .close {
  position: absolute; right: 8px; top: 7px; width: 30px; height: 30px; padding: 0; float: none;
  display: grid; place-items: center; background: none; border: 0; border-radius: 8px;
  color: inherit; font-size: 22px; line-height: 1; text-shadow: none; opacity: .65; cursor: pointer;
}
.alert .close:hover { opacity: 1; background: rgba(255, 255, 255, .08); }

/* ---------- 6. Page head, crumbs, toolbar ------------------------------- */
.pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px; margin: 0 0 18px; }
.crumbs, .section-title {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font: 700 12px/1.3 var(--font-d); letter-spacing: .15em; text-transform: uppercase; color: var(--faint);
}
.crumbs a, .section-title a { color: var(--muted); transition: color .15s; }
.crumbs a:hover, .section-title a:hover { color: var(--gold); }
.crumbs .sep { opacity: .45; }
.crumbs b, .crumbs .cur { color: var(--text); }
.crumbs .ico { color: var(--gold); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.search { position: relative; }
.search .ico { position: absolute; left: 12px; top: 50%; margin-top: -.575em; color: var(--faint); pointer-events: none; }
.search .input { width: 240px; height: 40px; padding-left: 38px; }
.toolbar select.input { width: auto; min-width: 170px; height: 40px; }
.count-pill { font: 700 12px var(--font-d); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 0 4px; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.admin-disc { margin: 0 0 18px; }
.admin-disc > summary { display: inline-flex; list-style: none; }
.admin-disc > summary::-webkit-details-marker { display: none; }
.admin-disc > form { margin-top: 12px; }
.admin-disc .admin-actions { margin: 0; }
.input--short { width: 92px; }

.sec-title {
  display: flex; align-items: center; gap: 12px; margin: 0 0 14px;
  font: 700 14px/1 var(--font-d); letter-spacing: .2em; text-transform: uppercase; color: var(--text);
}
.sec-title::before { content: ""; width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); }
.sec-title small { margin-left: auto; color: var(--faint); letter-spacing: .1em; font-size: 12px; }

/* category pills (switcher on category + item pages) */
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; margin: 0 0 4px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #2a3047 transparent; }
.recent { scrollbar-width: thin; }
.cats, .recent { position: relative; }
.cat-pill {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 8px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--glass); color: var(--muted);
  font: 700 13px/1 var(--font-d); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.cat-pill img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.cat-pill:hover { color: var(--text); border-color: var(--line-2); background: var(--glass-2); }
.cat-pill.is-active { color: var(--gold-2); border-color: rgba(246, 185, 59, .6); background: rgba(246, 185, 59, .12); box-shadow: 0 0 20px rgba(246, 185, 59, .1); }

/* ---------- 7. Grids + tiles -------------------------------------------- */
.grid { display: grid; gap: 14px; }
.grid--cat { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.grid--items { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }

.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 16px 12px 14px; overflow: hidden; isolation: isolate;
  border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .02));
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), border-color .2s, box-shadow .25s;
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5; transition: opacity .25s;
  background: radial-gradient(130px 96px at 50% 34%, rgba(246, 185, 59, .17), transparent 72%);
}
.tile::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; opacity: 0; transition: opacity .25s;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.tile:hover, .tile:focus-visible {
  transform: translateY(-4px); border-color: rgba(246, 185, 59, .55);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .5), 0 0 0 1px rgba(246, 185, 59, .16), 0 0 30px rgba(246, 185, 59, .12);
}
.tile:hover::before, .tile:focus-visible::before { opacity: 1; }
.tile:hover::after, .tile:focus-visible::after { opacity: 1; }

.tile__img { display: grid; place-items: center; width: 100%; height: 100px; margin: 4px 0 10px; }
.tile__img img { max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .65)); transition: transform .28s cubic-bezier(.3, 1.4, .5, 1); }
.tile:hover .tile__img img { transform: translateY(-4px) scale(1.06); }
.tile__name {
  width: 100%; font: 600 13px/1.3 var(--font); color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em;
}
.tile__tags { position: absolute; top: 9px; left: 9px; right: 9px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: space-between; align-items: flex-start; pointer-events: none; }
.tile__tags > span { display: flex; flex-wrap: wrap; gap: 4px; }
[data-left] { font-variant-numeric: tabular-nums; }   /* digits keep their width: the ticking countdown never shifts the layout */
.tile__cd { margin-top: 6px; font: 700 12px var(--font-d); letter-spacing: .06em; color: var(--crimson-2); display: inline-flex; align-items: center; gap: 5px; }

.cat-card { padding: 20px 12px 16px; }
.cat-card .tile__img { height: 92px; }
.cat-card .tile__name { font: 700 15px/1.25 var(--font-d); letter-spacing: .08em; text-transform: uppercase; min-height: 0; }

.item-card .tile__price { margin-top: 10px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px;
  font: 700 11px/1 var(--font-d); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
}
.tag--sale { color: #fff; background: linear-gradient(135deg, #f0504a, #b3231d); box-shadow: 0 3px 10px rgba(229, 72, 63, .4); }
.tag--promo { color: var(--gold-2); background: rgba(246, 185, 59, .14); border: 1px solid rgba(246, 185, 59, .4); }
.tag--bonus { color: var(--teal); background: rgba(79, 209, 197, .13); border: 1px solid rgba(79, 209, 197, .32); }
.tag--qty { color: var(--text); background: rgba(255, 255, 255, .1); }

.price { display: inline-flex; align-items: center; gap: 7px; font: 700 19px/1 var(--font-d); letter-spacing: .02em; }
.price img { width: 16px; height: 16px; image-rendering: pixelated; }
.price s { color: var(--faint); font-size: 14px; font-weight: 600; }
.price--md { color: var(--gold-2); }
.price--jd { color: var(--teal); }
.price--xl { font-size: 34px; gap: 10px; }
.price--xl img { width: 32px; height: 32px; }
.price--xl s { font-size: 20px; }

.empty {
  text-align: center; padding: 54px 18px; color: var(--muted);
  border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--glass);
}
.empty .ico { width: 34px; height: 34px; color: var(--faint); margin-bottom: 8px; }

/* ---------- 8. Hero, wallet, login ------------------------------------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin: 0 0 28px; }
.hero__main {
  position: relative; overflow: hidden; padding: 28px 30px; border: 1px solid var(--line); border-radius: var(--r);
  background:
    radial-gradient(440px 240px at 92% 0%, rgba(246, 185, 59, .2), transparent 70%),
    radial-gradient(380px 240px at 0% 110%, rgba(229, 72, 63, .15), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .02));
}
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 700 11px/1 var(--font-d); letter-spacing: .3em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: ""; width: 24px; height: 2px; border-radius: 2px; background: var(--gold); }
.hero h1 { margin: 12px 0 8px; font: 700 36px/1.05 var(--font-d); letter-spacing: .03em; text-transform: uppercase; }
.grad {
  background: linear-gradient(90deg, var(--gold-2), var(--gold) 45%, #ff7a45);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
}
.hero p { max-width: 44ch; color: var(--muted); margin-bottom: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; position: relative; z-index: 1; }
.hero__coins { position: absolute; right: 22px; bottom: 16px; display: flex; gap: 12px; pointer-events: none; }
.hero__coins img { width: 64px; height: 64px; image-rendering: pixelated; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .65)); animation: float 4.2s ease-in-out infinite; }
.hero__coins img:nth-child(2) { animation-delay: -2.1s; margin-top: 18px; }

.box {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
}
.box + .box { margin-top: 14px; }
.box__title {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font: 700 12px/1 var(--font-d); letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
}
.box__title::before { content: ""; width: 3px; height: 14px; border-radius: 3px; background: linear-gradient(180deg, var(--gold-2), var(--gold-3)); }
.box__title .ico { color: var(--gold); }

.wallet { display: grid; gap: 10px; }
.wallet__row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, .22); }
.wallet__row img { width: 32px; height: 32px; image-rendering: pixelated; }
.wallet__amt { font: 700 26px/1 var(--font-d); letter-spacing: .02em; }
.wallet__row--md .wallet__amt { color: var(--gold-2); }
.wallet__row--jd .wallet__amt { color: var(--teal); }
.wallet__lbl { margin-left: auto; text-align: right; font: 700 11px/1.3 var(--font-d); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.wallet__lbl b { display: block; color: var(--muted); font-size: 13px; }
.wallet + .btn { margin-top: 14px; }

.login { display: grid; gap: 2px; }
.login .btn { margin-top: 6px; }
.login__hint { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.authcard { max-width: 440px; margin: 28px auto 0; padding: 28px; }
.authcard h1 { font: 700 24px/1.1 var(--font-d); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.authcard .sub { color: var(--muted); margin-bottom: 20px; }

/* ---------- 9. Item detail ---------------------------------------------- */
.item-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.item-aside { position: sticky; top: 80px; min-width: 0; }
.item-main { min-width: 0; }
.buybox { padding: 20px; text-align: center; }
.buybox__img {
  display: grid; place-items: center; min-height: 190px; margin: 0 0 14px; border-radius: 12px;
  background: radial-gradient(closest-side, rgba(246, 185, 59, .22), transparent 78%);
}
.buybox__img img { filter: drop-shadow(0 12px 16px rgba(0, 0, 0, .7)); }
.buybox h1 { font: 700 21px/1.2 var(--font-d); letter-spacing: .04em; margin-bottom: 10px; }
.buybox__tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.buybox__cd { display: flex; align-items: center; justify-content: center; gap: 8px; margin: -4px 0 12px; font: 700 13px/1.3 var(--font-d); letter-spacing: .06em; color: var(--crimson-2); }
.buybox__info { min-width: 0; }
.buybox__price { margin: 6px 0 4px; }
.buybox__bal { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.buybox__bal b { color: var(--text); }
.buybox__note { margin: 12px 0 0; font-size: 12px; color: var(--faint); display: flex; gap: 8px; text-align: left; align-items: flex-start; }
.buybox__note .ico { margin-top: 2px; color: var(--teal); }
.buybox .alert { text-align: left; margin: 0 0 14px; }

.props { display: grid; gap: 8px; }
.prop {
  position: relative; padding: 11px 14px 11px 32px; font-size: 13.5px; line-height: 1.45;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .04);
}
.prop::before { content: ""; position: absolute; left: 14px; top: 50%; margin-top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.prop .val, .prop b { color: var(--gold-2); font-weight: 700; }
.prop--info::before { background: var(--teal); box-shadow: 0 0 8px var(--teal); }
.prop--warn::before { background: var(--crimson); box-shadow: 0 0 8px var(--crimson); }
.prop--plain::before { display: none; }
.prop .ico { color: var(--teal); margin-right: 6px; }

.stones { display: flex; flex-wrap: wrap; gap: 10px; }
.stone { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(79, 209, 197, .07); font-size: 13px; }
.stone img { image-rendering: pixelated; }

.desc { color: #cdd3e3; line-height: 1.7; }
.bonus-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.buybox__hint { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 10px; padding: 9px 12px; text-align: left; font-size: 12.5px; line-height: 1.4; color: var(--gold-2); border: 1px solid rgba(246, 185, 59, .3); border-radius: 10px; background: rgba(246, 185, 59, .08); }
.buybox__hint .ico { margin-top: 1px; }

/* ---------- 10. Dialog --------------------------------------------------- */
.dlg { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.dlg.open { display: flex; }
.dlg__bg { position: absolute; inset: 0; background: rgba(4, 5, 10, .74); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade .2s ease both; }
.dlg__card {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px;
  border: 1px solid rgba(246, 185, 59, .38); border-radius: 18px;
  background: linear-gradient(180deg, #1b1f33, #12141f);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 44px rgba(246, 185, 59, .12);
  animation: pop .24s cubic-bezier(.2, .9, .3, 1.15) both;
}
.dlg__x { position: absolute; right: 10px; top: 10px; width: 34px; height: 34px; display: grid; place-items: center; background: none; border: 0; border-radius: 9px; color: var(--muted); cursor: pointer; }
.dlg__x:hover { color: var(--text); background: var(--glass-2); }
.dlg h2 { font: 700 13px/1 var(--font-d); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-bottom: 16px; }
.dlg__item { display: flex; align-items: center; gap: 14px; padding: 12px; margin-bottom: 14px; border-radius: 12px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.dlg__item .name { font: 700 16px/1.25 var(--font-d); letter-spacing: .03em; }
.dlg__item .qty { color: var(--muted); font-size: 12.5px; }
.dlg__rows { margin: 0 0 14px; font-size: 13.5px; }
.dlg__row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 2px; border-bottom: 1px dashed var(--line); color: var(--muted); }
.dlg__row:last-child { border-bottom: 0; }
.dlg__row b { color: var(--text); font-family: var(--font-d); font-size: 16px; letter-spacing: .02em; }
.dlg__row--total b { color: var(--gold-2); font-size: 19px; }
.dlg__item img { max-height: 64px; object-fit: contain; }
.dlg__picked { margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 6px; }
.dlg__picked li { padding: 8px 12px; border-radius: 8px; background: rgba(79, 209, 197, .08); border: 1px solid rgba(79, 209, 197, .22); font-size: 13px; }

/* short windows (the in-game browser is only ~550 px tall) */
@media (max-height: 640px) {
  .dlg__card { padding: 16px 18px; }
  .dlg h2 { margin-bottom: 10px; }
  .dlg__item { padding: 8px 10px; margin-bottom: 10px; }
  .dlg__picked { margin-bottom: 10px; }
  .dlg__picked li { padding: 6px 10px; font-size: 12.5px; }
  .dlg__rows { margin-bottom: 8px; }
  .dlg__row { padding: 6px 2px; }
  .dlg__q { margin-bottom: 12px; }
}
.dlg__q { margin: 0 0 16px; color: var(--muted); }
.dlg__btns { display: flex; gap: 10px; }
.dlg__btns .btn { flex: 1; }
body.dlg-open { overflow: hidden; }

/* ---------- 11. Coin packs ---------------------------------------------- */
.grid--coins { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pack { align-items: stretch; padding: 40px 16px 16px; }
.pack form { margin: 0; }
.pack__img { display: grid; place-items: center; height: 64px; margin-bottom: 10px; }
.pack__img img { width: 64px; height: 64px; image-rendering: pixelated; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .6)); }
.pack__amt { font: 700 32px/1 var(--font-d); color: var(--gold-2); letter-spacing: .02em; }
.pack__amt small { font-size: 14px; color: var(--muted); letter-spacing: .12em; margin-left: 4px; }
.pack__price { margin: 6px 0 16px; font: 600 20px/1 var(--font-d); color: var(--text); }
.pack--best { border-color: rgba(246, 185, 59, .6); box-shadow: 0 0 0 1px rgba(246, 185, 59, .22), 0 0 36px rgba(246, 185, 59, .14); }
.pack .tile__tags { justify-content: center; }
.secure { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.secure .ico { color: var(--green); font-size: 20px; }

/* ---------- 12. Recently bought ----------------------------------------- */
.recent { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 8px; }
.recent__item {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; max-width: 280px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--glass);
  transition: border-color .15s, background .15s, transform .15s;
}
.recent__item:hover { border-color: rgba(246, 185, 59, .5); background: var(--glass-2); transform: translateY(-2px); }
.recent__name { display: block; font-weight: 600; font-size: 13px; line-height: 1.25; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-title--spaced { margin-top: 30px; }
.recent .price { font-size: 15px; }
.recent__img { display: grid; place-items: center; width: 40px; height: 48px; }

/* ---------- 13. Footer + maintenance ------------------------------------ */
.foot { flex: none; padding: 20px 0 26px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12px; }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--gold); }
.foot .links { display: flex; gap: 16px; }

.maint { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; }
.maint__card { max-width: 440px; padding: 34px 30px; }
.maint__card img { height: 70px; width: auto; margin-bottom: 14px; }
.maint__card h1 { font: 700 22px var(--font-d); letter-spacing: .12em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 8px; }
.maint__card p { color: var(--muted); margin: 0; }

/* ---------- 14. Motion --------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
/* No entrance animation on cards / boxes: every click is a full page load, so
   fading them in made the whole page "flash" on every navigation. */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- 15. Responsive ---------------------------------------------- */
@media (max-width: 900px) {
  .hero__coins { display: none; }
}

/* in-game window (~740 px) + small tablets */
@media (max-width: 820px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .page { padding: 16px 0 36px; }
  .topbar__in { gap: 8px; min-height: 54px; }
  .brand img { height: 36px; }
  .brand__tag, .chip--user { display: none; }
  .nav { margin-left: 0; }
  .nav__link { padding: 8px 9px; font-size: 12px; letter-spacing: .06em; }
  .chip { height: 34px; padding: 0 11px 0 9px; font-size: 14px; }
  .grid { gap: 10px; }
  .grid--cat { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .grid--items { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .grid--coins { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tile { padding: 14px 10px 12px; }
  .pack { padding-top: 38px; }
  .tile__img { height: 84px; }
  /* in-game window: icon + price + BUY on one row so the button is always above the fold */
  .item-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .item-aside { position: static; }
  .buybox { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 0 18px; align-items: center; padding: 16px; text-align: left; }
  .buybox__img { min-height: 0; height: 100%; margin: 0; }
  .buybox h1 { font-size: 19px; margin-bottom: 8px; }
  .buybox__tags, .buybox__cd { justify-content: flex-start; }
  .buybox__price { margin: 4px 0 2px; }
  .price--xl { font-size: 30px; }
  .buybox__bal { margin-bottom: 10px; }
  .buybox__note { margin-top: 8px; }
  .hero { gap: 12px; margin-bottom: 20px; }
  .hero__main { padding: 20px; }
  .hero h1 { font-size: 30px; margin: 10px 0 6px; }
  .hero p { font-size: 13px; margin-bottom: 14px; }
  .box { padding: 16px; }
  .wallet__row { padding: 10px 12px; gap: 10px; }
  .wallet__amt { font-size: 22px; }
  .search .input { width: 200px; }
}

/* phones */
@media (max-width: 640px) {
  body { font-size: 14px; }
  .topbar__in { flex-wrap: wrap; row-gap: 0; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; width: 100%; margin: 6px 0 0; overflow-x: auto; }
  .hero { grid-template-columns: 1fr; }
  .dd__btn .lbl { display: none; }
  .btn { white-space: normal; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
  .buybox { display: block; text-align: center; }
  .buybox__img { min-height: 150px; height: auto; margin-bottom: 12px; }
  .buybox__tags, .buybox__cd { justify-content: center; }
  .toolbar { width: 100%; }
  .search { flex: 1 1 100%; }
  .search .input { width: 100%; }
  .toolbar select.input { flex: 1 1 auto; }
  .grid--cat, .grid--items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--coins { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero h1 { font-size: 27px; }
  .price--xl { font-size: 30px; }
  .dlg { align-items: flex-end; padding: 0; }
  .dlg__card { max-width: none; border-radius: 18px 18px 0 0; }
  .authcard { margin-top: 12px; padding: 22px; }
  .foot__in { flex-direction: column; }
}
@media (max-width: 360px) {
  .grid--cat, .grid--items, .grid--coins { grid-template-columns: 1fr; }
}

/* ---------- in-game "lite" mode ------------------------------------------
   The shop runs in an embedded browser on top of a game that is already
   rendering at full speed on the same GPU. Anything that needs its own
   compositor layer or repaints continuously can flicker there, so this mode
   is flat and static: no animation, no transitions, no blur, no filters, no
   fixed full-screen layer, no hover movement. It also hides external links
   (there is no browser UI to come back from them). */
html.ingame { scroll-behavior: auto; }
html.ingame *, html.ingame *::before, html.ingame *::after {
  animation: none !important;
  transition: none !important;
}
html.ingame { --font: 'Segoe UI', Tahoma, Arial, sans-serif; --font-d: 'Segoe UI Semibold', 'Segoe UI', Tahoma, Arial, sans-serif; }
html.ingame body::before { display: none; }
html.ingame body { background: #0b0c12 linear-gradient(180deg, #0e1018 0%, #090a0f 100%); }
html.ingame .ext { display: none !important; }
html.ingame .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: #0b0c12; }
html.ingame .dlg__bg { -webkit-backdrop-filter: none; backdrop-filter: none; }
html.ingame .brand img,
html.ingame .tile__img img,
html.ingame .buybox__img img,
html.ingame .pack__img img,
html.ingame .hero__coins img { filter: none; }
html.ingame .tile, html.ingame .tile:hover, html.ingame .tile:focus-visible,
html.ingame .btn, html.ingame .btn:hover, html.ingame .btn-primary, html.ingame .btn-primary:hover,
html.ingame .recent__item:hover, html.ingame .cat-pill, html.ingame .pack--best { box-shadow: none; transform: none; }
html.ingame .tile { isolation: auto; }
html.ingame .tile::after { display: none; }
html.ingame .tile:hover, html.ingame .tile:focus-visible { border-color: var(--gold); }
html.ingame .tile:hover .tile__img img { transform: none; }
html.ingame .btn:hover { filter: none; }
html.ingame .grad { background: none; color: var(--gold-2); -webkit-text-fill-color: currentColor; }
html.ingame .foot { padding: 12px 0 14px; }

/* ---------- 16. Admin pages (Bootstrap 4 alpha is loaded there) ---------- */
.page-admin a:hover, .page-admin a:focus { text-decoration: none; }
.page-admin .section-title { margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.page-admin .media-section, .page-admin .images { background: transparent; }
.page-admin .container, .page-admin .container-fluid { max-width: 100%; padding: 0; }
.page-admin label { color: var(--muted); font: 600 12px var(--font-d); letter-spacing: .1em; text-transform: uppercase; }
.page-admin .form-group { margin-bottom: 14px; }
.page-admin .row { margin-left: -8px; margin-right: -8px; }
.page-admin .row > [class*="col-"] { padding-left: 8px; padding-right: 8px; }
.page-admin .collapse.show, .page-admin .collapse.in { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.page-admin .collapsing { margin-top: 12px; }
.page-admin .form-check.form-control { height: auto; min-height: 44px; display: flex; align-items: center; }
.page-admin .form-check-label { margin: 0; text-transform: none; letter-spacing: 0; font: 400 13.5px var(--font); color: var(--text); }
.page-admin .form-check-input { margin-right: 8px; accent-color: var(--gold); }
.page-admin .input-group-addon, .page-admin .input-group-text { background: var(--glass-2); border: 1px solid var(--line-2); color: var(--muted); border-radius: 10px; padding: 0 12px; display: flex; align-items: center; }

.page-admin .panel { border: 1px solid var(--line); border-radius: var(--r); background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); overflow: hidden; }
.page-admin .panel-heading { padding: 14px 16px 0; border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.page-admin .panel-body { padding: 18px; }

.page-admin .nav-tabs { display: flex; gap: 6px; margin: 0; padding: 0; border: 0; list-style: none; }
.page-admin .nav-tabs .nav-item { margin: 0; }
.page-admin .nav-tabs .nav-link {
  display: block; margin: 0; padding: 10px 16px; border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0;
  color: var(--muted); font: 700 12px/1 var(--font-d); letter-spacing: .1em; text-transform: uppercase;
}
.page-admin .nav-tabs .nav-link:hover { color: var(--text); background: var(--glass); border-color: transparent; }
.page-admin .nav-tabs .nav-link.active { color: var(--gold-2); background: var(--surface); border-color: var(--line); }

.page-admin .table { width: 100%; margin: 0 0 16px; color: var(--text); background: transparent; border-collapse: collapse; }
.page-admin .table th, .page-admin .table td { padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; background: transparent; }
.page-admin .table thead th { border-top: 0; border-bottom: 1px solid var(--line-2); color: var(--muted); font: 700 11px var(--font-d); letter-spacing: .14em; text-transform: uppercase; }
.page-admin .table-striped tbody tr:nth-of-type(odd) { background: rgba(255, 255, 255, .03); }
.page-admin .table-hover tbody tr:hover { background: rgba(246, 185, 59, .06); }
.page-admin .table img { image-rendering: pixelated; }

.page-admin .well, .page-admin .jumbotron { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.page-admin h3, .page-admin h4 { color: var(--text); }
