/* VIVA Class — direction C "esports game UI" (dark only).
   Near-black panels with cut corners, off-white type, ONE hot accent (#ff4655) + one cool secondary.
   Condensed uppercase Latin (Bahnschrift) paired with heavy Japanese gothic. Hatch used sparingly.
   Features use these classes; feature-only styles go in /features/{name}.css (prefix with the feature name). */
:root {
  --bg: #0b0d10; --bg-2: #111419;
  --surface: #15181d; --surface-solid: #15181d; --surface-2: #1c2026; --surface-3: #252a32;
  --line: rgba(236, 232, 225, .10); --line-strong: rgba(236, 232, 225, .24); --line-soft: rgba(236, 232, 225, .06);
  --text: #ece8e1; --muted: #8b9099; --ink: #ece8e1; --dim: #5b616b;
  --hot: #ff4655; --hot-2: #ff6b77; --hot-3: #d93a48; --cool: #4fd6cf;
  --cyan: var(--cool); --violet: #9b8cff; --magenta: #ff4655; --lime: #7fe0a2; --amber: #ffb547; --red: #ff4655; --blue: #5b9cff;
  --yellow: var(--amber); --pink: var(--magenta); --green: var(--lime); --purple: var(--violet); --sky: var(--cool); --orange: #ff8a3d;
  --accent: var(--hot); --accent-2: var(--cool); --accent-3: var(--amber); --accent-soft: color-mix(in srgb, var(--hot) 14%, transparent); --on-accent: #fff;
  --good: var(--lime); --good-ink: var(--lime); --bad: var(--red); --warn: var(--amber);
  --grad: linear-gradient(90deg, var(--hot), var(--hot-2)); --grad-btn: var(--hot); --grad-soft: color-mix(in srgb, var(--hot) 10%, transparent);
  --glow: 0 0 0 1px color-mix(in srgb, var(--hot) 50%, transparent);
  --hatch: repeating-linear-gradient(-45deg, rgba(236, 232, 225, .07) 0 2px, transparent 2px 9px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .4); --shadow: 0 14px 30px rgba(0, 0, 0, .45); --shadow-lg: 0 28px 64px rgba(0, 0, 0, .6);
  --radius-sm: 2px; --radius: 3px; --radius-lg: 4px; --cut: 14px;
  --ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--text);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic UI", "Yu Gothic", "BIZ UDPGothic", Meiryo, sans-serif;
  --font: "Hiragino Sans", "Segoe UI Variable Text", "Segoe UI", "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, sans-serif;
  --display: "Bahnschrift", "DIN Condensed", "DIN Alternate", "Arial Narrow", "Segoe UI Variable Display", var(--jp);
  --mono: "Cascadia Mono", "Cascadia Code", "SF Mono", Consolas, ui-monospace, monospace;
  --nav-w: 248px; --top-h: 0px; --tab-h: 0px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text); font: 500 15px/1.65 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(1200px 700px at 70% -20%, #1a1e25, transparent 70%), var(--bg);
  background-attachment: fixed;
}
a { color: var(--text); text-decoration: none; font-weight: 700; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
::selection { background: var(--hot); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: #2a2f37; border: 3px solid var(--bg); }
.boot { display: grid; place-items: center; align-content: center; gap: 14px; height: 100vh; font: 700 16px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .4em; color: var(--text); text-transform: uppercase; }
.boot-logo { width: 72px; height: 72px; animation: pulse 1.6s ease-in-out infinite; }

/* ---- place colours (one hot + one cool) ---- */
[data-path="/"] { --place: var(--hot); }
[data-path="/chat"] { --place: var(--cool); }
[data-path="/friends"] { --place: var(--cool); }
[data-path="/cards"] { --place: var(--hot); }
[data-path="/starship"] { --place: var(--hot); }
[data-path="/admin"] { --place: var(--amber); }
body[data-page="chat"] { --place: var(--cool); } body[data-page="friends"], body[data-page="profile"] { --place: var(--cool); }
body[data-page="cards"] { --place: var(--hot); } body[data-page="starship"] { --place: var(--hot); } body[data-page="admin"] { --place: var(--amber); }

/* ---- panels: flat, cut corner ---- */
.card, .tile, .hero, .modal, .auth-card { position: relative; background: var(--surface); }
.card, .hero, .modal {
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%); }

/* ---- shell ---- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px;
  background: rgba(11, 13, 16, .94); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 64px; height: 2px; background: var(--hot); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand .logo-img { width: 32px; height: 32px; }
.brand-name { font: 700 21px/1 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.brand-name b { font-weight: 700; margin-right: 5px; color: var(--text); }
.top-right { display: flex; align-items: center; gap: 4px; }
.me-btn { display: flex; }
.svg-ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: square; stroke-linejoin: miter; flex: none; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent;
  cursor: pointer; font-size: 17px; color: var(--muted); transition: color .12s, background .12s; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn:active { background: var(--surface-3); }

.nav { position: fixed; z-index: 25; display: flex; }
.nav-links { display: flex; }
.nav-links a { position: relative; display: flex; align-items: center; gap: 12px; color: var(--muted); font-weight: 700; transition: color .12s, background .12s; }
.nav-links a .ico { display: grid; place-items: center; }
.nav-links a .ico .svg-ico { width: 21px; height: 21px; }
.nav-brand, .nav-foot { display: none; }
#main { overflow-x: clip; padding: 20px 16px calc(var(--tab-h) + 28px); max-width: 1160px; margin: 0 auto; }
.page { animation: rise .35s var(--ease) both; }

@media (min-width: 900px) {
  .nav { top: 0; left: 0; bottom: 0; width: var(--nav-w); flex-direction: column; gap: 2px; padding: 26px 0 16px;
    background: #08090c; border-right: 1px solid var(--line); }
  .nav .nav-brand { display: flex; padding: 0 22px 30px; }
  .nav-links { flex-direction: column; gap: 2px; counter-reset: nav; }
  .nav-links a { padding: 12px 22px; font-size: 15px; letter-spacing: .04em; counter-increment: nav; }
  .nav-links a::after { content: counter(nav, decimal-leading-zero); margin-left: auto; font: 600 13px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; color: var(--dim); letter-spacing: .08em; }
  .nav-links a:hover { color: var(--text); background: rgba(236, 232, 225, .04); }
  .nav-links a.on { color: var(--text); background: linear-gradient(90deg, color-mix(in srgb, var(--hot) 16%, transparent), transparent 80%); }
  .nav-links a.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hot); }
  .nav-links a.on .ico { color: var(--hot); }
  .nav-links a.on::after { color: var(--hot); }
  .nav a .badge { margin-left: auto; }
  .nav .nav-foot { display: flex; flex-direction: column; gap: 10px; margin: auto 14px 0; padding: 14px; background: var(--surface);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
  .nav-me { display: flex; align-items: center; gap: 11px; color: var(--text); min-width: 0; }
  .nav-me .grow { min-width: 0; line-height: 1.3; }
  .nav-me-name { font-weight: 800; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-me-login { font: 600 13px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .06em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-foot-btns { display: flex; gap: 4px; }
  .nav-foot-btns .btn { flex: 1; white-space: nowrap; font-size: 12px; padding: 6px 8px; }
  #main { margin-left: var(--nav-w); padding: 34px 44px 64px; max-width: calc(1180px + var(--nav-w)); }
}
@media (max-width: 899px) {
  :root { --top-h: 56px; --tab-h: 64px; }
  .top { display: flex; }
  .nav { left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
    background: rgba(8, 9, 12, .97); border-top: 1px solid var(--line); }
  .nav .nav-brand, .nav .nav-foot { display: none; }
  .nav-links { flex: 1; justify-content: space-around; max-width: 560px; margin: 0 auto; }
  .nav-links a { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 0; font-size: 10.5px; min-width: 0; letter-spacing: .02em; }
  .nav-links a .ico { width: 44px; height: 28px; }
  .nav-links a .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav-links a.on { color: var(--text); }
  .nav-links a.on::before { content: ""; position: absolute; top: -1px; left: 50%; width: 28px; margin-left: -14px; height: 3px; background: var(--hot); }
  .nav-links a.on .ico { color: var(--hot); }
  .nav a .badge { position: absolute; top: 4px; left: 50%; margin-left: 8px; }
}
.page.wide { max-width: none; }

/* ---- building blocks ---- */
h1, h2, h3 { line-height: 1.3; font-weight: 800; letter-spacing: .02em; font-family: var(--jp); }
.page-title { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; font-size: 30px; font-weight: 800; letter-spacing: .03em; }
.page-title::before { content: ""; width: 6px; height: 28px; background: var(--place, var(--hot)); transform: skewX(-14deg); flex: none; }
.section-title { display: flex; align-items: center; gap: 12px; margin: 34px 0 14px; font: 800 17px var(--jp); letter-spacing: .06em; color: var(--text); }
.section-title::before { content: "LIVE"; padding: 2px 10px 1px; background: var(--hot); color: #fff; font: 700 13px/1.4 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .18em;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.section-title::after { content: ""; flex: 1; height: 8px; background: var(--hatch); opacity: .8; }
.card { box-shadow: none; padding: 18px 20px 20px; }
.card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 800; letter-spacing: .04em; }
.card-title::before { content: ""; width: 4px; height: 16px; background: var(--place, var(--hot)); flex: none; }
.card-title .ico { display: inline-grid; place-items: center; width: 26px; height: 26px; font-size: 15px; flex: none; filter: grayscale(1) brightness(1.3); opacity: .8; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; } .row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.btn { --b: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 20px; border: 0; border-radius: 0;
  background: var(--b); color: var(--text); cursor: pointer; font: 700 14px/1.4 var(--font); letter-spacing: .06em; text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
  transition: background .12s, color .12s, transform .08s, filter .12s; }
.btn:hover { --b: #323844; }
.btn:active { transform: translateY(1px); filter: brightness(.9); }
.btn:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--text); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn.primary { --b: var(--hot); color: #fff; font-weight: 800; }
.btn.primary:hover { --b: var(--hot-2); }
.btn.primary:active { --b: var(--hot-3); }
.btn.danger { color: var(--bad); }
.btn.primary.danger { --b: var(--hot); color: #fff; }
.btn.ghost { --b: transparent; color: var(--muted); }
.btn.ghost:hover { --b: rgba(236, 232, 225, .06); color: var(--text); }
.btn.big { padding: 14px 22px; font-size: 16px; width: 100%; letter-spacing: .14em; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%); }
.btn .svg-ico { width: 16px; height: 16px; }

.field { display: flex; flex-direction: column; gap: 6px; font: 700 13px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.field > span { font-family: var(--display); }
.input, .field input, .field textarea, .field select, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: 0; border: 0; border-bottom: 2px solid transparent; background: #0d0f13; color: var(--text);
  font: 600 16px var(--font); letter-spacing: normal; text-transform: none; outline: none; box-shadow: inset 0 0 0 1px var(--line); transition: border-color .12s, background .12s; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-bottom-color: var(--hot); background: #101318; }
.input::placeholder, .field input::placeholder, textarea::placeholder { color: var(--dim); font-weight: 500; }

.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 2px; background: #2a2f38; color: var(--text); font-weight: 800; overflow: hidden; line-height: 1;
  font-family: var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--hot); color: #fff; font: 700 12.5px/1 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; background: var(--surface-3);
  font: 700 12.5px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .1em; text-transform: uppercase; color: var(--text);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.pill.good { color: #0b0d10; background: var(--lime); }
.pill.bad { color: #fff; background: var(--hot); }
.pill.accent { color: #0b0d10; background: var(--cool); }
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-bottom: 1px solid var(--line-soft); color: var(--text); font-weight: 600; }
.item:last-child { border-bottom: 0; }
a.item:hover, .item.click:hover { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--hot); cursor: pointer; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; font-weight: 600; }
.tabs { display: flex; gap: 2px; margin-bottom: 16px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs button { position: relative; padding: 10px 18px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; white-space: nowrap; letter-spacing: .04em; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); box-shadow: inset 0 -3px 0 var(--place, var(--hot)); }
.online-dot { width: 10px; height: 10px; background: var(--lime); border: 2px solid var(--bg); transform: rotate(45deg); }
.online-dot.off { background: #3a3f48; }

/* ---- toast / modal ---- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: min(92vw, 480px); pointer-events: none; }
.toast { padding: 12px 20px 12px 18px; background: #ece8e1; color: #0f1115; font-weight: 800; box-shadow: var(--shadow), inset 4px 0 0 var(--hot); max-width: 100%;
  animation: toastin .25s var(--ease) both; transition: opacity .35s; overflow-wrap: anywhere; }
.toast.bad { background: var(--bad); color: #fff; box-shadow: var(--shadow); }
.toast.good { box-shadow: var(--shadow), inset 4px 0 0 var(--lime); }
.toast.out { opacity: 0; }
.modal-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(5, 6, 8, .78); display: grid; place-items: center; padding: 16px; animation: fade .18s both; }
.modal { width: min(540px, 100%); max-height: 88vh; overflow: auto; padding: 22px; background: var(--surface); box-shadow: inset 0 3px 0 var(--hot); animation: pop .24s var(--ease) both;
  --cut: 18px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-head h2 { margin: 0; font-size: 20px; }
@media (max-width: 899px) {
  .modal-wrap { place-items: end center; padding: 0; }
  .modal { width: 100%; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation: sheet .28s var(--ease) both; }
}

/* ---- home: lobby ---- */
.hero { overflow: hidden; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 26px 30px 28px; margin-bottom: 0; --cut: 22px;
  background:
    linear-gradient(var(--hot), var(--hot)) 0 100% / 132px 4px no-repeat,
    linear-gradient(100deg, transparent 62%, rgba(236, 232, 225, .025) 62%) ,
    var(--surface); }
.hero::before { content: "WELCOME BACK"; position: relative; z-index: 1; align-self: flex-start; margin-bottom: 14px; padding: 1px 10px 0 12px;
  font: 700 13px/1.6 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .24em; color: var(--muted); box-shadow: inset 3px 0 0 var(--hot); }
.hero::after { content: "LOBBY"; position: absolute; right: -6px; bottom: -0.2em; z-index: 0; pointer-events: none;
  font: 700 clamp(110px, 15vw, 196px)/1 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: -.01em; color: transparent; -webkit-text-stroke: 1.5px rgba(236, 232, 225, .09); }
.hero-deco, .hero-prompt, .dotmatrix { display: none !important; }
.hero .avatar { width: 72px !important; height: 72px !important; font-size: 38px !important; background: var(--hot); color: #fff; border-radius: 0;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%); }
.hero-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; min-width: 0; }
.hero-date { display: inline-flex; align-items: center; gap: 8px; font: 700 13px var(--jp); letter-spacing: .12em; color: var(--cool); }
.hello-hi { margin: 2px 0 2px; font: 800 clamp(24px, 3.6vw, 40px)/1.15 var(--jp); letter-spacing: .01em; color: var(--text); word-break: keep-all; overflow-wrap: anywhere; }
.hero-sub { margin: 0; color: var(--muted); font-weight: 700; }
@media (max-width: 600px) { .hero { padding: 20px 18px 22px; --cut: 16px; } .hero .avatar { width: 56px !important; height: 56px !important; font-size: 30px !important; } .hero-main { gap: 14px; } }

.tiles { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1fr); grid-auto-rows: minmax(158px, auto); margin-top: 12px; counter-reset: tile; }
.tile { --place: var(--hot); display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 158px; padding: 20px 20px 18px; color: var(--text);
  text-decoration: none; overflow: hidden; counter-increment: tile;
  background: linear-gradient(var(--place), var(--place)) 0 0 / 3px 100% no-repeat, var(--surface);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  transition: transform .18s var(--ease), background-size .18s var(--ease), background-color .18s; animation: rise .4s var(--ease) both; }
.tile:nth-child(2) { animation-delay: .04s; } .tile:nth-child(3) { animation-delay: .08s; } .tile:nth-child(4) { animation-delay: .12s; }
.tile[data-path="/chat"], .tile[data-path="/friends"] { --place: var(--cool); }
.tile::before { content: counter(tile, decimal-leading-zero); position: absolute; top: 12px; right: 22px; font: 700 44px/1 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; color: rgba(236, 232, 225, .08); letter-spacing: .02em; }
.tile:hover { transform: translateY(-3px); background-color: var(--surface-2); background-size: 6px 100%, auto; }
.tile:active { transform: translateY(0) scale(.99); background-color: var(--surface-3); }
.tile-ico { display: grid; place-items: center; width: 46px; height: 46px; color: var(--place); background: rgba(236, 232, 225, .05); font-size: 24px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.tile-ico .svg-ico { width: 24px; height: 24px; }
.tile-txt { position: relative; z-index: 1; display: flex; flex-direction: column; }
.tile-txt::before { font: 700 13px/1 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .22em; color: var(--place); margin-bottom: 7px; }
.tile[data-path="/chat"] .tile-txt::before { content: "CHAT"; }
.tile[data-path="/cards"] .tile-txt::before { content: "CARDS / TRUMP"; }
.tile[data-path="/starship"] .tile-txt::before { content: "FEATURED MODE"; }
.tile[data-path="/friends"] .tile-txt::before { content: "FRIENDS"; }
.tile-txt b { font: 800 21px/1.25 var(--jp); letter-spacing: .03em; }
.tile-txt small { font-size: 12.5px; color: var(--muted); font-weight: 600; line-height: 1.45; margin-top: 4px; padding-right: 40px; }
.tile-go { position: absolute; right: 16px; bottom: 16px; display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); background: rgba(236, 232, 225, .06);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%); transition: color .15s, background .15s, transform .18s var(--ease); }
.tile:hover .tile-go { color: #fff; background: var(--place); transform: translateX(2px); }
.tile[data-path="/chat"]:hover .tile-go, .tile[data-path="/friends"]:hover .tile-go { color: #0b0d10; }
.tile-go .svg-ico { width: 16px; height: 16px; }
.tile .badge { position: absolute; top: 14px; left: 60px; }

/* featured: STARSHIP banner */
.tile[data-path="/starship"] { grid-column: 1; grid-row: 1 / span 2; min-height: 328px; justify-content: flex-end; padding: 26px 28px 26px;
  background:
    linear-gradient(115deg, transparent 0 63%, var(--hot) 63% 100%),
    repeating-linear-gradient(-45deg, rgba(236, 232, 225, .05) 0 2px, transparent 2px 10px) right top / 70% 100% no-repeat,
    linear-gradient(180deg, #1b1f26, #121519);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px)); }
.tile[data-path="/starship"]::before { content: "NEW SEASON"; top: 24px; left: 28px; right: auto; padding: 3px 10px 2px; font-size: 13px; line-height: 1.4; letter-spacing: .2em;
  color: #0b0d10; background: var(--text); clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.tile[data-path="/starship"]::after { content: "STARSHIP"; order: 1; position: relative; z-index: 1; margin: 0 0 4px -3px; font: 700 clamp(64px, 7.4vw, 112px)/.84 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75;
  letter-spacing: -.005em; color: var(--text); }
.tile[data-path="/starship"] .tile-txt { order: 2; }
.tile[data-path="/starship"] .tile-txt::before { color: var(--hot); }
.tile[data-path="/starship"] .tile-txt b { font-size: 24px; }
.tile[data-path="/starship"] .tile-txt small { font-size: 14px; color: #b4b8bf; }
.tile[data-path="/starship"] .tile-ico { position: absolute; top: 26px; right: 30px; width: 120px; height: 120px; margin-top: 0; color: #fff; background: transparent; clip-path: none; }
.tile[data-path="/starship"] .tile-ico .svg-ico { width: 120px; height: 120px; stroke-width: 1.1; }
.tile[data-path="/starship"] .tile-go { right: 26px; bottom: 26px; width: auto; height: 44px; padding: 0 16px 0 20px; gap: 10px; grid-auto-flow: column; color: #0b0d10; background: var(--text);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%); }
.tile[data-path="/starship"] .tile-go::before { content: "PLAY"; font: 700 19px/1 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .2em; }
.tile[data-path="/starship"]:hover { transform: translateY(-3px); filter: brightness(1.06); }
.tile[data-path="/starship"]:hover .tile-go { color: #fff; background: #0b0d10; }
/* (friends used to span 2 columns when there were only 4 places; with many places every tile takes one cell) */

@media (max-width: 899px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 10px; }
  .tile[data-path="/starship"] { grid-column: 1 / -1; grid-row: 1; min-height: 236px; padding: 20px; }
  .tile[data-path="/starship"]::before { top: 18px; left: 20px; }
  .tile[data-path="/starship"]::after { font-size: 60px; }
  .tile[data-path="/starship"] .tile-ico { width: 84px; height: 84px; top: 18px; right: 18px; }
  .tile[data-path="/starship"] .tile-ico .svg-ico { width: 84px; height: 84px; }
  .tile[data-path="/starship"] .tile-txt small { padding-right: 104px; font-size: 12.5px; }
  .tile[data-path="/starship"] .tile-go { right: 18px; bottom: 18px; height: 40px; padding: 0 12px 0 14px; }
  .tile[data-path="/starship"] .tile-go::before { font-size: 17px; }

}
@media (max-width: 600px) {
  .tile { min-height: 132px; padding: 16px; gap: 14px; }
  .tile::before { font-size: 34px; top: 10px; right: 16px; }
  .tile-txt b { font-size: 18px; } .tile-txt small { padding-right: 30px; font-size: 12px; }
  .tile-ico { width: 40px; height: 40px; } .tile-ico .svg-ico { width: 21px; height: 21px; }
  .tile-go { width: 28px; height: 28px; right: 12px; bottom: 12px; }
  .tile[data-path="/friends"] { min-height: 0; flex-direction: row; align-items: center; justify-content: flex-start; }
  .tile[data-path="/friends"]::before { top: 50%; margin-top: -17px; right: 52px; }
  .tile[data-path="/friends"] .tile-go { top: 50%; margin-top: -14px; }
}
.widgets { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.widget .card-title .ico { display: none; }
.cards-stats { gap: 0 !important; margin-bottom: 8px; }
.cards-stat { flex: 1; display: flex; flex-direction: column; padding: 0 0 0 12px; box-shadow: inset 2px 0 0 var(--line-strong); }
.cards-stat b { font: 700 46px/1 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; color: var(--text); }
.starship-w-play { margin-bottom: 6px; }
@media (max-width: 600px) { .widgets { grid-template-columns: 1fr; } }

/* ---- auth ---- */
.auth { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1fr; place-items: center; align-content: center; gap: 26px; padding: 32px 16px; overflow: hidden;
  background: radial-gradient(900px 600px at 20% 30%, #1a1e25, transparent 70%), var(--bg); }
@media (min-width: 900px) { .auth { grid-template-columns: 1.15fr 1fr; gap: 72px; padding: 40px 7vw; } }
.auth::before { content: ""; position: absolute; left: -12%; top: 0; bottom: 0; width: 46%; pointer-events: none; z-index: 0;
  background: var(--hatch); transform: skewX(-16deg); -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); opacity: .7; }
.auth::after { content: ""; position: absolute; right: -6%; bottom: -10%; width: 34vw; max-width: 520px; height: 46%; pointer-events: none; z-index: 0; background: var(--hot); transform: skewX(-16deg); opacity: .92; }
.auth-stickers { display: none; }
.auth-hero { position: relative; z-index: 1; text-align: center; }
@media (min-width: 900px) { .auth-hero { text-align: left; justify-self: end; } }
.auth-hero .logo-img { width: 56px; height: 56px; }
.auth-hero::before { content: "ONLINE CLASSROOM  /  SEASON 01"; display: block; margin-bottom: 18px; font: 700 14px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .3em; color: var(--muted); }
.auth-word { margin: 14px 0 10px; font: 700 clamp(84px, 13vw, 176px)/.8 var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: -.01em; text-transform: uppercase; color: var(--text); }
.auth-word .w2 { display: inline-block; color: var(--hot); }
.auth-tag { display: inline-flex; align-items: center; gap: 12px; margin: 18px 0 0; font: 800 16px var(--jp); letter-spacing: .12em; color: var(--text); }
.auth-tag::before { content: ""; width: 28px; height: 3px; background: var(--hot); }
.auth-card { z-index: 1; width: min(420px, 100%); padding: 32px 30px 26px; background: #ece8e1; color: #0f1115; box-shadow: none; animation: pop .4s var(--ease) both;
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%); }
@media (min-width: 900px) { .auth-card { justify-self: start; } }
.auth-card .muted { color: #6a6e75; }
.auth-brand h2 { margin: 0 0 2px; font: 800 28px/1.2 var(--jp); letter-spacing: .06em; color: #0f1115; }
.auth-brand::before { content: "SIGN IN"; display: block; margin-bottom: 4px; font: 700 13px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .3em; color: var(--hot); }
.auth-brand p { margin: 0 0 20px; font-weight: 600; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-card .field { color: #5a5e66; }
.auth-card .field input { background: #fff; color: #0f1115; box-shadow: inset 0 0 0 1px rgba(15, 17, 21, .14); }
.auth-card .field input:focus { background: #fff; border-bottom-color: var(--hot); box-shadow: inset 0 0 0 1px rgba(15, 17, 21, .3); }
.auth-card .btn.ghost { color: #55595f; } .auth-card .btn.ghost:hover { --b: rgba(15, 17, 21, .06); color: #0f1115; }
.auth-card .btn.primary { margin-top: 6px; }
.auth-msg { min-height: 1.3em; font-size: 14px; font-weight: 700; text-align: center; }
.auth-msg.bad { color: var(--hot-3); } .auth-msg.good { color: #1f8a4c; }
.auth-switch { text-align: center; }
@media (max-width: 899px) {
  .auth { align-content: start; padding-top: 48px; }
  .auth::after { width: 60vw; height: 30%; right: -20%; }
  .auth-hero::before { font-size: 12px; letter-spacing: .24em; margin-bottom: 10px; }
  .auth-word { font-size: 92px; }
  .auth-card { padding: 26px 22px 20px; }
}

/* ---- motion ---- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes scan { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes floor { from { background-position: 0 0; } to { background-position: 0 56px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- full-screen apps: cards and starship open as their own screen (no site menu / top bar) ---- */
body[data-page="cards"] .nav, body[data-page="cards"] .top,
body[data-page="starship"] .nav, body[data-page="starship"] .top { display: none !important; }
body[data-page="cards"] #main, body[data-page="starship"] #main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
body[data-page="cards"], body[data-page="starship"] { --top-h: 0px; --tab-h: 0px; }
body[data-page="cards"] .page, body[data-page="starship"] .page { animation: none; }
body[data-page="cards"] .cp-root { min-height: 100vh !important; min-height: 100dvh !important; border-radius: 0 !important; border: 0 !important; }

/* ---- status line (PC): game-client footer chip ---- */
.statusline { position: fixed; z-index: 26; right: 18px; bottom: 14px; display: none; height: 26px; overflow: hidden;
  background: #08090c; font: 600 13px/26px var(--display); font-stretch: condensed; font-variation-settings: "wdth" 75; letter-spacing: .08em; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.statusline > span { padding: 0 11px; box-shadow: inset 1px 0 0 var(--line); white-space: nowrap; }
.statusline > span:first-child { box-shadow: none; background: var(--hot); color: #fff; font-weight: 700; letter-spacing: .12em; }
.statusline b { color: var(--text); }
@media (min-width: 900px) { .statusline { display: flex; } }
body[data-page="cards"] .statusline, body[data-page="starship"] .statusline { display: none !important; }

body[data-page="chat"] .statusline { display: none !important; }

/* ---- phone menu: main places in the bar, the rest behind "メニュー" (coordinator, 2026-11-09) ---- */
.nav-more { display: none; }
@media (max-width: 899px) {
  .nav-links a.secondary { display: none; }
  .nav-more { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 0; min-width: 0;
    border: 0; background: none; color: var(--muted); font: inherit; font-size: 10.5px; letter-spacing: .02em; cursor: pointer; }
  .nav-more .ico { display: grid; place-items: center; width: 44px; height: 28px; font-size: 20px; }
}
@media (min-width: 900px) { .nav-links { overflow-y: auto; min-height: 0; flex: 1 1 auto; } }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 700; font-size: 13px;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.more-grid a .ico { display: grid; place-items: center; width: 40px; height: 40px; color: var(--place, var(--hot)); font-size: 22px; }
.more-grid a .ico .svg-ico { width: 24px; height: 24px; }
.more-grid a:hover { background: var(--surface-3); }
/* board games open full-screen like cards and starship */
body[data-page="board"] .nav, body[data-page="board"] .top, body[data-page="board"] .statusline { display: none !important; }
body[data-page="board"] #main { margin: 0 !important; padding: 0 !important; max-width: none !important; }
body[data-page="board"] { --top-h: 0px; --tab-h: 0px; }

/* ---- dialogs (app.confirm / app.ask), reconnect chip, phone tap sizes ---- */
.modal:focus { outline: none; }
.dialog { display: grid; gap: 16px; }
.dialog-text { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-input { width: 100%; }
.dialog-btns { display: flex; justify-content: flex-end; gap: 10px; }
.dialog-btns .btn { min-width: 96px; min-height: 44px; justify-content: center; }
.dialog-btns .btn.danger { background: var(--bad); color: #fff; }
.net-chip { display: none; align-items: center; gap: 6px; padding: 4px 10px; font-size: 12px; font-weight: 800; color: #0f1115; background: var(--amber, #ffc444); white-space: nowrap; }
.net-chip.on { display: inline-flex; }
@media (min-width: 900px) { .net-chip { position: fixed; right: 16px; top: 12px; z-index: 80; } }
@media (max-width: 899px) {
  .btn, .tabs button, .yotei-filter, .ai-seg button { min-height: 40px; }
  .btn.sm { display: inline-flex; align-items: center; justify-content: center; }
  .me-btn { min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }
  .dialog-btns { justify-content: stretch; }
  .dialog-btns .btn { flex: 1; }
}
.boot .btn { margin-top: 6px; }

/* ---- load bar (requests slower than 250 ms) ---- */
.loadbar { position: fixed; left: 0; top: 0; z-index: 120; width: 100%; height: 3px; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(90deg, transparent, var(--hot) 40%, var(--hot-2) 60%, transparent); background-size: 50% 100%; background-repeat: no-repeat; }
.loadbar.on { opacity: 1; animation: loadbar 1.1s linear infinite; }
@keyframes loadbar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
/* ---- same press / hover feel everywhere ---- */
.btn, .icon-btn, .tile, .tabs button { transition: transform .12s var(--ease), background-color .15s, color .15s, filter .15s; }
.btn:active:not(:disabled), .icon-btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .55; cursor: default; }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.08); } a.card:hover { background: var(--surface-2); } }
/* ---- theme picker (profile) ---- */
.theme-picks { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-pick { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 12px 6px 8px; border: 0; background: var(--surface-2); color: var(--text); font-weight: 700; cursor: pointer; }
.theme-pick i { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--c1) 0 55%, var(--c2) 55%); }
.theme-pick.on { box-shadow: inset 0 0 0 2px var(--text); }
