/* PlayNook — dark game-portal theme. Tokens first; dark is the default, light kept for later. */
:root {
  --bg: #0f0f1a; --bg2: #151526; --card: #1b1b2e; --card2: #23233a; --line: #2c2c47;
  --text: #f1f0fb; --muted: #a09fbd; --accent: #8b5cf6; --accent2: #22d3ee; --hot: #f43f5e; --new: #10b981; --warn: #f59e0b;
  --radius: 14px; --hdr: 64px; --side: 232px; --gap: 16px;
  --font: Inter, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1 { font-size: clamp(22px, 3vw, 30px); margin: 4px 0 12px; line-height: 1.2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h2 { font-size: 19px; margin: 0; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 16px; margin: 0 0 10px; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { width: 20px; height: 20px; fill: currentColor; flex: none; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
.emo { font-size: 1.1em; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent2); outline-offset: 2px; }

/* header */
.header { position: sticky; top: 0; z-index: 30; background: rgba(15, 15, 26, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr { height: var(--hdr); display: flex; align-items: center; gap: 12px; padding: 0 16px; max-width: 1800px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.3px; flex: none; }
.logo img { width: 34px; height: 34px; }
.logo b { color: var(--accent2); }
.search { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 0 14px; height: 42px; min-width: 0; }
.search:focus-within { border-color: var(--accent); }
.search .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; height: 100%; }
.suggest { position: absolute; top: 48px; left: 0; right: 0; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 16px 40px #0009; }
.sg { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.sg:hover, .sg:focus { background: var(--card); }
.sg-ic { font-size: 20px; } .sg-t { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sg-c { color: var(--muted); font-size: 12px; }
.sg-all { color: var(--accent2); border-top: 1px solid var(--line); margin-top: 4px; }
.hdr-links { display: flex; gap: 18px; margin-left: auto; font-weight: 600; color: var(--muted); }
.hdr-links a:hover { color: var(--text); }
.lang { background: var(--card); border: 1px solid var(--line); border-radius: 8px; height: 36px; padding: 0 10px; cursor: pointer; font-weight: 700; font-size: 13px; flex: none; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--card); }
.burger { display: none; }
.user-menu { position: relative; flex: none; }
.avatar-btn { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 600; }
.avatar-btn img { width: 32px; height: 32px; border-radius: 50%; }
.user-drop { display: none; position: absolute; right: 0; top: 46px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 190px; box-shadow: 0 16px 40px #0009; }
.user-menu.open .user-drop { display: block; }
.user-drop a, .user-drop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; background: none; border: 0; cursor: pointer; }
.user-drop a:hover, .user-drop button:hover { background: var(--card); }

/* chips row */
.chips-bar { border-bottom: 1px solid var(--line); background: var(--bg); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; max-width: 1800px; margin: 0 auto; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 13px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s; }
.chip:hover, .chip.active { background: var(--card2); border-color: var(--accent); }
.chip-all { color: var(--accent2); }

/* layout */
.layout { display: flex; max-width: 1800px; margin: 0 auto; }
.sidebar { width: var(--side); flex: none; position: sticky; top: var(--hdr); height: calc(100vh - var(--hdr)); overflow-y: auto; padding: 12px 10px 40px; border-right: 1px solid var(--line); scrollbar-width: thin; }
.side-head { display: none; }
.side { display: flex; flex-direction: column; gap: 2px; }
.side a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: 14px; }
.side a:hover { background: var(--card); color: var(--text); }
.side a.active { background: var(--card2); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.side .emo { width: 20px; text-align: center; }
.side-sep { margin: 14px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
.drawer-back { display: none; }
.content { flex: 1; min-width: 0; }
main { min-height: 70vh; outline: none; }
.page { padding: 16px 20px 32px; }
.page.narrow { max-width: 760px; }
.boot { display: grid; place-items: center; height: 60vh; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card2); font-weight: 700; cursor: pointer; white-space: nowrap; transition: transform .1s, filter .15s; }
.btn:hover { filter: brightness(1.15); } .btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: linear-gradient(90deg, var(--accent), #6d5df6 60%, #3b82f6); border: 0; color: #fff; box-shadow: 0 6px 20px rgba(139, 92, 246, .35); }
.btn-ghost { background: transparent; border-color: var(--accent); color: #c4b5fd; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; } .btn-lg { height: 50px; padding: 0 28px; font-size: 17px; } .btn-block { width: 100%; }
.btn.on { border-color: var(--warn); color: var(--warn); }
.linkish { background: none; border: 0; color: var(--accent2); cursor: pointer; font-weight: 700; padding: 0; }

/* hero */
.hero { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); margin-bottom: 8px; }
.hero-main { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 7; background: var(--card); }
.hero-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.hero-main:hover img { transform: scale(1.03); }
.hero-info { position: absolute; inset: auto 0 0 0; padding: 24px; background: linear-gradient(transparent, rgba(8, 8, 18, .92)); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.hero-info h1 { margin: 0; font-size: clamp(22px, 3.2vw, 38px); }
.hero-meta { display: flex; align-items: center; gap: 4px; color: #e5e3ff; font-size: 14px; }
.hero-side { display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px; min-height: 0; }
.hero-mini { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 14px; overflow: hidden; padding-right: 12px; font-weight: 700; min-height: 0; border: 1px solid transparent; }
.hero-mini:hover { border-color: var(--accent); }
.hero-mini img { height: 100%; aspect-ratio: 16 / 10; object-fit: cover; flex: none; max-height: 90px; }
.hero-mini span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* rows (horizontal carousels) */
.row { margin: 22px 0; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.row-head h2 .ic { color: var(--accent2); }
.row-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.more { color: var(--accent2); font-weight: 700; font-size: 14px; white-space: nowrap; }
.nav-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 18px; line-height: 1; }
.nav-btn:hover { border-color: var(--accent); }
.row-track { display: grid; grid-auto-flow: column; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
.row-track::-webkit-scrollbar { display: none; }
.row-md { grid-auto-columns: 224px; } .row-sm { grid-auto-columns: 128px; }
.row-track > * { scroll-snap-align: start; }

/* cards */
.card { display: block; border-radius: var(--radius); background: var(--card); overflow: hidden; border: 1px solid transparent; transition: transform .15s, border-color .15s, box-shadow .15s; min-width: 0; }
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 28px rgba(139, 92, 246, .25); }
.card-img { position: relative; aspect-ratio: 16 / 10; background: var(--card2); overflow: hidden; }
.card-sm .card-img { aspect-ratio: 1; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(10, 10, 20, .45); opacity: 0; transition: opacity .15s; }
.card-play .ic { width: 46px; height: 46px; padding: 10px; border-radius: 50%; background: var(--accent); }
.card:hover .card-play { opacity: 1; }
.badge { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; color: #fff; }
.hero-info .badge { position: static; }
.badge-new { background: var(--new); } .badge-hot { background: var(--hot); }
.card-body { padding: 9px 11px 11px; }
.card-title { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; gap: 10px; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.rating { display: inline-flex; align-items: center; gap: 3px; color: #fcd34d; font-weight: 700; }
.rating .ic { width: 14px; height: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.skeleton .card-img, .sk-line { background: linear-gradient(90deg, var(--card2), #2b2b46, var(--card2)); background-size: 200% 100%; animation: sh 1.2s infinite; }
.sk-line { height: 14px; border-radius: 6px; }
@keyframes sh { to { background-position: -200% 0; } }

/* collections + tags */
.collections { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.collection { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: linear-gradient(135deg, var(--card), var(--card2)); border: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.collection:hover { border-color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag-cloud.small .chip { font-size: 12.5px; padding: 4px 10px; }
.inline-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-chips .chip { font-size: 12px; padding: 3px 9px; }

/* listing */
.crumbs { color: var(--muted); font-size: 13px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a:hover { color: var(--text); }
.list-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.sort-tabs { display: flex; gap: 6px; margin: 8px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 24px 0; }
.pg { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line); font-weight: 700; padding: 0 8px; }
.pg.cur { background: var(--accent); border-color: var(--accent); }
.dots { align-self: center; color: var(--muted); }
.seo { margin-top: 36px; padding: 20px; border-radius: var(--radius); background: var(--bg2); border: 1px solid var(--line); color: #cfcde6; }
.seo h2 { margin-bottom: 8px; } .seo h3 { margin-top: 16px; }
.seo details { border-top: 1px solid var(--line); padding: 10px 0; } .seo summary { cursor: pointer; font-weight: 600; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.cat-tile:hover { border-color: var(--accent); }
.cat-emo { font-size: 34px; }

/* game page */
.game-top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.game-main h1 { margin-bottom: 4px; }
.rating-box { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 1px; }
.star { position: relative; width: 20px; height: 20px; display: inline-grid; color: #4b4a68; background: none; border: 0; padding: 0; }
.star .ic { width: 20px; height: 20px; }
.star::after { content: ""; position: absolute; inset: 0; width: var(--f); overflow: hidden; background: #fcd34d;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.3l6.2 3.7-1.7-7 5.5-4.8-7.2-.6L12 2 9.2 8.6 2 9.2l5.5 4.8-1.7 7z'/%3E%3C/svg%3E") 0 0 / 20px 20px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 17.3l6.2 3.7-1.7-7 5.5-4.8-7.2-.6L12 2 9.2 8.6 2 9.2l5.5 4.8-1.7 7z'/%3E%3C/svg%3E") 0 0 / 20px 20px no-repeat; }
.stars.interactive .star { cursor: pointer; width: 26px; height: 26px; }
.stars.interactive .star .ic { width: 26px; height: 26px; }
.stars.interactive .star::after { -webkit-mask-size: 26px 26px; mask-size: 26px 26px; }
.stars.interactive:hover .star::after { width: 0; }
.stars.interactive .star:hover::after, .stars.interactive .star:has(~ .star:hover)::after { width: 100%; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.player.portrait { aspect-ratio: auto; height: min(78vh, 760px); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player:fullscreen { border-radius: 0; }
.player-cover { position: absolute; inset: 0; display: grid; place-items: center; }
.cover-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(18px) brightness(.55); transform: scale(1.1); }
.cover-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 16px; }
.cover-inner h2 { font-size: clamp(20px, 3vw, 30px); text-shadow: 0 2px 10px #000; }
.cover-icon { width: clamp(84px, 14vw, 140px); border-radius: 24px; box-shadow: 0 10px 40px #000a; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--card); border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
.pb-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pb-left img { width: 40px; height: 40px; border-radius: 10px; }
.pb-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tool { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card2); cursor: pointer; font-weight: 600; font-size: 13.5px; }
.tool:hover { border-color: var(--accent); }
.tool.on { color: var(--hot); border-color: var(--hot); }
.game-aside { display: flex; flex-direction: column; gap: 14px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.game-aside .panel { margin: 0; }
.lb ol { list-style: none; padding: 0; margin: 0; }
.lb li { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.lb li:last-child { border: 0; } .lb li.me { color: var(--accent2); }
.lb-rank { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card2); font-size: 12px; font-weight: 800; flex: none; }
.lb li:nth-child(1) .lb-rank { background: #eab308; color: #000; } .lb li:nth-child(2) .lb-rank { background: #cbd5e1; color: #000; } .lb li:nth-child(3) .lb-rank { background: #d97706; color: #000; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.meta-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; }
.meta dt { color: var(--muted); } .meta dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.meta a { color: var(--accent2); }
.game-text { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.game-text section, .embed { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.game-text p { margin: 8px 0 0; color: #d5d3ea; }
.embed { grid-column: 1 / -1; } .embed summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.embed textarea { width: 100%; margin-top: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: 12.5px ui-monospace, monospace; resize: vertical; }
.notice { background: var(--card); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 16px; margin: 8px 0 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.notice.warn { border-color: var(--warn); color: var(--warn); }
.warn-text { color: var(--warn); }

/* account + dev + admin */
.profile-head, .dev-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-head h1, .dev-head h1 { margin: 0; }
.avatar-lg { width: 72px; height: 72px; border-radius: 50%; }
.dev-avatar { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-size: 34px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.profile-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dev-hero { text-align: center; padding: 40px 20px; border-radius: 20px; background: radial-gradient(circle at 30% 0, rgba(139, 92, 246, .35), transparent 60%), radial-gradient(circle at 80% 100%, rgba(34, 211, 238, .25), transparent 60%), var(--bg2); border: 1px solid var(--line); margin-bottom: 18px; }
.dev-hero h1 { justify-content: center; font-size: clamp(24px, 4vw, 40px); }
.dev-hero p { color: #d5d3ea; max-width: 640px; margin: 0 auto 20px; }
.steps { list-style: none; padding: 0; margin: 0 auto 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 900px; }
.steps li { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; }
.step-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); font-weight: 800; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.tile-v { font-size: 28px; font-weight: 800; background: linear-gradient(90deg, #c4b5fd, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tile-k { color: var(--muted); font-size: 13px; }
.table { display: flex; flex-direction: column; }
.trow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.trow:last-child { border: 0; }
.trow img { width: 48px; height: 48px; border-radius: 10px; flex: none; }
.tmain { flex: 1; min-width: 180px; } .tmain a { font-weight: 700; color: var(--accent2); }
.url { overflow-wrap: anywhere; }
.tnum { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tactions { display: flex; gap: 6px; flex-wrap: wrap; }
.status { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--card2); white-space: nowrap; }
.st-published { color: var(--new); } .st-pending { color: var(--warn); } .st-rejected { color: var(--hot); } .st-hidden { color: var(--muted); }

/* forms + modal */
.form { display: flex; flex-direction: column; gap: 12px; }
.form h2 { margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field[hidden] { display: none; }
.field input, .field select, .field textarea { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--text); font-size: 15px; font-weight: 400; width: 100%; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.form-err { color: var(--hot); min-height: 1em; margin: 0; font-size: 14px; }
.inline-form { flex-direction: row; align-items: flex-end; flex-wrap: wrap; } .inline-form .field { flex: 1; min-width: 200px; }
.demo-accts { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.demo-accts p { width: 100%; margin: 0; }
.sso-box { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.sso-box p { margin: 0; }
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgba(5, 5, 12, .7); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.modal { position: relative; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 30px 80px #000c; }
.modal-x { position: absolute; top: 12px; right: 12px; background: none; border: 0; cursor: pointer; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 80; background: var(--card2); border: 1px solid var(--accent);
  padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: .25s; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); } .toast.warn { border-color: var(--warn); }
.state-box { text-align: center; padding: 50px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.state-emoji { font-size: 48px; }

/* footer */
.footer { border-top: 1px solid var(--line); margin-top: 20px; }
.foot { padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.foot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.foot-chips .chip { font-size: 12px; padding: 4px 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; color: var(--muted); }
.foot-links a:hover { color: var(--text); }

/* responsive */
@media (max-width: 1280px) { .hide-md { display: none; } .game-top { grid-template-columns: minmax(0, 1fr) 280px; } }
@media (max-width: 1100px) {
  .burger { display: grid; }
  .sidebar { position: fixed; top: 0; left: 0; z-index: 50; height: 100vh; background: var(--bg); transform: translateX(-105%); transition: transform .2s; width: min(300px, 86vw); }
  .side-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .drawer-back { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 45; }
  .game-top { grid-template-columns: 1fr; }
  .game-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .game-text { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --hdr: 56px; }
  .hdr { gap: 8px; padding: 0 10px; }
  .logo span, .hide-sm { display: none; }
  .search { height: 38px; }
  .hdr .btn { height: 36px; padding: 0 12px; font-size: 13px; }
  .page { padding: 12px 14px 28px; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { aspect-ratio: 16 / 10; }
  .hero-side { grid-template-rows: none; grid-template-columns: 1fr 1fr; }
  .hero-mini { flex-direction: column; align-items: stretch; padding: 0 0 8px; gap: 6px; font-size: 13px; }
  .hero-mini img { max-height: none; width: 100%; }
  .hero-mini span { padding: 0 8px; }
  .row-md { grid-auto-columns: 46%; } .row-sm { grid-auto-columns: 28%; }
  .nav-btn { display: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-aside { grid-template-columns: 1fr; }
  .player:not(.portrait) { aspect-ratio: 4 / 3; }
  .player.portrait { height: 72vh; }
  .tool span { display: none; } .tool { padding: 0 10px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .collections { grid-template-columns: 1fr; }
  .row-head h2 { font-size: 17px; }
  .meta-row { grid-template-columns: 100px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Android / iOS app shell (web/js/native.mjs adds .native-app): keep clear of the notch and home indicator */
.native-app .header { padding-top: env(safe-area-inset-top); }
.native-app body { padding-bottom: env(safe-area-inset-bottom); -webkit-tap-highlight-color: transparent; }
.native-app .modal-back { padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom)); }

/* MMP admin (web/js/views-mmp.mjs) */
.mmp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mmp-head h1 { margin: 0; }
.mmp-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0 16px; }
.mmp-filters .field { min-width: 140px; flex: 1 1 140px; margin: 0; }
.mmp-filters select, .mmp-filters input { width: 100%; }
.mmp-filters .stack { display: grid; gap: 6px; }
.mmp-actions { margin: 12px 0; }
.mconn-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.mconn { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 6px; }
.mconn-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.mconn .tactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.mbadge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); vertical-align: middle; }
.mbadge.demo { color: var(--warn); border-color: var(--warn); } .mbadge.ok { color: var(--new); border-color: var(--new); }
.mbadge.bad, .mbadge.off { color: var(--hot); border-color: var(--hot); }
.tile-s { margin-top: 2px; }
.mmp-chart-wrap { width: 100%; overflow: hidden; }
.mmp-chart { width: 100%; height: auto; display: block; }
.mmp-chart .bar { fill: var(--accent); opacity: .55; }
.mmp-chart .ln-r { stroke: var(--new); stroke-width: 2.5; } .mmp-chart .ln-c { stroke: var(--hot); stroke-width: 2; stroke-dasharray: 5 4; }
.mmp-chart .ax { fill: var(--muted); font-size: 12px; }
.mmp-legend { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 6px; }
.lg { display: inline-block; width: 14px; height: 8px; border-radius: 2px; }
.lg-i { background: var(--accent); opacity: .55; } .lg-r { background: var(--new); } .lg-c { background: var(--hot); }
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.dtable th, .dtable td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.dtable th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.dtable .num { text-align: right; font-variant-numeric: tabular-nums; }
.dtable code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.mono { width: 100%; padding: 10px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); color: var(--text); }
@media (max-width: 600px) { .mconn-list { grid-template-columns: 1fr; } .mmp-filters .field { flex-basis: 100%; } }
