:root {
  --bg: #08080a;
  --bg-soft: #0a0b0e;
  --bg-card: #0e0f13;
  --fg: #E8EAE6;
  --muted: #9aa0a8;
  --muted-2: #8A8F98;
  --muted-3: #5d636c;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.06);
  --accent: #ff3b30;
  --accent-2: #ff5a40;
  --accent-3: #ff6a4a;
  --maxw: 1240px;
  --display: 'Russo One', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a0a0c; }
::-webkit-scrollbar-thumb { background: #2a1416; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.container { max-width: var(--maxw); margin: 0 auto; }

/* ---------- background layers ---------- */
.bg-glow, .bg-grid { position: fixed; inset: 0; pointer-events: none; }
.bg-glow {
  z-index: 0;
  background:
    radial-gradient(900px 600px at 50% -8%, rgba(255,48,32,0.16), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(255,48,32,0.07), transparent 60%);
}
.bg-grid {
  z-index: 0; opacity: 0.5;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 75%);
          mask-image: radial-gradient(circle at 50% 35%, #000 0%, transparent 75%);
}
@keyframes zlFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes zlHalo { 0%,100% { transform: scale(0.92); opacity: 0.7; } 50% { transform: scale(1.08); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .hero-logo, .hero-halo { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 16px clamp(20px, 5vw, 64px);
  background: rgba(8,8,10,0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
}
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 40px; height: 40px; display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--display); font-size: 19px; letter-spacing: 0.5px; color: var(--fg); }
.brand-name .dot, .dot { color: var(--accent); }
.brand-slogan { font-family: var(--mono); font-size: 9px; letter-spacing: 3.5px; color: var(--accent); margin-top: 4px; }

.nav-links { display: flex; align-items: center; gap: 34px; margin-left: auto; }
.nav-links a {
  font-family: var(--mono); font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #b8bcc4; transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

.lang-toggle {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: #fff;
  padding: 11px 20px; border: 1px solid var(--accent); background: rgba(255,59,48,0.1);
  transition: background 0.2s, color 0.2s;
}
.lang-toggle:hover { background: var(--accent); color: #fff; }

.burger { display: none; flex-direction: column; gap: 5px; cursor: pointer; padding: 8px; }
.burger span { width: 24px; height: 2px; background: var(--fg); display: block; transition: 0.2s; }

/* ---------- buttons ---------- */
.btn {
  font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; padding: 16px 32px; border: 1px solid transparent; transition: all 0.2s;
}
.btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 8px 30px rgba(255,48,32,0.3); }
.btn-primary:hover { background: var(--accent-2); box-shadow: 0 10px 40px rgba(255,48,32,0.5); }
.btn-ghost { color: var(--fg); background: transparent; border-color: rgba(255,255,255,0.2); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- kicker / section heads ---------- */
.kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 3px; color: var(--accent); }
.kicker.center { justify-content: center; }
.kicker .rule { width: 30px; height: 2px; background: var(--accent); flex: none; }

.section { position: relative; z-index: 1; padding: clamp(64px,9vw,120px) clamp(20px,5vw,64px); border-top: 1px solid rgba(255,255,255,0.05); }
.section-alt { background: var(--bg-soft); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: clamp(40px,5vw,64px); }
.section-title { font-family: var(--display); font-size: clamp(34px,6vw,72px); line-height: 0.98; color: var(--fg); }
.section-note { max-width: 340px; font-size: 15px; color: var(--muted-2); }

/* ---------- hero ---------- */
.hero {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(56px,9vw,120px) clamp(20px,5vw,64px) clamp(72px,10vw,130px);
}
.hero-mark { position: relative; display: flex; justify-content: center; align-items: center; margin-bottom: clamp(28px,4vw,44px); }
.hero-halo {
  position: absolute; width: 62%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,48,32,0.55), transparent 68%);
  filter: blur(34px); opacity: 0.7; animation: zlHalo 5s ease-in-out infinite;
}
.hero-logo {
  position: relative; width: clamp(150px,21vw,250px); height: auto; overflow: visible;
  filter: drop-shadow(0 0 20px rgba(255,48,32,0.5)) drop-shadow(0 0 44px rgba(255,48,32,0.22));
  animation: zlFloat 6.5s ease-in-out infinite;
}
.hero-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: clamp(20px,3vw,30px);
  font-family: var(--mono); font-size: 12px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted-2); }
.hero-kicker .rule { width: 34px; height: 1px; background: var(--accent); }
.hero-title { font-family: var(--display); font-size: clamp(48px,11vw,150px); line-height: 0.92; letter-spacing: -1px; color: var(--fg); text-shadow: 0 0 60px rgba(255,48,32,0.25); }
.hero-slogan { display: flex; align-items: center; gap: 16px; margin-top: clamp(16px,2.4vw,24px);
  font-family: var(--mono); font-size: clamp(15px,2.4vw,26px); font-weight: 600; letter-spacing: clamp(6px,1.4vw,14px); text-transform: uppercase; color: var(--accent); }
.hero-slogan .rule { width: clamp(24px,5vw,52px); height: 1px; background: rgba(255,59,48,0.5); }
.hero-lead { max-width: 560px; font-size: clamp(16px,2.1vw,20px); color: var(--muted); margin: clamp(24px,3.5vw,34px) 0 clamp(32px,4vw,42px); text-wrap: pretty; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.hero-cta.center { justify-content: center; }
.hero-platforms { display: flex; flex-wrap: wrap; gap: clamp(18px,3vw,34px); justify-content: center; margin-top: clamp(48px,7vw,80px);
  font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--muted-3); }
.hero-platforms i { color: #2a2e35; font-style: normal; }

/* ---------- games ---------- */
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.game-card {
  position: relative; background: var(--bg-card); border: 1px solid var(--line); overflow: hidden;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.game-card:hover { transform: translateY(-6px); border-color: rgba(255,59,48,0.5); box-shadow: 0 20px 50px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,59,48,0.2); }
.game-cover { position: relative; aspect-ratio: 16/10; background: var(--bg); overflow: hidden; }
.game-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-status {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: 2px; padding: 5px 10px; text-transform: uppercase;
}
.game-status.dev { color: #fff; background: var(--accent); }
.game-status.live { color: var(--bg); background: var(--fg); }
.game-status.soon { color: var(--accent); background: rgba(255,59,48,0.12); border: 1px solid rgba(255,59,48,0.5); padding: 4px 10px; }
.game-body { padding: 24px; }
.game-cat { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; }
.game-name { font-family: var(--display); font-size: 26px; margin: 10px 0 8px; color: var(--fg); }
.game-tag { font-size: 14px; color: var(--muted-2); margin-bottom: 18px; }
.game-plat { display: flex; gap: 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--muted-3); }
.game-plat i { color: #2a2e35; font-style: normal; }
.game-more { margin-top: 18px; font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); }
a.game-card { display: block; color: inherit; }

/* ---------- single game page ---------- */
.gamepage { position: relative; z-index: 1; padding: clamp(80px,10vw,120px) clamp(20px,5vw,64px) clamp(64px,8vw,96px); }
.gp-inner { max-width: 960px; }
.gp-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px,4vw,52px); align-items: center; margin: 28px 0 clamp(40px,6vw,64px); }
.gp-cover { border: 1px solid var(--line); overflow: hidden; aspect-ratio: 16/10; background: var(--bg); }
.gp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gp-head .game-cat { font-size: 12px; }
.gp-title { font-family: var(--display); font-size: clamp(34px,6vw,64px); line-height: 1; color: var(--fg); margin: 12px 0 14px; }
.gp-head .game-status { position: static; display: inline-block; margin-bottom: 16px; }
.gp-tag { font-size: clamp(16px,2vw,19px); color: var(--muted); margin-bottom: 20px; text-wrap: pretty; }
.gp-head .game-plat { font-size: 11px; }
.gp-body { max-width: 720px; }
.gp-body h2 { font-family: var(--display); font-size: clamp(20px,3vw,26px); color: var(--fg); margin: 36px 0 14px; }
.gp-body p { color: #cfd2d6; margin-bottom: 16px; }
.gp-body ul { color: #cfd2d6; margin: 0 0 16px 22px; }
.gp-body li { margin-bottom: 8px; }
.gp-body a { color: var(--accent); }
.gp-cta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }
.gp-cta .btn { text-decoration: none; }
@media (max-width: 720px) { .gp-hero { grid-template-columns: 1fr; } }

/* rich content blocks for game pages (feature grid / day-night loop / shots / controls) */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 8px 0 16px; }
.feat { background: var(--bg-card); border: 1px solid var(--line); padding: 24px; }
.feat-ico { font-size: 30px; line-height: 1; margin-bottom: 12px; }
.feat h3 { font-family: var(--display); font-size: 17px; color: var(--fg); margin-bottom: 8px; }
.feat p { font-size: 14px; color: var(--muted-2); margin: 0; }

.loop { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 8px 0 16px; }
.phase { border: 1px solid var(--line); padding: 28px; }
.phase.day { background: linear-gradient(160deg, #1a130a, var(--bg-card)); border-color: rgba(255,170,60,0.22); }
.phase.night { background: linear-gradient(160deg, #0c1326, var(--bg-card)); border-color: rgba(90,140,255,0.22); }
.phase h3 { font-family: var(--display); font-size: 20px; color: var(--fg); margin-bottom: 12px; }
.phase ul { list-style: none; margin: 0; padding: 0; }
.phase li { position: relative; padding: 5px 0 5px 22px; color: #cfd2d6; }
.phase li::before { content: "›"; position: absolute; left: 4px; color: var(--accent); font-weight: 700; }

.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 8px 0 16px; }
.shot { position: relative; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center; text-align: center;
  background: repeating-linear-gradient(45deg, #121319 0 12px, var(--bg-card) 12px 24px);
  border: 1px solid var(--line); color: var(--muted-2); font-family: var(--mono); font-size: 12px; padding: 12px; }
.shot::after { content: "▣"; position: absolute; font-size: 40px; opacity: 0.14; }
.shot span { position: relative; z-index: 1; }

.ctrl-table { width: 100%; max-width: 560px; border-collapse: collapse; margin: 8px 0 16px; }
.ctrl-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ctrl-table td:first-child { color: var(--muted-2); }
.ctrl-table td:last-child { text-align: right; font-family: var(--mono); color: var(--fg); }

@media (max-width: 560px) { .loop { grid-template-columns: 1fr; } }

/* ---------- studio ---------- */
.studio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: clamp(40px,6vw,80px); align-items: center; }
.studio-grid .section-title { margin-bottom: 26px; }
.studio-p1 { font-size: clamp(16px,2vw,19px); line-height: 1.7; color: #b8bcc4; margin-bottom: 18px; text-wrap: pretty; }
.studio-p2 { font-size: 15px; line-height: 1.7; color: var(--muted-2); text-wrap: pretty; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.stat { background: var(--bg-soft); padding: clamp(24px,4vw,40px); }
.stat-value { font-family: var(--display); font-size: clamp(38px,5vw,56px); color: var(--fg); line-height: 1; }
.stat:first-child .stat-value { color: var(--accent); }
.stat-label { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted-2); margin-top: 12px; text-transform: uppercase; }

/* ---------- community ---------- */
.community { position: relative; max-width: 1100px; margin: 0 auto; overflow: hidden;
  border: 1px solid rgba(255,59,48,0.3); background: linear-gradient(135deg, #14080a, #0a0b0e 60%);
  padding: clamp(44px,7vw,90px) clamp(24px,5vw,72px); text-align: center; }
.community-glow { position: absolute; top: -40%; left: 50%; transform: translateX(-50%); width: 120%; height: 120%;
  background: radial-gradient(circle at 50% 0%, rgba(255,48,32,0.22), transparent 55%); pointer-events: none; }
.community-inner { position: relative; }
.community-inner .section-title { font-size: clamp(32px,6vw,68px); margin-bottom: 20px; }
.community-text { max-width: 520px; margin: 0 auto 36px; font-size: clamp(15px,2vw,18px); color: var(--muted); text-wrap: pretty; }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 1; padding: clamp(56px,7vw,90px) clamp(20px,5vw,64px) 40px; border-top: 1px solid var(--line); background: #070708; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 40px; padding-bottom: clamp(40px,5vw,64px); }
.footer-brand { grid-column: 1 / -1; max-width: 360px; }
.footer-brand .brand { margin-bottom: 18px; }
.footer-blurb { font-size: 14px; color: var(--muted-3); }
.footer-head { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--accent); margin-bottom: 18px; text-transform: uppercase; }
.footer-col { display: flex; flex-direction: column; }
.footer-col a { font-size: 14px; color: var(--muted); transition: color 0.2s; margin-bottom: 12px; }
.footer-col a:hover { color: #fff; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 28px; border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted-3); }
.footer-slogan { letter-spacing: 4px; color: var(--accent); }

/* ---------- legal pages ---------- */
.legal { position: relative; z-index: 1; padding: clamp(80px,10vw,120px) clamp(20px,5vw,64px) clamp(60px,8vw,90px); }
.legal-inner { max-width: 760px; }
.backlink { display: inline-flex; font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 32px; transition: color 0.2s; }
.backlink:hover { color: var(--accent); }
.legal-title { font-family: var(--display); font-size: clamp(30px,5vw,52px); line-height: 1.05; color: var(--fg); }
.legal-updated { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--muted-3); margin-top: 14px; margin-bottom: 40px; }
.legal-body p { color: #cfd2d6; margin-bottom: 16px; }
.legal-body h2 { font-family: var(--display); font-size: 20px; color: var(--fg); margin: 36px 0 14px; }
.legal-body ul { color: #cfd2d6; margin: 0 0 16px 22px; }
.legal-body li { margin-bottom: 8px; }
.legal-body a { color: var(--accent); }
.legal-body a:hover { text-decoration: underline; }

/* ---------- 404 ---------- */
.notfound { position: relative; z-index: 1; padding: 160px 24px; text-align: center; }
.notfound h1 { font-family: var(--display); font-size: 6rem; color: var(--accent); }
.notfound p { color: var(--muted); margin: 8px 0 28px; }
.notfound .btn { display: inline-block; }

/* ---------- mobile ---------- */
@media (max-width: 880px) {
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 22px;
    background: #0b0c10; border-top: 1px solid rgba(255,59,48,0.18); border-bottom: 1px solid rgba(255,59,48,0.18);
    padding: 26px; display: none; margin-left: 0;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .burger { display: flex; }
  .lang-toggle { margin-left: auto; }
}

/* ==================== account area ==================== */

/* --- header login state --- */
.btn-login {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; color: #fff; white-space: nowrap;
  padding: 11px 20px; border: 1px solid var(--accent); background: var(--accent);
  transition: background 0.2s;
}
.btn-login:hover { background: var(--accent-2); }
.nav-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-user:hover .nav-nick { color: var(--accent); }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none;
  border: 1px solid rgba(255,59,48,0.4); display: block;
}
.nav-avatar-ph {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 14px; color: #fff;
  background: linear-gradient(140deg, #2a1416, #16090b);
}
.nav-nick {
  font-family: var(--mono); font-size: 13px; color: #b8bcc4; transition: color 0.2s;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.home-flash { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 18px clamp(20px,5vw,64px) 0; }

/* --- layout --- */
.acct-wrap {
  position: relative; z-index: 1; max-width: 880px; margin: 0 auto;
  padding: clamp(36px,6vw,64px) clamp(20px,5vw,64px) clamp(64px,8vw,100px);
}
.acct-narrow { max-width: 520px; }
.acct-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.acct-title { font-family: var(--display); font-size: clamp(26px,4vw,40px); line-height: 1.05; margin-bottom: 18px; }
.acct-tabs {
  display: flex; flex-wrap: wrap; gap: 4px 22px; margin-bottom: 26px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.acct-tabs a {
  font-family: var(--mono); font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase;
  color: #b8bcc4; padding: 10px 2px 12px; border-bottom: 2px solid transparent; transition: color 0.2s;
}
.acct-tabs a:hover { color: var(--accent); }
.acct-tabs a.active { color: var(--fg); border-bottom-color: var(--accent); }
.inline-form { display: inline; }

/* --- cards & notices --- */
.acct-wrap .card {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: clamp(20px,3.5vw,30px); margin-bottom: 20px;
}
.card-title { font-family: var(--display); font-size: 18px; margin-bottom: 16px; }
.card-title .count { color: var(--accent); font-size: 15px; margin-left: 6px; }
.notice { padding: 13px 16px; margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.notice-ok { color: #9fe6a0; background: rgba(60,180,90,0.08); border-color: rgba(60,180,90,0.35); }
.notice-err { color: #ff9088; background: rgba(255,59,48,0.08); border-color: rgba(255,59,48,0.4); }

/* --- forms --- */
.form .field { display: block; margin-bottom: 18px; }
.form .field > span, .form fieldset legend {
  display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted-2); margin-bottom: 7px;
}
.form input:not([type="checkbox"]):not([type="file"]), .form textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--fg);
  background: var(--bg-soft); border: 1px solid rgba(255,255,255,0.12); border-radius: 0;
  transition: border-color 0.2s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); }
.form input:disabled { color: var(--muted-3); background: #0a0a0d; }
.form textarea { resize: vertical; }
.form input[type="file"] { font-size: 13px; color: var(--muted); }
.form fieldset { border: none; margin-bottom: 18px; }
.hint { display: block; font-size: 12.5px; color: var(--muted-3); margin-top: 7px; line-height: 1.5; }
.terms-hint { margin-top: 14px; text-align: center; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: 14px; color: #cfd2d6; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin-top: 2px; flex: none; }
.form-text { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.form-links { text-align: center; margin-top: 18px; font-size: 14px; }
.form-links a { color: var(--accent); }
.form-links a:hover { text-decoration: underline; }
.form-links .sep { color: var(--muted-3); margin: 0 10px; }
.center-form { text-align: center; margin-top: 14px; }
.mono, .profile-handle { font-family: var(--mono); }
.mono-link { font-family: var(--mono); color: var(--accent); }
.mono-link:hover { text-decoration: underline; }

/* --- account buttons (scoped: home CTAs use .btn + modifier) --- */
.acct-wrap .btn-primary, .acct-wrap .btn-secondary, .acct-wrap .btn-danger, .acct-wrap .btn-ghost {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 13px 26px; border: 1px solid transparent;
  cursor: pointer; transition: all 0.2s; background: transparent;
}
.acct-wrap .btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.acct-wrap .btn-primary:hover { background: var(--accent-2); }
.acct-wrap .btn-secondary { color: var(--fg); border-color: rgba(255,255,255,0.25); }
.acct-wrap .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.acct-wrap .btn-ghost { color: var(--muted); border-color: rgba(255,255,255,0.14); }
.acct-wrap .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.acct-wrap .btn-danger { color: #ff9088; border-color: rgba(255,59,48,0.5); }
.acct-wrap .btn-danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.acct-wrap .btn-sm { padding: 9px 16px; font-size: 11.5px; }
.btn-link { display: inline-block; text-align: center; }
.danger-card { border-color: rgba(255,59,48,0.3); }

/* --- avatars --- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: block; }
.avatar-md { width: 56px; height: 56px; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-xl { width: 128px; height: 128px; }
.avatar-ph {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); color: #fff; font-size: 18px;
  background: linear-gradient(140deg, #2a1416, #16090b); border: 1px solid rgba(255,59,48,0.35);
}
.avatar-md.avatar-ph { font-size: 24px; }
.avatar-lg.avatar-ph { font-size: 40px; }
.avatar-xl.avatar-ph { font-size: 54px; }
.avatar-row { display: flex; gap: 22px; align-items: center; margin-bottom: 20px; }
.avatar-ctl { flex: 1; min-width: 0; }

/* --- friends --- */
.invite-form { display: flex; gap: 10px; align-items: center; }
.invite-form .at-prefix { font-family: var(--mono); font-size: 18px; color: var(--accent); }
.invite-form input {
  flex: 1; min-width: 0; padding: 12px 14px; font-family: var(--mono); font-size: 15px;
  color: var(--fg); background: var(--bg-soft); border: 1px solid rgba(255,255,255,0.12);
}
.invite-form input:focus { outline: none; border-color: var(--accent); }
.friend-row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.friend-row:first-of-type { border-top: none; }
.friend-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.friend-id:hover strong { color: var(--accent); }
.friend-names { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.friend-names strong { font-size: 15px; transition: color 0.2s; }
.friend-names .mono { font-size: 12px; color: var(--muted-3); }
.friend-note { font-size: 13.5px; color: var(--muted); }
.friend-actions { display: flex; gap: 8px; margin-left: auto; }
.friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.friend-cell {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.friend-cell form { margin-left: auto; }
.empty-text { color: var(--muted-3); font-size: 14.5px; }

/* --- security / history --- */
.table-scroll { overflow-x: auto; }
.history { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.history th {
  font-family: var(--mono); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--muted-3); text-align: left; padding: 8px 14px 8px 0; border-bottom: 1px solid var(--line);
}
.history td { padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.history .mono { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hist-agent { color: var(--muted-3); font-size: 12.5px; max-width: 260px; overflow-wrap: anywhere; }
.dot-ok { color: #6fdd7f; }
.dot-fail { color: var(--accent); }

/* --- public profile --- */
.profile-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile-id { min-width: 0; }
.profile-nick { font-family: var(--display); font-size: clamp(26px,4.5vw,40px); line-height: 1.05; }
.profile-handle { font-size: 14px; color: var(--accent); margin-top: 6px; }
.profile-joined { font-size: 13px; color: var(--muted-3); margin-top: 8px; }
.profile-actions { margin-left: auto; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.profile-actions form { display: flex; }
.profile-bio { color: #cfd2d6; font-size: 15.5px; line-height: 1.7; white-space: pre-line; }
.badge-friends, .badge-pending {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1px; padding: 8px 14px;
}
.badge-friends { color: #9fe6a0; border: 1px solid rgba(60,180,90,0.35); background: rgba(60,180,90,0.08); }
.badge-pending { color: var(--muted); border: 1px solid var(--line); }

/* --- message / empty states --- */
.message-card, .empty-state { text-align: center; padding: clamp(36px,6vw,56px) clamp(20px,4vw,40px); }
.message-card .acct-title { margin-bottom: 12px; }
.message-card .form-text { max-width: 420px; margin: 0 auto 22px; }
.empty-icon { font-size: 40px; margin-bottom: 14px; }

@media (max-width: 640px) {
  .profile-hero { flex-direction: column; align-items: flex-start; }
  .profile-actions { margin-left: 0; align-items: flex-start; }
  .friend-actions { margin-left: 0; width: 100%; }
  .invite-form { flex-wrap: wrap; }
  .nav-nick { display: none; }
  .avatar-row { flex-direction: column; align-items: flex-start; }
}

/* ==================== apps platform ==================== */

/* Full-width app page: the iframe takes the whole viewport width. The site
   header is NOT sticky here — it scrolls away, and only the compact app info
   bar (sticky) stays on screen. The grid overlay is switched off so nothing
   sits over the game. */
body:has(.app-full) .nav { position: static; }
body:has(.app-full) .bg-grid { display: none; }

.app-full { position: relative; z-index: 1; }
.app-full-inner { max-width: 880px; margin: 0 auto; padding: 12px clamp(20px,5vw,64px) 0; }
.app-full-inner:empty { display: none; }

/* Compact sticky info bar: icon + name + owner + actions in one row (~72px,
   matched by the .app-frame height calc below). */
.app-hero {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 14px;
  min-height: 72px; padding: 10px clamp(16px,4vw,40px);
  background: rgba(10,11,14,0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line);
}
.app-icon {
  width: 46px; height: 46px; border-radius: 22%; object-fit: cover; flex: none; display: block;
  border: 1px solid rgba(255,59,48,0.3);
}
.app-icon-ph {
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  font-family: var(--display); color: #fff;
  background: linear-gradient(140deg, #2a1416, #16090b);
}
.app-id { min-width: 0; flex: 1; }
.app-name {
  font-family: var(--display); font-size: clamp(16px,2.4vw,21px); line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-owner { font-size: 12px; color: var(--muted-3); margin-top: 2px; }
.app-owner a { color: var(--accent); }
.app-owner a:hover { text-decoration: underline; }
.app-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-left: auto; }
/* Fullscreen toggle in the app-hero bar, next to the ⋮ menu. */
.app-fs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0; flex: none; cursor: pointer;
  color: var(--fg); background: transparent; border: 0; border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.app-fs-btn:hover { color: var(--accent); background: rgba(255,255,255,0.06); }
.app-fs-btn svg { display: block; }

/* Description + store links below the frame. */
.app-about { max-width: 880px; margin: 0 auto; padding: 22px clamp(20px,5vw,64px) 30px; }
.app-summary { font-size: 14.5px; color: var(--muted); max-width: 640px; }
.app-about .store-links { margin-top: 14px; }
.app-actions .btn-primary, .app-actions .btn-danger, .app-actions .btn-secondary, .app-actions .btn-ghost {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 1.5px;
  text-transform: uppercase; padding: 9px 16px; border: 1px solid transparent; cursor: pointer;
  background: transparent; transition: all 0.2s;
}
.app-actions .btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.app-actions .btn-primary:hover { background: var(--accent-2); }
.app-actions .btn-secondary { color: var(--fg); border-color: rgba(255,255,255,0.25); }
.app-actions .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.app-actions .btn-danger { color: #ff9088; border-color: rgba(255,59,48,0.5); }
.app-actions .btn-danger:hover { background: var(--accent); color: #fff; }
/* Borderless, full-viewport app frame: once the site header has scrolled
   away, the sticky info bar (72px) + the frame fill the screen exactly. */
.app-frame {
  display: block; width: 100%; height: calc(100dvh - 136px); min-height: 320px;
  border: 0; outline: 0; margin: 0; padding: 0; background: #000;
  /* JS (app_page.html) sets the exact height = viewport − chrome above, so the
     game fills the screen minus the panel without page scroll. This calc is the
     no-JS fallback (site nav ~64 + sticky app-hero 72). */
}

/* Development banner over a dev/pending/rejected app version. */
.dev-banner {
  position: sticky; top: 0; z-index: 91;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px clamp(16px,4vw,40px); font-size: 13px; color: #ffcf88;
  background: rgba(120,80,20,0.4); border-bottom: 1px solid rgba(255,180,80,0.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.dev-dot { width: 8px; height: 8px; border-radius: 50%; background: #ffb84d; flex: none; box-shadow: 0 0 8px #ffb84d; }
.dev-note { color: #ff9088; }

/* Moderator reject-with-comment popover, reusing the kebab machinery. */
.reject-summary { list-style: none; cursor: pointer; }
.reject-summary::-webkit-details-marker { display: none; }
.reject-menu { padding: 12px; min-width: 240px; }
.reject-menu textarea {
  width: 100%; margin-bottom: 10px; padding: 8px 10px; font: inherit; font-size: 13px;
  color: var(--fg); background: var(--bg-soft); border: 1px solid rgba(255,255,255,0.15); resize: vertical;
}
.submit-card { border-color: rgba(255,180,80,0.35); }

/* Catalog grid: two columns of icon + name + short description. */
.catalog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.catalog-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.2s;
}
.catalog-card:hover { border-color: rgba(255,59,48,0.5); transform: translateY(-2px); }
.catalog-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.catalog-info strong { font-size: 15.5px; }
.catalog-summary {
  font-size: 13px; color: var(--muted-3); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 640px) { .catalog-grid { grid-template-columns: 1fr; } }

/* Install screen: big icon + description + install/cancel. */
.install-screen { text-align: center; padding: clamp(32px,6vw,56px) clamp(20px,4vw,40px); }
.install-icon { width: 120px; height: 120px; margin: 0 auto 18px; font-size: 48px; }
.install-name { font-family: var(--display); font-size: clamp(24px,4vw,34px); margin-bottom: 8px; }
.install-summary { color: var(--muted); font-size: 15px; max-width: 480px; margin: 14px auto 0; line-height: 1.65; }
.install-stores { justify-content: center; margin-top: 16px; }
.install-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }

/* Kebab (⋮) menu on the app bar. */
.kebab { position: relative; }
.kebab summary {
  list-style: none; cursor: pointer; user-select: none;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--muted); border: 1px solid var(--line); background: var(--bg-soft);
}
.kebab summary::-webkit-details-marker { display: none; }
.kebab summary:hover { color: var(--accent); border-color: var(--accent); }
.kebab[open] summary { color: var(--accent); border-color: var(--accent); }
.kebab-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 95; min-width: 200px;
  background: #101116; border: 1px solid var(--line); box-shadow: 0 12px 34px rgba(0,0,0,0.55);
  display: flex; flex-direction: column; padding: 6px 0;
}
.kebab-menu form { display: contents; }
.kebab-item {
  display: block; width: 100%; text-align: left; padding: 10px 16px;
  font: inherit; font-size: 14px; color: var(--fg); background: none; border: none; cursor: pointer;
}
.kebab-item:hover { background: rgba(255,59,48,0.1); color: var(--accent); }
.kebab-danger { color: #ff9088; }

/* Block button: quiet, below the friend actions. */
.btn-block-user { opacity: 0.55; font-size: 10.5px !important; padding: 7px 12px !important; }
.btn-block-user:hover { opacity: 1; }

/* Profile activity feed. */
.activity-list { list-style: none; }
.activity-list li { padding: 8px 0; border-top: 1px solid var(--line-2); font-size: 14px; color: #cfd2d6; }
.activity-list li:first-child { border-top: none; }
.activity-list a { color: var(--accent); }
.activity-list a:hover { text-decoration: underline; }
.activity-when { font-size: 12px; color: var(--muted-3); margin-right: 10px; }

/* Fullscreen game controls float over the app frame. The wrapper is what goes
   fullscreen (it holds the iframe + the overlay buttons), so the exit/purchases
   controls stay visible over the game — mirroring the client. */
.app-frame-wrap { position: relative; display: block; }
.game-ctl {
  position: absolute; z-index: 60; width: 42px; height: 42px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; cursor: pointer; color: #fff;
  background: rgba(0,0,0,0.45); opacity: 0.6;
  transition: opacity 0.15s, background 0.2s;
}
.game-ctl:hover { opacity: 1; background: rgba(0,0,0,0.72); }
.game-ctl svg { display: block; }
.game-exit { left: 14px; top: 14px; display: none; }
.game-buy { right: 14px; top: 14px; display: none; }
/* In fullscreen the wrapper fills the screen; iframe 100%, swap the controls. */
#game-wrap:fullscreen { width: 100vw; height: 100vh; background: #000; }
#game-wrap:fullscreen .app-frame { width: 100%; height: 100%; min-height: 0; }
#game-wrap:fullscreen .game-exit,
#game-wrap:fullscreen .game-buy { display: flex; }
/* In-game purchases panel, centered over the game. */
.game-pay {
  position: absolute; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.72);
}
.game-pay[hidden] { display: none; }
.game-pay-card {
  width: calc(100% - 48px); max-width: 360px; box-sizing: border-box;
  padding: 22px; text-align: center; color: #fff;
  background: #16171c; border-radius: 16px;
}
.game-pay-card h3 { margin: 0 0 8px; }
.game-pay-item { margin: 0; color: #ddd; }
.game-pay-amount { margin: 4px 0 18px; font-size: 22px; color: #bbb; }
.game-pay-card .btn, .game-pay-card .btn-secondary { display: block; width: 100%; margin-top: 8px; }

/* Slug field with the availability check button. */
.slug-row { display: flex; align-items: center; gap: 10px; }
.slug-row .at-prefix { color: var(--accent); font-size: 14px; }
.slug-row input { flex: 1; min-width: 0; }
.slug-result { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.slug-ok { color: #6fdd7f; }
.slug-bad { color: var(--accent); }
.store-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.store-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12px; color: #b8bcc4;
  padding: 8px 14px; border: 1px solid var(--line); background: var(--bg-soft);
  transition: border-color 0.2s, color 0.2s;
}
.store-link:hover { border-color: var(--accent); color: var(--accent); }
.store-link svg { width: 18px; height: 18px; flex: none; }

/* App edit form: dynamic store-link rows. */
.link-row { display: flex; gap: 10px; margin: 10px 0; }
.link-row select {
  flex: 0 0 200px; padding: 11px 12px; font: inherit; font-size: 14px; color: var(--fg);
  background: var(--bg-soft); border: 1px solid rgba(255,255,255,0.12);
}
.link-row input { flex: 1; }
.form select {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 15px; color: var(--fg);
  background: var(--bg-soft); border: 1px solid rgba(255,255,255,0.12);
}
.form select:focus { outline: none; border-color: var(--accent); }

/* Docs page: code blocks. */
.docs-body pre {
  background: var(--bg-card); border: 1px solid var(--line); padding: 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: #cfd2d6;
  overflow-x: auto; margin: 0 0 16px;
}
.docs-body code {
  font-family: var(--mono); font-size: 0.92em; color: var(--accent-3);
  background: rgba(255,59,48,0.07); padding: 1px 5px; border-radius: 3px;
}
.docs-body pre code { background: none; padding: 0; color: inherit; }

@media (max-width: 640px) {
  .app-actions .badge-pending { display: none; } /* keep the sticky bar one row */
  .link-row { flex-wrap: wrap; }
  .link-row select { flex-basis: 100%; }
}

/* --- user wall / posts --- */
.avatar-sm { width: 38px; height: 38px; }
.avatar-xs { width: 26px; height: 26px; }
.avatar-sm.avatar-ph { font-size: 16px; }
.avatar-xs.avatar-ph { font-size: 12px; }

.post-compose { margin-bottom: 20px; }
.post-compose textarea {
  width: 100%; resize: vertical; min-height: 74px; padding: 12px 14px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg);
  font: inherit; font-size: 14.5px; line-height: 1.5;
}
.post-compose textarea:focus { outline: none; border-color: var(--accent); }
.post-compose-foot { display: flex; justify-content: flex-end; margin-top: 10px; }
.wall-locked { color: var(--muted-3); margin-bottom: 4px; }

.post-list { display: flex; flex-direction: column; gap: 16px; }
.post {
  border: 1px solid var(--line); background: var(--bg-soft); padding: 16px 18px;
}
.post-single { border: none; background: none; padding: 0; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.post-author { font-weight: 600; font-size: 14.5px; color: var(--fg); }
.post-author:hover { color: var(--accent); }
.post-when { font-size: 12px; color: var(--muted-3); }
.post-when:hover { color: var(--muted); }
.post-tag {
  margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted-2); white-space: nowrap;
}
.post-body { margin-top: 12px; font-size: 15px; line-height: 1.6; color: #e2e4e0; white-space: pre-wrap; word-wrap: break-word; }
.post-game {
  display: inline-block; margin-top: 12px; font-size: 13px; color: var(--accent);
  border: 1px solid rgba(255,59,48,0.35); padding: 5px 12px;
}
.post-game:hover { background: rgba(255,59,48,0.1); }

.post-embed {
  margin-top: 12px; padding: 12px 14px; border-left: 2px solid var(--accent);
  background: rgba(255,255,255,0.02); display: flex; flex-direction: column; gap: 8px;
}
.post-embed-head { display: flex; align-items: center; gap: 9px; }
.post-embed-author { font-size: 13.5px; color: var(--fg); }
.post-embed-author .mono { font-size: 11.5px; color: var(--muted-3); }
.post-embed-body { font-size: 14px; line-height: 1.55; color: #cfd2d6; white-space: pre-wrap; word-wrap: break-word; }
.post-embed-body:hover { color: var(--fg); }
.post-embed-game { font-size: 12.5px; color: var(--accent); }
.post-embed-gone { font-size: 13px; color: var(--muted-3); font-style: italic; }

.post-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.reactions { display: flex; gap: 8px; }
.reactions form { display: inline; }
.react, .react-count {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  font: inherit; font-size: 13px; border: 1px solid var(--line); background: var(--bg-card);
  color: var(--muted); cursor: pointer;
}
.react:hover { border-color: var(--accent); color: var(--fg); }
.react.on { border-color: var(--accent); color: var(--fg); background: rgba(255,59,48,0.12); }
.react-count { cursor: default; }
.post-controls { display: flex; gap: 8px; margin-left: auto; }
.post-controls form { display: inline; }

.back-wall { margin-bottom: 16px; }
.back-wall a { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.back-wall a:hover { color: var(--accent); }
.post-signin { margin-top: 16px; color: var(--muted-3); }
.post-signin a { color: var(--accent); }

/* --- merged feed events + comments --- */
.feed-event {
  padding: 12px 16px; border: 1px dashed var(--line); background: rgba(255,255,255,0.015);
  font-size: 13.5px; color: #cfd2d6;
}
.feed-event a { color: var(--accent); }
.feed-event a:hover { text-decoration: underline; }

.post-comment-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  font-size: 13px; border: 1px solid var(--line); background: var(--bg-card); color: var(--muted);
}
.post-comment-link:hover { border-color: var(--accent); color: var(--fg); }

.comment-list { list-style: none; display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.comment { display: flex; gap: 11px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; }
.comment-author { font-weight: 600; font-size: 14px; color: var(--fg); }
.comment-author:hover { color: var(--accent); }
.comment-when { font-size: 11.5px; color: var(--muted-3); }
.comment-del { margin-left: auto; }
.link-btn {
  background: none; border: none; color: var(--muted-3); cursor: pointer;
  font: inherit; font-size: 13px; padding: 2px 6px;
}
.link-btn:hover { color: var(--accent); }
.comment-body { margin-top: 4px; font-size: 14.5px; line-height: 1.55; color: #e2e4e0; white-space: pre-wrap; word-wrap: break-word; }

.comment-form textarea {
  width: 100%; resize: vertical; min-height: 52px; padding: 11px 13px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--fg);
  font: inherit; font-size: 14px; line-height: 1.5;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-form-foot { display: flex; justify-content: flex-end; margin-top: 10px; }


/* ---------- Панель модератора на странице игры (?dev) ---------- */
.mod-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #1c1410;
  border-bottom: 1px solid rgba(255, 179, 71, 0.25);
}
.mod-label {
  color: #ffb347;
  font-size: 13px;
  margin-right: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mod-bar form { display: inline; }
.mod-bar .btn-primary, .mod-bar .btn-danger { white-space: nowrap; }
.mod-reject {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px;
  background: #190f0f;
  border-bottom: 1px solid rgba(255, 90, 80, 0.25);
}
.mod-reject textarea {
  width: 100%;
  max-width: 640px;
  resize: vertical;
  background: #101014;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
.mod-reject textarea:focus { outline: none; border-color: #ff5a50; }
.mod-reject-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Документация серверных кубиков (/docs/backend) ---------- */
/* Три колонки: навигация — текст — примеры кода. На узком экране колонки
   складываются в одну, навигация уезжает в раскрывающийся блок сверху. */
.cubedoc {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 32px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  align-items: start;
}
.cubedoc-nav {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 8px;
  font-size: 13px;
}
.cubedoc-nav-inner { display: flex; flex-direction: column; gap: 18px; }
.cubedoc-search {
  width: 100%;
  padding: 8px 10px;
  background: #101014;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  color: #fff;
  font: inherit;
  font-size: 13px;
}
.cubedoc-search:focus { outline: none; border-color: var(--accent); }
.cubedoc-nav-group { display: flex; flex-direction: column; gap: 2px; }
.cubedoc-nav-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #6f7480;
  margin-bottom: 4px;
}
.cubedoc-nav-title a { color: #cfd2d6; text-transform: none; letter-spacing: 0; font-size: 13.5px; }
.cubedoc-nav-title em { color: #6f7480; font-style: normal; font-family: var(--mono, monospace); font-size: 11.5px; }
.cubedoc-nav a {
  color: #9aa0a8;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
}
.cubedoc-nav a code { font-size: 12px; color: inherit; background: none; padding: 0; }
.cubedoc-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.cubedoc-nav a.is-current { color: #fff; border-left-color: var(--accent); background: rgba(255,59,48,.08); }
.cubedoc-op-server code::after { content: " ⟵ связь"; font-size: 10px; color: #6f7480; }

.cubedoc-main { min-width: 0; }
.cubedoc-head { margin-bottom: 28px; }
.cubedoc-head h1 { font-family: var(--display); font-size: 34px; margin-bottom: 12px; }
.cubedoc-lead { color: #cfd2d6; max-width: 70ch; margin-bottom: 8px; }
.cubedoc-section { margin-bottom: 44px; scroll-margin-top: 80px; }
.cubedoc-section h2 {
  font-family: var(--display);
  font-size: 23px;
  margin: 0 0 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.cubedoc-section h3 { font-size: 16px; margin: 26px 0 10px; color: #fff; }
.cubedoc-cube h2 .cubedoc-name { font-size: 15px; color: var(--accent); background: none; }
.cubedoc-sub { color: #9aa0a8; max-width: 75ch; margin-bottom: 6px; }
.cubedoc-meta, .cubedoc-note { color: #6f7480; font-size: 12.5px; max-width: 75ch; margin-bottom: 10px; }
.cubedoc-anchor { color: #3a3f47; text-decoration: none; margin-left: 10px; font-size: 16px; }
.cubedoc-anchor:hover { color: var(--accent); }

/* Строка «текст слева — код справа». */
.cubedoc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin: 14px 0 22px;
}
.cubedoc-text { color: #cfd2d6; font-size: 14.5px; line-height: 1.65; }
.cubedoc-text p { margin-bottom: 12px; }
.cubedoc-text ul { margin: 0 0 12px 20px; }
.cubedoc-text li { margin-bottom: 6px; }
.cubedoc-text code { font-size: 12.5px; }
.cubedoc-code-empty { display: none; }

.cubedoc-code {
  background: #0b0b0e;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 72px;
}
.cubedoc-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.09); }
.cubedoc-tab {
  flex: 1;
  background: none;
  border: 0;
  color: #7b818b;
  font: inherit;
  font-size: 12px;
  padding: 8px 6px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.cubedoc-tab:hover { color: #fff; }
.cubedoc-tab.is-active { color: #fff; border-bottom-color: var(--accent); }
.cubedoc-pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.55;
  color: #d7dbe0;
  background: none;
  max-height: 460px;
}
.cubedoc-pre code { background: none; padding: 0; font-size: inherit; color: inherit; }

/* Операция кубика. */
.cubedoc-op { padding: 6px 0; scroll-margin-top: 80px; }
.cubedoc-op h4 { font-size: 15px; margin: 0 0 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cubedoc-op h4 code { font-size: 14px; color: #fff; background: rgba(255,255,255,.06); padding: 2px 8px; border-radius: 6px; }
.cubedoc-badge { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.cubedoc-badge-client { background: rgba(80,200,120,.14); color: #7fd8a0; }
.cubedoc-badge-server { background: rgba(255,179,71,.14); color: #ffb347; }
.cubedoc-params { color: #7b818b; font-size: 12.5px; }
.cubedoc-params code { font-size: 12px; }

/* Номер сборки под игрой: служебная строка, не должна спорить с игрой. */
.app-build {
  margin: 6px 2px 0;
  color: #6f7480;
  font-size: 11.5px;
  font-family: var(--mono, monospace);
  text-align: right;
}

/* Схемы (mermaid). До загрузки библиотеки в блоке лежит исходник схемы —
   прячем его, чтобы не мигало «сырым» текстом; без JS схема просто не видна,
   а весь смысл раздела остаётся в тексте рядом. */
.cubedoc-diagram {
  margin: 4px 0 26px;
  padding: 18px 16px 12px;
  background: #0c0d11;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
}
.cubedoc-diagram pre.mermaid {
  margin: 0;
  background: none;
  border: 0;
  padding: 0;
  font-size: 0;
  line-height: 0;
  color: transparent;
  text-align: center;
  min-height: 40px;
}
.cubedoc-diagram pre.mermaid[data-processed] {
  font-size: inherit;
  line-height: inherit;
  display: flex;
  justify-content: center;
}
.cubedoc-diagram pre.mermaid.is-raw {
  font: 12px/1.55 var(--mono, monospace);
  color: #7b818b;
  text-align: left;
  white-space: pre;
}
.cubedoc-diagram pre.mermaid svg { max-width: 100%; height: auto; }
.cubedoc-diagram figcaption {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.05);
  color: #7b818b;
  font-size: 12.5px;
  line-height: 1.55;
}
/* Одиночный блок кода (server.json): вкладка работает подписью, не кнопкой. */
.cubedoc-tab.is-static { color: #9aa0a8; cursor: default; border-bottom: 2px solid transparent; }
.cubedoc-tab.is-static.is-active { color: #cfd2d6; border-bottom-color: rgba(255,255,255,.18); }

/* Таблицы свойств и событий. */
.cubedoc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.cubedoc-table th {
  text-align: left;
  color: #7b818b;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 6px 10px 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.cubedoc-table td { padding: 7px 10px 7px 0; border-bottom: 1px solid rgba(255,255,255,.05); color: #cfd2d6; vertical-align: top; }
.cubedoc-table code { font-size: 12px; }
.cubedoc-lim { color: #6f7480; font-size: 11.5px; }

@media (max-width: 1100px) {
  .cubedoc { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .cubedoc-nav { position: static; max-height: 320px; }
  .cubedoc-row { grid-template-columns: minmax(0, 1fr); }
  .cubedoc-code { position: static; }
}
.docs-cta {
  margin: 6px 0 22px;
  padding: 14px 16px;
  background: rgba(255,59,48,.08);
  border: 1px solid rgba(255,59,48,.25);
  border-radius: 10px;
}
.docs-cta a { color: #fff; text-decoration: none; }
.docs-cta a:hover { text-decoration: underline; }
