@charset "UTF-8";

/* Night garden, warm timber and a small pool of lamplight share one restrained UI palette. */
:root {
  color-scheme: dark;
  --bg: #10231d;
  --panel: #1c3228;
  --panel2: #2b4533;
  --line: #49644c;
  --ink: #f2e8d2;
  --muted: #b4c1aa;
  --warm: #efc48b;
  --warm2: #d4a66b;
  --coral: #e8a08b;
  --green: #aac895;
  --font: 'Microsoft YaHei UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
}
* { box-sizing: border-box; }
html { scroll-padding-block: 20px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.65 var(--font); font-variant-numeric: tabular-nums; -webkit-text-size-adjust: 100%; }
button, input, textarea, select { font: inherit; }
button { min-width: 44px; min-height: 44px; border: 1px solid #577151; background: #2e4836; color: var(--ink); border-radius: 6px; padding: 9px 14px; cursor: pointer; font-weight: 600; }
button:hover:not(:disabled) { background: #3c5841; border-color: #9aa67b; }
button:disabled { color: #9ba28d; background-color: #263a2c; border-color: #40513b; cursor: not-allowed; box-shadow: none; }
button.primary { background: var(--warm); color: #352c20; border-color: var(--warm); box-shadow: 0 3px 0 #977248; }
button.primary:hover:not(:disabled) { background: #f5d4a4; }
button.primary:disabled { background: #64704f; border-color: #64704f; color: #c4c7ae; box-shadow: none; }
button.danger { color: #ffc0a9; border-color: #9a6558; }
button.ghost { background: transparent; }
button.text-button { border-color: transparent; background: transparent; padding: 7px 10px; color: var(--muted); font-weight: 400; }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 4px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 2.2vw, 34px); line-height: 1.3; letter-spacing: .5px; font-weight: 700; }
h2 { font-size: 18px; line-height: 1.4; }
h3 { font-size: 16px; line-height: 1.45; }
p { color: var(--muted); }
small, .small { font-size: 12px; color: var(--muted); line-height: 1.6; }
a { color: var(--warm); }
.full { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.topbar { max-width: 1500px; min-height: 84px; margin: auto; display: flex; align-items: center; gap: 24px; padding: 16px 40px; border-bottom: 1px solid #2e4938; }
.brand { display: flex; align-items: center; gap: 13px; color: var(--ink); text-decoration: none; flex: none; }
.brand svg { width: 31px; height: 31px; color: var(--warm); }
.brand > span { font-size: 25px; font-weight: 750; letter-spacing: 4px; line-height: 1.1; }
.brand small { display: block; margin-top: 8px; font-size: 11px; letter-spacing: 1px; font-weight: 400; }
.top-status { display: flex; align-items: center; justify-content: center; gap: 9px; margin-left: auto; color: var(--muted); font-size: 13px; }
.top-status i, .warm-dot { display: inline-block; flex: none; width: 7px; height: 7px; background: var(--green); box-shadow: 0 0 9px #a7c69550; border-radius: 50%; }
.top-status i.failed { background: var(--coral); }
.identity { max-width: 220px; min-width: 100px; background: transparent; border-color: #58704f; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }

.world-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; align-items: start; max-width: 1500px; margin: 0 auto; gap: 30px; padding: 32px 40px 24px; }
.world-column { min-width: 0; }
.scene-intro { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.scene-intro > div { min-width: 0; }
.scene-intro > .primary { flex: none; margin-bottom: 3px; font-size: 13px; }
.scene-intro p { margin-top: 8px; font-size: 13px; }
.scene-overline { font-size: 12px; color: var(--warm); display: block; margin-bottom: 6px; }
.scene {
  position: relative; width: 100%; aspect-ratio: 960 / 580;
  container-type: inline-size; background: #263f31; border: 0; border-radius: 2px;
  box-shadow: 0 0 0 3px #52654a, 0 0 0 4px #0b1d15, 0 7px 0 #091a12;
  overflow: hidden; isolation: isolate; touch-action: manipulation; cursor: crosshair;
}
.scene > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.scene.in-room, .scene[data-space="room"] { background: #74573f; box-shadow: 0 0 0 3px #8a7050, 0 0 0 4px #221c15, 0 7px 0 #091a12; }
.moon-label { position: absolute; left: 3%; top: 5%; color: #e0dfbf; font-size: 10px; letter-spacing: 1px; border: 1px solid #697c5b; padding: 3px 8px; background: #112b22db; pointer-events: none; }
.scene.in-room .moon-label, .scene[data-space="room"] .moon-label { background: #30271ee8; border-color: #98734c; color: #f3d9ac; }
.room-doors, .scene-tables, .sprite-layer { position: absolute; inset: 0; pointer-events: none; }
.room-doors { z-index: 1; }
.scene-tables { z-index: 2; }
.sprite-layer { z-index: 3; }

.door {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%, -100%);
  pointer-events: auto; padding: 8px 5px 5px; width: clamp(44px, 8cqw, 78px); height: clamp(50px, 10.3cqw, 100px);
  border: 3px solid #aa865a; border-radius: 1px; background: #745738;
  box-shadow: inset 0 0 0 3px #473b2b, 3px 4px 0 #10271c; font-size: 11px; line-height: 1.45;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px;
}
.door::before { content: ''; position: absolute; right: 8px; top: 52%; width: 4px; height: 7px; background: #f2cf88; box-shadow: 0 0 9px #f1d19560; }
.door::after { content: ''; position: absolute; top: -11px; left: 9px; right: 9px; height: 5px; background: #efd094; box-shadow: 0 0 19px #efc48b55; }
.door > span, .door .door-title { display: block; width: 100%; padding: 2px; background: #3c3326d9; color: #f5e3c5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.door small { color: #f2d7ae; font-size: 10px; }
.door.active, .door.current { background: #957143; border-color: var(--warm); }
.door.locked { border-color: #c89b69; }
.door.full { border-color: #9a8e6f; }
.door.full > span { color: #d9cfb5; }
.door.exit-door { left: 8%; }
.more-doors { position: absolute; left: 86%; top: 39%; transform: translate(-50%, -100%); pointer-events: auto; background: #253d2af2; padding: 7px 8px; font-size: 11px; }

/* The sprite scales with the world; its transparent button remains at least 44×44. */
.person { position: absolute; width: clamp(44px, 5cqw, 48px); height: clamp(44px, 6.25cqw, 60px); min-height: 44px; transform: translate(-50%, -100%); padding: 0; border: 0; background: transparent !important; border-radius: 0; pointer-events: auto; transition: left .32s linear, top .32s linear; z-index: 2; }
.person canvas { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: clamp(24px, 5cqw, 48px); height: auto; aspect-ratio: 32 / 40; image-rendering: pixelated; display: block; filter: drop-shadow(0 2px 0 #10241960); pointer-events: none; }
.person .person-name { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); max-width: 120px; font-size: 11px; line-height: 1.5; white-space: nowrap; font-weight: 400; background: #10231ce8; padding: 2px 7px; border-radius: 3px; border: 1px solid #68805c88; color: #e7e5cb; text-overflow: ellipsis; overflow: hidden; opacity: .72; pointer-events: none; }
.person:hover .person-name, .person:focus-visible .person-name, .person.selected .person-name { opacity: 1; }
.person.mine .person-name { border-color: var(--warm); color: var(--warm); opacity: 1; }
.person.friend:not(.mine) .person-name { background: #e2e4c9; color: #2b3b2a; border-color: #b4c394; opacity: 1; }
.person.selected::before { content: ''; position: absolute; left: 50%; bottom: -4px; width: clamp(30px, 6cqw, 56px); height: clamp(9px, 1.65cqw, 16px); transform: translateX(-50%); border: 2px solid var(--warm); border-radius: 50%; box-shadow: 0 0 14px #efc48b45; pointer-events: none; }
.person.newcomer::after { content: ''; position: absolute; top: 3px; left: 50%; width: clamp(19px, 3.4cqw, 32px); height: 8px; border: 2px solid #f4d992; border-radius: 50%; box-shadow: 0 0 11px #f4d99255; transform: translateX(-50%) rotate(-9deg); pointer-events: none; }
.person.bubbling .person-name { opacity: 0; }
.person-bubble { position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translateX(-50%); width: max-content; max-width: min(220px, 55cqw); padding: 6px 9px; background: var(--ink); color: #2a3a2e; border: 2px solid #aa9065; border-radius: 4px; box-shadow: 3px 3px 0 #0c2118; font-size: 12px; font-weight: 500; line-height: 1.5; overflow-wrap: anywhere; pointer-events: none; animation: speech-in .14s ease-out; }
.person-bubble::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: #aa9065; }
@keyframes speech-in { from { opacity: 0; transform: translate(-50%, 5px); } to { opacity: 1; transform: translate(-50%, 0); } }
.person-actions { position: absolute; z-index: 200; pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 5px; max-width: calc(100% - 16px); width: max-content; padding: 5px; background: #142a21f5; border: 1px solid var(--warm); border-radius: 6px; box-shadow: 3px 4px 0 #0b1d15; transform: translate(-50%, -100%); }
.person-actions button { min-height: 44px; padding: 7px 10px; font-size: 12px; border-radius: 4px; }
.person-action-name { width: 100%; font-size: 11px; color: var(--warm); padding: 0 5px; line-height: 1.5; text-align: center; }

.scene-table { position: absolute; transform: translate(-50%, -50%); min-width: 44px; min-height: 44px; width: clamp(54px, 11cqw, 112px); background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 4px 7px; pointer-events: auto; font-size: 11px; line-height: 1.4; box-shadow: none; }
.scene-table:hover:not(:disabled), .scene-table.selected { background: #efc48b16; border-color: var(--warm); color: var(--warm); }
.scene-table.playing { border-color: var(--coral); }
.scene-table small { display: block; color: inherit; font-size: 10px; }
.table-label { position: absolute; top: calc(100% + 3px); left: 50%; transform: translateX(-50%); display: block; width: max-content; max-width: 40cqw; padding: 2px 6px; background: #1a3025ee; border: 1px solid #8d9267; border-radius: 3px; color: inherit; font-size: 10px; white-space: nowrap; pointer-events: none; }
.scene-seat { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; border: 1px dashed #d5c799; background: #f2e8d20f; pointer-events: auto; font-size: 10px; line-height: 1.2; color: #fff1d0; }
.scene-seat:hover:not(:disabled), .scene-seat.selected { background: #efc48b33; border-color: var(--warm); border-style: solid; }
.scene-seat.occupied { border-color: #80936d; background: transparent; color: #e6dcc6; }
.scene-seat.ready, .scene-seat.mine { border-color: var(--warm); border-style: solid; }
.scene-seat:disabled { opacity: .66; background: transparent; }
.scene-hint { position: absolute; bottom: 12px; left: 14px; color: #e1e1c9; font-size: 10px; line-height: 1.5; background: #142c23db; padding: 5px 9px; border: 1px solid #657c5366; pointer-events: none; z-index: 4; }
.scene-hint span { margin-left: 10px; color: var(--muted); }
.scene-bubble { position: absolute; bottom: 12%; left: 50%; transform: translateX(-50%); padding: 9px 15px; background: var(--ink); color: #2c3d30; max-width: 80%; border: 2px solid #ab9269; font-size: 12px; display: none; box-shadow: 3px 3px 0 #15271e; pointer-events: none; }
.scene-bubble.show { display: block; }
.world-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 16px 0 25px; gap: 5px 16px; }
.location-info { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.location-info small { margin-left: 4px; }
.world-footer-actions { display: flex; align-items: center; gap: 5px; }
.panel-toggle { display: none; }

.table-strip { border-top: 1px solid #3e573e; padding-top: 22px; scroll-margin-top: 20px; }
.section-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-line span { color: var(--muted); font-size: 12px; }
.game-menu { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.game-menu button { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 15px 13px; border-radius: 4px; background: #213a2c; border-color: #4b6849; box-shadow: 0 3px 0 #0c2117; }
.game-menu button:hover:not(:disabled) { background: #2f4b36; }
.pixel-icon { font-family: Georgia, serif; font-size: 25px; line-height: 1.2; color: var(--warm); margin-bottom: 8px; }
.game-menu b { font-size: 13px; }
.game-menu small { font-size: 11px; font-weight: 400; margin-top: 5px; }
.table-card { margin-top: 16px; padding: 19px; border: 1px solid #5b734f; background: #223b2b; box-shadow: 0 3px 0 #0c1d16; scroll-margin-top: 20px; }
.table-card.selected { border-color: var(--warm); }
.table-card.playing { border-top: 3px solid var(--warm); }
.table-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.table-header > div { min-width: 0; }
.table-header small { display: block; margin-top: 5px; }
.table-header > button { flex: none; }
.seat-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.seat-list span { padding: 4px 9px; background: #304c33; border: 1px solid #627951; border-radius: 4px; font-size: 12px; }
.seat-list span.ready { border-color: var(--warm); color: var(--warm); }
.seat-list span.empty { background: transparent; border-style: dashed; color: var(--muted); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.game-area { border-top: 1px solid #4c6745; padding-top: 16px; margin-top: 16px; }
.game-area p { margin-top: 8px; }
.game-area .game-status { color: var(--warm); font-size: 16px; font-weight: 600; }
.choice-row { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 16px; }
.choice-row button { flex: 1; min-width: 80px; padding: 13px 9px; font-size: 14px; }
.game-rule { font-size: 12px; color: var(--muted); margin-top: 10px !important; }
.game-area.finished { border-top: 0; margin-top: 13px; padding-top: 0; }
.game-result { padding: 18px; border: 1px solid #7a915f; background: #2d4931; }
.game-result .game-status, .game-result h3, .game-result > strong { display: block; font-size: 22px; line-height: 1.35; color: var(--warm); }
.game-result p { color: #d1dbc0; font-size: 13px; }
.board { width: min(100%, 480px); height: auto; image-rendering: pixelated; display: block; margin: 16px auto; border: 4px solid #788060; background: #ddd9b9; touch-action: manipulation; }
.token-options { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.token-options button { min-width: 52px; }

.reward { position: relative; background: #3c3324; border: 1px solid #b9965d; padding: 17px; margin-top: 15px; }
.reward-header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.reward b, .reward-header strong { color: var(--warm); }
.privacy-badge { display: inline-flex; align-items: center; min-height: 25px; border: 1px solid #c29b63; border-radius: 20px; padding: 1px 9px; color: var(--warm); font-size: 11px; white-space: nowrap; }
.reward.sealed { border-style: dashed; background: #352f24; }
.reward.sealed::before { content: ''; display: block; width: 30px; height: 22px; border: 2px solid #b9965d; background: linear-gradient(33deg, transparent 48%, #b9965d 49%, #b9965d 53%, transparent 54%), linear-gradient(-33deg, transparent 48%, #b9965d 49%, #b9965d 53%, transparent 54%); margin-bottom: 11px; }
.reward p { color: #eedfc4; white-space: pre-wrap; overflow-wrap: anywhere; }
.reward > small { display: block; margin-top: 5px; }
.reward-body { margin-top: 13px; padding-top: 12px; border-top: 1px solid #8c734855; }
.reward-body p + p { margin-top: 10px; }
.reward.revealed { border-style: solid; background: #453b29; }
.reward .button-row { margin-top: 13px; }
.reward > button { margin-top: 12px; }

.social-panel { border: 1px solid #4b6646; background: var(--panel); min-width: 0; align-self: start; position: sticky; top: 18px; box-shadow: 0 5px 0 #0b1d15; scroll-margin-top: 16px; }
.panel-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: #172d23; border-bottom: 1px solid #4b6646; padding: 4px 4px 0; }
.panel-tabs button { min-width: 0; border: 0; background: transparent; border-radius: 0; padding: 13px 0; color: var(--muted); position: relative; }
.panel-tabs button.active, .panel-tabs button[aria-pressed="true"] { color: var(--warm); box-shadow: inset 0 -3px var(--warm); }
.panel-tabs button span:not(:empty) { display: inline-block; font-size: 10px; background: var(--coral); color: #32241d; margin-left: 3px; min-width: 14px; border-radius: 8px; }
.tab-panel { padding: 21px 18px; }
.panel-heading { margin-bottom: 17px; }
.panel-heading h2 { font-size: 17px; }
.panel-heading span { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.chat-log { height: 330px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #687a57 transparent; padding-right: 5px; }
.chat-empty { padding: 75px 15px; text-align: center; font-size: 13px; color: var(--muted); }
.chat-row { margin-bottom: 15px; }
.chat-row header { display: flex; gap: 8px; align-items: center; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.chat-row header button { font-size: 12px; border: 0; min-height: 44px; padding: 3px 0; background: transparent; color: var(--warm); text-align: left; }
.chat-row time { margin-left: auto; font-size: 10px; color: #a5b196; flex: none; }
.chat-row .bubble { display: inline-block; max-width: 100%; padding: 8px 11px; background: #2b4633; border: 1px solid #486245; border-radius: 2px 10px 10px 10px; white-space: pre-wrap; overflow-wrap: anywhere; color: #e8e6d0; font-size: 13px; }
.chat-row.mine .bubble { background: #45543a; border-color: #6e7e54; }
.chat-row .sticker { font-size: 32px; line-height: 1.2; display: block; margin-top: 4px; }
.sticker-picker { display: flex; flex-wrap: wrap; gap: 6px 2px; padding-top: 12px; border-top: 1px solid #405c3f; margin-top: 12px; }
.sticker-picker button { font-size: 20px; flex: 1 0 44px; min-width: 44px; min-height: 44px; padding: 5px; border: 0; background: transparent; }
.chat-form { margin-top: 9px; }
.chat-form textarea { width: 100%; resize: vertical; background: #142b20; border: 1px solid #617952; border-radius: 5px; min-height: 72px; padding: 11px 12px; color: var(--ink); }
textarea::placeholder, input::placeholder { color: #98a88e; opacity: 1; }
.chat-form > div { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-top: 8px; }
.chat-form small { font-size: 10px; }
.chat-form button { min-width: 70px; }
.list-card { padding: 17px 0; border-bottom: 1px solid #405c3f; }
.list-card:last-child { border-bottom: 0; }
.list-card header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; }
.list-card small { display: block; margin-top: 4px; }
.list-card .button-row { margin-top: 9px; }
.list-card button { padding: 7px 11px; font-size: 12px; }
.empty-note { color: var(--muted); font-size: 12px; margin: 18px 0; }
.room-current { padding: 14px; background: #2e4832; margin: 16px 0; border-left: 3px solid var(--warm); }
.room-current p { font-size: 12px; margin: 6px 0; }
.notification { font-size: 12px; border-left: 2px solid var(--warm); padding: 9px 11px; margin: 9px 0; background: #29402d; }

.me-avatar { display: flex; gap: 17px; align-items: center; margin-bottom: 16px; }
.me-avatar canvas { width: 70px; height: 88px; image-rendering: pixelated; background: #304c39; border: 1px solid #697e56; padding: 8px; flex: none; }
.me-avatar h2 { font-size: 22px; overflow-wrap: anywhere; }
.tag { display: inline-block; border: 1px solid #897e59; font-size: 10px; padding: 2px 7px; color: var(--warm); margin-top: 4px; }
.xp-line { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.xp-bar { height: 5px; background: #14281d; margin-bottom: 20px; }
.xp-bar i { display: block; height: 100%; background: var(--warm); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; border-top: 1px solid #4d6247; border-bottom: 1px solid #4d6247; padding: 14px 0; margin-bottom: 15px; }
.stat-grid strong { display: block; font-size: 22px; line-height: 1.3; font-weight: 500; }
.stat-grid small { font-size: 10px; }
.profile-actions { display: grid; gap: 8px; }
.profile-actions button { text-align: left; background: #263e2e; font-size: 12px; }
.record { padding: 14px 0; border-bottom: 1px solid #43583f; font-size: 12px; }
.record header { display: flex; justify-content: space-between; gap: 12px; }
.record p { font-size: 12px; margin-top: 5px; }
.record .win { color: var(--warm); }
.site-footer { max-width: 1500px; margin: 8px auto 0; padding: 18px 40px max(28px, env(safe-area-inset-bottom)); color: #a2af93; font-size: 11px; display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid #2e4938; }

/* Authentication is an entrance of its own, with an opaque night backdrop. */
.auth-overlay { position: fixed; inset: 0; background: radial-gradient(ellipse at 50% 35%, #2d4632, #10231d 72%); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 26px; overflow: auto; }
.auth-card { width: min(460px, 100%); padding: 34px; margin: auto; background: #24392a; border: 1px solid #8e9a71; border-top: 4px solid var(--warm); box-shadow: 0 8px 0 #0d2016, 0 25px 90px #0004; position: relative; }
.auth-card h1 { font-size: 30px; line-height: 1.4; margin-top: 14px; text-wrap: balance; }
.auth-card p { font-size: 13px; margin-top: 9px; }
.auth-emblem { font-size: 13px; color: var(--warm); letter-spacing: 2px; }
.auth-tabs { display: flex; border-bottom: 1px solid #5a6b4c; margin: 21px 0 18px; }
.auth-tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.auth-tabs button.active { color: var(--warm); box-shadow: inset 0 -2px var(--warm); }
.field { display: block; font-size: 12px; color: var(--ink); margin: 14px 0; }
.field input, .field textarea, .field select { display: block; margin-top: 6px; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #6d7e55; border-radius: 4px; background: #14291d; color: var(--ink); }
.field textarea { resize: vertical; }
.field small { display: block; margin-top: 5px; }
.check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 12px 0; min-height: 44px; }
.check input { accent-color: var(--warm); width: 18px; height: 18px; flex: none; }
.form-error { color: #ffb79e; min-height: 20px; font-size: 12px; margin: 8px 0; }
.auth-card .primary { margin-top: 4px; }
.auth-footnote { font-size: 11px !important; line-height: 1.7; border-top: 1px solid #526345; padding-top: 14px; margin-top: 19px !important; }
dialog { color: var(--ink); background: #23382a; border: 1px solid #83926b; padding: 26px; width: min(520px, calc(100% - 30px)); max-height: 88dvh; overflow: auto; overscroll-behavior: contain; box-shadow: 0 8px 0 #0c1f14, 0 30px 100px #0007; border-radius: 4px; }
dialog::backdrop { background: #071b15ce; backdrop-filter: blur(4px); }
.dialog-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.dialog-top h2 { font-size: 23px; }
.dialog-top button { padding: 0; width: 44px; border: 0; background: transparent; font-size: 24px; flex: none; }
.dialog-description { font-size: 13px; margin-bottom: 18px; }
.dialog-description strong { color: var(--warm); }
.avatar-preview { display: grid; place-items: center; background: #314d36; border: 1px solid #607954; height: 170px; margin: 12px 0; }
.avatar-preview canvas { width: 96px; height: 120px; image-rendering: pixelated; }
.avatar-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 15px; }
.assessment-dialog { width: min(760px, calc(100% - 24px)); }
.assessment-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0; }
.assessment-tabs button { min-width: 44px; font-size: 11px; padding: 7px; }
.assessment-tabs button.active { background: var(--warm); color: #332d24; }
.assessment-question { border: 0; border-top: 1px solid #526746; padding: 18px 0; margin: 0; }
.assessment-question legend { float: left; display: block; width: 100%; font-size: 13px; margin-bottom: 9px; }
.assessment-question label { display: flex; clear: both; align-items: center; gap: 15px; }
.assessment-question select, .visibility-row select { border: 1px solid #637951; background: #14291d; color: var(--ink); min-height: 44px; padding: 7px 11px; border-radius: 4px; max-width: 100%; }
.assessment-note { font-size: 12px; margin-top: 18px; border-top: 1px solid #526345; padding-top: 12px; }
.score-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.score-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; background: #304834; font-size: 12px; }
.radar { display: block; width: min(100%, 360px); margin: 15px auto; }
.radar-grid polygon, .radar-grid line { stroke: #7a8c5c66; stroke-width: 1; fill: none; }
.radar-value { stroke: var(--warm); stroke-width: 2; fill: #efc48b33; }
.radar text { fill: #dfdfc6; font-size: 8px; text-anchor: middle; dominant-baseline: middle; }
.assessment-results { margin-top: 19px; }
.dm-log { height: 280px; overflow: auto; padding: 10px 0; }
.public-dimensions { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.public-dimensions span { padding: 4px 8px; background: #35503a; font-size: 12px; }
.rule-list { padding-left: 21px; color: var(--muted); font-size: 13px; }
.rule-list li { margin: 10px 0; }
#toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(12px); z-index: 50; background: #f0dfbb; color: #35412f; border: 2px solid #af9764; padding: 11px 18px; max-width: min(500px, 90%); width: max-content; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; box-shadow: 3px 4px 0 #0d2119; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.load-message { text-align: center; margin-top: 20px; color: var(--muted); }

@media (min-width: 1450px) {
  .world-layout { grid-template-columns: minmax(0, 1fr) 370px; gap: 34px; }
  .chat-log { height: 405px; }
}
@media (max-width: 1100px) {
  .topbar { padding-inline: 25px; }
  .world-layout { padding: 26px; gap: 24px; grid-template-columns: minmax(0, 1fr) 305px; }
  .scene-intro { align-items: flex-start; gap: 12px; }
  .scene-intro > .primary { font-size: 12px; padding: 9px; }
  .location-info small { display: none; }
  .game-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-menu button { display: grid; grid-template-columns: 28px 1fr; gap: 3px 8px; }
  .game-menu .pixel-icon { grid-row: 1 / 3; margin: 0; }
  .game-menu small { margin: 0; }
  .site-footer { padding-inline: 25px; }
}
@media (max-width: 800px) {
  html { scroll-padding-block: 14px; }
  .topbar { min-height: 76px; padding: 13px 18px; gap: 10px; flex-wrap: wrap; }
  .brand { gap: 9px; }
  .brand > span { font-size: 22px; }
  .brand svg { width: 25px; height: 25px; }
  .brand small { font-size: 10px; margin-top: 6px; letter-spacing: 0; }
  .top-status { font-size: 11px; max-width: 120px; margin-left: auto; }
  .identity { max-width: 140px; min-width: 44px; padding: 7px 10px; font-size: 11px; }
  .world-layout { display: flex; flex-direction: column; padding: 24px 18px 18px; gap: 16px; }
  .world-column { width: 100%; }
  .scene-intro { margin-bottom: 18px; }
  .scene-intro h1 { font-size: 24px; }
  .scene-intro p { font-size: 12px; }
  .scene-intro > .primary { min-width: 95px; }
  .scene .moon-label { font-size: 9px; padding: 2px 6px; }
  .scene-hint { font-size: 9px; left: 8px; bottom: 8px; padding: 3px 6px; }
  .scene-hint span { display: none; }
  .person .person-name { font-size: 10px; top: -20px; max-width: 91px; padding: 1px 5px; }
  .person-bubble { font-size: 11px; padding: 5px 7px; }
  .person-actions { gap: 4px; }
  .person-actions button { padding: 7px 8px; font-size: 11px; }
  .door { font-size: 9px; border-width: 2px; padding: 4px 2px; }
  .door small { font-size: 8px; }
  .door::before { right: 5px; width: 3px; height: 5px; }
  .door::after { top: -8px; height: 4px; left: 7px; right: 7px; }
  .scene-table { font-size: 10px; padding: 3px 5px; }
  .scene-table small, .table-label { font-size: 9px; }
  .scene-seat { font-size: 9px; }
  .world-footer { align-items: flex-start; margin: 12px 0 18px; gap: 3px 8px; }
  .location-info { min-height: 44px; font-size: 12px; align-content: center; }
  .world-footer-actions { margin-left: auto; }
  .world-footer .text-button { font-size: 11px; padding-inline: 6px; }
  .panel-toggle { display: inline-flex; align-items: center; justify-content: center; padding: 7px 9px; font-size: 11px; background: #223c2b; }
  .table-strip { padding-top: 18px; }
  .section-line { align-items: flex-start; gap: 8px; }
  .section-line h2 { font-size: 17px; }
  .section-line span { font-size: 11px; max-width: 122px; text-align: right; }
  .game-menu { gap: 9px; }
  .game-menu button { padding: 13px 11px; }
  .game-menu b { font-size: 13px; }
  .game-menu small { font-size: 10px; }
  .table-card { padding: 15px; }
  .table-header h3 { font-size: 15px; }
  .table-header > button { font-size: 11px; padding: 8px 10px; }
  .seat-list { gap: 5px; }
  .seat-list span { font-size: 11px; }
  .button-row button { flex-grow: 1; font-size: 12px; }
  .choice-row button { font-size: 13px; }
  .game-result { padding: 15px; }
  .game-result .game-status, .game-result h3, .game-result > strong { font-size: 21px; }
  .reward { padding: 15px; }
  .social-panel { position: static; width: 100%; }
  .social-panel.collapsed { display: none; }
  /* Tabs stay inside their panel; no fixed bar can cover room actions or the composer. */
  .panel-tabs { position: static; }
  .panel-tabs button { min-height: 48px; }
  .tab-panel { padding: 19px 17px; }
  .chat-log { height: 260px; max-height: 42dvh; }
  .chat-form textarea { font-size: 16px; resize: vertical; }
  .chat-form > div small { font-size: 10px; max-width: 190px; }
  .site-footer { padding: 17px 18px max(28px, env(safe-area-inset-bottom)); font-size: 10px; }
  .site-footer span { display: none; }
  .auth-overlay { padding: 18px; }
  .auth-card { padding: 25px; }
  .auth-card h1 { font-size: 27px; }
  .auth-card .field input { font-size: 16px; }
  dialog { padding: 21px; }
  .assessment-tabs { gap: 4px; }
  .assessment-tabs button { padding: 7px 9px; }
}
@media (max-width: 420px) {
  .topbar { gap: 7px; }
  .top-status { order: 3; width: 100%; max-width: none; justify-content: flex-start; padding-left: 34px; margin-top: -3px; }
  .identity { margin-left: auto; max-width: 135px; }
  .scene-intro { flex-wrap: wrap; gap: 12px; }
  .scene-intro > .primary { margin-bottom: 0; }
  .scene-intro h1 { font-size: 25px; }
  .world-footer-actions { width: 100%; justify-content: space-between; margin-left: 0; }
  .world-footer { gap: 0; }
  .auth-card { padding: 24px 22px; }
  .auth-card h1 { font-size: 25px; }
  .game-menu button { padding: 12px 9px; }
  .game-menu small { line-height: 1.5; }
  .sticker-picker button { flex-basis: calc((100% - 4px) / 3); }
  .score-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
