:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: #ddd;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  -webkit-user-select: none; user-select: none; }

/* ---- player stage ---- */
#stage { position: fixed; inset: 0; background: #000; }
#stage canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#field { position: fixed; inset: 0; background: #000; will-change: background-color; }
#vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(circle at center, rgba(0,0,0,0) 38%, rgba(0,0,0,0.55) 78%, #000 100%); }
body.playing { touch-action: none; overflow: hidden; }

#hud { position: fixed; top: env(safe-area-inset-top, 12px); left: 14px;
  font-size: 12px; line-height: 1.5; color: rgba(255,255,255,0.5);
  text-shadow: 0 0 6px #000; pointer-events: none; white-space: pre; z-index: 30; }
#hud.hidden { display: none; }

.overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px; padding: 24px;
  background: #000; color: #cfcfcf; text-align: center; }
.overlay.hidden { display: none; }
.overlay h1 { font-size: 17px; font-weight: 600; letter-spacing: .04em; color: #ff8a28; margin: 0; }
.overlay p  { max-width: 32em; font-size: 13px; line-height: 1.7; margin: 0; color: #9a9a9a; }
.warn { color: #c98; font-size: 12px; max-width: 30em; line-height: 1.6; }
.tip  { color: #ff8a28; font-size: 12px; }
#err  { color: #e66; font-size: 12px; max-width: 40em; white-space: pre-wrap; }
.overlay button, .btn { font: inherit; font-size: 15px; padding: 13px 30px; border-radius: 999px;
  border: 1px solid #ff8a28; background: transparent; color: #ff8a28; cursor: pointer; letter-spacing: .05em; }
.overlay button:active, .btn:active { background: #ff8a28; color: #000; }

/* ---- catalog (index) ---- */
.wrap { max-width: 880px; margin: 0 auto; padding: 28px 20px 60px; }
header.site { text-align: center; padding: 18px 0 24px; }
header.site h1 { color: #ff8a28; font-size: 20px; letter-spacing: .06em; margin: 0 0 8px; }
header.site p { color: #888; font-size: 12.5px; line-height: 1.6; margin: 0; }
.group h2 { color: #777; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  margin: 26px 0 10px; border-bottom: 1px solid rgba(255,255,255,.08); padding-bottom: 6px; }
.card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  padding: 14px 16px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; margin: 9px 0;
  background: rgba(255,255,255,.015); }
.card .title { font-size: 15px; color: #eee; flex: 1 1 auto; min-width: 40%; }
.card .meta { color: #888; font-size: 11.5px; flex: 1 1 100%; }
.card .meta b { color: #ff8a28; font-weight: 500; }
.modes { display: flex; gap: 7px; flex-wrap: wrap; }
.modes a { text-decoration: none; font-size: 12px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(255,138,40,.5); color: #ff8a28; }
.modes a:active { background: #ff8a28; color: #000; }
.foot { color: #6a6a6a; font-size: 11px; line-height: 1.7; margin-top: 30px; text-align: center; }

/* ---- shared control menu (built by Menu.init in core.js) ---- */
#gear { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: none;
  width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(255,138,40,.6);
  background: rgba(0,0,0,.5); color: #ff8a28; font-size: 22px; cursor: pointer;
  align-items: center; justify-content: center; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.started #gear { display: flex; }
#menu { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; transform: translateY(115%);
  transition: transform .22s ease; background: rgba(8,8,10,.93);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,138,40,.3); border-radius: 16px 16px 0 0;
  max-height: 74vh; overflow-y: auto; padding: 6px 16px calc(18px + env(safe-area-inset-bottom));
  font-size: 13px; }
#menu.show { transform: translateY(0); }
.mhead { display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: rgba(8,8,10,.96); padding: 12px 0 10px; }
.mtitle { color: #ff8a28; letter-spacing: .04em; font-weight: 600; }
.mclose { background: none; border: none; color: #999; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.06); }
.mlabel { flex: 0 0 36%; color: #aaa; display: flex; justify-content: space-between; align-items: center; }
.mval { color: #ff8a28; margin-left: 8px; }
.mslider { flex: 1; accent-color: #ff8a28; height: 30px; }
.mseg { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { padding: 8px 13px; border-radius: 999px; border: 1px solid rgba(255,255,255,.18);
  background: transparent; color: #bbb; font: inherit; cursor: pointer; }
.mchip.on { border-color: #ff8a28; color: #ff8a28; background: rgba(255,138,40,.14); }
.mbtn { flex: 1; padding: 12px 14px; border-radius: 11px; border: 1px solid rgba(255,138,40,.5);
  background: transparent; color: #ff8a28; font: inherit; cursor: pointer; }
.mbtn.on { background: rgba(255,138,40,.16); }
