      button, [role="button"], select, summary, input:not([type="checkbox"], [type="radio"]) { min-height: 2.25rem; }
      * { box-sizing: border-box; }
      /* Dopamine theme: deep indigo night with soft neon (violet /
         pink / cyan). Saturation and glow are kept moderate on
         purpose, so the page stays easy on the eyes over long
         sessions — no flashing, no raw primary colours. The look
         is intentionally dark in both system colour modes. */
      :root{
        --bg:#16131f; --bg2:#100d18; --panel:#201c33; --panel-line:#3b3560;
        --ink:#edeaf7; --ink-soft:#a39cc9; --accent:#7c66dd; --accent-ink:#ffffff;
        --accent-soft:#2b2450; --accent-text:#b3a5f5; --good:#4cb08a; --bad:#e07a68;
        --cyan:#56c3d4; --pink:#e58ec9;
        --accent-grad:linear-gradient(135deg,#7c66dd 0%,#9a5fc0 52%,#c05b9d 100%);
        --glow:0 6px 22px rgba(124,102,221,.35);
        /* Board squares deliberately stay OFF the neon theme:
           chess uses the classic light/dark pairing every player
           knows (#f0d9b5 / #b58863), so the board reads instantly. */
        --sq-light:#f0d9b5; --sq-dark:#b58863;
        --board-line:#4a3f7d;
        --shadow:0 12px 32px rgba(0,0,0,.5);
        color-scheme: dark;
      }
      html{ scroll-behavior:smooth; overflow-x:clip; }
      body{ overflow-x:clip; }
      body{
        margin:0;
        background:
          radial-gradient(640px 420px at 12% -60px, rgba(124,102,221,.17), transparent 62%),
          radial-gradient(720px 480px at 92% -40px, rgba(192,91,157,.11), transparent 62%),
          radial-gradient(820px 620px at 50% 112%, rgba(86,195,212,.08), transparent 62%),
          linear-gradient(180deg,var(--bg) 0%,var(--bg2) 100%);
        background-attachment:fixed;
        color:var(--ink);
        font-family:"Zen Kaku Gothic New","Hiragino Kaku Gothic ProN","Noto Sans JP","Noto Sans Arabic","Noto Sans SC","PingFang SC",sans-serif;
        line-height:1.6; -webkit-text-size-adjust:100%;
      }
      .wrap{ max-width:1060px; margin:0 auto; padding:0 16px 40px; }

      /* top utility bar: language switch lives here, top corner of the game-select screen */
      .topbar{
        position:sticky; top:0; z-index:40; backdrop-filter:blur(8px);
        background:color-mix(in srgb, var(--bg) 88%, transparent);
        border-bottom:1px solid var(--panel-line);
      }
      .topbar-in{ max-width:1060px; margin:0 auto; padding:8px 16px; display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
      /* site logo: big neon-gradient wordmark, shared across all languages */
      .brand{
        font-weight:900; letter-spacing:.05em; white-space:nowrap;
        font-size:34px; line-height:1.2;
        background:linear-gradient(92deg,#56c3d4 0%,#7c66dd 32%,#c05b9d 66%,#e58ec9 100%);
        -webkit-background-clip:text; background-clip:text;
        -webkit-text-fill-color:transparent; color:transparent;
        filter:drop-shadow(0 0 9px rgba(124,102,221,.45)) drop-shadow(0 3px 16px rgba(192,91,157,.30));
      }
      /* intro line under the brand row: what this site is */
      .tagline{ max-width:1060px; margin:0 auto; padding:0 16px 6px; text-align:center; font-size:14.5px; font-weight:800; color:var(--ink); letter-spacing:.02em; }
      .tagline::before, .tagline::after{ content:""; display:inline-block; width:26px; height:2px; background:var(--accent); vertical-align:middle; margin:0 10px; border-radius:2px; }
      @media (max-width:640px){ .tagline{ padding:0 10px 4px; font-size:13px; } .tagline::before, .tagline::after{ width:16px; margin:0 7px; } }
      .online-box{ display:inline-flex; align-items:center; gap:7px; background:var(--panel); border:1.5px solid var(--panel-line); border-radius:999px; padding:4px 12px; font-size:13px; font-weight:800; min-height:36px; white-space:nowrap; color:var(--ink); }
      .online-dot{ width:9px; height:9px; border-radius:50%; background:var(--good); flex:none; box-shadow:0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); animation:onlinePulse 2s ease-in-out infinite; }
      @keyframes onlinePulse{ 0%,100%{ opacity:1; } 50%{ opacity:.55; } }
      @media (prefers-reduced-motion: reduce){ .online-dot{ animation:none; } }
      .g-online{ display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:800; opacity:.9; white-space:nowrap; }
      .g-online .online-dot{ width:8px; height:8px; }

      /* talk bar + flowing ticker (top of the site, under the top bar) */
      .talkbar{ max-width:1060px; margin:0 auto; padding:0 16px 8px; }
      .talk-form{ display:flex; gap:8px; align-items:center; }
      .talk-label{ font-weight:900; font-size:13.5px; white-space:nowrap; display:inline-flex; align-items:center; gap:5px; }
      .talk-form input{
        flex:1 1 auto; min-width:0; border:2px solid var(--panel-line); border-radius:999px;
        padding:8px 14px; font-size:14.5px; background:var(--panel); color:var(--ink); font-family:inherit; min-height:40px;
      }
      .talk-send{
        border:none; border-radius:999px; padding:8px 18px; font-size:14px; font-weight:900; cursor:pointer;
        background:var(--accent-grad); color:var(--accent-ink); box-shadow:var(--glow); min-height:40px; white-space:nowrap; flex:none;
      }
      .talk-send:disabled{ opacity:.45; cursor:not-allowed; }
      .talk-msg{ font-size:12px; color:var(--bad); margin:4px 2px 0; min-height:1.2em; }
      .talk-msg:empty{ margin:0; min-height:0; }
      /* ticker: no band, no background — the words alone flow over
         the page. The layer covers the whole screen (fixed, taps
         pass through) and each message appears at a random height,
         so words drift in from anywhere between the top and the
         bottom of the screen instead of running in one fixed strip. */
      .ticker{ position:fixed; inset:0; z-index:45; pointer-events:none; overflow:hidden; background:transparent; }
      /* One message at a time flows right to left exactly once (the
         motion itself is driven from JS so it can be queued and
         stopped). Nothing loops and nothing replays. */
      .ticker-track{ position:absolute; inset:0; }
      .ticker-item{ font-size:20px; font-weight:800; color:var(--ink); display:inline-flex; align-items:center; gap:6px; white-space:nowrap; text-shadow:0 0 6px var(--bg), 0 0 3px var(--bg); }
      .ticker-item .t-name{ color:var(--accent-text); font-weight:900; }
      .ticker-single{ position:absolute; left:0; will-change:transform; }
      /* the rare centre-stage draw (1 in 500): a little larger so
         the spin in the middle of the screen reads as an event */
      .ticker-special{ font-size:23px; }
      /* the 1-in-100 huge draw: the same right-to-left flow, but in
         a much bigger size so the words fill the screen */
      .ticker-huge{ font-size:52px; }
      /* On the game screen (from the moment a game is opened until
         returning to the title screen) the ticker stops and the talk
         form is hidden, so nothing distracts from the match. The
         online count stays visible. Both come back on the title
         screen, where body.in-game is removed. */
      body.in-game .ticker, body.in-game .talkbar{ display:none; }
      /* Language switching lives on the title (game-select) screen
         only: once a game or the drawing board is open, the language
         buttons and label leave the top bar. The language chosen on
         the title screen still applies to every screen — applyLang
         is global — there is just no switcher outside the title.
         The profile button next to them is not a language control
         and stays. */
      body.in-game .lang-label, body.in-game .lang-btn[data-lang],
      body.in-draw .lang-label, body.in-draw .lang-btn[data-lang]{ display:none; }
      .langbox{ margin-inline-start:auto; display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
      .lang-label{ font-size:12px; font-weight:700; color:var(--ink-soft); display:flex; align-items:center; gap:4px; }
      .lang-btn{
        border:1.5px solid var(--panel-line); background:var(--panel); color:var(--ink);
        border-radius:999px; padding:4px 12px; font-size:13px; font-weight:700; cursor:pointer; min-height:36px;
      }
      .lang-btn[aria-pressed="true"]{ background:var(--accent-grad); border-color:transparent; color:var(--accent-ink); }

      /* Phones: keep the whole top area compact so the online count,
         the talk form and the ticker are all visible at a glance —
         brand + online pill share the first row, the profile/language
         buttons sit on one row below, and nothing wraps into a tall
         stack that pushes the new features off the first screen. */
      @media (max-width:640px){
        .topbar-in{ padding:6px 10px; gap:6px 8px; }
        .brand{ font-size:25px; }
        .online-box{ font-size:12px; padding:2px 10px; min-height:32px; margin-inline-start:auto; }
        .langbox{ flex-basis:100%; margin-inline-start:0; justify-content:flex-start; gap:5px; }
        .lang-label{ font-size:11px; }
        .lang-btn{ padding:3px 10px; font-size:12.5px; min-height:32px; }
        .talkbar{ padding:0 10px 6px; }
        .talk-label{ font-size:12.5px; }
        .talk-form input{ font-size:16px; min-height:38px; padding:7px 12px; }
        .talk-send{ min-height:38px; padding:7px 14px; font-size:13.5px; }
        .ticker-item{ font-size:18px; }
        .ticker-special{ font-size:20px; }
        .ticker-huge{ font-size:42px; }
      }

      /* featured game (Chess) */
      .feature{
        margin-top:22px; background:var(--panel); border:1px solid var(--panel-line); border-radius:20px;
        box-shadow:var(--shadow), 0 0 46px rgba(124,102,221,.13); overflow:hidden; display:grid; grid-template-columns:1fr; }
      @media (min-width:760px){ .feature{ grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr); } }
      .feature-txt{ padding:26px 26px 22px; }
      .feature-tag{ display:inline-block; background:var(--accent-soft); color:var(--accent-text); font-weight:900; font-size:12px; padding:3px 10px; border-radius:6px; letter-spacing:.06em; }
      .feature h1{ font-size:clamp(30px,6vw,44px); line-height:1.15; margin:12px 0 8px; font-weight:900;
        background:linear-gradient(92deg,#b3a5f5 0%,var(--pink) 55%,#7fd4e2 110%);
        -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent; color:transparent; }
      .feature p{ color:var(--ink-soft); margin:0 0 18px; font-size:15px; }
      .cta-row{ display:flex; flex-wrap:wrap; gap:10px; }
      .btn{
        border:none; border-radius:12px; padding:10px 20px; font-size:15px; font-weight:900; cursor:pointer;
        min-height:48px; display:inline-flex; align-items:center; gap:8px; text-decoration:none;
      }
      .btn-main{ background:var(--accent-grad); color:var(--accent-ink); box-shadow:var(--glow); }
      .btn-main:hover{ filter:brightness(1.08); }
      .btn-sub{ background:transparent; color:var(--ink); border:2px solid var(--panel-line); }
      .btn:disabled{ opacity:.45; cursor:not-allowed; }
      .feature-board{ padding:22px; display:flex; align-items:center; justify-content:center; background:
        repeating-conic-gradient(rgba(255,255,255,.045) 0% 25%, transparent 0% 50%) 0 0/28px 28px; }
      .mini-board{ display:grid; grid-template-columns:repeat(8,1fr); grid-template-rows:repeat(8,1fr); width:min(320px,78vw); aspect-ratio:1; border-radius:10px; overflow:hidden; border:3px solid var(--board-line); box-shadow:var(--shadow); }
      .mini-board i{ display:flex; align-items:center; justify-content:center; font-style:normal; font-size:clamp(15px,4.4vw,24px); line-height:1; }
      .mini-board .l{ background:var(--sq-light); } .mini-board .d{ background:var(--sq-dark); }
      /* Pieces in the standard look: plain white with a dark
         outline, plain black with a faint light edge — no tint. */
      .pw{ color:#ffffff; text-shadow:0 0 3px #202020,0 0 3px #202020,1px 1px 0 #202020; }
      .pb{ color:#161616; text-shadow:0 0 2px rgba(255,255,255,.55); }

      h2.sec{ font-size:22px; font-weight:900; margin:38px 0 6px; display:flex; align-items:baseline; gap:10px; }
      .sec-note{ color:var(--ink-soft); font-size:13.5px; margin:0 0 16px; }

      /* game select grid */
      .grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
      @media (min-width:700px){ .grid{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
      .game-card{
        min-width:0;
        background:var(--panel); border:1px solid var(--panel-line); border-radius:16px; padding:18px 14px 14px;
        text-align:center; position:relative; display:flex; flex-direction:column; align-items:center; gap:2px;
        transition:border-color .2s ease, box-shadow .2s ease;
      }
      .game-card:hover{ border-color:#5a4f96; box-shadow:0 8px 26px rgba(124,102,221,.22); }
      .game-card.playable{ cursor:pointer; }
      .game-card .gicon{
        width:76px; height:76px; border-radius:14px; margin-bottom:10px; position:relative; overflow:hidden;
        border:2px solid var(--board-line); display:grid; grid-template-columns:repeat(4,1fr); grid-template-rows:repeat(4,1fr);
      }
      .gicon i{ font-style:normal; }
      .gicon .l{ background:var(--sq-light); } .gicon .d{ background:var(--sq-dark); }
      .gicon .piece{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:38px; }
      .gicon.plain{ display:flex; align-items:center; justify-content:center; background:var(--accent-soft); font-size:36px; }
      .game-card h3{ margin:0; font-size:16.5px; font-weight:900; }
      .game-card .origin{ color:var(--ink-soft); font-size:12px; margin:0; }
      .badge{ font-size:11px; font-weight:900; padding:2px 9px; border-radius:999px; margin-top:8px; }
      .badge-now{ background:var(--good); color:#fff; }
      .badge-soon{ background:var(--accent-soft); color:var(--accent-text); }
      .wait-line{ font-size:12px; font-weight:800; color:var(--ink-soft); margin:7px 0 0; text-align:center; }
      .game-card .play-link{ margin-top:10px; font-weight:900; color:var(--accent-text); text-decoration:none; padding:8px 10px; min-height:36px; display:inline-flex; align-items:center; background:none; border:none; cursor:pointer; font-family:inherit; font-size:15px; }

      /* play panel */
      .panel{ background:var(--panel); border:1px solid var(--panel-line); border-radius:20px; box-shadow:var(--shadow); padding:20px; margin-top:14px; }
      .mode-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
      .mode-tab{ border:2px solid var(--panel-line); background:transparent; color:var(--ink); border-radius:999px; padding:8px 18px; font-weight:900; font-size:14.5px; cursor:pointer; min-height:44px; }
      .mode-tab[aria-selected="true"]{ background:var(--accent-grad); color:#fff; border-color:transparent; box-shadow:var(--glow); }
      .play-flex{ display:grid; grid-template-columns:1fr; gap:20px; }
      @media (min-width:820px){ .play-flex{ grid-template-columns:auto 1fr; } }
      .board-wrap{ position:relative; width:min(440px,92vw); margin:0 auto; container-type:inline-size; }
      .board{
        display:grid; grid-template-columns:repeat(8,1fr); grid-template-rows:repeat(8,1fr); gap:0; width:100%; aspect-ratio:1;
        border:4px solid #6e5133; border-radius:8px; overflow:hidden; touch-action:manipulation; user-select:none; -webkit-user-select:none;
        box-shadow:0 10px 28px rgba(0,0,0,.45);
      }
      .sq{ position:relative; display:flex; align-items:center; justify-content:center; font-size:clamp(24px,7.2vw,42px); font-size:11cqw; line-height:1; cursor:pointer; border:none; padding:0; min-height:0; font-family:inherit; }
      .sq.l{ background:var(--sq-light); } .sq.d{ background:var(--sq-dark); }
      .sq.sel{ box-shadow:inset 0 0 0 4px var(--cyan), inset 0 0 18px rgba(86,195,212,.35); }
      .sq.hint::after{ content:""; position:absolute; width:26%; height:26%; border-radius:50%; background:rgba(24,18,48,.42); }
      .sq.cap-hint::after{ content:""; position:absolute; inset:6%; border-radius:50%; border:4px solid rgba(224,122,104,.75); background:transparent; width:auto; height:auto; }
      .sq.cool{ opacity:.45; }
      .sq .glyph{ pointer-events:none; }
      .overlay{
        position:absolute; inset:0; display:none; align-items:center; justify-content:center; flex-direction:column; gap:8px;
        background:rgba(10,8,22,.78); color:#f2efff; border-radius:8px; text-align:center; padding:16px; z-index:5;
      }
      .overlay.show{ display:flex; }
      .overlay .big{ font-size:clamp(44px,12vw,76px); font-weight:900; line-height:1; }
      .overlay .mid{ font-size:20px; font-weight:900; }
      .overlay .small{ font-size:13.5px; opacity:.85; }
      .side h3{ margin:2px 0 10px; font-size:17px; font-weight:900; }
      .side label{ font-size:13px; font-weight:700; color:var(--ink-soft); display:block; margin:12px 0 6px; }
      .seg{ display:flex; gap:6px; flex-wrap:wrap; }
      .seg button{ border:2px solid var(--panel-line); background:transparent; color:var(--ink); border-radius:10px; padding:8px 14px; font-weight:800; font-size:14px; cursor:pointer; min-height:44px; }
      .seg button[aria-pressed="true"]{ background:var(--accent-grad); border-color:transparent; color:var(--accent-ink); box-shadow:var(--glow); }
      .status-line{ font-size:15px; font-weight:800; min-height:1.6em; margin:6px 0; }
      .captured{ font-size:22px; letter-spacing:2px; min-height:30px; }
      .cap-label{ font-size:12px; color:var(--ink-soft); font-weight:700; }
      .room-row{ display:flex; gap:8px; flex-wrap:wrap; align-items:stretch; }
      .room-row input{
        flex:1 1 150px; border:2px solid var(--panel-line); border-radius:10px; padding:10px 12px; font-size:17px;
        background:var(--bg); color:var(--ink); text-transform:uppercase; letter-spacing:.14em; font-weight:800; min-height:48px;
      }
      .code-big{ font-size:30px; font-weight:900; letter-spacing:.22em; background:var(--accent-soft); color:#c0b2f7; border-radius:12px; padding:8px 18px; display:inline-block; margin:6px 0; box-shadow:0 0 18px rgba(124,102,221,.25); }
      .note{ font-size:13px; color:var(--ink-soft); }
      .hidden{ display:none !important; }
      .spinner{ width:38px; height:38px; border-radius:50%; border:5px solid var(--accent-soft); border-top-color:var(--accent); animation:spin 0.9s linear infinite; margin:6px auto; }
      @keyframes spin{ to{ transform:rotate(360deg); } }
      @media (prefers-reduced-motion: reduce){ .spinner{ animation-duration:2.4s; } html{ scroll-behavior:auto; } }

      /* ranking */
      .rank-tabs{ display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
      table.rank{ width:100%; border-collapse:collapse; font-size:14.5px; }
      table.rank th, table.rank td{ padding:9px 8px; text-align:start; border-bottom:1px solid var(--panel-line); }
      table.rank th{ font-size:12px; color:var(--ink-soft); letter-spacing:.05em; }
      table.rank td.pos{ font-weight:900; width:44px; }
      .rank-empty{ padding:26px 10px; text-align:center; color:var(--ink-soft); font-size:14.5px; }

      .rules p{ margin:0 0 10px; font-size:14.5px; }
      .rules b{ color:var(--accent-text); }
      footer{ margin-top:44px; border-top:1px solid var(--panel-line); padding-top:18px; color:var(--ink-soft); font-size:13px; }
      .ad-slot{
        margin-top:28px; border:1.5px dashed var(--panel-line); border-radius:12px; min-height:96px;
        display:flex; align-items:center; justify-content:center; color:var(--ink-soft); font-size:12px; letter-spacing:.2em;
      }
      /* ---- dedicated game screen ---- */
      .game-screen{ display:none; max-width:600px; margin:0 auto; }
      body.in-game .game-screen{ display:block; }
      body.in-game .wrap > *:not(.game-screen){ display:none; }
      /* While setting up (before the countdown) the game screen is a
         normal in-flow section and the page scrolls freely, so every
         control stays reachable and the board keeps its natural size.
         The fixed, locked-to-viewport layout below applies only while
         a game is actually running (body.locked, set by setPlaying). */
      body.locked{ overflow:hidden; overscroll-behavior:none; }
      body.locked .game-screen{
        display:flex; flex-direction:column;
        position:fixed; inset:0; z-index:60;
        width:100%; max-width:600px; height:100vh; height:100dvh; margin:0 auto;
        padding:calc(10px + env(safe-area-inset-top)) 14px calc(10px + env(safe-area-inset-bottom));
        background:linear-gradient(180deg,var(--bg) 0%,var(--bg2) 100%);
        overflow:hidden; touch-action:none; overscroll-behavior:none;
      }
      .game-screen .g-head{ margin-top:0; flex:none; }
      .game-screen .g-info{ flex:none; }
      .game-screen .cap-strip{ flex:none; }
      .game-screen{ --bs:min(440px,92vw); }
      .game-screen .board-wrap{
        flex:1 1 auto; min-height:0; width:100%; margin-top:10px;
        display:flex; align-items:center; justify-content:center;
      }
      .game-screen .board{ width:var(--bs); height:var(--bs); flex:none; }
      /* while a game is running: hide the setup panel and the info bar so
         the board gets all the remaining height (size is set by fitBoard) */
      .game-screen.playing .g-controls{ display:none; }
      .game-screen.playing .g-info{ display:none; }
      .game-screen .sq{ font-size:calc(var(--bs) * .115); }
      .game-screen .overlay{ inset:0; margin:auto; width:var(--bs); height:var(--bs); }
      .game-screen #gameStatus{ flex:none; }
      .game-screen .g-controls{ flex:none; margin-top:10px; }
      .game-screen .g-actions{ flex:none; }
      @media (max-height:720px){
        .game-screen .g-head{ padding:10px 14px; }
        .game-screen .g-info{ margin-top:8px; }
        .game-screen .cap-strip{ min-height:44px; margin-top:8px; }
        .game-screen .cap-pieces{ font-size:22px; }
        .game-screen .board-wrap{ margin-top:8px; }
        .game-screen #gameStatus{ margin-top:8px; }
        .game-screen .g-controls{ padding:12px; margin-top:8px; }
        .game-screen .mode-tabs{ margin-bottom:8px; }
        .game-screen .mode-tab{ min-height:38px; }
        .game-screen .seg button{ min-height:38px; }
        .game-screen .g-actions{ margin-top:10px; }
        .game-screen .ga-btn{ min-height:52px; }
      }
      .g-head{ margin-top:16px; background:var(--accent-grad); color:var(--accent-ink); border-radius:16px; padding:16px 18px; display:flex; align-items:center; gap:12px; box-shadow:var(--shadow), var(--glow); }
      .g-title{ font-size:clamp(24px,6vw,32px); font-weight:900; letter-spacing:.03em; line-height:1.2; }
      .g-chip{ margin-inline-start:auto; background:var(--panel); color:var(--ink); font-weight:900; font-size:13px; padding:6px 14px; border-radius:8px; white-space:nowrap; }
      .g-back-top{ border:none; cursor:pointer; font-family:inherit; flex:none; min-height:36px; }
      .g-info{ margin-top:10px; background:#262040; color:var(--ink); border:1px solid var(--panel-line); border-radius:12px; padding:10px 16px; display:flex; align-items:center; gap:10px; font-weight:900; font-size:14.5px; }
      .g-info-note{ margin-inline-start:auto; font-size:12px; opacity:.75; font-weight:700; white-space:nowrap; }
      .cap-strip{ display:flex; align-items:center; gap:12px; background:var(--panel); border:1px solid var(--panel-line); border-radius:12px; padding:8px 14px; min-height:54px; margin-top:12px; }
      .cap-strip.rival{ background:color-mix(in srgb, var(--bad) 9%, var(--panel)); }
      .cap-tag{ writing-mode:vertical-rl; font-size:11px; font-weight:900; letter-spacing:.25em; color:var(--ink-soft); }
      .cap-pieces{ font-size:26px; line-height:1.25; letter-spacing:2px; display:flex; flex-wrap:wrap; align-items:center; }
      .cap-none{ font-size:13.5px; color:var(--ink-soft); letter-spacing:0; }
      .game-screen .board-wrap{ margin-top:12px; }
      #gameStatus{ margin:12px 2px 0; }
      .g-controls{ margin-top:12px; }
      .g-controls h3{ margin:2px 0 10px; font-size:17px; font-weight:900; }
      .g-controls label{ font-size:13px; font-weight:700; color:var(--ink-soft); display:block; margin:12px 0 6px; }
      .g-actions{ display:grid; grid-template-columns:1fr 1fr; margin-top:14px; border:1px solid var(--panel-line); border-radius:14px; overflow:hidden; background:var(--panel); box-shadow:var(--shadow); }
      .ga-btn{ border:none; background:transparent; color:var(--ink); font-family:inherit; font-weight:900; font-size:14px; padding:10px 6px; cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-height:62px; }
      .ga-btn .ga-ic{ font-size:19px; line-height:1.1; }
      .ga-resign{ background:var(--bad); color:#fff; }
      .ga-btn + .ga-btn{ border-inline-start:1px solid var(--panel-line); }

      /* ---- big center countdown ---- */
      .count-overlay{ position:fixed; inset:0; z-index:80; display:none; align-items:center; justify-content:center; background:rgba(8,6,16,.55); }
      .count-overlay.show{ display:flex; }
      .count-num{ font-size:clamp(96px,30vw,190px); font-weight:900; color:#fff; text-shadow:0 0 22px rgba(154,95,192,.75), 0 0 64px rgba(124,102,221,.5), 0 6px 30px rgba(0,0,0,.45); line-height:1; }

      /* ---- comments ---- */
      .comment-form{ display:flex; flex-direction:column; gap:8px; margin:14px 0 6px; }
      .comment-form input, .comment-form textarea{
        border:2px solid var(--panel-line); border-radius:10px; padding:10px 12px; font-size:15px;
        background:var(--bg); color:var(--ink); font-family:inherit; width:100%;
      }
      .comment-form .btn{ align-self:flex-start; }
      .comment{ border-top:1px solid var(--panel-line); padding:12px 2px; }
      .c-head{ display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }
      .c-name{ font-weight:900; }
      .c-time{ font-size:12px; color:var(--ink-soft); }
      .c-body{ margin:4px 0 0; font-size:14.5px; white-space:pre-wrap; word-break:break-word; }

      /* ---- reversi board: the classic look — green board,
         plain black and white discs, off the neon theme ---- */
      .board.rev{ background:#0a7a34; border-color:#6e5133; }
      .board.rev .sq{ background:transparent; box-shadow:inset 0 0 0 1px rgba(0,0,0,.38); }
      .board.rev .sq.hint::after{ background:rgba(255,255,255,.42); width:22%; height:22%; }
      .board.rev .sq.last{ box-shadow:inset 0 0 0 3px rgba(255,214,64,.9); }
      .board.rev .disc{ width:84%; height:84%; border-radius:50%; pointer-events:none; box-shadow:0 2px 4px rgba(0,0,0,.45); display:block; }
      .board.rev .disc.b{ background:radial-gradient(circle at 35% 30%, #5a5a5a, #060606 72%); }
      .board.rev .disc.w{ background:radial-gradient(circle at 35% 30%, #ffffff, #e8e8e8 78%); }
      .gicon.rev{ background:#0a7a34; display:flex; align-items:center; justify-content:center; gap:3px; font-size:25px; border-color:var(--board-line); }
      .badge-feat{ background:var(--accent); color:var(--accent-ink); }

      /* ---- shogi board: light wood and classic wedge pieces,
         off the neon theme like the chess board ---- */
      .board.shogi{ grid-template-columns:repeat(9,1fr); grid-template-rows:repeat(9,1fr); background:#e9c883; border-color:#7d5f2e; }
      .board.shogi .sq{ background:transparent; box-shadow:inset 0 0 0 1px rgba(96,64,20,.5); font-size:clamp(13px,4vw,24px); }
      .board.shogi .sq.sel{ box-shadow:inset 0 0 0 3px var(--cyan), inset 0 0 14px rgba(86,195,212,.35); }
      .board.shogi .sq.hint::after{ background:rgba(60,35,5,.42); }
      .spc{
        display:flex; align-items:center; justify-content:center; pointer-events:none;
        width:86%; height:94%; line-height:1; font-weight:700; color:#2b1d07;
        background:linear-gradient(180deg,#faecc0 0%,#f3d894 78%,#eac87c 100%);
        clip-path:polygon(50% 0%, 87% 20%, 97% 100%, 3% 100%, 13% 20%);
      }
      .spc.gote{ transform:rotate(180deg); }
      .spc.pr{ color:#b3352b; }
      .spc.two{ font-size:.58em; letter-spacing:-.04em; }
      .game-screen .board.shogi .sq{ font-size:calc(var(--bs) * .078); }
      .gicon.shogi{ background:#e9c883; display:flex; align-items:center; justify-content:center; }
      .gicon.shogi .spc{ width:54%; height:74%; font-size:30px; }
      .hand-piece{
        border:1.5px solid #a97f3c; background:linear-gradient(180deg,#faecc0,#f0d48c); color:#2b1d07;
        border-radius:6px; padding:3px 9px; font-size:16px; font-weight:900; font-family:inherit;
        min-height:34px; margin:2px 3px 2px 0; display:inline-flex; align-items:center; text-shadow:none;
      }
      button.hand-piece{ cursor:pointer; }
      .hand-piece.sel{ outline:3px solid var(--cyan); outline-offset:1px; }

      /* ---- drawing chat (one shared huge public canvas, fullscreen) ---- */
      .draw-screen{ display:none; }
      body.in-draw{ overflow:hidden; overscroll-behavior:none; }
      body.in-draw .draw-screen{
        display:block; position:fixed; inset:0; z-index:60; max-width:none; margin:0;
        background:var(--bg2); overflow:hidden;
      }
      body.in-draw .wrap > *:not(.draw-screen){ display:none; }
      body.in-draw .ticker, body.in-draw .talkbar{ display:none; }
      body.in-draw .game-screen{ display:none !important; }
      .draw-viewport{
        position:absolute; inset:0; overflow:hidden;
        background:
          radial-gradient(720px 520px at 18% 0%, rgba(124,102,221,.13), transparent 62%),
          radial-gradient(680px 520px at 88% 100%, rgba(86,195,212,.08), transparent 62%),
          var(--bg2);
        touch-action:none; user-select:none; -webkit-user-select:none; cursor:crosshair;
      }
      .draw-viewport.panning{ cursor:grabbing; }
      #drawCanvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }
      .draw-topbar{
        position:absolute; top:0; left:0; right:0; z-index:6;
        display:flex; align-items:center; gap:10px;
        padding:calc(7px + env(safe-area-inset-top)) 10px 7px;
        background:var(--accent-grad); color:var(--accent-ink); box-shadow:var(--shadow), var(--glow);
      }
      .draw-topbar .g-title{ font-size:19px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      .draw-icon-btn{
        flex:none; width:42px; height:42px; min-height:42px; border-radius:10px; border:none;
        background:var(--panel); color:var(--ink); font-size:19px; line-height:1; cursor:pointer;
        display:flex; align-items:center; justify-content:center; padding:0;
      }
      .draw-back-top{ width:auto; padding:0 12px; gap:6px; font-size:13px; font-weight:900; font-family:inherit; }
      .draw-flow{ position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:4; }
      .draw-icon-btn[aria-pressed="true"]{ background:var(--ink); color:var(--bg); }
      .draw-topinfo{
        position:absolute; z-index:5; left:10px; right:10px;
        top:calc(64px + env(safe-area-inset-top)); pointer-events:none;
      }
      #drawOff{
        margin:8px 0 0; background:var(--panel); color:var(--bad);
        border:1.5px solid var(--bad); border-radius:8px; padding:5px 10px; font-weight:700;
      }
      .draw-dock{
        position:absolute; left:0; right:0; bottom:0; z-index:6;
        background:var(--panel); border-top:1.5px solid var(--panel-line);
        padding:8px 10px calc(8px + env(safe-area-inset-bottom));
        max-height:48dvh; overflow-y:auto;
      }
      .draw-tools{ display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; margin:0 0 8px; }
      .draw-tools .seg button[aria-pressed="true"]{ background:var(--accent-grad); border-color:transparent; color:var(--accent-ink); }
      .draw-colors{ display:flex; gap:7px; flex-wrap:wrap; align-items:center; }
      .draw-color{ width:34px; height:34px; min-height:34px; border-radius:50%; border:2.5px solid var(--panel-line); cursor:pointer; padding:0; flex:none; }
      .draw-color[aria-pressed="true"]{ border-color:var(--ink); box-shadow:0 0 0 2.5px var(--accent); }
      .draw-actions{ display:flex; flex-wrap:wrap; gap:7px; margin:0; }
      .draw-actions .btn{ min-height:42px; padding:7px 12px; font-size:13.5px; }
      .draw-clear-all{ color:var(--bad); border-color:var(--bad); font-weight:900; }
      .draw-people{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
      .draw-person{ font-size:12.5px; font-weight:800; background:var(--accent-soft); color:var(--ink); border-radius:999px; padding:3px 11px; }
      .draw-chat{
        display:none; position:absolute; z-index:7; margin:0;
        top:calc(64px + env(safe-area-inset-top)); inset-inline-end:10px;
        width:min(330px,88vw); max-height:min(58dvh,480px); overflow-y:auto;
        box-shadow:var(--shadow);
      }
      .draw-chat.open{ display:block; }
      .draw-chat h3{ margin:0 0 8px; font-size:15.5px; font-weight:900; }
      #drawChatList{ max-height:190px; overflow-y:auto; display:flex; flex-direction:column; gap:5px; margin-bottom:10px; }
      .draw-chat-msg{ font-size:14px; word-break:break-word; }
      .draw-chat-msg .dc-name{ font-weight:900; color:var(--accent-text); margin-inline-end:6px; }
      .draw-chat-empty{ font-size:13.5px; color:var(--ink-soft); }
      .draw-chat-form{ display:flex; gap:8px; }
      .draw-chat-form input{
        flex:1 1 auto; min-width:0; border:2px solid var(--panel-line); border-radius:10px;
        padding:9px 12px; font-size:15px; background:var(--bg); color:var(--ink); font-family:inherit; min-height:44px;
      }
      .cap-name{ font-size:13px; font-weight:900; letter-spacing:0; color:var(--ink); text-shadow:none; margin-inline-end:8px; white-space:nowrap; }
      .cap-pieces .cnt{ font-size:19px; font-weight:900; letter-spacing:0; color:var(--ink); text-shadow:none; }

      /* ---- profile modal ---- */
      .modal-back{ position:fixed; inset:0; z-index:90; background:rgba(8,6,16,.62); display:flex; align-items:center; justify-content:center; padding:20px; }
      .modal-card{ background:var(--panel); color:var(--ink); border:1px solid var(--panel-line); border-radius:16px; padding:22px; width:min(420px,100%); box-shadow:var(--shadow); }
      .modal-card h3{ margin:0 0 14px; font-size:18px; font-weight:900; }
      .modal-card label{ font-size:13px; font-weight:700; color:var(--ink-soft); display:block; margin:0 0 6px; }
      .modal-card input{ width:100%; border:2px solid var(--panel-line); border-radius:10px; padding:10px 12px; font-size:16px; background:var(--bg); color:var(--ink); font-family:inherit; }
      .modal-row{ display:flex; gap:8px; margin-top:16px; justify-content:flex-end; }

      /* ---- rules (button in the setup panel + modal) ---- */
      .rules-open-btn{ width:100%; justify-content:center; margin-top:16px; }
      .rules-card{ width:min(520px,100%); max-height:85dvh; overflow-y:auto; }
      .rules-card .rules p:last-child{ margin-bottom:0; }

      [dir="rtl"] .code-big, [dir="rtl"] .room-row input{ direction:ltr; }

      :focus-visible{ outline:2px solid var(--cyan); outline-offset:2px; }

      /* ============================================================
         App shell (bottom tab bar + posts / rooms / DM / profile)
         Calm slate gray, moss green and deep navy. No gold.
         ============================================================ */
      :root{
        --a-line:#3d4a5c; --a-soft:#aeb9c6; --a-green:#57b06a; --a-green-deep:#2e4634;
        --a-navy:#22304a; --a-panel:rgba(19,26,36,.92); --a-panel-solid:#1b2431;
        --a-paper:#8d7c5c; --a-paper-ink:#1d1912;
      }
      body{ padding-bottom:calc(78px + env(safe-area-inset-bottom)); }
      body:not([data-tab="games"]) .topbar,
      body:not([data-tab="games"]) .ticker{ display:none; }

      /* ---- bottom tab bar ---- */
      .tabbar{
        position:fixed; left:0; right:0; bottom:0; z-index:55;
        display:flex; align-items:stretch;
        background:rgba(15,20,28,.98); border-top:1.5px solid var(--a-line);
        padding-bottom:env(safe-area-inset-bottom);
        /* its own compositor layer, so scrolling or switching
           screens can never nudge it off the bottom edge */
        transform:translate3d(0,0,0); -webkit-transform:translate3d(0,0,0);
        will-change:transform; backface-visibility:hidden; -webkit-backface-visibility:hidden;
      }
      .tabbar button{
        flex:1 1 0; min-width:0; overflow:hidden; background:none; border:none; cursor:pointer; font-family:inherit;
        color:var(--a-soft); font-size:16px; font-weight:800; letter-spacing:-.01em;
        display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
        padding:8px 0 9px; min-height:66px; white-space:nowrap;
      }
      .tabbar button svg{ width:30px; height:30px; flex:none; }
      .tabbar button[data-tab-btn="posts"]{ flex-grow:.9; }
      .tabbar button[data-tab-btn="games"]{ flex-grow:.95; }
      .tabbar button[data-tab-btn="rooms"]{ flex-grow:1.2; }
      .tabbar button[data-tab-btn="dm"]{ flex-grow:.75; }
      .tabbar button[data-tab-btn="profile"]{ flex-grow:1.3; }
      .tabbar button[aria-selected="true"]{ color:#ffffff; }
      .tabbar button[aria-selected="true"] svg{ color:var(--a-green); }
      .tabbar button[aria-selected="true"] .tab-dm-seal{ fill:#c0554d; }
      .tabbar button span{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
      @media (max-width:420px){ .tabbar button{ font-size:15px; } }
      @media (max-width:350px){ .tabbar button{ font-size:14px; } }

      /* ---- tab views ---- */
      [data-view]{ display:none; }
      [data-view].active{ display:block; }
      .viewfix{
        position:fixed; inset:0; z-index:40; display:none;
        background:#10151d center/cover no-repeat;
      }
      .viewfix.active{ display:block; }
      .viewfix::before{ content:""; position:absolute; inset:0; background:rgba(9,13,19,.42); }
      .view-scroll{ position:relative; z-index:1; height:100%; overflow-y:auto; overscroll-behavior:contain; padding-bottom:calc(92px + env(safe-area-inset-bottom)); }
      .view-head{
        position:sticky; top:0; z-index:5; padding:calc(10px + env(safe-area-inset-top)) 14px 10px;
        background:rgba(13,18,26,.88); backdrop-filter:blur(6px); border-bottom:1px solid rgba(255,255,255,.08);
      }
      .avatar{ display:inline-flex; border-radius:50%; overflow:hidden; flex:none; align-items:center; justify-content:center; }
      .avatar svg{ display:block; }

      /* ---- posts (wooden bulletin board, paper notes) ---- */
      .posts-tabs{ position:relative; display:flex; max-width:640px; margin:0 auto; }
      .posts-tabs button{
        flex:1; background:none; border:none; cursor:pointer; font-family:inherit;
        font-size:19px; font-weight:900; color:var(--a-soft); padding:8px 0 12px; min-height:48px;
      }
      .posts-tabs button[aria-selected="true"]{ color:#fff; }
      .posts-ind{
        position:absolute; bottom:0; left:0; width:50%; height:3.5px; border-radius:3px;
        background:var(--a-green); transition:transform .28s ease;
      }
      .posts-viewport{ overflow:hidden; max-width:668px; margin:0 auto; touch-action:pan-y; }
      .posts-track{ display:flex; transition:transform .3s ease; align-items:flex-start; will-change:transform; }
      .posts-track.dragging{ transition:none; }
      .posts-panel{ flex:0 0 100%; min-width:0; padding:4px 14px 10px; }
      .paper{
        margin:16px auto; width:100%; box-sizing:border-box;
        background:var(--a-paper); color:var(--a-paper-ink);
        border-radius:5px; padding:20px 18px 13px; position:relative;
        box-shadow:0 8px 18px rgba(0,0,0,.5);
        transform:none; cursor:pointer;
      }
      .paper.pc-static{ cursor:default; }
      /* all post papers sit straight, identical width, centered — no tilt, no offset */
      #profPosts .paper, #upPosts .paper{ margin:14px auto; }
      .paper::before{
        content:""; position:absolute; top:-9px; left:50%; margin-left:-9px; width:18px; height:18px; border-radius:50%;
        background:radial-gradient(circle at 35% 32%, #c8d4e2, #5d7186 70%, #42536a);
        box-shadow:0 2px 4px rgba(0,0,0,.45);
      }
      .paper-head{ display:flex; align-items:center; gap:11px; }
      .paper-head .avatar{ width:48px; height:48px; }
      .paper-name{ font-size:16.5px; font-weight:900; line-height:1.25; }
      .paper-time{ font-size:12.5px; color:#3a3222; }
      .paper-body{ font-size:16.5px; line-height:1.65; margin:10px 0 6px; white-space:pre-wrap; word-break:break-word; }
      .paper-foot{ display:flex; gap:22px; border-top:1px solid #77694a; padding-top:9px; margin-top:8px; }
      .paper-act{
        background:none; border:none; cursor:pointer; font-family:inherit; color:#2e291d;
        font-size:15px; font-weight:800; display:inline-flex; align-items:center; gap:6px; padding:2px 4px; min-height:36px;
      }
      .paper-act svg{ width:21px; height:21px; }
      .paper-act.liked{ color:#173d20; }
      .paper-act.liked svg{ fill:#173d20; }
      .paper-replies{ margin-top:4px; }
      .paper-comment{ font-size:14.5px; color:#2b2517; border-top:1px dashed #77694a; padding:7px 2px 1px; word-break:break-word; }
      .paper-comment b{ color:#17130c; }
      .paper-reply{ display:flex; gap:8px; margin-top:10px; }
      .paper-reply input{
        flex:1; min-width:0; border:2px solid #6f6042; border-radius:9px; background:#cbbb96; color:#1d1912;
        font-family:inherit; font-size:15px; padding:8px 11px; min-height:42px;
      }
      .paper-reply-send{
        border:none; border-radius:9px; background:#476b4f; color:#fff; font-family:inherit;
        font-size:14.5px; font-weight:900; padding:8px 16px; cursor:pointer; min-height:42px; flex:none;
      }
      .fab{
        position:absolute; right:18px; bottom:calc(96px + env(safe-area-inset-bottom)); z-index:6;
        width:58px; height:58px; min-height:58px; border-radius:50%; border:none; cursor:pointer;
        background:var(--a-green); color:#fff; font-size:30px; font-weight:900; line-height:1;
        box-shadow:0 8px 20px rgba(0,0,0,.5); display:flex; align-items:center; justify-content:center;
      }
      .sheet{
        position:absolute; left:0; right:0; bottom:0; z-index:8; display:none;
        background:var(--a-panel-solid); border-top:1.5px solid var(--a-line);
        border-radius:18px 18px 0 0; padding:18px 16px calc(18px + env(safe-area-inset-bottom));
      }
      .sheet.open{ display:block; }
      .sheet h3{ margin:0 0 12px; font-size:17px; font-weight:900; color:#fff; }
      .sheet textarea{
        width:100%; border:2px solid var(--a-line); border-radius:12px; background:#121922; color:#fff;
        font-family:inherit; font-size:16px; padding:11px 12px; resize:vertical;
      }
      .sheet-row{ display:flex; gap:9px; justify-content:flex-end; margin-top:12px; }
      /* the post sheet sits above the fixed tab bar, so its
         buttons (投稿する) are never hidden behind it */
      #postSheet{ padding-bottom:calc(104px + env(safe-area-inset-bottom)); }
      #postSubmit{ font-size:16.5px; padding:10px 30px; }
      .post-attach-row{ margin-top:12px; }
      .post-img-prev{ margin-top:10px; }
      .post-img-prev img{ display:block; width:100%; max-height:230px; object-fit:cover; border-radius:10px; }
      .post-img-remove{
        margin-top:8px; background:none; border:1.5px solid var(--a-line); color:#fff; border-radius:9px;
        font-family:inherit; font-size:13.5px; font-weight:800; padding:7px 13px; cursor:pointer; min-height:38px;
      }
      /* a photo pasted onto a paper post */
      .paper-img{ display:block; width:100%; border-radius:3px; margin:9px 0 3px; box-shadow:0 1px 5px rgba(0,0,0,.35); }
      .a-btn{
        border:none; border-radius:11px; padding:10px 20px; font-size:15px; font-weight:900; cursor:pointer;
        font-family:inherit; min-height:46px; display:inline-flex; align-items:center; gap:7px;
      }
      .a-btn-main{ background:var(--a-green); color:#fff; }
      .a-btn-sub{ background:transparent; color:var(--a-soft); border:2px solid var(--a-line); }
      .a-btn:disabled{ opacity:.45; cursor:not-allowed; }

      /* ---- voice rooms (dungeon corridor) ---- */
      .rooms-title{ font-size:22px; font-weight:900; color:#fff; margin:0; }
      .room-cats{ display:flex; gap:8px; margin-top:10px; overflow-x:auto; scrollbar-width:none; }
      .room-cats::-webkit-scrollbar{ display:none; }
      .room-cats button{
        flex:none; border:1.5px solid var(--a-line); background:rgba(19,26,36,.85); color:var(--a-soft);
        font-family:inherit; font-size:17px; font-weight:800; border-radius:999px; padding:7px 18px; cursor:pointer; min-height:44px;
      }
      .room-cats button[aria-selected="true"]{ background:var(--a-navy); border-color:#54678a; color:#fff; }
      .gacha-banner{
        margin:16px 14px 4px; border-radius:16px; padding:18px; cursor:pointer; border:1px solid #54678a;
        background:linear-gradient(100deg,#22304a 0%,#274435 100%); color:#fff;
        display:flex; align-items:center; gap:14px; max-width:640px;
      }
      @media (min-width:668px){ .gacha-banner{ margin-left:auto; margin-right:auto; } }
      .gacha-banner .gacha-ic{ width:46px; height:46px; flex:none; }
      .gacha-banner b{ font-size:18px; display:block; }
      .gacha-banner span{ font-size:13.5px; color:#cfe0d2; }
      .room-list{ max-width:640px; margin:0 auto; padding:6px 12px 16px; }
      .room-card{
        width:100%; text-align:left; margin-top:5px; background:var(--a-panel); border:1px solid var(--a-line);
        border-radius:16px; padding:16px; cursor:pointer; font-family:inherit; color:var(--ink); display:block;
      }
      .room-card-top{ display:flex; align-items:center; gap:8px; margin-bottom:11px; }
      .room-tag{ background:var(--a-green-deep); color:#bfe6c8; font-size:12.5px; font-weight:900; padding:3px 10px; border-radius:6px; }
      .room-tag.hot{ background:#5a3436; color:#f2c4c0; }
      .room-count{ margin-inline-start:auto; font-size:14px; font-weight:800; color:var(--a-soft); display:inline-flex; align-items:center; gap:5px; }
      .room-card-main{ display:flex; gap:14px; align-items:center; }
      .room-card-main .avatar{ width:66px; height:66px; }
      .room-card-title{ font-size:19.5px; font-weight:900; line-height:1.35; }
      .room-card-host{ font-size:14px; color:var(--a-soft); margin-top:2px; }
      .rooms-viewport{ overflow:hidden; touch-action:pan-y; }
      .rooms-track{ display:flex; align-items:flex-start; transition:transform .3s ease; will-change:transform; }
      .rooms-track.dragging{ transition:none; }
      .rooms-panel{ flex:0 0 100%; min-width:0; }
      .create-room-form{ display:none; margin:14px 12px 0; max-width:640px; background:var(--a-panel); border:1px solid var(--a-line); border-radius:16px; padding:16px; }
      @media (min-width:664px){ .create-room-form{ margin-left:auto; margin-right:auto; } }
      .create-room-form.open{ display:block; }
      .create-room-form input{
        width:100%; border:2px solid var(--a-line); border-radius:11px; background:#121922; color:#fff;
        font-family:inherit; font-size:16px; padding:11px 12px;
      }

      /* ---- room screen ---- */
      .room-screen{
        position:fixed; inset:0; z-index:70; display:none; flex-direction:column;
        background:#0d1420 url("images/rooms.webp") center/cover no-repeat; color:#fff;
      }
      .room-screen.open{ display:flex; }
      .room-screen::before{ content:""; position:absolute; inset:0; background:rgba(8,12,19,.55); pointer-events:none; }
      .room-screen > *{ position:relative; z-index:1; }
      .room-head{ display:flex; align-items:flex-start; gap:10px; padding:calc(10px + env(safe-area-inset-top)) 12px 8px; }
      /* room name: no frame or panel — just the words themselves,
         with a shadow so they stay readable over the background */
      .room-head-txt{ flex:1; min-width:0; background:none; border-radius:0; padding:2px 0 0; }
      .room-head-txt .room-head-title{ text-shadow:0 1px 6px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.8); }
      .room-head-txt .room-head-sub{ text-shadow:0 1px 5px rgba(0,0,0,.9); }
      .room-head-title{ font-size:18px; font-weight:900; line-height:1.3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      .room-head-sub{ font-size:12.5px; color:var(--a-soft); }
      .room-head-btns{ display:flex; gap:8px; flex:none; }
      .round-btn{
        width:44px; height:44px; min-height:44px; border-radius:50%; border:1px solid var(--a-line); cursor:pointer;
        background:rgba(13,19,29,.85); color:#fff; display:flex; align-items:center; justify-content:center; padding:0;
      }
      .round-btn svg{ width:22px; height:22px; }
      .room-menu{
        position:absolute; top:calc(64px + env(safe-area-inset-top)); right:12px; z-index:5; display:none;
        background:var(--a-panel-solid); border:1px solid var(--a-line); border-radius:13px; padding:6px; min-width:210px;
        box-shadow:0 14px 30px rgba(0,0,0,.55);
      }
      .room-menu.open{ display:block; }
      .room-menu button{
        display:block; width:100%; text-align:left; background:none; border:none; cursor:pointer; font-family:inherit;
        color:#fff; font-size:15.5px; font-weight:700; padding:11px 12px; border-radius:9px; min-height:44px;
      }
      .room-menu button:hover{ background:#273242; }
      .room-menu button.hidden{ display:none; }
      .room-notice{
        margin:2px 12px 8px; background:rgba(13,19,29,.82); border:1px solid var(--a-line); border-radius:11px;
        padding:8px 12px; font-size:13.5px; color:#d7dee8; display:flex; gap:8px; align-items:baseline;
      }
      .room-notice b{ color:var(--a-green); flex:none; font-size:12.5px; }
      .room-main{ flex:1; display:flex; min-height:0; }
      .room-seats{ width:76px; flex:none; overflow-y:auto; padding:6px 0 10px; display:flex; flex-direction:column; align-items:center; gap:13px; scrollbar-width:none; }
      .room-seats::-webkit-scrollbar{ display:none; }
      .seat{ display:flex; flex-direction:column; align-items:center; gap:3px; background:none; border:none; cursor:pointer; font-family:inherit; padding:0; min-height:0; }
      .seat .avatar, .seat .seat-empty{
        width:56px; height:56px; border-radius:50%; position:relative;
      }
      .seat .seat-empty{
        border:2px dashed rgba(255,255,255,.4); color:rgba(255,255,255,.65);
        display:flex; align-items:center; justify-content:center; background:rgba(13,19,29,.5);
      }
      .seat .seat-empty svg{ width:24px; height:24px; }
      .seat.speaking .avatar{ box-shadow:0 0 0 3px var(--a-green), 0 0 16px rgba(87,176,106,.85); }
      .seat-name{ font-size:10.5px; color:#e6ecf3; max-width:72px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-shadow:0 1px 4px rgba(0,0,0,.8); }
      .seat-chain{
        position:absolute; inset:0; pointer-events:none;
      }
      .seat-wrap{ position:relative; }
      .room-stage{ flex:1; position:relative; min-width:0; display:flex; flex-direction:column; }
      .room-comments{
        position:relative; flex:1; min-height:0; overflow-y:auto; padding:8px 12px 10px 2px;
        display:flex; flex-direction:column; scrollbar-width:thin;
      }
      .room-comments-inner{ margin-top:auto; display:flex; flex-direction:column; }
      .rmsg{ font-size:15.5px; line-height:1.55; margin-top:9px; word-break:break-word; text-shadow:0 1px 5px rgba(0,0,0,.75); }
      .rmsg .r-name{ font-weight:900; color:#9fd8ab; margin-inline-end:7px; }
      .rmsg.me .r-name{ color:#a9c6ee; }
      .rmsg.sys{
        align-self:center; text-align:center; background:rgba(13,19,29,.78); border-radius:999px;
        padding:5px 14px; font-size:13.5px; color:#cfd9e4; text-shadow:none; max-width:92%;
      }
      .heart-float{
        position:absolute; z-index:4; pointer-events:none; color:#7ed491;
        animation:heartUp 0.95s ease-out forwards;
      }
      .heart-float svg{ width:26px; height:26px; fill:#7ed491; }
      @keyframes heartUp{ from{ transform:translateY(0) scale(.7); opacity:0; } 18%{ opacity:1; } to{ transform:translateY(-92px) scale(1.12); opacity:0; } }
      @media (prefers-reduced-motion: reduce){ .heart-float{ animation:none; display:none; } }
      /* battle happens on the room screen itself — no floating
         translucent panel, no separate screen. The enemy appears
         in the centre of the room stage, over the room's own
         background, and the comments behind it fade back so the
         fight stays easy to watch. */
      .battle{
        position:absolute; left:50%; top:43%; transform:translate(calc(-50% - 42px),-50%); z-index:3;
        display:none;
        flex-direction:column; align-items:center; width:min(430px,calc(100% - 88px)); max-height:96%; overflow-y:auto;
        background:transparent; border:none;
        padding:10px 12px 12px; text-align:center; box-shadow:none;
        text-shadow:0 1px 5px rgba(0,0,0,.8);
      }
      /* while a battle is on, the comment text thins out so the
         fight in the middle of the screen is easy to see */
      .room-comments .rmsg{ transition:opacity .35s ease; }
      .room-comments.battling .rmsg{ opacity:.4; }
      /* skill choices, opened by the スキル button: a column of
         round buttons just inside the battle rail, at the right
         edge of the room */
      .skill-menu{
        position:absolute; right:88px; top:50%; transform:translateY(-50%); z-index:4;
        display:none; flex-direction:column; gap:10px; align-items:center;
      }
      .skill-menu.open{ display:flex; }
      .skill-opt{
        width:54px; height:54px; min-height:54px; border-radius:50%; padding:0;
        border:1.5px solid var(--a-line); background:#131a26; color:#fff; cursor:pointer;
        font-family:inherit; font-size:15px; font-weight:900;
        display:flex; align-items:center; justify-content:center;
        box-shadow:0 6px 16px rgba(0,0,0,.45);
      }
      .skill-opt:disabled{ opacity:.45; cursor:not-allowed; }
      .skill-opt.ice{ border-color:#56c3d4; color:#aee6ef; }
      .skill-opt.fire{ border-color:#e07a68; color:#f6c0b4; }
      .skill-opt.thunder{ border-color:#d9b84a; color:#f0dda0; }
      .skill-opt.heal{ border-color:var(--a-green); color:#a9dcb4; }
      .battle.open{ display:flex; }
      .battle-enemy{ width:104px; height:104px; }
      .battle.open .battle-enemy{ animation:enemyIn .45s ease-out; }
      @keyframes enemyIn{ from{ transform:scale(.35) translateY(16px); opacity:0; } to{ transform:scale(1) translateY(0); opacity:1; } }
      @media (prefers-reduced-motion: reduce){ .battle.open .battle-enemy{ animation:none; } }
      .battle-name{ font-size:20px; font-weight:900; margin-top:6px; }
      .battle-sub{ font-size:12.5px; color:var(--a-soft); margin-top:3px; font-weight:700; }
      .battle-btns .a-btn:disabled{ opacity:.45; }
      .battle-cd{ font-size:13px; font-weight:800; color:var(--a-soft); margin-top:9px; min-height:1.4em; font-variant-numeric:tabular-nums; }
      .battle-cd.ready{ color:#7ed491; }
      /* battle presentation stays bare: no card, no name plate,
         no log line — just the enemy icons gathered in the middle
         of the room and the two HP bars (red for the enemy,
         green for the party), with the action buttons under them.
         The hidden rows stay in the DOM because the battle code
         writes to them; they simply never show. */
      .battle-name, .battle-sub, .battle .hp-label, .battle-log, .battle-cd{ display:none; }
      .auto-bar{
        display:flex; align-items:center; justify-content:flex-end; gap:9px;
        padding:7px 12px 1px; background:rgba(10,15,23,.9);
      }
      .auto-bar span{ font-size:13.5px; font-weight:800; color:#dbe4ef; }
      .auto-toggle{
        font-family:inherit; font-size:13px; font-weight:900; color:#dbe4ef; cursor:pointer;
        background:#2a3648; border:1.5px solid var(--a-line); border-radius:999px; padding:5px 15px; min-height:32px;
      }
      .auto-toggle.on{ background:var(--a-green); border-color:var(--a-green); color:#fff; }
      .listeners-bar{
        display:flex; justify-content:flex-end; padding:7px 12px 0;
        background:rgba(10,15,23,.9);
      }
      /* guest cluster: one small block above the comment box —
         "ゲスト（N人）" on top, tiny icons overlapped below it.
         The whole block is a button opening the member list. */
      .guest-cluster{
        display:flex; flex-direction:column; align-items:flex-start; gap:4px;
        background:rgba(19,26,36,.92); border:1px solid var(--a-line); border-radius:13px;
        padding:7px 11px 8px; cursor:pointer; font-family:inherit; color:#fff; text-align:left;
        box-shadow:0 6px 16px rgba(0,0,0,.4);
      }
      .guest-cluster:active{ background:rgba(35,46,62,.95); }
      .listeners-count{ font-size:16.5px; font-weight:900; color:#fff; line-height:1.25; white-space:nowrap; }
      .listeners-icons{ display:flex; align-items:center; min-width:0; }
      .listeners-icons .avatar{
        width:24px; height:24px; flex:none; border:2px solid #2b3648; margin-left:-8px;
        box-shadow:0 1px 4px rgba(0,0,0,.45);
      }
      .listeners-icons .avatar:first-child{ margin-left:0; }
      .listeners-icons:empty{ display:none; }

      /* ---- room member list (opened from the guest cluster) ---- */
      .members-screen{
        position:fixed; inset:0; z-index:75; display:none; flex-direction:column;
        background:#0d1420 url("images/rooms.webp") center/cover no-repeat; color:#fff;
      }
      .members-screen.open{ display:flex; }
      .members-screen::before{ content:""; position:absolute; inset:0; background:rgba(8,12,19,.55); pointer-events:none; }
      .members-screen > *{ position:relative; z-index:1; }
      .members-head{ display:flex; align-items:center; gap:11px; padding:calc(10px + env(safe-area-inset-top)) 12px 10px; background:rgba(13,19,29,.85); border-bottom:1px solid rgba(255,255,255,.09); }
      .members-title{ font-size:17.5px; font-weight:900; }
      .members-total{ margin-inline-start:auto; font-size:13px; font-weight:800; color:var(--a-soft); flex:none; }
      .members-list{ flex:1; overflow-y:auto; overscroll-behavior:contain; width:100%; max-width:640px; margin:0 auto; padding:6px 12px calc(96px + env(safe-area-inset-bottom)); }
      .members-sec{ font-size:16px; font-weight:900; margin:18px 2px 4px; text-shadow:0 1px 5px rgba(0,0,0,.75); }
      .member-row{
        display:flex; align-items:center; gap:12px; width:100%; text-align:left;
        background:var(--a-panel); border:1px solid var(--a-line); border-radius:14px;
        padding:10px 13px; margin-top:6px; cursor:pointer; font-family:inherit; color:#fff;
      }
      .member-row .avatar{ width:46px; height:46px; }
      .member-row-name{ font-size:16px; font-weight:900; min-width:0; word-break:break-word; }
      .member-badge{
        display:inline-block; font-size:11px; font-weight:900; color:#0e2413; background:var(--a-green);
        border-radius:5px; padding:2px 7px; margin-inline-start:8px; vertical-align:2px; white-space:nowrap;
      }
      .member-badge.mic{ background:#54678a; color:#fff; }
      .member-row.me{ cursor:default; }
      .members-note{ font-size:13px; color:var(--a-soft); font-weight:700; margin:10px 2px 0; }
      .members-empty{ font-size:14px; color:var(--a-soft); margin:6px 2px 0; }
      .challenge-note{ font-size:13.5px; color:var(--ink-soft); margin:0 0 10px; }
      .challenge-list{ display:flex; flex-direction:column; gap:8px; max-height:50dvh; overflow-y:auto; }
      .challenge-item{
        display:flex; align-items:center; gap:10px; width:100%; text-align:left; font-family:inherit; cursor:pointer;
        background:var(--bg); color:var(--ink); border:1.5px solid var(--panel-line); border-radius:12px; padding:10px 12px;
      }
      .challenge-item .avatar{ width:38px; height:38px; flex:none; }
      .challenge-item b{ font-size:15px; display:block; }
      .challenge-item span{ font-size:12px; color:var(--ink-soft); display:block; }
      .challenge-item span.challenge-power{ font-size:13px; font-weight:800; color:var(--ink); margin-top:2px; }

      /* ---- challenge letter flow, in the middle of the room ---- */
      .ch-overlay{
        position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); z-index:6;
        display:none; width:min(320px,92%);
      }
      .ch-overlay.on{ display:block; }
      .ch-wait{
        background:rgba(10,15,23,.95); border:1.5px solid rgba(255,255,255,.28); border-radius:18px;
        padding:20px 18px 16px; text-align:center; box-shadow:0 18px 44px rgba(0,0,0,.6);
      }
      .ch-wait-title{ font-size:18px; font-weight:900; }
      .ch-wait-sub{ font-size:13px; color:var(--a-soft); font-weight:700; margin-top:5px; word-break:break-word; }
      .ch-num{ font-size:54px; font-weight:900; line-height:1.1; margin-top:8px; font-variant-numeric:tabular-nums; }
      .ch-wait-note{ font-size:13px; color:#cfd9e4; margin-top:6px; }
      .ch-letter-paper{
        background:linear-gradient(180deg,#f8f0dc,#efe2c4); color:#33291a; border:1px solid #d6c294;
        border-radius:8px; padding:22px 20px 18px; text-align:center;
        box-shadow:0 18px 44px rgba(0,0,0,.65); transform:rotate(-1.3deg);
      }
      .ch-overlay.on .ch-letter-paper{ animation:letterIn .4s ease-out; }
      @keyframes letterIn{ from{ transform:rotate(-1.3deg) translateY(16px) scale(.92); opacity:0; } to{ transform:rotate(-1.3deg) translateY(0) scale(1); opacity:1; } }
      .ch-letter-icon{ width:64px; height:64px; margin:0 auto; }
      .ch-letter-title{ font-size:19px; font-weight:900; margin-top:8px; }
      .ch-letter-from{ font-size:13.5px; font-weight:700; color:#6d5c3d; margin-top:5px; word-break:break-word; }
      .ch-letter-q{ font-size:16.5px; font-weight:900; margin-top:12px; }
      .ch-letter-num{ font-size:15px; font-weight:900; color:#a33c2e; margin-top:8px; font-variant-numeric:tabular-nums; }
      .ch-letter-btns{ display:flex; gap:10px; justify-content:center; margin-top:14px; }
      .ch-letter-btns .a-btn{ min-width:104px; }
      .ch-start{ text-align:center; pointer-events:none; }
      .ch-start span{
        display:inline-block; font-size:118px; font-weight:900; color:#fff; line-height:1;
        text-shadow:0 6px 34px rgba(0,0,0,.85), 0 0 3px rgba(0,0,0,.6);
      }
      .ch-start span.pop{ animation:chPop .78s ease-out; }
      @keyframes chPop{ 0%{ transform:scale(1.7); opacity:0; } 25%{ opacity:1; } 100%{ transform:scale(1); opacity:1; } }
      @media (prefers-reduced-motion: reduce){
        .ch-overlay.on .ch-letter-paper{ animation:none; }
        .ch-start span.pop{ animation:none; }
      }
      /* versus battle: the other room's people stand in the middle */
      .battle-enemy.party{ width:auto; height:auto; display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
      .battle-enemy.party .opp{ display:flex; flex-direction:column; align-items:center; gap:3px; }
      .battle-enemy.party .opp .avatar{ width:52px; height:52px; }
      .battle-enemy.party .opp span{ font-size:10.5px; font-weight:800; color:#dbe4ef; max-width:60px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      /* versus battles only (room vs room and guild battles):
         the enemy party does NOT stand in the middle of the
         screen — the whole battle cluster sits at the top of the
         stage, just under the room's announcement bar. Monster
         battles keep the centred .battle placement above. */
      .battle.versus{ top:8px; transform:translate(calc(-50% - 42px),0); }
      /* while the two rooms' voices are linked, the opponent
         whose voice is coming through right now glows, the same
         green ring a speaking seat gets */
      .battle-enemy.party .opp .avatar{ transition:box-shadow .3s ease; }
      .battle-enemy.party .opp.speaking .avatar{ box-shadow:0 0 0 3px var(--a-green), 0 0 16px rgba(87,176,106,.9); }
      /* ---- opponents who stay after a versus battle ----
         The battle panel closes when the fight ends, but while
         the two rooms stay voice-linked the other room's people
         stay right here, under the announcement: icon + name,
         until the post-battle × ends the link. Whoever is
         talking glows, exactly like in the battle itself.
         Each person is a button: tapping one opens their
         profile, and its Back steps one screen back to the
         room. */
      .post-opp{ display:none; margin:0 12px 2px; }
      .post-opp.open{ display:block; }
      .post-opp-party{ display:flex; gap:10px; justify-content:center; flex-wrap:wrap; }
      .post-opp-party .opp{
        display:flex; flex-direction:column; align-items:center; gap:3px;
        background:none; border:none; padding:2px; margin:0; cursor:pointer;
        font-family:inherit; color:#fff; min-height:0;
      }
      .post-opp-party .opp .avatar{ width:52px; height:52px; transition:box-shadow .3s ease; }
      .post-opp-party .opp span{ font-size:10.5px; font-weight:800; color:#dbe4ef; max-width:60px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-shadow:0 1px 4px rgba(0,0,0,.8); }
      .post-opp-party .opp.speaking .avatar{ box-shadow:0 0 0 3px var(--a-green), 0 0 16px rgba(87,176,106,.9); }
      /* voice link bar: appears under the announcement the moment
         a challenge is accepted — both rooms can hear each other */
      .voice-link{
        display:none; align-items:center; gap:8px; margin:0 12px 8px;
        background:rgba(23,52,32,.88); border:1px solid var(--a-green); border-radius:11px;
        padding:8px 12px; font-size:13.5px; font-weight:800; color:#cdeeda;
      }
      .voice-link.on{ display:flex; }
      .voice-link svg{ width:19px; height:19px; flex:none; color:#7ed491; }
      .voice-link span{ min-width:0; word-break:break-word; }
      /* ---- share the room by DM ----
         Recent DM partners in one sideways-sliding strip; the
         ETC chip at its end opens everyone ever DM'd. Tapping
         people selects them (30 at most), one 送信 sends the
         room invite into each selected DM thread. */
      .share-note{ font-size:13.5px; color:var(--ink-soft); margin:0 0 10px; }
      .share-strip{
        display:flex; gap:6px; overflow-x:auto; padding:6px 2px 10px;
        scrollbar-width:thin; -webkit-overflow-scrolling:touch;
      }
      .share-chip{
        flex:none; width:74px; display:flex; flex-direction:column; align-items:center; gap:5px;
        background:none; border:none; cursor:pointer; font-family:inherit; color:var(--ink);
        padding:6px 2px 4px; border-radius:12px; position:relative;
      }
      .share-chip .avatar{ width:52px; height:52px; }
      .share-chip .share-name{ font-size:12px; font-weight:800; max-width:70px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      .share-chip.sel .avatar{ box-shadow:0 0 0 3px var(--a-green); }
      .share-chip .share-check{
        position:absolute; top:2px; right:8px; width:21px; height:21px; border-radius:50%;
        background:var(--a-green); color:#fff; display:none; align-items:center; justify-content:center;
      }
      .share-chip.sel .share-check{ display:flex; }
      .share-chip .share-check svg{ width:13px; height:13px; }
      .share-chip.etc .etc-ball{
        width:52px; height:52px; border-radius:50%; flex:none;
        border:2px dashed var(--panel-line); color:var(--ink-soft);
        display:flex; align-items:center; justify-content:center;
        font-size:14px; font-weight:900; letter-spacing:.04em;
      }
      .share-count{ font-size:13.5px; font-weight:800; color:var(--ink-soft); margin-inline-end:auto; align-self:center; }
      .share-all-list{ display:flex; flex-direction:column; gap:8px; max-height:52dvh; overflow-y:auto; }
      .share-all-row{
        display:flex; align-items:center; gap:11px; width:100%; text-align:left; font-family:inherit; cursor:pointer;
        background:var(--bg); color:var(--ink); border:1.5px solid var(--panel-line); border-radius:12px; padding:9px 12px;
      }
      .share-all-row .avatar{ width:42px; height:42px; flex:none; }
      .share-all-row b{ font-size:15.5px; }
      .share-all-row .share-check{
        margin-inline-start:auto; flex:none; width:24px; height:24px; border-radius:50%;
        border:2px solid var(--panel-line); color:#fff; display:flex; align-items:center; justify-content:center;
      }
      .share-all-row.sel{ border-color:var(--a-green); }
      .share-all-row.sel .share-check{ background:var(--a-green); border-color:var(--a-green); }
      .share-all-row .share-check svg{ width:14px; height:14px; opacity:0; }
      .share-all-row.sel .share-check svg{ opacity:1; }
      .hpbar{ width:min(300px,80%); height:14px; border-radius:999px; background:#39424f; overflow:hidden; margin-top:8px; border:1px solid rgba(255,255,255,.25); }
      .hpbar i{ display:block; height:100%; background:var(--a-green); transition:width .3s ease; }
      .hpbar.enemy i{ background:#c0554d; }
      .hp-label{ font-size:13px; color:var(--a-soft); margin-top:10px; font-weight:800; }
      /* the battle column never lets its rows overlap: every row
         keeps its own height, and the log is the one part that
         shrinks (and scrolls inside itself) when space runs out,
         so the buttons below it always stay put and readable */
      .battle > *{ flex:none; }
      .battle-log{
        flex:0 1 auto; font-size:14.5px; margin-top:13px; min-height:1.5em; width:100%;
        overflow-y:auto; color:#e8eef5;
      }
      /* battle actions: round buttons stacked down the right edge
         of the room (the approved sample's shape). They are fully
         opaque, so no comment or log text can ever show through
         or overlap them. */
      .battle-rail{
        position:absolute; right:10px; top:50%; transform:translateY(-50%); z-index:4;
        display:none; flex-direction:column; gap:12px; align-items:center;
      }
      .battle-rail.open{ display:flex; }
      .battle-rail .rail-btn{
        width:64px; height:64px; min-height:64px; border-radius:50%; padding:0;
        border:2px solid var(--a-line); background:#131a26; color:#fff;
        font-family:inherit; font-size:15px; font-weight:900; cursor:pointer;
        display:flex; align-items:center; justify-content:center; text-align:center;
        box-shadow:0 6px 16px rgba(0,0,0,.45);
      }
      .battle-rail .rail-btn.atk{ background:var(--a-green); border-color:var(--a-green); }
      .battle-rail .rail-btn.auto-toggle.on{ background:var(--a-green); border-color:var(--a-green); color:#fff; }
      /* flee button: alone at the bottom-left edge of the room,
         as far from the right-edge attack rail as it can be, so
         nobody taps it by mistake mid-fight */
      .flee-btn{
        position:absolute; left:10px; bottom:10px; z-index:4; display:none;
        width:52px; height:52px; min-height:52px; border-radius:50%; padding:0;
        border:2px solid var(--a-line); background:#131a26; color:#fff;
        font-family:inherit; font-size:12.5px; font-weight:900; cursor:pointer;
        align-items:center; justify-content:center; text-align:center;
        box-shadow:0 6px 16px rgba(0,0,0,.45);
      }
      .flee-btn.open{ display:flex; }
      /* ---- after a versus battle ----
         The fight is over but the two rooms stay voice-linked,
         so everyone can keep talking. The rematch tab waits at
         the right edge of the room (same round shape as the
         battle rail), and the × at the top-right closes the
         whole post-battle state: the voice link ends and the
         rematch tab goes away. The layer itself lets taps
         through; only its two buttons take them. */
      .post-battle{ position:absolute; inset:0; z-index:5; display:none; pointer-events:none; }
      .post-battle.open{ display:block; }
      .post-battle .pb-close{
        position:absolute; top:10px; right:10px; pointer-events:auto;
        width:42px; height:42px; min-height:42px; border-radius:50%; padding:0;
        border:2px solid var(--a-line); background:#131a26; color:#fff;
        font-family:inherit; cursor:pointer;
        display:flex; align-items:center; justify-content:center;
        box-shadow:0 6px 16px rgba(0,0,0,.45);
      }
      .post-battle .pb-close svg{ width:20px; height:20px; }
      .post-battle .pb-rematch{
        position:absolute; right:10px; top:50%; transform:translateY(-50%); pointer-events:auto;
        width:74px; height:74px; min-height:74px; border-radius:50%; padding:6px;
        border:2px solid var(--a-green); background:var(--a-green); color:#fff;
        font-family:inherit; font-size:14px; font-weight:900; cursor:pointer; line-height:1.3;
        display:flex; align-items:center; justify-content:center; text-align:center;
        box-shadow:0 6px 16px rgba(0,0,0,.45);
      }
      .battle-rail .rail-btn:disabled{ opacity:.45; cursor:not-allowed; }
      .battle-rail .rb-num{ font-size:23px; font-variant-numeric:tabular-nums; }
      .battle-rail .rb-sub{ display:block; font-size:10.5px; line-height:1.1; }
      /* charged up: waiting without attacking fills the charge —
         the attack button glows gold and the next hit is double */
      .battle-rail .rail-btn.atk.charged{ box-shadow:0 0 0 3px #ffe9a8, 0 0 24px rgba(255,210,90,.9); }
      /* the enemy's weakness element, shown as one small chip
         under the HP bars; it changes while the battle runs */
      .battle-weak{
        margin-top:9px; font-size:12.5px; font-weight:900; color:#dbe4ef;
        background:rgba(10,15,23,.78); border:1.5px solid var(--a-line); border-radius:999px; padding:3px 13px;
      }
      .battle-weak:empty{ display:none; }
      .battle-weak.w-fire{ border-color:#e07a68; color:#f6c0b4; }
      .battle-weak.w-ice{ border-color:#56c3d4; color:#aee6ef; }
      .battle-weak.w-thunder{ border-color:#d9b84a; color:#f0dda0; }
      /* short event labels that rise over the stage: ally hits,
         combos, cheers, weakness changes */
      .battle-float{
        position:absolute; z-index:6; pointer-events:none;
        font-size:16.5px; font-weight:900; color:#fff; white-space:nowrap;
        text-shadow:0 2px 8px rgba(0,0,0,.85);
        animation:floatUp 1.6s ease-out forwards;
      }
      .battle-float.combo{ color:#ffd95e; font-size:20px; }
      .battle-float.charge{ color:#ffe9a8; }
      .battle-float.cheer{ color:#a9dcb4; }
      .battle-float.weak{ color:#f0dda0; font-size:14.5px; }
      @keyframes floatUp{ from{ transform:translateY(8px); opacity:0; } 15%{ opacity:1; } to{ transform:translateY(-46px); opacity:0; } }
      @media (prefers-reduced-motion: reduce){ .battle-float{ animation:none; display:none; } }
      /* MVP of the finished battle, announced over the stage */
      .mvp-banner{
        position:absolute; top:14px; left:50%; transform:translateX(-50%); z-index:6;
        display:none; max-width:92%; text-align:center;
        background:rgba(24,20,8,.92); border:1.5px solid #d9b84a; border-radius:999px;
        padding:8px 18px; font-size:15px; font-weight:900; color:#ffe9a8;
        box-shadow:0 10px 26px rgba(0,0,0,.55); text-shadow:0 1px 4px rgba(0,0,0,.7);
      }
      .mvp-banner.on{ display:block; }
      /* battle sound effects on/off, at the left of the bar
         above the comment box */
      .sfx-toggle{
        margin-inline-end:auto; font-family:inherit; font-size:13px; font-weight:900; color:#dbe4ef;
        cursor:pointer; background:#2a3648; border:1.5px solid var(--a-line); border-radius:999px;
        padding:6px 14px; min-height:34px;
      }
      .sfx-toggle.off{ opacity:.55; }
      .room-inputbar{
        display:flex; gap:8px; align-items:center; padding:9px 12px calc(10px + env(safe-area-inset-bottom));
        background:rgba(10,15,23,.9); border-top:1px solid rgba(255,255,255,.1);
      }
      .room-inputbar input{
        flex:1; min-width:0; border:2px solid var(--a-line); border-radius:999px; background:#141c28; color:#fff;
        font-family:inherit; font-size:16px; padding:10px 15px; min-height:46px;
      }
      .mic-btn.on{ background:var(--a-green); border-color:var(--a-green); }
      .room-mini{
        position:fixed; right:12px; bottom:calc(88px + env(safe-area-inset-bottom)); z-index:65; display:none;
        align-items:center; gap:10px; background:var(--a-panel-solid); border:1.5px solid var(--a-green);
        border-radius:999px; padding:7px 16px 7px 8px; cursor:pointer; font-family:inherit; color:#fff;
        box-shadow:0 10px 24px rgba(0,0,0,.55); max-width:min(78vw,340px);
      }
      .room-mini.show{ display:flex; }
      .room-mini .avatar{ width:40px; height:40px; }
      .room-mini b{ font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      .room-mini span{ font-size:11.5px; color:var(--a-green); font-weight:900; flex:none; }

      /* ---- DM (battered wooden mailbox) ---- */
      .dm-boxes{ display:flex; gap:10px; padding:16px 12px 4px; max-width:640px; margin:0 auto; }
      .dm-box{
        flex:1; background:var(--a-panel); border:1px solid var(--a-line); border-radius:15px; padding:13px 6px 11px;
        color:#fff; font-family:inherit; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:5px;
        font-size:14.5px; font-weight:800; min-height:84px; justify-content:center; position:relative;
      }
      .dm-box svg{ width:27px; height:27px; }
      .dm-box .dm-badge{
        position:absolute; top:8px; right:8px; background:#c0554d; color:#fff; font-size:11.5px; font-weight:900;
        border-radius:999px; min-width:21px; height:21px; display:flex; align-items:center; justify-content:center; padding:0 6px;
      }
      .dm-box .dm-lock{ font-size:11px; color:#d9a08e; font-weight:800; }
      .dm-list{ max-width:640px; margin:0 auto; padding:8px 12px 16px; }
      .dm-row{
        width:100%; display:flex; gap:13px; align-items:center; text-align:left; margin-top:5px;
        background:var(--a-panel); border:1px solid var(--a-line); border-radius:16px; padding:16px;
        cursor:pointer; font-family:inherit; color:#fff;
      }
      .dm-row .avatar{ width:58px; height:58px; }
      .dm-row-main{ flex:1; min-width:0; }
      .dm-row-top{ display:flex; align-items:baseline; gap:8px; }
      .dm-row-name{ font-size:17.5px; font-weight:900; }
      .dm-pin{ font-size:11px; font-weight:900; color:#9fd8ab; border:1px solid var(--a-green); border-radius:5px; padding:1px 6px; flex:none; }
      .dm-row-time{ margin-inline-start:auto; font-size:12.5px; color:var(--a-soft); flex:none; }
      .dm-row-snippet{ font-size:15px; color:var(--a-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
      .dm-unread{
        background:var(--a-green); color:#fff; font-size:12px; font-weight:900; border-radius:999px;
        min-width:23px; height:23px; display:flex; align-items:center; justify-content:center; padding:0 7px; flex:none;
      }
      .dm-chat{
        position:fixed; inset:0; z-index:70; display:none; flex-direction:column;
        background:#0d1420 url("images/dm.webp") center/cover no-repeat; color:#fff;
      }
      .dm-chat.open{ display:flex; }
      .dm-chat::before{ content:""; position:absolute; inset:0; background:rgba(8,12,19,.6); pointer-events:none; }
      .dm-chat > *{ position:relative; z-index:1; }
      .dm-chat-head{ display:flex; align-items:center; gap:11px; padding:calc(10px + env(safe-area-inset-top)) 12px 10px; background:rgba(13,19,29,.85); border-bottom:1px solid rgba(255,255,255,.09); }
      .dm-chat-head .avatar{ width:42px; height:42px; }
      .dm-av-btn{
        background:none; border:none; padding:0; cursor:pointer; border-radius:50%;
        min-height:0; flex:none; display:inline-flex;
      }

      /* ---- other user's profile (from a DM chat) ---- */
      .user-prof{
        position:fixed; inset:0; z-index:80; display:none;
        background:#10151d url("images/profile.webp") center/cover no-repeat; color:#fff;
      }
      .user-prof.open{ display:block; }
      .user-prof::before{ content:""; position:absolute; inset:0; background:rgba(9,13,19,.42); }
      .user-prof-scroll{ position:relative; z-index:1; height:100%; overflow-y:auto; overscroll-behavior:contain; padding-bottom:calc(30px + env(safe-area-inset-bottom)); }
      .user-prof-head{ display:flex; align-items:center; gap:11px; padding:calc(10px + env(safe-area-inset-top)) 12px 6px; max-width:640px; margin:0 auto; }
      .user-prof-head h2{ font-size:19px; font-weight:900; margin:0; text-shadow:0 2px 7px rgba(0,0,0,.8); }
      .user-prof .prof-inner{ padding-top:8px; }
      #upAvatar{ width:108px; height:108px; border:3.5px solid #54678a; box-shadow:0 8px 22px rgba(0,0,0,.55); }

      /* ---- DM notification lists (likes / comment replies) ---- */
      .notif-screen{
        position:fixed; inset:0; z-index:72; display:none; flex-direction:column;
        background:#0d1420 url("images/dm.webp") center/cover no-repeat; color:#fff;
      }
      .notif-screen.open{ display:flex; }
      .notif-screen::before{ content:""; position:absolute; inset:0; background:rgba(8,12,19,.55); pointer-events:none; }
      .notif-screen > *{ position:relative; z-index:1; }
      .notif-head{ display:flex; align-items:center; gap:11px; padding:calc(10px + env(safe-area-inset-top)) 12px 10px; background:rgba(13,19,29,.85); border-bottom:1px solid rgba(255,255,255,.09); }
      .notif-title{ font-size:17.5px; font-weight:900; }
      .notif-list{ flex:1; overflow-y:auto; overscroll-behavior:contain; width:100%; max-width:640px; margin:0 auto; padding:10px 12px calc(96px + env(safe-area-inset-bottom)); }
      .notif-row{ display:flex; gap:12px; background:var(--a-panel); border:1px solid var(--a-line); border-radius:14px; padding:13px 14px; margin-top:5px; }
      .notif-row .avatar{ width:46px; height:46px; }
      .notif-main{ flex:1; min-width:0; }
      .notif-txt{ font-size:15px; line-height:1.5; }
      .notif-txt b{ font-weight:900; }
      .notif-time{ font-size:12px; color:var(--a-soft); margin-inline-start:8px; white-space:nowrap; }
      .notif-snip{
        margin-top:7px; font-size:13.5px; line-height:1.55; color:#c6d2df;
        background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.09); border-radius:9px; padding:7px 10px;
        word-break:break-word;
      }
      .notif-snip .notif-snip-label{ display:block; font-size:11px; font-weight:900; color:var(--a-green); margin-bottom:2px; }

      /* ---- one post's comments (opened by tapping a post card,
         from the posts tab or from either profile): the comments
         are more papers pinned on the same bulletin board ---- */
      .pc-screen{
        position:fixed; inset:0; z-index:85; display:none; flex-direction:column;
        background:#0d1420 url("images/posts.webp") center/cover no-repeat; color:#fff;
      }
      .pc-screen.open{ display:flex; }
      .pc-screen::before{ content:""; position:absolute; inset:0; background:rgba(9,13,19,.42); pointer-events:none; }
      .pc-screen > *{ position:relative; z-index:1; }
      .pc-list{ flex:1; overflow-y:auto; overscroll-behavior:contain; width:100%; max-width:640px; margin:0 auto; padding:6px 12px calc(40px + env(safe-area-inset-bottom)); }
      .pc-list .paper{ margin:14px auto; }
      .pc-paper{
        margin:16px auto 0; width:100%; box-sizing:border-box; position:relative;
        background:var(--a-paper); color:var(--a-paper-ink);
        border-radius:5px; padding:16px 15px 10px;
        box-shadow:0 8px 18px rgba(0,0,0,.5);
      }
      .pc-paper::before{
        content:""; position:absolute; top:-8px; left:50%; margin-left:-8px; width:16px; height:16px; border-radius:50%;
        background:radial-gradient(circle at 35% 32%, #c8d4e2, #5d7186 70%, #42536a);
        box-shadow:0 2px 4px rgba(0,0,0,.45);
      }
      .pc-head{ display:flex; align-items:center; gap:10px; }
      .pc-head .avatar{ width:40px; height:40px; flex:none; }
      .pc-name{ font-size:15px; font-weight:900; line-height:1.25; }
      .pc-time{ font-size:12px; color:#3a3222; white-space:nowrap; }
      .pc-text{ font-size:15px; line-height:1.6; margin-top:7px; word-break:break-word; }
      .pc-foot{ display:flex; align-items:center; gap:8px; border-top:1px solid #77694a; margin-top:9px; padding-top:5px; }
      .pc-reply-btn{
        background:none; border:none; cursor:pointer; font-family:inherit; color:#2e291d;
        font-size:13.5px; font-weight:800; display:inline-flex; align-items:center; gap:5px; padding:4px 6px; min-height:34px;
      }
      .pc-reply-btn svg{ width:17px; height:17px; }
      .pc-replies{ margin:2px 0 4px 30px; }
      .pc-replies .pc-paper{ margin-top:12px; padding:13px 13px 8px; }
      .pc-replies .pc-head .avatar{ width:34px; height:34px; }
      .pc-replies .pc-name{ font-size:14px; }
      .pc-replies .pc-text{ font-size:14px; }
      .pc-paper .paper-reply{ margin:8px 0 4px; }
      .pc-empty{
        margin:16px auto 0; background:var(--a-paper); color:var(--a-paper-ink);
        border-radius:5px; padding:16px 15px; font-size:14.5px; font-weight:700;
        box-shadow:0 8px 18px rgba(0,0,0,.5);
      }
      .dm-chat-name{ font-size:17.5px; font-weight:900; }
      .dm-msgs{ flex:1; overflow-y:auto; padding:14px 14px 8px; display:flex; flex-direction:column; gap:9px; }
      .dm-msg{ max-width:78%; font-size:15.5px; line-height:1.55; padding:9px 13px; border-radius:16px; background:rgba(27,36,49,.95); align-self:flex-start; border-bottom-left-radius:5px; word-break:break-word; }
      .dm-msg.me{ align-self:flex-end; background:#2e5b3c; border-bottom-left-radius:16px; border-bottom-right-radius:5px; }

      /* ---- profile (adventurer's house) ---- */
      .prof-inner{ max-width:640px; margin:0 auto; padding:calc(16px + env(safe-area-inset-top)) 12px 10px; position:relative; }
      .prof-top{ display:flex; align-items:flex-start; justify-content:center; gap:6px; }
      .equip-col{ display:flex; flex-direction:column; gap:9px; padding-top:0; }
      .equip-slot{
        width:54px; height:54px; border-radius:11px; background:rgba(15,21,30,.82); border:1.5px solid var(--a-line);
        display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; color:#cfd9e4;
      }
      .equip-slot svg{ width:25px; height:25px; }
      .equip-slot span{ font-size:9px; font-weight:800; color:var(--a-soft); }
      .prof-center{ text-align:center; padding:0 4px; }
      .prof-avatar-btn{ background:none; border:none; cursor:pointer; padding:0; border-radius:50%; min-height:0; }
      .prof-avatar-btn .avatar{ width:108px; height:108px; border:3.5px solid #54678a; box-shadow:0 8px 22px rgba(0,0,0,.55); }
      .prof-avatar-hint{ font-size:11.5px; color:var(--a-soft); margin-top:5px; text-shadow:0 1px 4px rgba(0,0,0,.8); }
      .prof-name{ font-size:23px; font-weight:900; color:#fff; margin-top:7px; text-shadow:0 2px 8px rgba(0,0,0,.85); line-height:1.3; }
      .prof-title{ display:inline-block; margin-top:5px; background:rgba(34,48,74,.92); border:1px solid #54678a; color:#dbe7f7; font-size:13.5px; font-weight:800; border-radius:999px; padding:3px 13px; }
      .prof-level{ font-size:15.5px; font-weight:900; color:#fff; margin-top:7px; text-shadow:0 1px 5px rgba(0,0,0,.85); }
      .prof-stats{ display:flex; gap:8px; margin-top:12px; width:86%; margin-left:auto; margin-right:auto; }
      .prof-stat{ flex:1; background:var(--a-panel); border:1px solid var(--a-line); border-radius:13px; padding:6px 4px 7px; text-align:center; }
      .prof-stat b{ display:block; font-size:19px; line-height:1.1; color:#fff; }
      .prof-stat span{ display:block; font-size:12.5px; line-height:1.25; color:var(--a-soft); font-weight:800; }
      /* experience: no big panel — just a slim frame around the
         label row and the gauge, same chip style as ギルド/戦歴 */
      .prof-exp{ margin-top:10px; background:rgba(15,21,30,.88); border:1.5px solid var(--a-line); border-radius:9px; padding:6px 10px 8px; }
      .prof-exp-top{ display:flex; justify-content:space-between; font-size:13px; font-weight:800; color:var(--a-soft); }
      .prof-exp-top b{ color:#fff; }
      .expbar{ height:10px; border-radius:999px; background:#39424f; overflow:hidden; margin-top:5px; }
      .expbar i{ display:block; height:100%; width:62%; background:var(--a-green); border-radius:999px; }
      .prof-bio{
        margin-top:13px; background:var(--a-panel); border:1px solid var(--a-line); border-radius:13px; padding:12px 14px;
        color:#e8eef5; font-size:15.5px; line-height:1.65; cursor:pointer; word-break:break-word;
      }
      .prof-bio .bio-text{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
      .prof-bio.open .bio-text{ display:block; }
      .prof-bio-label{ font-size:12px; font-weight:900; color:var(--a-green); display:block; margin-bottom:3px; }
      /* guild / history / edit: small chips that hug the text —
         just a frame around the word, no band or tab shape */
      .edge-btn{
        position:absolute; top:196px; z-index:3; border:1.5px solid var(--a-line); cursor:pointer;
        background:rgba(15,21,30,.88); color:#dbe4ef; font-family:inherit; font-weight:900; font-size:12.5px;
        display:inline-flex; align-items:center; justify-content:center; gap:5px;
        padding:5px 9px; border-radius:9px; line-height:1.25; white-space:nowrap;
      }
      .edge-btn svg{ width:15px; height:15px; flex:none; }
      .edge-btn.left{ left:8px; }
      .edge-btn.right{ right:8px; }
      /* edit chip: in normal flow, in a row that mirrors the stats
         row (same 86% width, same 3 columns), sitting in the third
         column — directly above the 防御力 card, clear of the title
         pill, the level line and every other element */
      .prof-edit-row{ display:flex; gap:8px; width:86%; margin:12px auto 0; }
      .prof-edit-row i{ flex:1; }
      .prof-edit-cell{ flex:1; display:flex; justify-content:center; }
      .prof-edit-btn{
        border:1.5px solid var(--a-line); cursor:pointer;
        background:rgba(15,21,30,.88); color:#dbe4ef; font-family:inherit; font-weight:900; font-size:12.5px;
        display:inline-flex; align-items:center; justify-content:center; gap:5px;
        padding:5px 9px; border-radius:9px; line-height:1.25; white-space:nowrap;
      }
      .prof-edit-btn svg{ width:14px; height:14px; flex:none; }
      .prof-edit-row + .prof-stats{ margin-top:6px; }
      /* whole equipment columns lean a little toward the centre,
         so they never slide under the edge bands */
      #equipLeft{ transform:translateX(18px); }
      #equipRight{ transform:translateX(-18px); }
      .prof-posts-head{ font-size:18px; font-weight:900; color:#fff; margin:22px 4px 2px; text-shadow:0 2px 7px rgba(0,0,0,.85); }
      .side-sheet{
        position:fixed; top:0; bottom:0; z-index:76; width:min(340px,88vw); display:none; flex-direction:column;
        background:var(--a-panel-solid); padding:calc(16px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
        box-shadow:0 0 44px rgba(0,0,0,.6);
      }
      .side-sheet.open{ display:flex; }
      .side-sheet.right{ right:0; border-left:1.5px solid var(--a-line); }
      .side-sheet.left{ left:0; border-right:1.5px solid var(--a-line); }
      .side-sheet h3{ margin:0 0 6px; font-size:19px; font-weight:900; color:#fff; display:flex; align-items:center; gap:9px; }
      .side-sheet .sheet-close{ margin-inline-start:auto; }
      .history-row{ display:flex; align-items:center; gap:11px; padding:12px 2px; border-bottom:1px solid #2b3646; color:#e8eef5; font-size:15px; }
      .history-row .res{ margin-inline-start:auto; font-weight:900; flex:none; }
      .history-row .res.win{ color:var(--a-green); }
      .history-row .res.lose{ color:#e08a82; }
      .history-row small{ display:block; color:var(--a-soft); font-size:12.5px; }
      .guild-txt{ color:#cfd9e4; font-size:15px; line-height:1.7; }
      /* guild sheet: the announcement and the roster scroll
         together inside the sheet; the header stays put */
      .sheet-scroll{ flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; margin:0 -4px; padding:0 4px 4px; }
      .guild-chat-btn{ width:100%; justify-content:center; margin:14px 0 2px; }
      .guild-roster-head{ font-size:14.5px; font-weight:900; color:#fff; margin:18px 0 2px; letter-spacing:.04em; }
      /* member roster: names engraved one per row, role badge at
         the end of the row — leader in moss green, vice-leader in
         deep navy, members plain */
      .guild-row{ display:flex; align-items:center; gap:10px; padding:8px 2px; border-bottom:1px solid #2b3646; }
      .guild-row .avatar{ width:36px; height:36px; }
      .guild-row-name{ font-size:15px; font-weight:800; color:#e8eef5; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
      .guild-row-lv{ font-size:12px; color:var(--a-soft); font-weight:700; flex:none; }
      .role-badge{ margin-inline-start:auto; font-size:11.5px; font-weight:900; padding:2px 9px; border-radius:999px; flex:none; }
      .role-leader{ background:var(--a-green-deep); color:#bfe6c8; border:1px solid var(--a-green); }
      .role-vice{ background:var(--a-navy); color:#c9d8f2; border:1px solid #54678a; }
      .role-member{ color:var(--a-soft); border:1px solid #2b3646; }
      /* the "…" expander under the first 20 names */
      .guild-more{
        width:100%; margin-top:12px; background:rgba(15,21,30,.6); border:1.5px solid var(--a-line); border-radius:11px;
        color:#dbe4ef; font-family:inherit; font-size:14px; font-weight:900; padding:7px 10px; cursor:pointer;
        display:flex; align-items:center; justify-content:center; gap:9px; min-height:44px;
      }
      .guild-more .dots{ font-size:19px; letter-spacing:.28em; line-height:1; }
      /* guild chat: the DM chat look over the dungeon corridor,
         with the sender's name over each member's bubble */
      .gchat-screen{ background-image:url("images/rooms.webp"); }
      .gchat-sub{ font-size:12.5px; color:var(--a-soft); font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
      .gchat-row{ display:flex; flex-direction:column; align-items:flex-start; max-width:100%; }
      .gchat-row.me{ align-items:flex-end; }
      .gchat-who{ font-size:12px; font-weight:800; color:#c6d2df; margin:0 3px 2px; text-shadow:0 1px 4px rgba(0,0,0,.8); }

      /* ---- icon select ---- */
      .icon-screen{
        position:fixed; inset:0; z-index:75; display:none;
        background:#10151d url("images/profile.webp") center/cover no-repeat; color:#fff;
      }
      .icon-screen.open{ display:block; }
      .icon-screen::before{ content:""; position:absolute; inset:0; background:rgba(9,13,19,.5); }
      .icon-scroll{ position:relative; z-index:1; height:100%; overflow-y:auto; padding-bottom:calc(30px + env(safe-area-inset-bottom)); }
      .icon-head{ display:flex; align-items:center; gap:11px; padding:calc(10px + env(safe-area-inset-top)) 12px 6px; }
      .icon-head h2{ font-size:19px; font-weight:900; margin:0; text-shadow:0 2px 7px rgba(0,0,0,.8); }
      .icon-preview{ display:flex; flex-direction:column; align-items:center; padding:12px 0 4px; }
      .icon-preview .avatar{ width:118px; height:118px; border:3.5px solid #54678a; box-shadow:0 10px 26px rgba(0,0,0,.6); }
      .icon-sec{ max-width:560px; margin:16px auto 0; padding:0 16px; }
      .icon-sec h3{ font-size:16px; font-weight:900; margin:0 0 10px; text-shadow:0 1px 5px rgba(0,0,0,.85); }
      .icon-grid{ display:flex; gap:11px; flex-wrap:wrap; }
      .icon-choice{ background:none; border:none; cursor:pointer; padding:0; border-radius:50%; min-height:0; }
      .icon-choice .avatar{ width:64px; height:64px; border:3px solid transparent; }
      .icon-choice[aria-pressed="true"] .avatar{ border-color:var(--a-green); box-shadow:0 0 0 2px rgba(87,176,106,.5); }
      .bg-choice{ width:52px; height:52px; min-height:52px; border-radius:50%; border:3px solid transparent; cursor:pointer; padding:0; }
      .bg-choice[aria-pressed="true"]{ border-color:var(--a-green); box-shadow:0 0 0 2px rgba(87,176,106,.5); }
      .icon-apply{ max-width:560px; margin:24px auto 0; padding:0 16px; }
      .icon-apply .a-btn{ width:100%; justify-content:center; font-size:16.5px; min-height:52px; }

      .app-toast{
        position:fixed; left:50%; transform:translateX(-50%); bottom:calc(92px + env(safe-area-inset-bottom)); z-index:90;
        background:rgba(16,22,31,.96); color:#fff; border:1px solid var(--a-line); border-radius:999px;
        padding:10px 20px; font-size:14.5px; font-weight:800; display:none; max-width:88vw; text-align:center;
        box-shadow:0 12px 28px rgba(0,0,0,.5);
      }
      .app-toast.show{ display:block; }
