/* =====================================================================
   Cheap Games – site styles (no bundler). Themes: [data-theme=dark|light]
   ===================================================================== */
:root {
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Chakra Petch", "Inter", system-ui, sans-serif;
  --radius: 14px; --radius-sm: 9px;
  --primary: #7c5cff; --primary-2: #a78bfa; --primary-ink: #fff;
  --accent: #22d3ee; --accent-2: #f472b6;
  --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --neutral: #94a3b8;
  --z-header: 50; --z-dropdown: 60; --z-modal: 100; --z-toast: 120;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.45);
  --container: 1280px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d17; --bg-2: #10131f; --surface: #151a2b; --surface-2: #1c2238; --surface-3: #252c47;
  --border: #283052; --text: #e8eaf6; --muted: #9aa3c7; --heading: #fff;
  --input: #0f1322; --glow: rgba(124,92,255,.35);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5fb; --bg-2: #eceef8; --surface: #ffffff; --surface-2: #f6f7fc; --surface-3: #eceffa;
  --border: #dde1f0; --text: #1d2140; --muted: #646b8f; --heading: #0f1230;
  --input: #fff; --glow: rgba(124,92,255,.2);
  --shadow: 0 10px 30px -14px rgba(30,40,90,.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary-2); text-decoration: none; }
[data-theme="light"] a { color: var(--primary); }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--heading); line-height: 1.2; margin: 0 0 .5em; letter-spacing: .01em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }
small, .muted { color: var(--muted); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; gap: 18px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--heading) !important; text-decoration: none !important; white-space: nowrap; }
.logo .mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-size: 1.05rem; box-shadow: 0 6px 20px -6px var(--glow); }
.logo b { color: var(--accent); font-weight: 700; }
.header-search { flex: 1; max-width: 520px; position: relative; }
.header-search input { width: 100%; padding: 10px 14px 10px 40px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit; }
.header-search > i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.main-nav { display: flex; gap: 4px; }
.main-nav a, .icon-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 500; text-decoration: none !important; background: none; border: 0; cursor: pointer; font: inherit; position: relative; }
.main-nav a:hover, .icon-btn:hover, .main-nav a.active { background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.badge-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent-2); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; }
.nav-toggle { display: none; }

/* ---------- Dropdowns ---------- */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; z-index: var(--z-dropdown); display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; text-align: left; font: inherit; cursor: pointer; text-decoration: none !important; }
.dropdown-menu a:hover, .dropdown-menu button:hover, .dropdown-menu .on { background: var(--surface-2); }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 6px 0; }
.dropdown-menu .head { padding: 8px 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.notif-menu { width: 340px; max-height: 420px; overflow: auto; }
.notif-item { display: flex !important; gap: 10px; align-items: flex-start !important; }
.notif-item.unread { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.notif-item small { display: block; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none !important; transition: transform .08s, background .15s, box-shadow .15s; white-space: nowrap; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary), #6246ea); color: var(--primary-ink) !important; box-shadow: 0 8px 22px -10px var(--glow); }
.btn-primary:hover { box-shadow: 0 10px 28px -8px var(--glow); }
.btn-accent { background: var(--accent); color: #062029 !important; }
.btn-ghost { background: var(--surface-2); color: var(--text) !important; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-ok { background: var(--ok); color: #fff !important; }
.btn-bad { background: var(--bad); color: #fff !important; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text) !important; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; color: var(--heading); }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.input, select.input, textarea.input { width: 100%; padding: 10px 13px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--input); color: var(--text); font: inherit; transition: border .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--glow); }
textarea.input { min-height: 110px; resize: vertical; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); border: 1px solid var(--border); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); color: var(--muted); }
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.error, .field .error { color: var(--bad); font-size: 13px; margin-top: 4px; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 150px; position: relative; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card span { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; font-weight: 500; }
.radio-card input:checked + span { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); box-shadow: 0 0 0 3px var(--glow); }

/* Switch */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); position: relative; flex-shrink: 0; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--glow); }
.switch b { display: block; color: var(--heading); }
.switch small { display: block; }

/* ---------- Cards / layout ---------- */
main { min-height: 70vh; padding: 28px 0 60px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 18px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title h2, .card-title h3 { margin: 0; }
.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-head h2 { margin: 0; display: flex; gap: 10px; align-items: center; }
.layout-side { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; }
.layout-main-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sticky { position: sticky; top: 86px; }

/* Hero */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 46px 40px; margin-bottom: 34px; border: 1px solid var(--border);
  background: radial-gradient(900px 400px at 85% -10%, color-mix(in srgb, var(--primary) 45%, transparent), transparent 60%),
              radial-gradient(700px 300px at -10% 120%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%), var(--surface); }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 720px; }
.hero h1 span { background: linear-gradient(90deg, var(--primary-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 1.08rem; max-width: 620px; }
.hero-search { display: flex; gap: 10px; max-width: 640px; margin: 22px 0 18px; }
.hero-search .input { padding: 14px 18px; font-size: 1.02rem; border-radius: 13px; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 22px; }
.stats div b { display: block; font-family: var(--font-head); font-size: 1.6rem; color: var(--heading); }
.stats div span { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text) !important; font-size: 13px; font-weight: 500; text-decoration: none !important; }
.chip:hover { border-color: var(--primary); }

/* Grid of listing cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.lcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, border-color .15s, box-shadow .15s; color: var(--text) !important; text-decoration: none !important; }
.lcard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 60%, var(--border)); box-shadow: var(--shadow); }
.lcard .thumb { position: relative; aspect-ratio: 460/215; background: var(--surface-2); overflow: hidden; }
.lcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lcard .tags { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.lcard .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lcard .title { font-weight: 600; color: var(--heading); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.lcard .meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.lcard .foot { display: flex; justify-content: space-between; align-items: end; margin-top: auto; }
.price { font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--heading); }
.price small { font-family: var(--font); font-size: 11px; color: var(--muted); font-weight: 500; display: block; text-transform: uppercase; letter-spacing: .05em; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 7px; font-size: 11.5px; font-weight: 600; background: rgba(10,12,25,.78); color: #fff; backdrop-filter: blur(4px); }
.tag-auction { background: linear-gradient(135deg, #f59e0b, #f97316); }
.tag-offer { background: color-mix(in srgb, var(--primary) 85%, #000); }
.tag-region { background: #0e7490; }
.tag-sched { background: #475569; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.pill-ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); border-color: transparent; }
.pill-bad { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); border-color: transparent; }
.pill-warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); border-color: transparent; }
.pill-info { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); border-color: transparent; }
.pill-primary { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary-2); border-color: transparent; }

/* Avatar / reputation */
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--primary), var(--accent-2)); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 96px; height: 96px; font-size: 32px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10px; }
.user-chip { display: inline-flex; align-items: center; gap: 9px; color: var(--text) !important; font-weight: 600; text-decoration: none !important; }
.rep { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; }
.rep .pos { color: var(--ok); } .rep .neg { color: var(--bad); } .rep .neu { color: var(--neutral); }
.afk { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); font-size: 11.5px; font-weight: 700; }
.role-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.role-admin { background: var(--bad); color: #fff; } .role-moderator { background: var(--accent); color: #032; }

/* Icons */
.svg-icon { display: inline-block; width: 1.1em; height: 1.1em; vertical-align: -0.15em; background: currentColor; -webkit-mask: var(--svg) center / contain no-repeat; mask: var(--svg) center / contain no-repeat; }
.ico-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; font-size: 14px; }
.ico-btn:hover { border-color: var(--primary); color: var(--primary-2); }
.ico-btn.warn { color: var(--accent); }
.ico-btn.auction { color: var(--warn); }
.flag-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 4px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; }
.flag-chip .flag { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; }
.flag-chip b { font-weight: 700; }

/* ---------- Game page ---------- */
.game-hero { display: grid; grid-template-columns: 460px minmax(0, 1fr); gap: 28px; margin-bottom: 30px; }
.game-hero .cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); aspect-ratio: 460/215; background: var(--surface-2); }
.game-hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; margin: 14px 0; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.gallery a { border-radius: 10px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 16/9; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.video { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: #000; }
.video iframe, .video video { width: 100%; height: 100%; border: 0; }
.prose { color: var(--text); }
.prose img { border-radius: 10px; margin: 10px 0; }
.prose h2, .prose h3 { margin-top: 1.2em; }
.clamp { max-height: 360px; overflow: hidden; position: relative; }
.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; background: linear-gradient(transparent, var(--surface)); }
.clamp.open { max-height: none; } .clamp.open::after { display: none; }

/* Sellers table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.table th { text-align: left; padding: 12px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.table .icons { display: flex; gap: 6px; align-items: center; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Auction box */
.auction-box { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--warn) 8%, var(--surface)), var(--surface)); }
.countdown { font-family: var(--font-head); font-size: 1.5rem; font-weight: 700; color: var(--warn); }
.bid-list { max-height: 260px; overflow: auto; }
.bid-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* Filters */
.filters .group { margin-bottom: 18px; }
.filters .group h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; font-family: var(--font); }
.filters label.check { display: flex; padding: 4px 0; font-size: 14px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 11px 16px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none !important; display: inline-flex; gap: 8px; align-items: center; }
.tabs a.active { color: var(--heading); border-color: var(--primary); }
.tabs .count { font-size: 11px; background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }

/* Profile */
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.profile-head h1 { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rep-box { display: flex; gap: 10px; }
.rep-box div { text-align: center; padding: 10px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 80px; }
.rep-box b { display: block; font-family: var(--font-head); font-size: 1.3rem; }
.gamer-ids { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.gamer-id { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.gamer-id i { width: 20px; text-align: center; color: var(--primary-2); }
.gamer-id small { display: block; font-size: 11px; }
.fb-item { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; gap: 12px; }
.fb-item:last-child { border-bottom: 0; }
.fb-rating { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.fb-positive { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.fb-negative { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
.fb-neutral { background: color-mix(in srgb, var(--neutral) 18%, transparent); color: var(--neutral); }
.fb-reply { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: 14px; }

/* ---------- Messages ---------- */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100vh - 170px); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; }
.inbox-list a { display: flex; gap: 11px; padding: 13px 14px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.inbox-list a:hover, .inbox-list a.active { background: var(--surface-2); }
.inbox-list a.unread .who { color: var(--heading); font-weight: 700; }
.inbox-list a.unread::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent-2); align-self: center; flex-shrink: 0; }
.inbox-list .who { font-weight: 600; } .inbox-list .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-list .txt { min-width: 0; flex: 1; }
.thread { display: flex; flex-direction: column; min-width: 0; }
.thread-head { padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.thread-body { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: var(--bg-2); }
.thread-form { border-top: 1px solid var(--border); padding: 12px; display: flex; gap: 10px; }
.thread-form textarea { min-height: 46px; height: 46px; flex: 1; }
.msg { max-width: 72%; padding: 10px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; word-wrap: break-word; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, var(--primary), #6246ea); color: #fff; border-color: transparent; }
.msg time { display: block; font-size: 11px; opacity: .65; margin-top: 4px; }
.msg-system { align-self: center; max-width: 85%; text-align: center; font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 7px 14px; border-radius: 999px; }
.offer-card { align-self: stretch; max-width: 520px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--primary) 50%, var(--border)); background: var(--surface); padding: 14px 16px; }
.offer-card.mine { align-self: flex-end; }
.offer-card .amount { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; color: var(--heading); }
.offer-card .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.listing-mini { display: flex; gap: 12px; align-items: center; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 14px; }
.listing-mini img { width: 92px; border-radius: 8px; }

/* ---------- Modal (native <dialog>) ---------- */
dialog.modal { border: 1px solid var(--border); border-radius: 18px; padding: 0; background: var(--surface); color: var(--text); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(5,7,15,.65); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; display: flex; gap: 10px; align-items: center; }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: var(--surface); }
.close-x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.close-x:hover { background: var(--surface-2); color: var(--text); }

/* Game picker */
.picker { position: relative; }
.picker-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); z-index: var(--z-dropdown); max-height: 420px; overflow: auto; display: none; }
.picker-results.open { display: block; }
.picker-results .grp { padding: 8px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); display: flex; gap: 6px; align-items: center; }
.picker-results button { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px 14px; background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.picker-results button:hover, .picker-results button.hl { background: var(--surface-2); }
.picker-results img { width: 72px; height: 34px; object-fit: cover; border-radius: 5px; background: var(--surface-3); }
.picked { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--primary); border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.picked img { width: 140px; border-radius: 8px; }
.manual-box { border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px; margin-top: 14px; background: var(--surface-2); }
.img-previews { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.img-previews img { width: 110px; height: 62px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.flag-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* Coins tag input */
.taginput { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input); position: relative; }
.taginput input { border: 0; background: transparent; color: var(--text); font: inherit; flex: 1; min-width: 120px; padding: 4px; outline: none; }
.taginput .tg { display: inline-flex; align-items: center; gap: 5px; background: var(--surface-3); border-radius: 7px; padding: 3px 4px 3px 9px; font-size: 12.5px; font-weight: 600; }
.taginput .tg button { background: none; border: 0; color: var(--muted); cursor: pointer; }
.taginput .sugg { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); z-index: var(--z-dropdown); max-height: 220px; overflow: auto; }
.taginput .sugg button { display: flex; gap: 8px; align-items: center; width: 100%; padding: 7px 10px; background: none; border: 0; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.taginput .sugg button:hover { background: var(--surface-2); }
.taginput .sugg img { width: 18px; height: 18px; }
.method-row { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px; background: var(--surface-2); }
.method-row .extra { margin-top: 10px; }

/* Alerts / toasts */
.alert { padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid; }
.alert-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.alert-bad { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.alert-info { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.alert ul { margin: 0; padding-left: 18px; }
.toast { position: fixed; bottom: 22px; right: 22px; z-index: var(--z-toast); padding: 13px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); max-width: 360px; animation: up .25s ease; }
@keyframes up { from { transform: translateY(12px); opacity: 0; } }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty i { font-size: 2.4rem; margin-bottom: 12px; display: block; color: var(--surface-3); }

/* Pagination (Laravel default markup) */
nav[role="navigation"] { margin-top: 22px; }
nav[role="navigation"] > div:first-child { display: none; }
nav[role="navigation"] span, nav[role="navigation"] a { display: inline-flex; }
.pagination { display: flex; gap: 6px; list-style: none; padding: 0; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.pagination li > * { display: grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.pagination .active > * { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .disabled > * { opacity: .45; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0; color: var(--muted); font-size: 14px; background: var(--bg-2); }
.site-footer .cols { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.theme-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.theme-switch button { background: none; border: 0; color: var(--muted); padding: 6px 11px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; display: inline-flex; gap: 6px; align-items: center; }
.theme-switch button.on { background: var(--primary); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .game-hero { grid-template-columns: 1fr; }
  .layout-main-side { grid-template-columns: 1fr; }
  .sticky { position: static; }
}
@media (max-width: 900px) {
  .layout-side { grid-template-columns: 1fr; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 66px; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 10px; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: inline-flex; }
  .header-search { display: none; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); }
  .inbox.has-thread .inbox-list { display: none; }
  .thread-body { min-height: 50vh; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hero { padding: 30px 22px; }
  .hero-search { flex-direction: column; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .msg { max-width: 88%; }
  .logo span.txt { display: none; }
}
