:root {
	--paper: #e7d9b8; --ink: #26313d; --dark: #10151c; --panel: rgba(16, 21, 28, 0.82); --accent: #d86679;
	--anomaly: #c8e66a; --trim: #244c68; --good: #7bd88f; --warn: #f2c94c; --bad: #ff6b6b;
	--hand: "Marker Felt", "Comic Sans MS", "Segoe Print", cursive;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #f2efe6; font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; user-select: none; }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; transition: filter 0.6s; }
.hidden { display: none !important; }
kbd { display: inline-block; min-width: 24px; padding: 2px 7px; border-radius: 5px; background: #f2efe6; color: var(--ink); font: bold 14px system-ui; text-align: center; box-shadow: 0 2px 0 #9a927c; }
button { font: inherit; cursor: pointer; }
.dim { opacity: 0.65; } .small { font-size: 12.5px; }

#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.75) 100%); opacity: 0; transition: opacity 0.4s; }
#flash { position: fixed; inset: 0; pointer-events: none; background: #000; opacity: 0; transition: opacity 0.25s; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; padding: 20px; text-align: center; color: #e9eef5; background: #0b0f14; font: 22px var(--hand); z-index: 50; }

/* ---- menu ---- */
#menu { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #1b2733, #07090c 75%); z-index: 20; overflow: auto; }
.menu-card { width: min(680px, 94vw); padding: 26px 30px; background: var(--paper); color: var(--ink); border-radius: 6px; box-shadow: 0 20px 60px #000a, inset 0 0 0 2px #cdbd97; transform: rotate(-0.4deg); }
.logo { font: bold 62px/1 var(--hand); letter-spacing: 2px; display: flex; align-items: baseline; gap: 4px; }
.logo .bell { color: #c62f3b; } .logo small { margin-left: 14px; font-size: 30px; color: var(--ink); opacity: 0.75; }
.tagline { margin: 6px 0 18px; font: 18px var(--hand); }
.menu-card label { display: block; margin: 8px 0; font-weight: 600; font-size: 13.5px; }
.menu-card input, .menu-card select { display: block; width: 100%; margin-top: 4px; padding: 9px 10px; font: 16px system-ui; color: var(--ink); background: #fff8e6; border: 2px solid #b9a77e; border-radius: 5px; }
.menu-row { display: flex; gap: 22px; margin-top: 8px; } .menu-col { flex: 1; } .menu-col h3 { margin: 6px 0; font: 20px var(--hand); }
button.primary { margin-top: 8px; padding: 10px 18px; width: 100%; font: bold 16px system-ui; color: #fff8e6; background: var(--trim); border: 0; border-radius: 6px; box-shadow: 0 3px 0 #142c3d; }
button.primary:hover { filter: brightness(1.15); } button.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #142c3d; }
#menuError { min-height: 20px; color: #b3262f; font-weight: 700; }

/* ---- HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#hud button, #hud input { pointer-events: auto; }
#top { position: absolute; top: 12px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: flex-start; }
#credits { padding: 6px 12px; background: var(--panel); border-radius: 8px; font-size: 18px; } #credits .coin { color: var(--warn); margin-right: 6px; }
#clockBox { text-align: center; text-shadow: 0 2px 6px #000; }
#phaseName { font: bold 13px system-ui; letter-spacing: 3px; opacity: 0.85; }
#clock { font: bold 40px/1 "Courier New", monospace; letter-spacing: 2px; transition: color 0.3s; }
#clock.night { color: #a9c1e8; } #clock.three33 { color: var(--accent); text-shadow: 0 0 18px #d8667988; }
#clock.glitch { animation: glitch 0.12s steps(2) 10; }
@keyframes glitch { 0% { transform: translate(-3px, 1px) skewX(8deg); } 50% { transform: translate(4px, -2px) skewX(-10deg); } 100% { transform: none; } }
#zoneName { font-size: 12.5px; letter-spacing: 1.5px; opacity: 0.7; margin-top: 3px; }
#roomInfo { padding: 6px 12px; background: var(--panel); border-radius: 8px; font-size: 13px; text-align: right; }
#roomInfo b { font: bold 17px "Courier New", monospace; letter-spacing: 3px; color: var(--anomaly); }
#lastBell { position: absolute; top: 17%; left: 50%; transform: translateX(-50%); text-align: center; text-shadow: 0 3px 12px #000; }
.lb-title { font: bold 26px system-ui; letter-spacing: 8px; color: var(--warn); }
#lastBellTime { font: bold 84px/1 "Courier New", monospace; } .lb-sub { letter-spacing: 4px; opacity: 0.8; }
#bellHint { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); padding: 7px 16px; background: #000c; border: 2px solid var(--accent); border-radius: 8px; font-weight: 700; letter-spacing: 1px; color: #ffd9df; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 22px #d86679aa; } }
#announce { position: absolute; top: 150px; left: 50%; transform: translateX(-50%); width: min(720px, 90vw); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ann { padding: 9px 18px; border-radius: 8px; background: var(--panel); text-align: center; animation: annIn 0.3s; max-width: 100%; }
.ann.pa { font-family: "Courier New", monospace; background: #0d1410e8; border-left: 4px solid #7bd88f; color: #cfead2; }
.ann.pa::before { content: "📢 "; }
.ann.warn { background: #3a1114e8; border: 2px solid var(--bad); color: #ffd6d6; font-weight: 700; }
.ann.good { background: #10301ae8; border: 2px solid var(--good); }
.ann.bell { background: #1a0d12ee; border: 2px solid var(--accent); color: #ffd9df; font-weight: 700; letter-spacing: 1px; }
.ann.out { opacity: 0; transition: opacity 0.6s; }
@keyframes annIn { from { transform: translateY(-8px); opacity: 0; } }
#toasts { position: absolute; right: 16px; top: 74px; width: 330px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.toast { padding: 8px 12px; background: var(--paper); color: var(--ink); border-radius: 4px; box-shadow: 0 4px 12px #0008; font-size: 14px; transform: rotate(0.6deg); animation: annIn 0.25s; max-width: 100%; }
.toast.good { border-left: 5px solid #3f9a57; } .toast.warn { border-left: 5px solid #c9962a; } .toast.bad { border-left: 5px solid #c62f3b; }
.toast.credits { background: #fff3c4; font-weight: 700; } .toast.out { opacity: 0; transition: opacity 0.5s; }
#say { position: absolute; left: 50%; bottom: 190px; transform: translateX(-50%); width: min(640px, 86vw); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sayline { padding: 8px 14px; background: #fffbef; color: var(--ink); border-radius: 14px; border: 2px solid var(--ink); font: 17px var(--hand); animation: annIn 0.25s; }
.sayline b { color: #9a2f3b; }
#prompt { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); padding: 7px 14px; background: var(--panel); border-radius: 8px; display: flex; align-items: center; gap: 9px; font-weight: 600; white-space: nowrap; }
#prompt .bar { position: absolute; left: 6px; right: 6px; bottom: -7px; }
.bar { height: 5px; background: #0009; border-radius: 3px; overflow: hidden; } .bar i { display: block; height: 100%; width: 0; background: var(--anomaly); }
#crosshair { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: #fff9; }
#stare { position: absolute; left: 50%; top: 34%; transform: translateX(-50%); width: 300px; text-align: center; }
.stare-label { font-weight: 800; letter-spacing: 3px; color: #fff; text-shadow: 0 0 12px #f00; margin-bottom: 5px; }
#stare .bar { height: 10px; } #stare .bar i { background: #fff; }
#hunted { position: absolute; top: 26%; left: 50%; transform: translateX(-50%); padding: 6px 18px; font: bold 22px system-ui; letter-spacing: 5px; color: var(--bad); border: 2px solid var(--bad); background: #000a; animation: pulse 1s infinite; }
#fx { position: absolute; left: 16px; bottom: 96px; display: flex; flex-direction: column; gap: 5px; }
.fxchip { padding: 4px 10px; background: var(--panel); border-radius: 6px; font-size: 13px; border-left: 4px solid var(--anomaly); }
.fxchip.bad { border-color: var(--bad); }
#slots { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 10px; }
.slot { position: relative; width: 74px; height: 74px; background: var(--panel); border: 2px solid #ffffff2a; border-radius: 10px; display: grid; place-items: center; pointer-events: auto; cursor: pointer; }
.slot img { max-width: 58px; max-height: 54px; } .slot.empty { opacity: 0.45; } .slot.spent img { filter: grayscale(1) brightness(0.55); }
.slot .key { position: absolute; left: 5px; top: 3px; font: bold 12px system-ui; opacity: 0.8; }
.slot .ch { position: absolute; right: 5px; bottom: 2px; font: bold 13px system-ui; color: var(--anomaly); }
.slot.loot { border-color: var(--bad); box-shadow: 0 0 14px #ff6b6b88; }
.slot.fl { width: 56px; height: 56px; align-self: flex-end; font-size: 24px; } .slot.fl.on { border-color: #ffe9a8; box-shadow: 0 0 12px #ffe9a877; }
#sideButtons { position: absolute; right: 16px; bottom: 18px; display: flex; gap: 8px; }
#sideButtons button { position: relative; width: 46px; height: 46px; font-size: 21px; background: var(--panel); color: #fff; border: 2px solid #ffffff2a; border-radius: 10px; }
#btnNote i { position: absolute; right: -4px; top: -4px; width: 13px; height: 13px; border-radius: 50%; background: var(--accent); display: none; } #btnNote.unread i { display: block; animation: pulse 1s infinite; }
#chat { position: absolute; left: 16px; bottom: 18px; width: 320px; }
#chatLog { max-height: 150px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; font-size: 13.5px; text-shadow: 0 1px 3px #000; }
#chatLog div { padding: 1px 0; } #chatLog .sys { opacity: 0.6; font-style: italic; } #chatLog b { color: var(--anomaly); }
#chatInput { width: 100%; margin-top: 4px; padding: 6px 9px; background: #0008; color: #fff; border: 1px solid #fff3; border-radius: 6px; font: 14px system-ui; opacity: 0.55; }
#chatInput:focus { opacity: 1; outline: none; border-color: var(--anomaly); }
#lockHint { position: absolute; left: 50%; top: 66%; transform: translateX(-50%); padding: 8px 16px; background: #000a; border-radius: 8px; }

#detention { position: absolute; left: 16px; top: 74px; padding: 10px 18px; background: #1a0f10ee; border: 2px solid var(--bad); border-radius: 10px; text-align: center; min-width: 330px; }
#detention .dt-title { font-weight: 800; letter-spacing: 3px; color: var(--bad); } #detention .dt-time { font: bold 34px "Courier New", monospace; }
#detention .dt-task { margin-top: 4px; font-size: 14px; } #detention .dt-ways { margin-top: 5px; font-size: 12.5px; opacity: 0.75; }
#teacherHud { position: absolute; left: 16px; top: 74px; width: 290px; padding: 10px 12px; background: #1a1016ee; border: 2px solid var(--accent); border-radius: 10px; font-size: 13.5px; }
#teacherHud h4 { margin: 0 0 6px; letter-spacing: 2px; color: #ffd9df; } #teacherHud .task { padding: 2px 0; } #teacherHud .task.done { color: var(--good); text-decoration: line-through; }
#teacherHud .ab { margin-top: 6px; display: flex; align-items: center; gap: 7px; } #teacherHud .ab.cd { opacity: 0.5; }

/* ---- full-screen moments ---- */
#caught { position: fixed; inset: 0; background: #000; display: grid; place-items: center; z-index: 12; }
.caught-in { text-align: center; font-family: "Courier New", monospace; } .c1 { font-size: 40px; font-weight: 800; letter-spacing: 5px; color: #fff; }
.c2 { margin-top: 14px; font-size: 22px; color: var(--bad); }
#big { position: fixed; left: 0; right: 0; top: 30%; text-align: center; pointer-events: none; font: bold 64px/1.1 system-ui; letter-spacing: 8px; text-shadow: 0 4px 24px #000; z-index: 11; animation: bigIn 3.2s forwards; }
#big small { display: block; margin-top: 10px; font-size: 20px; letter-spacing: 3px; font-weight: 500; opacity: 0.9; }
#big.day { color: #ffe1a6; } #big.night { color: #a9c1e8; } #big.dawn { color: #ffd9a8; } #big.bell { color: var(--accent); } #big.big { color: var(--warn); }
@keyframes bigIn { 0% { opacity: 0; transform: scale(1.15); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---- modal: paper ---- */
#modal { position: fixed; inset: 0; display: grid; place-items: center; background: #000a; z-index: 15; }
#modalBox { position: relative; width: min(760px, 94vw); max-height: 90vh; overflow: auto; padding: 22px 26px; background: var(--paper); color: var(--ink); border-radius: 4px; box-shadow: 0 20px 60px #000c, inset 0 0 0 2px #cdbd97; user-select: text; }
#modalBox.dark { background: #171c24; color: #f2efe6; box-shadow: 0 20px 60px #000c, inset 0 0 0 2px #2c3644; }
#modalBox.note { width: min(480px, 92vw); transform: rotate(-1.2deg); background: #fbf3d6 linear-gradient(#0000 0 31px, #9bb7d455 31px 32px) 0 46px / 100% 32px; font: 21px/32px var(--hand); padding: 30px 34px 26px; }
#modalBox.notebook { background: #f4ecd2 linear-gradient(#0000 0 27px, #9bb7d455 27px 28px) 0 60px / 100% 28px; border-left: 26px solid #6b4a3a; }
#modalBox h2 { margin: 0 0 10px; font: 30px/1.1 var(--hand); } #modalBox h3 { margin: 14px 0 6px; font: 21px var(--hand); }
.close { position: absolute; right: 10px; top: 8px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #0002; font-size: 18px; color: inherit; }
.btn { padding: 8px 14px; margin: 3px 3px 3px 0; background: var(--trim); color: #fff8e6; border: 0; border-radius: 6px; font-weight: 700; box-shadow: 0 2px 0 #142c3d; }
.btn:disabled { opacity: 0.4; cursor: default; } .btn.ghost { background: #0000; color: inherit; box-shadow: inset 0 0 0 2px currentColor; } .btn.red { background: #9a2f3b; box-shadow: 0 2px 0 #5d1820; }
.btn.small { padding: 4px 9px; font-size: 13px; }
.note-role { margin-top: 12px; padding-top: 8px; border-top: 2px dashed #9a2f3b; color: #9a2f3b; }
.note-hint { font-size: 17px; opacity: 0.75; }
.stamp { display: inline-block; padding: 2px 12px; border: 3px solid; border-radius: 6px; font: bold 18px system-ui; letter-spacing: 3px; transform: rotate(-6deg); }
.stamp.done { color: #2f8a4a; } .stamp.failed { color: #b3262f; } .stamp.none { color: #777; }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.item { padding: 10px; background: #fff8e6; border: 2px solid #cdbd97; border-radius: 6px; }
.item .row { display: flex; gap: 10px; align-items: center; } .item img { width: 62px; height: 52px; object-fit: contain; }
.item .nm { font: 18px var(--hand); line-height: 1.1; } .rar { font: bold 11px system-ui; letter-spacing: 2px; opacity: 0.7; }
.rar.FORBIDDEN { color: #9a2f3b; opacity: 1; } .rar.REDACTED { background: #111; color: #111; padding: 0 4px; opacity: 1; } .rar.ODD { color: #3f6a8a; opacity: 1; }
.places { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; } .places .btn.on { background: #2f8a4a; box-shadow: 0 2px 0 #1b5a2e; }
.book-page { display: flex; gap: 20px; min-height: 250px; } .book-art { flex: 0 0 210px; display: grid; place-items: center; background: #0001; border-radius: 6px; padding: 10px; }
.book-art img { max-width: 190px; max-height: 190px; } .book-text { flex: 1; font: 19px/28px var(--hand); }
.book-text .lbl { font: bold 11px system-ui; letter-spacing: 2px; opacity: 0.6; display: block; margin-top: 6px; }
.unknown { letter-spacing: 4px; opacity: 0.5; } .warning { color: #9a2f3b; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; } .tabs .btn { background: #0000; color: inherit; box-shadow: inset 0 0 0 2px #26313d55; } .tabs .btn.on { background: var(--ink); color: var(--paper); }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.page { padding: 8px 10px; min-height: 84px; background: #fff8e6; border: 2px solid #cdbd97; border-radius: 4px; font: 15px var(--hand); cursor: pointer; }
.page.locked { opacity: 0.4; cursor: default; background: #0001; } .page b { display: block; font: bold 11px system-ui; letter-spacing: 2px; opacity: 0.6; }
.board { background: #20362a; border: 10px solid #7a5a3c; border-radius: 4px; padding: 18px; color: #e9eee4; font: 22px var(--hand); position: relative; min-height: 170px; }
.board .digits { display: flex; gap: 22px; justify-content: center; font: bold 64px var(--hand); margin: 6px 0 10px; }
.board .notes { display: flex; gap: 22px; flex-wrap: wrap; font-size: 17px; opacity: 0.55; justify-content: center; }
.cards { display: flex; gap: 10px; justify-content: center; margin: 14px 0; } .card { padding: 9px 12px; background: #fff8e6; border: 2px solid #cdbd97; border-radius: 4px; font: 18px var(--hand); transform: rotate(-2deg); }
.card:nth-child(2) { transform: rotate(1.5deg); } .card b { font-size: 22px; }
.keypad { display: grid; grid-template-columns: repeat(3, 62px); gap: 7px; justify-content: center; } .keypad button { height: 50px; font: bold 22px system-ui; background: #2a323c; color: #fff; border: 0; border-radius: 8px; box-shadow: 0 3px 0 #0e1218; }
.code { margin: 8px auto; width: 210px; padding: 6px; text-align: center; font: bold 36px "Courier New", monospace; letter-spacing: 12px; background: #0b0f14; color: var(--anomaly); border-radius: 6px; min-height: 54px; }
.code.wrong { color: var(--bad); animation: glitch 0.1s steps(2) 4; }
.bellcards { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; } .bellcard { width: 210px; padding: 16px 14px; background: #0b0b0d; color: #f2efe6; border: 2px solid var(--accent); border-radius: 10px; cursor: pointer; text-align: center; transition: transform 0.15s; }
.bellcard:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 10px 30px #d8667955; } .bellcard h3 { font: bold 20px system-ui !important; letter-spacing: 3px; color: var(--accent); margin: 0 0 8px !important; }
.highlight { display: flex; gap: 12px; align-items: center; padding: 9px 12px; margin: 6px 0; background: #fff8e6; border: 2px solid #cdbd97; border-radius: 6px; font: 19px var(--hand); }
.highlight .ic { font-size: 26px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; font-size: 14px; } .kv b { opacity: 0.6; font-weight: 600; }
table.report { width: 100%; border-collapse: collapse; font-size: 14.5px; } table.report th { text-align: left; font: bold 11px system-ui; letter-spacing: 1.5px; opacity: 0.6; padding: 4px 6px; }
table.report td { padding: 6px; border-top: 1px solid #26313d33; } table.report .ttl { font: 19px var(--hand); color: #9a2f3b; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.vote { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lobby-code { font: bold 58px "Courier New", monospace; letter-spacing: 12px; color: var(--trim); }
.plist { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; } .pchip { padding: 4px 10px; background: #fff8e6; border: 2px solid #cdbd97; border-radius: 14px; font-weight: 600; }
.jars { display: flex; gap: 14px; justify-content: center; margin: 16px 0; } .jar { width: 74px; height: 96px; border-radius: 10px 10px 16px 16px; border: 3px solid #26313d; cursor: pointer; opacity: 0.55; transition: transform 0.1s, opacity 0.1s; }
.jar.lit { opacity: 1; transform: scale(1.12); box-shadow: 0 0 26px currentColor; } .jar:active { transform: scale(0.94); }
.helpgrid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; }
@media (max-width: 800px) { .menu-row { flex-direction: column; gap: 4px; } #chat { width: 220px; } .book-page { flex-direction: column; } }

/* ---- avatar picker ---- */
.hero { display: flex; gap: 16px; align-items: center; margin: 10px 0 4px; padding: 10px 12px; background: #fff8e6; border: 2px solid #cdbd97; border-radius: 6px; }
#heroCanvas { width: 170px; height: 220px; flex: 0 0 170px; }
.hero-opts { flex: 1; min-width: 0; } .hero-opts h3 { margin: 0 0 6px; font: 20px var(--hand); }
.hero-row { display: flex; align-items: center; gap: 10px; margin: 5px 0; } .hero-row > span { flex: 0 0 76px; font-weight: 600; font-size: 13.5px; }
.sw { display: flex; flex-wrap: wrap; gap: 5px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #26313d44; padding: 0; }
.swatch.on { border-color: var(--ink); box-shadow: 0 0 0 3px #fff8e6, 0 0 0 5px var(--ink); }
.chip { padding: 4px 10px; border-radius: 14px; border: 2px solid #26313d55; background: #0000; color: var(--ink); font: 600 13px system-ui; }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
@media (max-width: 800px) { .hero { flex-direction: column; } }

/* ---- guide, map, hearing compass ---- */
#nowHint { margin-top: 5px; display: inline-block; padding: 3px 12px; background: var(--panel); border-radius: 12px; font-size: 13px; color: #fff3c4; text-shadow: none; }
#nowHint:empty { display: none; }
#radar { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.ping { position: absolute; left: 0; top: 0; width: 0; height: 0; animation: pingFade 1.1s forwards; }
.ping i { position: absolute; left: -44px; top: -128px; width: 88px; height: 26px; border-top: 5px solid #fff; border-radius: 50% 50% 0 0 / 100% 100% 0 0; box-sizing: border-box; }
.ping span { position: absolute; left: -70px; top: -158px; width: 140px; text-align: center; font: bold 12.5px system-ui; letter-spacing: 1px; color: #fff; text-shadow: 0 1px 4px #000, 0 0 2px #000; transform-origin: 70px 8px; }
@keyframes pingFade { 0% { opacity: 0; } 12% { opacity: 1; } 70% { opacity: 0.8; } 100% { opacity: 0; } }
.gstep { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed #26313d33; } .gstep b { flex: 0 0 118px; font: 18px var(--hand); } .gstep span { flex: 1; }
.who { display: flex; gap: 14px; padding: 10px; margin: 8px 0; background: #fff8e6; border: 2px solid #cdbd97; border-radius: 6px; }
.who-pics { display: flex; gap: 6px; flex: 0 0 auto; } .who-pics img { width: 84px; height: 114px; object-fit: contain; background: #e9dfc2; border-radius: 6px; }
.who-pics img.night { background: radial-gradient(circle at 50% 40%, #2b3550, #0a0c12); }
.who-text { flex: 1; font-size: 14px; display: flex; flex-direction: column; gap: 3px; } .who-name { font: 23px var(--hand); display: flex; align-items: center; gap: 10px; }
.who-rule { font: bold 11px system-ui; letter-spacing: 2px; padding: 2px 8px; border: 2px solid #9a2f3b; color: #9a2f3b; border-radius: 4px; }
.who-esc { color: #1f6a3a; }
@media (max-width: 800px) { .who { flex-direction: column; } }

/* ---- touch controls (tablets) ---- */
#touchPad, #joy, #touchBtns, .touchOnly { display: none; }
.touch #touchPad { display: block; position: absolute; inset: 0; pointer-events: auto; touch-action: none; -webkit-touch-callout: none; }
.touch #joy { display: block; position: absolute; left: 48px; bottom: 48px; width: 150px; height: 150px; border-radius: 50%; background: #ffffff12; border: 2px solid #ffffff3a; pointer-events: none; transition: background 0.15s; }
.touch #joy.active { background: #ffffff24; }
#joyKnob { position: absolute; left: 44px; top: 44px; width: 62px; height: 62px; border-radius: 50%; background: #ffffff50; border: 2px solid #ffffffaa; }
.touch #touchBtns { display: block; }
.touch .touchOnly { display: inline-block; }
.tbtn { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; background: var(--panel); color: #fff; border: 2px solid #ffffff44; font: bold 22px system-ui; padding: 0; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.tbtn.pressed { transform: scale(0.92); background: #26313d; }
#tAct { right: 44px; bottom: 140px; width: 100px; height: 100px; font-size: 40px; }
#tAct.ready { border-color: var(--anomaly); box-shadow: 0 0 22px #c8e66a99; }
#tRun { right: 160px; bottom: 104px; width: 76px; height: 76px; font-size: 15px; letter-spacing: 1px; }
#tRun.on { background: #7a2f35; border-color: var(--bad); box-shadow: 0 0 16px #ff6b6b77; }
#tAb1 { right: 168px; bottom: 196px; width: 64px; height: 64px; }
#tAb2 { right: 96px; bottom: 256px; width: 64px; height: 64px; }
#tRep { right: 96px; bottom: 256px; width: 64px; height: 64px; }
.touch #sideButtons { top: 54px; bottom: auto; }
.touch #sideButtons button { touch-action: manipulation; }
.touch #toasts { top: 112px; }
.touch #chat { bottom: 228px; width: 270px; }
.touch #chatInput { display: none; } .touch #chatInput.show { display: block; opacity: 1; }
.touch #fx { top: 190px; bottom: auto; }
.touch #lockHint { display: none !important; }
.touch .slot { touch-action: manipulation; }

/* ---- rules ---- */
.rules { line-height: 1.45; } .rules p { margin: 4px 0 6px; } .rules ul, .rules ol { margin: 2px 0 6px; padding-left: 20px; } .rules li { margin: 3px 0; }
.rules .rsec { padding: 6px 0 4px; border-bottom: 1px dashed #26313d33; } .rules .rsec h3 { margin: 8px 0 4px; }
.rules .rbox { padding: 10px 12px; background: #fff3c9; border: 2px solid #d9c27a; border-radius: 6px; transform: rotate(-0.3deg); }
.rules .rphases { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0; } .rules .rphases > div { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 4px; border: 2px solid #26313d33; border-radius: 6px; font-size: 13.5px; } .rules .ri { font-size: 22px; }
.rules .rcredits b { color: #1f7a3a; text-align: right; }
.rules-btn { display: block; width: 100%; margin: 10px 0 4px; padding: 10px; font: 20px var(--hand); color: var(--ink); background: #fff8e6; border: 2px dashed #b9a77e; border-radius: 6px; cursor: pointer; }
#menuRules { max-height: 52vh; overflow: auto; padding: 4px 10px 10px; margin-bottom: 8px; border: 2px solid #cdbd97; border-radius: 6px; background: #fffaf0; }
@media (max-width: 560px) { .rules .rphases { grid-template-columns: repeat(2, 1fr); } }
#loadingErr { max-width: 520px; font: 16px system-ui; } #loadingErr p { margin: 0 0 12px; opacity: .8; } #loadingErr button { padding: 10px 18px; font: bold 16px system-ui; border: 0; border-radius: 6px; background: #e9eef5; color: #141a22; }
