:root {
  --bg: #0d1117;
  --bg2: #151b24;
  --card: #1b2330;
  --line: #273142;
  --text: #e8edf4;
  --muted: #8b97a8;
  --accent: #7ee03a;
  --accent2: #ffb020;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: "Baloo 2", "Segoe UI", Roboto, Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* header */
header.top { position: sticky; top: 0; z-index: 20; background: rgba(13,17,23,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { font-size: 28px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.brand b { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search { flex: 1; max-width: 420px; margin-left: auto; }
.search input { width: 100%; height: 42px; border-radius: 21px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); padding: 0 18px; font: inherit; font-size: 16px; outline: none; }
.search input:focus { border-color: var(--accent); }

/* hero */
.hero { position: relative; margin: 24px 0; border-radius: 24px; overflow: hidden; min-height: 340px; display: flex; align-items: flex-end; background: var(--bg2) center/cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13,17,23,.92) 0%, rgba(13,17,23,.55) 45%, rgba(13,17,23,0) 75%); }
.hero .in { position: relative; z-index: 1; padding: 32px; max-width: 560px; }
.hero .logo { width: 260px; margin-bottom: 8px; filter: drop-shadow(0 6px 12px rgba(0,0,0,.5)); }
.hero p { color: #cfd8e3; font-size: 18px; line-height: 1.45; margin: 0 0 18px; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 10px; background: rgba(126,224,58,.14); color: var(--accent); margin: 0 6px 6px 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 28px; border-radius: 25px; font-weight: 800; font-size: 19px; color: #10200a; background: linear-gradient(180deg, #9cf55a, #4fb81c); box-shadow: 0 6px 20px rgba(79,184,28,.35); border: none; cursor: pointer; font-family: inherit; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--card); color: var(--text); box-shadow: none; border: 1px solid var(--line); }

/* grid */
h2.sec { font-size: 24px; margin: 28px 0 14px; display: flex; align-items: center; gap: 10px; }
h2.sec small { color: var(--muted); font-size: 15px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { height: 34px; padding: 0 16px; border-radius: 17px; border: 1px solid var(--line); background: var(--bg2); color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.chip.on { color: #10200a; background: var(--accent); border-color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; padding-bottom: 40px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card .cv { aspect-ratio: 3/4; background: #222 center/cover no-repeat; position: relative; }
.card .cv .new { position: absolute; top: 10px; left: 10px; background: var(--accent2); color: #2a1800; font-weight: 800; font-size: 12px; padding: 2px 8px; border-radius: 8px; }
.card .meta { padding: 10px 12px 12px; }
.card .t { font-weight: 800; font-size: 17px; line-height: 1.2; }
.card .s { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); padding: 30px 0; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 22px 0 30px; }

/* play page */
.play { display: grid; grid-template-columns: minmax(0, auto) 340px; gap: 24px; justify-content: center; padding: 20px 0 40px; }
.stagebox { position: relative; height: calc(100vh - 110px); max-height: 1000px; aspect-ratio: 1/2; background: #000; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.stagebox.landscape { aspect-ratio: 16/9; height: auto; width: min(100%, 1100px); }
.stagebox iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.side h1 { margin: 6px 0 4px; font-size: 32px; line-height: 1.1; }
.side .sub { color: var(--muted); margin-bottom: 12px; }
.side p { color: #cfd8e3; line-height: 1.5; }
.side ol { padding-left: 20px; color: #cfd8e3; line-height: 1.5; }
.side .acts { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.side .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; }

@media (max-width: 860px) {
  .play { grid-template-columns: 1fr; }
  .stagebox { height: calc(100vh - 90px); margin: 0 auto; }
  .hero { min-height: 280px; }
  .hero .in { padding: 20px; }
  .hero .logo { width: 190px; }
  .brand { font-size: 22px; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .search { display: none; }
}
/* phone: game page = game only */
body.playing-mobile header.top, body.playing-mobile .side, body.playing-mobile footer { display: none; }
body.playing-mobile .play { padding: 0; }
body.playing-mobile .stagebox { height: 100vh; height: 100dvh; width: 100vw; max-height: none; aspect-ratio: auto; border-radius: 0; border: 0; }
@media (max-width: 520px) {
  .hero { min-height: 420px; }
  .hero::after { background: linear-gradient(0deg, rgba(13,17,23,.97) 30%, rgba(13,17,23,.4) 65%, rgba(13,17,23,0) 100%); }
  .hero p { font-size: 16px; }
}

.langsel { height: 42px; border-radius: 21px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; font-weight: 700; padding: 0 12px; }
header.top .search + .langsel { margin-left: 8px; }
@media (max-width: 520px) { .langsel { height: 36px; font-size: 14px; margin-left: auto; } }
/* SEO / pre-rendered pages */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card .cv img { width: 100%; height: 100%; object-fit: cover; }
.card h3.t { margin: 0; }
.card[hidden] { display: none; }
.grid.mini { grid-template-columns: repeat(2, 1fr); padding: 10px 0 0; }
.side .box h2 { font-size: 18px; margin: 0 0 6px; }
.crumbs { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.crumbs a:hover { color: var(--accent); }
footer .intro { max-width: 820px; line-height: 1.5; margin: 0 0 12px; }
footer .langs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 12px; font-size: 13px; }
footer .langs a:hover { color: var(--accent); }
.hero h2 { font-size: 40px; margin: 0 0 8px; }
.langlist { columns: 2; font-size: 20px; line-height: 2; }
