/* LYX DAO — 夜空のハイウェイ×アーケードRPG
   宇宙の濃紺に、虹は「細い帯」として使う（面のグラデにしない）。縁は太め、影は真下にずらす */
:root {
  --bg: #070a1f;
  --bg2: #0e1433;
  --panel: #121a3f;
  --panel2: #18224f;
  --line: #2a3672;
  --ink: #f3f5ff;
  --sub: #a8b1dd;
  --dim: #6f79ad;
  --r1: #ff4d6d; --r2: #ff9f1c; --r3: #ffd23f; --r4: #2ee6a6; --r5: #4cc9ff; --r6: #9b7bff;
  --accent: #ffd23f;
  --hot: #ff4d6d;
  --ok: #2ee6a6;
  --rainbow: linear-gradient(90deg, var(--r1), var(--r2), var(--r3), var(--r4), var(--r5), var(--r6));
  --head: "Dela Gothic One", "M PLUS Rounded 1c", sans-serif;
  --body: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --tab-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--body); font-weight: 500; font-size: 16px; line-height: 1.6; overscroll-behavior-y: contain; }
body { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
input, textarea, select { font-size: 16px; }
a { color: var(--r5); }
h1, h2, h3 { font-family: var(--head); font-weight: 400; letter-spacing: .02em; margin: 0; line-height: 1.3; }
:focus-visible { outline: 3px solid var(--r5); outline-offset: 2px; }

/* 星空（動かない層。ロビーは Canvas で別に描く） */
#sky { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 38% 64%, #cfe6ff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 52%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 86%, #ffe9b0 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 34%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 48%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 88%, #cfe6ff 50%, transparent 51%),
    radial-gradient(ellipse 80% 50% at 50% 110%, #1b1450 0%, transparent 70%),
    var(--bg);
}
#app { position: fixed; inset: 0; z-index: 1; }
.scr { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---- 部品 ---- */
.rainbow-bar { height: 4px; background: var(--rainbow); border-radius: 2px; }
.btn { appearance: none; border: 2px solid #000; background: var(--accent); color: #1a1300; font-weight: 800; padding: 12px 20px; min-height: 48px; border-radius: 12px; cursor: pointer; box-shadow: 0 4px 0 #000; transition: transform .08s, box-shadow .08s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); box-shadow: 0 4px 0 #04061a; }
.btn.blue { background: var(--r5); color: #021826; }
.btn.green { background: var(--ok); color: #032318; }
.btn.danger { background: var(--hot); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; box-shadow: 0 3px 0 #000; }
.btn.wide { width: 100%; }
.link { background: none; border: 0; color: var(--r5); padding: 8px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; }
.field > span { font-size: 14px; color: var(--sub); font-weight: 700; }
.field small { color: var(--dim); font-size: 12px; }
.input, textarea.input, select.input { width: 100%; background: var(--bg2); border: 2px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); }
.input:focus { border-color: var(--r5); outline: none; }
textarea.input { resize: vertical; min-height: 84px; }
.count { align-self: flex-end; font-size: 12px; color: var(--dim); }

.card { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 14px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--panel2); border: 1px solid var(--line); color: var(--sub); }
.chip.on { background: var(--ok); color: #032318; border-color: #000; }
.chip.warn { background: var(--r2); color: #241300; border-color: #000; }
.lv { font-family: var(--head); font-size: 13px; color: var(--accent); }
.muted { color: var(--sub); }
.tiny { font-size: 12px; color: var(--dim); }
.row { display: flex; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.empty { text-align: center; padding: 32px 16px; color: var(--sub); }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* ---- モーダル・トースト ---- */
#layer { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.backdrop { position: absolute; inset: 0; background: rgba(3, 4, 16, .72); display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; animation: fade .18s; }
.backdrop.out { opacity: 0; transition: opacity .18s; }
.modal { position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow: auto; background: var(--panel); border: 2px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; padding: 22px 18px calc(22px + var(--safe-b)); animation: up .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal::before { content: ""; position: absolute; left: 18px; right: 18px; top: 0; height: 3px; background: var(--rainbow); border-radius: 0 0 3px 3px; }
.modal.wide { max-width: 760px; }
.modal .x { position: absolute; right: 8px; top: 8px; width: 44px; height: 44px; border: 0; background: none; color: var(--sub); font-size: 26px; cursor: pointer; }
@media (min-width: 720px) { .backdrop { align-items: center; } .modal { border-radius: 20px; border-bottom: 2px solid var(--line); } }
.confirm p { margin: 8px 0 18px; white-space: pre-wrap; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; left: 0; right: 0; top: calc(12px + var(--safe-t)); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--panel2); border: 2px solid #000; box-shadow: 0 4px 0 #000; padding: 10px 16px; border-radius: 12px; font-weight: 700; max-width: 90vw; animation: up .2s; }
.toast.ok { background: var(--ok); color: #032318; }
.toast.err { background: var(--hot); color: #fff; }
.toast.out { opacity: 0; transition: opacity .3s; }

/* ---- はじめの画面 ---- */
.welcome { align-items: center; justify-content: center; text-align: center; padding: 24px 16px calc(24px + var(--safe-b)); overflow: auto; }
.logo { font-family: var(--head); font-size: clamp(48px, 15vw, 88px); line-height: 1; letter-spacing: .04em; color: #fff; text-shadow: 0 4px 0 #000, 0 0 28px rgba(255, 210, 63, .35); }
.logo small { display: block; font-size: .24em; letter-spacing: .3em; margin-top: 10px; color: var(--sub); text-shadow: none; }
.road { position: relative; width: min(420px, 90vw); height: 120px; margin: 18px auto 8px; perspective: 260px; }
.road i { position: absolute; left: 50%; bottom: 0; width: 70%; height: 220px; transform-origin: bottom; transform: translateX(-50%) rotateX(68deg); background: repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, .5) 22px 26px), linear-gradient(90deg, var(--r1), var(--r2), var(--r3), var(--r4), var(--r5), var(--r6)); background-size: 100% 48px, 100% 100%; animation: roll 1.2s linear infinite; border-radius: 6px; opacity: .9; box-shadow: 0 0 40px rgba(76, 201, 255, .35); }
@keyframes roll { to { background-position: 0 48px, 0 0; } }
@media (prefers-reduced-motion: reduce) { .road i { animation: none; } }
.welcome .lead { color: var(--sub); max-width: 26em; margin: 8px auto 22px; }
.welcome .acts { display: flex; flex-direction: column; gap: 12px; width: min(340px, 100%); }
.authbox { width: min(400px, 100%); text-align: left; margin-top: 8px; }

/* ---- 登録の段 ---- */
.flow { padding: calc(16px + var(--safe-t)) 16px calc(24px + var(--safe-b)); overflow: auto; }
.flow-in { max-width: 520px; margin: 0 auto; width: 100%; }
.steps { display: flex; gap: 6px; margin: 8px 0 18px; }
.steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.steps i.on { background: var(--accent); }
.flow h2 { font-size: 24px; margin-bottom: 6px; }
.flow .lead { color: var(--sub); margin: 0 0 18px; }
.vis { display: flex; gap: 6px; }
.vis button { flex: 1; min-height: 40px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg2); color: var(--sub); font-weight: 700; cursor: pointer; }
.vis button.on { border-color: #000; background: var(--r5); color: #021826; }
.photo-pick { display: flex; align-items: center; gap: 14px; }
.photo { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: var(--bg2); border: 3px solid var(--line); flex: none; }
.photo.big { width: 112px; height: 112px; }
.consent { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--bg2); border-radius: 12px; margin: 10px 0 16px; }
.consent input { width: 22px; height: 22px; margin-top: 2px; flex: none; }

/* ---- アバター作り ---- */
.maker { display: grid; grid-template-columns: 1fr; gap: 12px; }
.maker-stage { display: flex; justify-content: center; align-items: flex-end; height: 200px; background: radial-gradient(ellipse at 50% 90%, #24306b 0%, transparent 65%); border-radius: 16px; position: relative; overflow: hidden; }
.maker-stage::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: 14px; height: 6px; background: var(--rainbow); border-radius: 3px; opacity: .8; }
.maker-stage img { width: 150px; height: 200px; position: relative; z-index: 1; }
.maker-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.maker-tabs button { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg2); color: var(--sub); font-weight: 700; cursor: pointer; }
.maker-tabs button.on { background: var(--accent); color: #1a1300; border-color: #000; }
.maker-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.maker-opts button { min-height: 52px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 700; padding: 4px; position: relative; }
.maker-opts button.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.maker-opts button[disabled] { opacity: .45; }
.maker-opts .sw { width: 30px; height: 30px; border-radius: 50%; display: block; margin: 0 auto; border: 2px solid rgba(0, 0, 0, .4); }
.maker-opts .lock { display: block; font-size: 11px; color: var(--dim); }

/* ---- 本体（タブ） ---- */
.main { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
.topbar { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 12px 8px; background: linear-gradient(180deg, rgba(7, 10, 31, .96), rgba(7, 10, 31, .75)); border-bottom: 1px solid var(--line); }
.topbar .me-ava { width: 40px; height: 40px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--line); overflow: hidden; flex: none; }
.topbar .me-ava img { width: 40px; height: 54px; margin-top: -2px; }
.xpbar { max-width: 320px; height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.xpbar i { display: block; height: 100%; background: var(--rainbow); }
.topbar .nick { font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.online { font-size: 12px; color: var(--ok); font-weight: 800; white-space: nowrap; }
.online::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 4px; box-shadow: 0 0 8px var(--ok); }
.bell { position: relative; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; flex: none; }
.bell b { position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--hot); color: #fff; font-size: 11px; line-height: 18px; }
.tabview { position: relative; flex: 1; min-height: 0; }
.tabview > .scr { overflow: auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: #0a0f2a; border-top: 2px solid var(--line); }
.tabs::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: var(--rainbow); opacity: .7; }
.tabs button { border: 0; background: none; color: var(--dim); font-size: 11px; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; position: relative; }
.tabs button svg { width: 26px; height: 26px; }
.tabs button.on { color: var(--accent); }
.tabs button b { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--hot); color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; }

/* ---- コミュニティ（ロビー） ---- */
.lobby { overflow: hidden !important; overflow: clip !important; } /* clip：ボタンを押したときにロビーごと横へずれないように（hidden だと focus で中がスクロールした） */
.lobby canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; }
.lobby .hud { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 8px; align-items: flex-end; pointer-events: none; }
.lobby .hud > * { pointer-events: auto; }
/* 左下：あいさつ（時間帯・頑張ろう・😊）と、行動記録・本音を書くボタン（2026-10-12） */
.greets { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.grow-row { display: flex; gap: 6px; }
.gbtn { display: inline-flex; align-items: center; gap: 4px; height: 42px; padding: 0 12px; border: 2px solid var(--line); border-radius: 999px; background: rgba(10, 15, 42, .88); color: var(--ink); font: inherit; font-size: 13px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.gbtn span { font-size: 18px; line-height: 1; }
.gbtn:hover { border-color: var(--accent); }
.gbtn:active { transform: scale(.96); }
.gbtn.emo { width: 42px; padding: 0; justify-content: center; font-size: 22px; }
.gbtn.sub { height: 34px; padding: 0 10px; font-size: 12px; color: var(--sub); }
.gbtn.sub span { font-size: 15px; }
.qemoji { display: flex; gap: 2px; background: rgba(10, 15, 42, .92); border: 2px solid var(--line); border-radius: 999px; padding: 3px 6px; animation: up .15s; }
.qemoji[hidden] { display: none; }
.qemoji button { width: 38px; height: 38px; border: 0; background: none; font-size: 21px; cursor: pointer; border-radius: 50%; }
.qemoji button:active { background: var(--panel2); }
/* 右：島の通話。誰かが通話しているときは光らせ、人数を出す */
.lobby-btn.call { position: relative; }
.lobby-btn.call.live { border-color: var(--ok); box-shadow: 0 0 12px rgba(46, 230, 166, .45); }
.lobby-btn.call .n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ok); color: #062a1e; font-size: 12px; line-height: 20px; }
.lobby .hint { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(10, 15, 42, .85); border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: 12px; color: var(--sub); white-space: nowrap; pointer-events: none; }
.gfeed { position: absolute; left: 10px; top: 44px; width: min(300px, 70%); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.gfeed div { background: rgba(10, 15, 42, .8); border-radius: 10px; padding: 4px 10px; font-size: 12px; animation: up .2s; }
.gfeed div b { color: var(--accent); margin-right: 4px; }

/* ---- プロフィール・カード ---- */
.prof-head { display: flex; gap: 14px; align-items: center; }
.prof-ava { width: 96px; height: 128px; flex: none; background: radial-gradient(ellipse at 50% 85%, #24306b 0%, transparent 70%); border-radius: 14px; }
.prof-ava img { width: 96px; height: 128px; }
.prof-name { font-family: var(--head); font-size: 22px; }
.title-tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 1px 10px; border-radius: 999px; border: 2px solid currentColor; margin-top: 2px; }
.kv { display: grid; grid-template-columns: 7em 1fr; gap: 6px 10px; margin: 14px 0; font-size: 15px; }
.kv dt { color: var(--sub); font-size: 13px; font-weight: 700; padding-top: 2px; }
.kv dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
/* 自分目標・他者目標（アバターを押したカードの上のほうに大きく。2026-10-12） */
.goals { display: grid; gap: 8px; margin: 14px 0 4px; }
.goal { border: 2px solid; border-radius: 14px; padding: 10px 12px; }
.goal.self { background: rgba(255, 210, 63, .08); border-color: rgba(255, 210, 63, .45); }
.goal.others { background: rgba(46, 230, 166, .08); border-color: rgba(46, 230, 166, .45); }
.goal-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--accent); }
.goal.others .goal-h { color: var(--ok); }
.goal-h span { font-size: 16px; }
.goal p { margin: 4px 0 0; font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
/* ルールの窓（public/js/rulesview.js） */
.rules-view h2 { margin-bottom: 4px; }
.rules-sec { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(24, 34, 79, .55); }
.rules-sec h3 { font-size: 16px; margin: 0 0 8px; }
.rules-text { counter-reset: rule; }
.rules-text p { position: relative; margin: 0 0 8px; padding-left: 1.7em; font-size: 14px; line-height: 1.65; }
.rules-text p::before { counter-increment: rule; content: counter(rule) "."; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.rules-coin { width: 100%; border-collapse: collapse; font-size: 14px; }
.rules-coin th { color: var(--sub); font-size: 12px; font-weight: 700; text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.rules-coin td { padding: 8px 6px; border-bottom: 1px solid rgba(42, 54, 114, .6); vertical-align: top; }
.rules-coin td.n { color: var(--accent); font-weight: 800; white-space: nowrap; text-align: right; }
.rules-coin td.lim { color: var(--sub); font-size: 12px; white-space: nowrap; }
.rules-notes { margin: 0; padding-left: 1.2em; }
.rules-notes li { margin: 4px 0; font-size: 13px; color: var(--sub); line-height: 1.6; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.stats div { background: var(--bg2); border-radius: 12px; padding: 8px 4px; text-align: center; }
.stats b { display: block; font-family: var(--head); font-size: 22px; color: var(--accent); line-height: 1.2; }
.stats span { font-size: 11px; color: var(--sub); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: inline-flex; align-items: center; gap: 6px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px 2px 2px; font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink); min-height: 36px; }
.person img { width: 32px; height: 32px; border-radius: 50%; background: var(--panel2); object-fit: cover; object-position: top; }
.sec { margin-top: 18px; }
.sec > h3 { font-size: 15px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.sec > h3::after { content: ""; flex: 1; height: 2px; background: var(--line); }

/* ---- 泉 ---- */
.fountain-hero { text-align: center; padding: 6px 0 4px; }
.fountain-hero h2 { font-size: 22px; }
.bignums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.bignums div { background: var(--bg2); border: 2px solid var(--line); border-radius: 14px; padding: 10px 6px; text-align: center; }
.bignums b { display: block; font-family: var(--head); font-size: 28px; line-height: 1.1; }
.bignums span { font-size: 12px; color: var(--sub); }
.bars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 120px; padding: 8px 4px 0; }
.bars .col { display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; justify-content: flex-end; }
.bars .col i { width: 60%; min-height: 2px; background: var(--r5); border-radius: 4px 4px 0 0; }
.bars .col i.p { background: var(--r3); }
.bars .col span { font-size: 11px; color: var(--sub); }
.bars .col em { font-style: normal; font-size: 11px; font-weight: 800; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--sub); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.feed li .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; flex: none; font-size: 18px; }
.feed li p { margin: 0; font-size: 14px; }
.feed li time { font-size: 11px; color: var(--dim); }

/* ---- 紹介の樹 ---- */
.tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 2px dashed var(--line); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: 8px 0; position: relative; }
.tree ul ul li::before { content: ""; position: absolute; left: -18px; top: 18px; width: 14px; height: 2px; background: var(--line); }

/* ---- チャット ---- */
.seg { display: flex; gap: 0; margin: 10px 12px; background: var(--bg2); border-radius: 12px; padding: 4px; border: 2px solid var(--line); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: none; color: var(--sub); font-weight: 800; cursor: pointer; position: relative; }
.seg button.on { background: var(--accent); color: #1a1300; }
.seg button b { margin-left: 4px; background: var(--hot); color: #fff; border-radius: 8px; padding: 0 6px; font-size: 11px; }
.chatwrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.msgs { flex: 1; min-height: 0; overflow: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.msg .av { width: 36px; height: 36px; border-radius: 50%; background: var(--panel2); overflow: hidden; flex: none; cursor: pointer; border: 0; padding: 0; }
.msg .av img { width: 36px; height: 48px; }
.msg .bub { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 7px 12px; white-space: pre-wrap; word-break: break-word; }
.msg .who { font-size: 11px; color: var(--sub); font-weight: 700; margin: 0 0 2px 4px; }
.msg time { font-size: 10px; color: var(--dim); flex: none; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg.mine .bub { background: #2b3a8a; border-color: #3d4fb0; border-radius: 14px 14px 4px 14px; }
.composer { display: flex; gap: 8px; padding: 8px 12px 10px; border-top: 1px solid var(--line); background: rgba(7, 10, 31, .9); }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 120px; }
.dmlist { list-style: none; margin: 0; padding: 0 12px; }
.dmlist li button { width: 100%; display: flex; gap: 10px; align-items: center; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; cursor: pointer; min-height: 60px; }
.dmlist .av { width: 44px; height: 44px; border-radius: 50%; background: var(--panel2); overflow: hidden; flex: none; }
.dmlist .av img { width: 44px; height: 58px; }
.dmlist .last { font-size: 13px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dmlist .un { background: var(--hot); color: #fff; border-radius: 10px; font-size: 11px; padding: 0 7px; font-weight: 800; }
.dmhead { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.back { width: 44px; height: 44px; border: 0; background: none; color: var(--ink); font-size: 22px; cursor: pointer; }

/* ---- プロジェクト・マイページ ---- */
.pad { padding: 12px 12px 24px; }
.pj { background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; cursor: pointer; text-align: left; width: 100%; color: var(--ink); display: block; }
.pj.done { opacity: .82; }
.pj h3 { font-size: 17px; margin: 4px 0; }
.pj p { margin: 0 0 8px; color: var(--sub); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj .faces { display: flex; }
.pj .faces img { width: 30px; height: 30px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--panel); margin-right: -8px; object-fit: cover; object-position: top; }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.headrow h2 { font-size: 20px; }
.menu { list-style: none; margin: 0; padding: 0; border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.menu li + li { border-top: 1px solid var(--line); }
.menu button { width: 100%; text-align: left; background: var(--panel); border: 0; color: var(--ink); padding: 14px; min-height: 52px; cursor: pointer; font-weight: 700; display: flex; justify-content: space-between; }
.menu button::after { content: "›"; color: var(--dim); }
.code { font-family: var(--head); font-size: 26px; letter-spacing: .14em; color: var(--accent); text-align: center; background: var(--bg2); border: 2px dashed var(--line); border-radius: 12px; padding: 8px; user-select: all; }
.inbox li { list-style: none; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.inbox li.new p { font-weight: 800; }
.inbox li p { margin: 0; }
.inbox { margin: 0; padding: 0; }

/* ---- 運営 ---- */
.admin-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.adm-item { border: 2px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; background: var(--panel); }
.adm-item .row { flex-wrap: wrap; }
.secret { font-family: ui-monospace, monospace; word-break: break-all; background: var(--bg2); padding: 8px; border-radius: 8px; user-select: all; }

.legal { padding: calc(16px + var(--safe-t)) 16px 40px; overflow: auto; }
.legal .in { max-width: 720px; margin: 0 auto; }
.legal h1 { font-size: 22px; margin: 12px 0; }
.legal h2 { font-size: 17px; margin: 22px 0 6px; }
.legal p, .legal li { color: var(--sub); }
.adm-ava { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--panel2); flex: none; }
.adm-ava img { width: 44px; height: 58px; }
.weakpw { position: relative; z-index: 3; border: 0; border-bottom: 2px solid #000; background: var(--r2); color: #241300; font-weight: 800; font-size: 13px; padding: 8px 12px; text-align: left; cursor: pointer; }
.weakpw[hidden] { display: none; }
#fx, #tapfx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#fx { z-index: 25; }
#tapfx { z-index: 40; }

/* ---- 生成パーツのアバター（2026-10-06） ---- */
img.face { object-fit: cover; object-position: 50% 30%; background: radial-gradient(circle at 50% 40%, #2c3a86, #141b48); }
.topbar .me-ava img, .msg .av img, .dmlist .av img, .adm-ava img { width: 100%; height: 100%; margin: 0; }
.person img.face { width: 32px; height: 32px; }
.pj .faces img.face { width: 30px; height: 30px; }
.prof-ava { width: 104px; height: 150px; display: flex; align-items: flex-end; justify-content: center; }
.prof-ava img.fullbody { width: auto; height: 146px; }
.maker-stage { height: 260px; }
.maker-stage img.fullbody { width: auto; height: 236px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.45)); }
.maker-opts.pics { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); }
.maker-opts button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; }
.maker-opts.pics button { min-height: 108px; padding: 6px 4px; }
.maker-opts.pics img { width: 72px; height: 72px; object-fit: contain; }
.maker-opts small { font-size: 11px; color: var(--sub); line-height: 1.2; }
.maker-opts button.on small { color: var(--accent); }
.maker-opts .none { width: 72px; height: 72px; display: grid; place-items: center; color: var(--dim); }

/* ---- 生成した絵の組み込み（2026-10-06） ---- */
.tabs button img.tabic { width: 30px; height: 30px; filter: grayscale(.85) brightness(.75); transition: filter .15s, transform .15s; }
.tabs button.on img.tabic { filter: none; transform: translateY(-2px) scale(1.1); }
.bell img.gen { width: 30px; height: 30px; }
img.emblem { width: 30px; height: 30px; }
.badge img.gen { width: 22px; height: 22px; margin-left: -6px; }
.stats img.st { width: 26px; height: 26px; display: block; margin: 0 auto 2px; }
.fountain-hero img.hero { width: 160px; height: auto; display: block; margin: -4px auto 4px; filter: drop-shadow(0 10px 18px rgba(76,201,255,.35)); }
.welcome.keyart { background: linear-gradient(180deg, rgba(7,10,31,.15) 0%, rgba(7,10,31,.25) 40%, rgba(7,10,31,.92) 72%), url("/img/gen/keyart.webp") center / cover no-repeat; justify-content: flex-end; }
.welcome.keyart .logo { margin-top: 0; }
@media (min-width: 720px) { .welcome.keyart { background-size: auto 100%, cover; } }

/* ---- ロビーの拡大・移動のボタン（2026-10-06） ---- */
.lobby .hud-r { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.zoombar { display: flex; flex-direction: column; background: rgba(10, 15, 42, .85); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.lobby-btn { min-width: 44px; min-height: 44px; border: 0; background: rgba(10, 15, 42, .85); color: var(--ink); font-size: 20px; font-weight: 800; cursor: pointer; }
.zoombar .lobby-btn + .lobby-btn { border-top: 1px solid var(--line); }
.lobby-btn.recenter { white-space: nowrap; font-size: 13px; padding: 0 14px; border: 2px solid var(--accent); border-radius: 999px; color: var(--accent); }
.lobby-btn[hidden] { display: none; }
.lobby .lobby-btn.recenter { position: absolute; top: 48px; right: 10px; z-index: 2; }

/* ---- プロジェクトの島（2026-10-12）：島一覧・テーマの選択・虹のボタン ---- */
/* 縦長の小さいボタン（拡大・縮小と同じ幅。スマホで下の列が画面からはみ出さないように） */
.lobby-btn.isles { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 48px; padding: 5px 0 4px; border: 2px solid var(--line); border-radius: 14px; font-size: 22px; line-height: 1; }
.lobby-btn.isles small { font-size: 10px; font-weight: 800; white-space: nowrap; }
.lobby-btn.isles:hover { border-color: var(--accent); }
.isles h3 { margin: 18px 0 8px; font-size: 15px; color: var(--sub); }
.isle-row { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 8px; padding: 8px 12px 8px 8px; text-align: left; background: var(--panel2); border: 2px solid var(--line); border-radius: 14px; color: var(--ink); cursor: pointer; font: inherit; }
.isle-row:hover { border-color: var(--accent); }
.isle-row.here { border-color: var(--ok); cursor: default; }
.isle-row b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isle-row .tiny { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.isle-thumb { flex: none; width: 76px; height: 52px; object-fit: contain; }
.isle-go { flex: none; font-weight: 800; font-size: 13px; color: var(--accent); white-space: nowrap; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; margin-top: 6px; }
.theme { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 8px; background: var(--panel2); border: 2px solid var(--line); border-radius: 12px; color: var(--sub); font: inherit; font-size: 11px; font-weight: 800; cursor: pointer; line-height: 1.25; text-align: center; }
.theme img, .theme .theme-auto { width: 72px; height: 50px; object-fit: contain; }
.theme .theme-auto { display: grid; place-items: center; font-size: 30px; }
.theme.on { border-color: var(--accent); background: #2b3a8a; color: var(--ink); box-shadow: 0 0 0 2px rgba(255, 210, 63, .35); }
.btn.rainbow { background: var(--rainbow); color: #14102a; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }

/* PC：スクロールできる箱に細いスクロールバーを見せる（下に続きがあると分かるように）。つかんでなぞる間は文字を選ばない */
@media (pointer: fine) {
  .modal, .tabview > .scr { scrollbar-width: thin; scrollbar-color: #3b4a96 transparent; }
  .modal::-webkit-scrollbar, .tabview > .scr::-webkit-scrollbar { width: 10px; }
  .modal::-webkit-scrollbar-thumb, .tabview > .scr::-webkit-scrollbar-thumb { background: #3b4a96; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
}
body.dragging, body.dragging * { user-select: none !important; cursor: grabbing !important; }
/* 幅 360 以下：あいさつのボタンを詰めて、右の通話・島一覧・拡大のボタンを画面に残す */
@media (max-width: 360px) {
  .grow-row { gap: 4px; }
  .gbtn { padding: 0 8px; font-size: 12px; }
  .gbtn span { font-size: 16px; }
  .gbtn.emo { width: 38px; }
  .qemoji button { width: 34px; height: 36px; font-size: 19px; }
}
.rules-ic { width: 22px; height: 22px; vertical-align: -5px; margin-right: 6px; }

/* メンバー種別の札（2026-10-12 社長「メンバー種別を2つに分けたい」）。上のバー・メンバーのカード・ロビーの一覧で使う */
.tier-tag { display: inline-flex; align-items: center; flex: none; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 18px; white-space: nowrap; border: 1px solid; }
.tier-tag.rookies { color: #b8f5c4; background: rgba(46, 230, 166, .14); border-color: rgba(46, 230, 166, .55); }
.tier-tag.members { color: #ffe9a3; background: rgba(255, 210, 63, .14); border-color: rgba(255, 210, 63, .55); }
.tier-tag[hidden] { display: none; }
/* ルーキーズの「読むだけ」の案内（チャットの入力欄の代わり） */
.rookie-note { margin: 0; padding: 10px 14px calc(10px + var(--safe-b)); font-size: 13px; line-height: 1.5; color: #b8f5c4; background: rgba(46, 230, 166, .08); border-top: 1px solid rgba(46, 230, 166, .35); text-align: center; }
/* ロビーの右の列：隠したボタン（.isles は display:flex なので、隠す指定を後ろで強める） */
.lobby-btn.isles[hidden] { display: none; }
.lobby-btn.isles.rk { border-color: rgba(46, 230, 166, .7); color: #b8f5c4; }
/* ルーキーズのロビーの左下：PR を書くボタンと一言 */
.gbtn.green { border-color: var(--ok); color: #b8f5c4; background: rgba(6, 40, 30, .9); }
.rk-lobby-note { margin: 0; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #b8f5c4; background: rgba(7, 10, 31, .78); }

/* 横向きで背が低いときは、右の列を横に並べる（844x390 でルールのボタンが上の帯に隠れた。ルーキーズの島ではボタンが1つ増える・2026-10-12） */
@media (max-height: 500px) {
  .lobby .hud-r { flex-direction: row; flex-wrap: wrap-reverse; justify-content: flex-end; align-items: flex-end; max-width: max(160px, calc(100vw - 320px)); } /* 左の挨拶の帯（幅 約290px）にかかるときは2段に折り返す */
  .lobby .zoombar { flex-direction: row; } /* ＋−も横にして、折り返しても上の帯にかからない高さにする */
  .lobby .zoombar .lobby-btn + .lobby-btn { border-top: 0; border-left: 1px solid var(--line); }
}
@media (max-width: 360px) {
  .tabs button { font-size: 10px; white-space: nowrap; letter-spacing: -.04em; } /* 1つ 64px に6文字を1段で収める（320x568） */
}
