/* Website design. One color family set under Appearance (12 colors x Light, Deep, Dark),
   printed as CSS variables on <html>. One font (Outfit). No gradients. */

:root {
  /* Theme colors: these defaults (Violet, Deep) are replaced by the inline style on <html>. */
  --bg: hsl(252 55% 15%);
  --s1: hsl(252 51% 20%);
  --s2: hsl(252 47% 24%);
  --line: hsl(252 43% 30%);
  --accent: hsl(252 90% 74%);
  --on-accent: hsl(252 70% 10%);
  --muted: hsl(252 28% 78%);
  --text: hsl(252 40% 97%);

  /* Names used across the templates, all built from the theme colors above. */
  --bg-2: var(--s1);
  --surface: var(--s1);
  --surface-2: var(--s2);
  --soft-hover: var(--line);
  --line-2: var(--line);
  --faint: var(--muted);
  --prose: var(--text);
  --header-bg: var(--bg);
  --ink: var(--on-accent);
  --danger: hsl(0 85% 68%);
  --r-card: 16px;
  --r-thumb: 12px;
  --r-pill: 999px;
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: var(--font);
  --body: var(--font);
  --wrap: 1320px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); overflow-x: hidden; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 28px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 12px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 10px; font-weight: 600; font-size: 15px; line-height: 1.2; white-space: nowrap; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s, filter .15s; text-align: center; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-solid { background: var(--accent); color: var(--on-accent); }
.btn-solid:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--s2); }
.btn-soft { background: var(--s2); }
.btn-soft:hover { background: var(--line); }
.btn-danger { background: var(--s2); color: var(--danger); border-color: var(--line); }
.btn-danger:hover { background: var(--line); }
.btn-icon { width: 44px; padding: 0; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; font-size: 14px; padding: 0 14px; }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }
.icon-btn { width: 42px; height: 42px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--s2); color: var(--text); flex: none; }
.icon-btn:hover { background: var(--line); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn svg { width: 20px; height: 20px; }
.text-link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */
.hdr { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; gap: 12px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-word { font-weight: 800; font-size: 21px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-img { height: 40px; width: auto; max-width: 200px; object-fit: contain; }
.logo { flex: none; }
.nav { display: flex; gap: 4px; margin-left: 14px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-link { padding: 8px 14px; border-radius: 10px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.hdr-right { flex: none; }
.nav-link:hover, .nav-link.on { color: var(--text); background: var(--s1); }
.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 8px; height: 42px; width: 260px; padding: 0 14px; border-radius: 12px; background: var(--s1); border: 1px solid var(--line); color: var(--muted); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: var(--text); outline: 0; }
.search:focus-within { border-color: var(--accent); }
.mob { display: none; }
@media (max-width: 1023px) {
  .hdr-in { height: 62px; gap: 10px; }
  .nav, .search { display: none; }
  .mob { display: inline-grid; }
  .logo-mark { width: 30px; height: 30px; }
  .logo-word { font-size: 19px; }
}
@media (max-width: 359px) { .logo-word { font-size: 17px; } }

/* Account button and menu */
.user-menu { position: relative; }
.user-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); padding: 0; overflow: hidden; }
.user-btn svg { width: 22px; height: 22px; }
.user-btn.is-in { background: var(--s2); }
.user-btn.is-in svg, .user-btn .avatar { width: 42px; height: 42px; }
.dd { position: absolute; right: 0; top: calc(100% + 10px); width: 250px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px; z-index: 60; display: grid; gap: 4px; }
.dd[hidden] { display: none; }
.dd-note { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.dd .btn + .btn { margin-top: 4px; }
.dd-head { padding: 4px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: grid; }
.dd-head small, .acc-me small { color: var(--muted); font-size: 13px; }
.dd-link { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border-radius: 8px; font-weight: 600; font-size: 15px; text-align: left; }
.dd-link:hover { background: var(--s2); }
.dd-link svg { width: 18px; height: 18px; }

/* Phone menu drawer */
.drawer { position: fixed; inset: 0; z-index: 80; display: none; }
.drawer.open { display: block; }
.drawer-bg { position: absolute; inset: 0; background: #000a; }
.drawer-panel { position: absolute; top: 0; left: 0; bottom: 0; width: min(300px, 85vw); background: var(--s1); border-right: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.drawer-panel .nav-link { display: flex; min-height: 46px; align-items: center; font-size: 16px; color: var(--text); }

/* ---------- Typography and sections ---------- */
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
h1 em, .accent-text { font-style: normal; color: var(--accent); }
h2 { font-size: clamp(21px, 2.6vw, 26px); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h3 { font-weight: 700; }
.sec { padding: 26px 0 6px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-h p { color: var(--muted); margin-top: 4px; font-size: 15px; }
.sec-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.sec-tools .icon-btn { width: 38px; height: 38px; }
.view-all { font-weight: 600; color: var(--accent); margin-right: 4px; font-size: 15px; white-space: nowrap; }
.view-all:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Featured games (homepage) ---------- */
.hero { padding: 22px 0 6px; }
.hero-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .hero-grid .feat:first-child { grid-row: span 2; }
  .hero-grid.is-single { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
}
.feat { display: flex; flex-direction: column; border-radius: var(--r-card); overflow: hidden; background: var(--s1); border: 1px solid var(--line); min-width: 0; transition: border-color .15s; }
.feat:hover { border-color: var(--accent); }
.feat img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; flex: 1 1 auto; min-height: 0; background: var(--s2); }
.feat-info { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.feat-text { min-width: 0; }
.feat-info b { display: block; font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feat-info small { display: block; color: var(--muted); font-size: 13px; }
.hero-grid .feat:first-child .feat-info b { font-size: 22px; }
.hero-grid .feat:not(:first-child) .feat-btn { display: none; }
@media (max-width: 899px) { .hero-grid .feat:not(:first-child), .hero-grid.is-single .feat:not(:first-child) { display: none; } }
.hero-grid.is-single .feat:not(:first-child) { display: none; }
.feat img, .feat-info { transition: opacity .3s; }
.feat.swap img, .feat.swap .feat-info { opacity: 0; }
.hero-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.hero-dots[hidden] { display: none; }
.hero-dots button { width: 8px; height: 8px; border-radius: 99px; background: var(--line); padding: 0; }
.hero-dots button.on { width: 22px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .feat img, .feat-info { transition: none; } }

/* Game rows: whole cards only, arrows move one full view */
.car { --n: 2; --gap: 12px; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)); gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; padding-bottom: 2px; }
.car::-webkit-scrollbar { display: none; }
.car > * { scroll-snap-align: start; }
@media (min-width: 600px) { .car { --n: 4; } }
@media (min-width: 1024px) { .car { --n: 6; } }
@media (min-width: 1280px) { .car { --n: 7; } }

/* ---------- Game cards ---------- */
/* Every game grid shows 2 games per line on phones, 3 on tablets and 6 on computers.
   Pages hold a multiple of 6 games, so every line is full. Short fixed lists (class "trim")
   hide an unfinished last line instead of leaving half of it empty. */
.grid { display: grid; gap: 18px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 599px) { .grid.trim > :nth-child(2n+3):last-child { display: none; } }
@media (min-width: 600px) and (max-width: 1023px) { .grid.trim > :nth-child(3n+4):nth-last-child(-n+2), .grid.trim > :nth-child(3n+4):nth-last-child(-n+2) ~ * { display: none; } }
@media (min-width: 1024px) { .grid.trim > :nth-child(6n+7):nth-last-child(-n+5), .grid.trim > :nth-child(6n+7):nth-last-child(-n+5) ~ * { display: none; } }
.gcard { display: block; min-width: 0; }
.gthumb { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--r-thumb); overflow: hidden; background: var(--s1); }
.gthumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.gcard:hover .gthumb img { transform: scale(1.05); }
.gthumb .play { position: absolute; right: 8px; bottom: 8px; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; opacity: 0; transform: translateY(6px); transition: .2s; }
.gthumb .play svg { width: 15px; height: 15px; margin-left: 2px; }
.gcard:hover .play, .gcard:focus-visible .play { opacity: 1; transform: none; }
.gcard:focus-visible { outline: none; }
.gcard:focus-visible .gthumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.gtitle { display: block; font-weight: 600; font-size: 15px; line-height: 1.3; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gmeta { display: flex; gap: 6px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.gmeta .chip { background: none; padding: 0; color: var(--muted); font-weight: 500; font-size: 13px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill); background: var(--s2); color: var(--muted); font-weight: 600; font-size: 12px; }
a.chip:hover { color: var(--text); }
.chip.hot { background: var(--accent); color: var(--on-accent); }

/* Continue playing */
.strip { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 640px) { .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mini { display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.mini:hover { border-color: var(--accent); }
.mini img { width: 64px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.mini-body { min-width: 0; flex: 1; display: grid; }
.mini b { font-size: 14.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini small { color: var(--muted); font-size: 12.5px; }
.mini .go { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; flex: none; }
.mini .go svg { width: 14px; height: 14px; }

/* Category cards (Categories page) */
.cats { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.split { display: grid; grid-template-columns: 40% minmax(0, 1fr); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; min-height: 160px; transition: border-color .15s; }
.split:hover { border-color: var(--accent); }
.sp-img { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; background: var(--s2); }
.sp-img img { width: 100%; height: 100%; object-fit: cover; }
.sp-txt { padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 0; }
.sp-name { font-size: 19px; font-weight: 700; }
.sp-intro { color: var(--muted); font-size: 14px; line-height: 1.5; }
.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.sp-row .count { font-size: 13px; color: var(--muted); font-weight: 600; }
.sp-row .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
@media (max-width: 375px) { .split { grid-template-columns: 36% minmax(0, 1fr); } .sp-intro { display: none; } }

/* Pagination */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pg { min-width: 42px; height: 42px; padding: 0 8px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; background: var(--s1); border: 1px solid var(--line); color: var(--muted); }
a.pg:hover { color: var(--text); border-color: var(--accent); }
.pg.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.pg.dots { background: none; border: 0; min-width: 20px; }
@media (max-width: 480px) { .pg.hide-s { display: none; } .pager .btn { padding: 0 14px; } }
@media (max-width: 374px) { .pager-step span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .pager-step { width: 44px; padding: 0; } }

/* About section (homepage) */
.about { margin-top: 34px; padding: 34px 0 10px; border-top: 1px solid var(--line); }
.about-in { max-width: 900px; }
.about-title { font-size: clamp(25px, 3.2vw, 32px); margin-bottom: 12px; }
.about h3 { font-size: 20px; margin: 24px 0 8px; }
.about p { color: var(--muted); margin-bottom: 12px; }

/* Listing pages */
.crumbs { padding: 20px 0 10px; font-size: 13.5px; color: var(--muted); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; }
.crumbs a:hover { color: var(--text); }
.list-head { margin: 4px 0 22px; display: grid; gap: 8px; }
.list-intro { color: var(--muted); max-width: 70ch; }
.list-count { color: var(--muted); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.search-bar { display: flex; gap: 10px; margin-bottom: 24px; max-width: 640px; }
.search-bar .input { flex: 1; min-width: 0; }
@media (max-width: 480px) { .search-bar { flex-direction: column; } }

/* ---------- Game page ---------- */
.gp-head { display: grid; gap: 10px; margin-bottom: 18px; }
.play-wrap { max-width: 1040px; margin: 0 auto; }
.player { position: relative; width: 100%; aspect-ratio: var(--ratio, 16 / 9); max-height: 82vh; margin: 0 auto; border-radius: var(--r-card); overflow: hidden; background: #000; border: 1px solid var(--line); }
.player.is-portrait { width: auto; height: min(82vh, 760px); max-width: 100%; }
.player.is-square { max-width: min(100%, 82vh); }
@media (max-width: 640px) { .player.is-portrait { width: 100%; height: auto; max-height: 85vh; } }
.player-stage, .player-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-start { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; text-align: center; z-index: 2; background: var(--s1); }
.player-start[hidden], .player-state[hidden] { display: none; }
.player-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); max-width: none; object-fit: cover; filter: blur(22px) brightness(.45); }
.player-thumb { position: relative; width: min(240px, 46%); height: auto; border-radius: 14px; }
.btn-play { position: relative; min-height: 52px; padding: 0 30px; font-size: 17px; }
.player-state { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; background: var(--s1); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--s2); border-top-color: var(--accent); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.player:fullscreen { border-radius: 0; max-height: none; width: 100%; height: 100%; aspect-ratio: auto; border: 0; }
.toolbar { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; margin-top: 14px; }
.toolbar .tb { display: flex; gap: 10px; flex-wrap: wrap; }
[data-favorite].is-on { background: var(--accent); color: var(--on-accent); }
[data-favorite].is-on svg { fill: currentColor; }
.play-note { margin-top: 12px; font-size: 14px; }
@media (max-width: 480px) { .toolbar, .toolbar .tb { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; } }
.gp-body { display: grid; gap: 20px; margin-top: 30px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .gp-body { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.gp-body .panel h2 { font-size: 21px; margin-bottom: 12px; }
.prose-text { color: var(--text); }
.tips { list-style: none; display: grid; gap: 12px; counter-reset: tip; }
.tips li { counter-increment: tip; display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.tips li::before { content: counter(tip); width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; line-height: 32px; text-align: center; }
dl.kv div { display: flex; justify-content: space-between; gap: 12px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { font-weight: 600; text-align: right; }
dl.kv a { color: var(--accent); }

/* Dialogs */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-bg { position: absolute; inset: 0; background: #000b; }
.modal-box { position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h2 { font-size: 21px; }
html.modal-open { overflow: hidden; }
.reasons { border: 0; display: grid; gap: 10px; margin-bottom: 16px; }
.reasons legend { font-weight: 600; margin-bottom: 8px; }
.reasons .check { min-height: 32px; align-items: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.report-msg { min-height: 22px; font-size: 14.5px; margin-bottom: 6px; }
.report-msg.is-ok { color: var(--accent); }
.report-msg.is-error { color: var(--danger); }

/* ---------- Panels, notices, forms ---------- */
.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); padding: 22px; }
.panel + .panel { margin-top: 20px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--s1); font-size: 15px; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.notice.error { border-color: var(--danger); }
.notice.error svg { color: var(--danger); }
.notice.ok { border-color: var(--accent); }
.notice.ok svg { color: var(--accent); }
.notice ul { padding-left: 18px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14.5px; }
.field small { color: var(--muted); font-size: 13px; }
.input { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px; }
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--muted); opacity: .8; }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.row-2 { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .row-2 { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 19px; height: 19px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.captcha { margin-bottom: 16px; min-height: 65px; }

/* ---------- Log in and sign up ---------- */
.auth { display: grid; justify-items: center; gap: 18px; padding: 40px 0 24px; }
.auth-card { width: 100%; max-width: 460px; display: grid; gap: 14px; }
.auth-card h1 { font-size: clamp(26px, 5vw, 30px); }
.auth-card .field { margin-bottom: 0; }
.auth-sub { margin-top: -6px; color: var(--muted); }
.auth-small h2 { font-size: 18px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fine { color: var(--muted); font-size: 13px; text-align: center; }
.auth-switch { text-align: center; color: var(--muted); font-size: 14.5px; }
.auth-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 4px; background: var(--s2); color: var(--accent); }
.auth-icon svg { width: 26px; height: 26px; }
.auth-icon.is-error { color: var(--danger); }
.auth .notice ul { margin: 0; }

/* ---------- Player account ---------- */
.acc { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); padding-top: 24px; padding-bottom: 20px; }
@media (min-width: 1024px) { .acc { grid-template-columns: 240px minmax(0, 1fr); align-items: start; } }
.acc-side { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px; display: grid; gap: 10px; }
@media (min-width: 1024px) { .acc-side { position: sticky; top: 86px; } }
.acc-me { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 4px; }
.acc-me div { display: grid; min-width: 0; }
.acc-me b { overflow-wrap: anywhere; }
.acc-nav { display: grid; gap: 4px; }
@media (max-width: 1023px) { .acc-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } .acc-out { display: none; } }
.acc-link { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 15px; text-align: left; }
@media (max-width: 1023px) { .acc-nav .acc-link { justify-content: center; text-align: center; font-size: 14px; padding: 0 6px; } }
.acc-link:hover { color: var(--text); background: var(--s2); }
.acc-link.on { background: var(--accent); color: var(--on-accent); }
.acc-out { border-top: 1px solid var(--line); padding-top: 8px; }
.acc-main { min-width: 0; display: grid; gap: 20px; align-content: start; }
.acc-title { font-size: clamp(25px, 3.6vw, 32px); }
.acc-welcome { margin-top: -8px; }
.acc-sec .sec-h h2 { font-size: 22px; }
.sub-tabs { display: flex; gap: 4px; padding: 4px; background: var(--s1); border: 1px solid var(--line); border-radius: 12px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.sub-tabs a { padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: var(--muted); white-space: nowrap; }
.sub-tabs a:hover { color: var(--text); }
.sub-tabs a.on { background: var(--accent); color: var(--on-accent); }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; min-width: 0; }
.stat span { color: var(--muted); font-size: 13.5px; font-weight: 500; }
.stat b { display: block; font-size: 28px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
@media (max-width: 420px) { .stat { padding: 12px; } .stat b { font-size: 22px; } .stat span { font-size: 12.5px; } }
.acc-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.acc-cards { display: grid; gap: 20px; }
.acc-cards .panel { display: grid; gap: 12px; }
.acc-cards .panel h2 { font-size: 21px; }
.acc-cards .field { margin-bottom: 0; max-width: 460px; }
.acc-cards .btn { justify-self: start; }
.gcard-wrap { display: grid; gap: 8px; align-content: start; min-width: 0; }
.danger-zone { border-color: var(--line); }
.merge-offer { display: grid; gap: 10px; border-color: var(--accent); }
.merge-offer[hidden] { display: none; }
.merge-offer h2 { font-size: 20px; }
.avatar-pick { border: 0; margin: 8px 0 20px; }
.avatar-pick legend { font-weight: 600; margin-bottom: 10px; }
.avatar-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.avatar-opt { position: relative; display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }
.avatar-opt input { position: absolute; opacity: 0; pointer-events: none; }
.avatar-opt:has(input:checked) { border-color: var(--accent); color: var(--text); }
.avatar-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.avatar { display: block; border-radius: 50%; flex: none; }

/* ---------- Guides ---------- */
.guides { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .guides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .guides { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.guide-cats { margin-bottom: 20px; }
.acard { display: flex; flex-direction: column; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; transition: border-color .15s; min-width: 0; }
.acard:hover { border-color: var(--accent); }
.acard-img { display: block; aspect-ratio: 16 / 9; background: var(--s2); overflow: hidden; }
.acard-img img { width: 100%; height: 100%; object-fit: cover; }
.acard-body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 18px; flex: 1; align-items: flex-start; }
.acard-title { font-size: 19px; line-height: 1.3; font-weight: 700; }
.acard-text { color: var(--muted); font-size: 14.5px; }
.acard-btn { margin-top: auto; }
.article { max-width: 860px; }
.article-head { display: grid; gap: 12px; justify-items: start; margin: 6px 0 22px; }
.article-head h1 { font-size: clamp(28px, 4.2vw, 40px); }
.article-meta { color: var(--muted); font-size: 14px; }
.article-hero { margin: 0 0 26px; border-radius: var(--r-card); overflow: hidden; background: var(--s1); aspect-ratio: 16 / 9; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-body { font-size: 17px; line-height: 1.75; }
.article-body > * + * { margin-top: 1em; }
.article-body h2 { font-size: clamp(22px, 3vw, 27px); margin-top: 1.6em; }
.article-body h3 { font-size: 20px; margin-top: 1.4em; }
.article-body p, .article-body li { color: var(--text); }
.article-body ul, .article-body ol { padding-left: 1.3em; display: grid; gap: .4em; }
.article-body li::marker { color: var(--accent); }
.article-body blockquote { border-left: 4px solid var(--accent); padding: 6px 0 6px 16px; color: var(--muted); }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.article-body th, .article-body td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article-body img { border-radius: 12px; height: auto; }
.page-article { padding-bottom: 20px; }

/* Contact page */
.contact-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; } }
.contact-mail { font-size: 17px; }
.contact-mail a { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.contact-form { max-width: 760px; }
.contact-list { list-style: none; display: grid; gap: 12px; }
.contact-list li { display: grid; gap: 2px; }
.contact-list b { font-size: 15px; }
.contact-list span { color: var(--muted); font-size: 14.5px; }
.form-stack { display: grid; gap: 14px; }
.form-stack .field { margin-bottom: 0; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line); border-radius: var(--r-card); background: var(--s1); }
.empty h2 { font-size: 22px; margin-bottom: 8px; }
.empty p { color: var(--muted); max-width: 52ch; margin: 0 auto; }

/* ---------- Footer ---------- */
.ftr { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0; }
.ftr-in { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; justify-content: space-between; }
.ftr-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.ftr-brand svg { width: 24px; height: 24px; }
.ftr nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ftr nav a, .ftr nav button { font-size: 14px; color: var(--muted); padding: 6px 0; font-weight: 500; }
.ftr nav a:hover, .ftr nav button:hover { color: var(--text); }
@media (max-width: 767px) { .ftr-in { flex-direction: column; align-items: flex-start; } .ftr nav a, .ftr nav button { padding: 8px 0; } }

/* ---------- Centered pages (admin log in, errors, installer) ---------- */
.center-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; gap: 22px; }
.center-card { width: 100%; max-width: 460px; }
.center-card.wide { max-width: 760px; }
.center-card h1 { font-size: clamp(26px, 5vw, 32px); margin-bottom: 8px; }
.center-logo { display: flex; justify-content: center; }
.error-code { font-size: clamp(64px, 16vw, 120px); line-height: 1; font-weight: 800; color: var(--accent); }

/* ---------- Installer ---------- */
.steps { display: flex; gap: 8px; list-style: none; margin-bottom: 20px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: var(--r-pill); background: var(--s1); border: 1px solid var(--line); font-size: 14px; color: var(--muted); font-weight: 600; }
.steps li b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--s2); color: var(--text); font-size: 13px; }
.steps li.on { color: var(--text); }
.steps li.on b { background: var(--accent); color: var(--on-accent); }
.steps li.done b { color: var(--accent); }
.checklist { list-style: none; display: grid; gap: 2px; }
.checklist li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--s2); }
.checklist .mark svg { width: 15px; height: 15px; }
.checklist .yes .mark { color: var(--accent); }
.checklist .no .mark { color: var(--danger); }
.checklist .warn .mark { color: var(--text); }
.checklist strong { display: block; font-size: 15px; }
.checklist span { color: var(--muted); font-size: 13.5px; }
.form-actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; overflow-wrap: anywhere; }
.kv { display: grid; gap: 0; }
.kv div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; flex-wrap: wrap; }
.kv div:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { overflow-wrap: anywhere; }

/* ---------- Cookie banner and settings ---------- */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 80; display: flex; justify-content: center; }
.cookie-bar[hidden] { display: none; }
.cookie-bar-in { width: 100%; max-width: 980px; display: flex; align-items: center; gap: 18px; padding: 16px 18px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-card); }
.cookie-bar p { margin: 0; font-size: 14.5px; color: var(--muted); flex: 1 1 auto; }
.cookie-bar strong { color: var(--text); }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }
@media (max-width: 760px) {
  .cookie-bar { left: 10px; right: 10px; bottom: 10px; }
  .cookie-bar-in { flex-direction: column; align-items: stretch; padding: 14px; }
  .cookie-actions .btn { flex: 1 1 100%; }
}
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: default; }
label.cookie-row { cursor: pointer; }
.cookie-row p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); }
.cookie-row .chip { flex: 0 0 auto; }
.switch { appearance: none; -webkit-appearance: none; flex: 0 0 auto; width: 48px; height: 28px; border-radius: 999px; background: var(--s2); border: 1px solid var(--line); position: relative; cursor: pointer; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch:checked::after { transform: translateX(20px); background: var(--on-accent); }
#cookie-modal .form-actions { margin-top: 16px; }
#cookie-modal .fine { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* Ad zones: collapsed until an ad request is made */
.ad-zone { display: none; margin: 28px auto; max-width: 970px; text-align: center; }
.ad-zone.on { display: block; }
.ad-label { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-zone ins { min-height: 90px; }
.article-body .ad-zone { margin: 32px auto; }
