/* Shared UI adapters; the original copied styles remain unchanged. */
:root{--ink:#1f2937;--muted:#64748b;--accent:#3569c8;--border:#dce4ee;--paper:#fff;--radius:14px}*{box-sizing:border-box}body.higu-site{margin:0;min-width:0;color:var(--ink);background:#edf2f7;font-family:system-ui,"Microsoft JhengHei",sans-serif;line-height:1.55}button,input,textarea,select{font:inherit}button,.button{cursor:pointer}button:disabled{cursor:wait;opacity:.6}button,.button{border:1px solid #c8d4e3;border-radius:8px;padding:8px 14px;background:#fff;color:#294366;text-decoration:none;display:inline-block}button:hover,.button:hover{background:#edf4ff}button.primary,.button.primary{background:#3569c8;color:#fff;border-color:#3569c8}button.primary:hover,.button.primary:hover{background:#2858b0}a{color:#315fa6}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible{outline:3px solid #f6b74b;outline-offset:3px}input,textarea,select{width:100%;border:1px solid #c6d2e1;border-radius:8px;padding:9px 11px;background:#fff;color:#172b48}textarea{resize:vertical}input[type=checkbox]{width:18px;height:18px;accent-color:#3569c8}input[type=color]{height:44px;padding:4px}input[type=file]{max-width:100%}label{display:flex;flex-direction:column;gap:5px;font-weight:600}label small,.muted{color:var(--muted);font-size:.88rem;font-weight:400}h1,h2,h3,p{margin:0 0 12px}h1{font-size:1.7rem}h2{font-size:1.15rem}h3{font-size:1rem}.skip-link{position:fixed;left:8px;top:-80px;z-index:9999;padding:12px;background:#fff}.skip-link:focus{top:8px}.site-header{display:flex;gap:24px;align-items:center;justify-content:space-between;padding:17px max(20px,calc((100vw - 1200px)/2));background:rgba(255,255,255,.92);border-bottom:1px solid var(--border)}.site-brand{font-size:1.35rem;font-weight:800;text-decoration:none;white-space:nowrap}.site-brand span{font-size:.7rem;letter-spacing:2px;color:#91a3bb}.site-header nav{display:flex;flex-wrap:wrap;gap:8px 18px;font-size:.9rem}.site-header nav a{text-decoration:none}.site-header nav [aria-current]{font-weight:800;color:#153b74}.site-content{width:min(1200px,calc(100% - 32px));margin:28px auto;display:grid;gap:22px}.site-footer{padding:25px 20px;text-align:center;font-size:.85rem;color:#64748b}.glass-card{padding:26px;background:rgba(255,255,255,.88);border:1px solid rgba(255,255,255,.85);border-radius:18px;box-shadow:0 8px 28px #213a6010}.hero{display:flex;justify-content:space-between;gap:20px;align-items:center;min-height:205px;background:linear-gradient(100deg,#ffffffe8,#ffffffa8),url('css/header-bg.jpg') center/cover}.hero p{margin:0}.eyebrow{font-size:.72rem;letter-spacing:2px;color:#6c829e}.section-heading,.section-head{display:flex;justify-content:space-between;align-items:center;gap:16px}.section-heading h2,.section-head h2{margin:0}.filter-row,.inline-form,.form-actions,.compose-options{display:flex;align-items:end;gap:12px;flex-wrap:wrap}.filter-row{margin:18px 0}.filter-row label{min-width:160px}.room-list{display:grid;gap:12px}.room-item{padding:18px;border:1px solid var(--border);border-radius:12px;display:grid;grid-template-columns:1fr auto;align-items:center;gap:15px;background:#ffffffa6}.room-item h3{margin-bottom:4px}.room-meta{font-size:.85rem;color:#64748b}.room-links{display:flex;gap:8px;flex-wrap:wrap}.badge{display:inline-block;font-size:.75rem;background:#e6edf8;border-radius:5px;padding:3px 7px;color:#4d658c;margin-left:8px}.badge.waiting{background:#def4e5;color:#226e3d}.badge.playing{background:#fff0d1;color:#925800}.stack-form{display:grid;gap:18px}.form-grid,.two-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.two-columns{margin:20px 0}.two-columns form{padding:18px;border:1px solid var(--border);border-radius:12px}.check{flex-direction:row;align-items:center;font-weight:400}fieldset{border:1px solid var(--border);border-radius:12px;padding:20px;min-width:0}legend{padding:0 8px;font-weight:700}details{border:1px solid var(--border);border-radius:10px;padding:15px}summary{cursor:pointer;font-weight:600}details .form-grid{margin-top:18px}.entry-card{width:min(720px,100%);margin:auto}.notice{position:sticky;top:0;z-index:500;padding:12px 22px;background:#e7f3ec;color:#21543a;border-bottom:1px solid #aed0b8;white-space:pre-wrap}.notice.error{background:#fff0ec;color:#8c2c22;border-color:#eab6ab}.empty-state{padding:25px;text-align:center;color:#667e9d}.icon-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(105px,1fr));gap:12px;margin-top:20px}.icon-item{padding:12px;text-align:center;background:#f4f7fb;border-radius:9px;overflow-wrap:anywhere}.icon-item img{width:45px;height:45px;object-fit:contain}.icon-item small{display:block;color:#61768e}#iconPreview{padding:20px;margin-top:20px;background:#f1f5fb}#pendingIcon{width:90px;height:90px;object-fit:contain;image-rendering:auto}.prose{max-width:1000px}.prose h2{margin-top:25px}.prose li{margin:8px 0}.prose ol,.prose ul{padding-left:28px}.role-reference{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.role-reference article{padding:15px;background:#f3f6fb;border-radius:9px}.role-reference img{max-width:100%;height:35px;object-fit:contain;object-position:left}.stat-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.stat-card{border:1px solid var(--border);padding:18px;border-radius:10px}.stat-card strong{display:block;font-size:1.8rem}.data-table{width:100%;border-collapse:collapse;margin-top:16px}.data-table th,.data-table td{text-align:left;padding:10px;border-bottom:1px solid var(--border)}
/* Modes share the same controls and have distinct presentation. */
.game-container{width:100%;margin:0}.higu-game.game-app{min-height:70vh;padding-bottom:0;display:block}.higu-game .game-topbar{position:static;display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;padding:18px 24px}.higu-game .room-title{font-size:1.3rem}.game-toolbar{display:flex;gap:9px;align-items:center;flex-wrap:wrap;padding:10px 24px;border-bottom:1px solid #d7dce7;font-size:.85rem}.game-toolbar button{padding:5px 10px}.game-toolbar #connectionState{margin-right:auto}.game-workspace{padding:16px 24px;display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px;max-width:1550px;margin:auto}.game-workspace>section{min-width:0;background:#ffffffde;border:1px solid #d5dce5;border-radius:12px;padding:15px}.game-workspace .player-panel{grid-column:1/-1;margin:0}.game-workspace .ability-panel{grid-column:2;grid-row:2;margin:0}.game-workspace .action-panel{grid-column:2;grid-row:3;align-self:start}.game-workspace .talk-panel{grid-column:1;grid-row:2/5;position:relative;display:flex;flex-direction:column}.game-workspace .compose-panel{grid-column:1/-1;grid-row:5}.game-workspace .action-panel .inline-form{display:grid}.game-workspace .player-grid,.page-log .player-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(135px,1fr));gap:8px;padding:8px 0;margin:0}.higu-player{display:grid;grid-template-columns:45px 1fr;gap:8px;align-items:center;padding:9px;background:#f7f9fb;border:1px solid #d6dce6;border-radius:8px;min-height:66px;font-size:.83rem;overflow:hidden}.higu-player img{width:45px;height:45px;object-fit:contain}.higu-player .player-name{font-weight:700;overflow-wrap:anywhere}.higu-player .player-meta{font-size:.72rem;color:#64748b}.higu-player.is-dead{opacity:.62;background:#edf0f4}.higu-player.is-gm{border-color:#b98af4}.higu-game .talk-log{height:440px;min-height:200px;max-height:65vh;overflow-y:auto;overflow-x:hidden;padding:8px 2px;margin-top:10px;border:0;display:block;scroll-behavior:auto}.higu-game .talk-messages,.log-stream{display:flex;flex-direction:column;gap:9px}.message{border:1px solid #dbe1e8;border-radius:9px;padding:10px 13px;background:#fff;overflow-wrap:anywhere}.message .message-head{font-size:.76rem;color:#64748b;display:flex;gap:12px;justify-content:space-between;margin-bottom:4px}.message .message-body{white-space:pre-wrap}.message.font-strong .message-body{font-size:1.25rem;font-weight:700}.message.font-weak .message-body{font-size:.8rem}.message.is-system{background:#f0f3f8;border-left:3px solid #94a7c2}.message.is-private{border-left:3px solid #b194db}.compose-row{display:flex;align-items:stretch;gap:10px}.compose-row textarea{flex:1;min-width:0}.compose-options{margin-bottom:12px}.compose-panel label[for=sayInput]{margin-bottom:6px}.compose-panel .muted{margin:8px 0 0}.compose-row button{min-width:85px}.mode-switch{display:flex;gap:5px;align-items:center}.mode-switch .mini-btn{font-size:.8rem;text-decoration:none;padding:6px 10px;border:1px solid #ccd5e1;border-radius:6px}.mode-switch .is-active{background:#3569c8;color:#fff}.higu-game[data-phase=night]{background:#151c39;color:#e0e7f5}.higu-game[data-phase=night] .game-topbar,.higu-game[data-phase=night] .game-toolbar{background:#1c2649;color:#e0e7f5}.higu-game[data-phase=night] .game-workspace>section{background:#202c4d;color:#e0e7f5;border-color:#40506f}.higu-game[data-phase=night] .message,.higu-game[data-phase=night] .higu-player{background:#2a3656;color:#f1f5ff;border-color:#475674}.higu-game[data-phase=night] .message.is-system{background:#23304a}.higu-game[data-phase=night] .muted,.higu-game[data-phase=night] .message-head,.higu-game[data-phase=night] .player-meta{color:#b3c4e1}.higu-game[data-phase=night] #abilityResults{color:#e5edff}.higu-game[data-phase=night] .mode-switch a{color:#cbdafa}.mode-2 .higu-game{background:#fff7e9}.mode-2 .game-workspace{display:flex;flex-direction:column;max-width:1250px}.mode-2 .game-workspace .ability-panel{order:1}.mode-2 .game-workspace .player-panel{order:0}.mode-2 .game-workspace .action-panel{order:2}.mode-2 .game-workspace .talk-panel{order:3}.mode-2 .game-workspace .compose-panel{order:4}.mode-2 .game-workspace .action-panel .inline-form{display:flex}.mode-2 .game-workspace>section{border-radius:5px;border-color:#d0bba2}.mode-2 .message{display:grid;grid-template-columns:200px 1fr;gap:10px;border-radius:2px;border-color:#dccbb5}.mode-2 .message-head{display:flex;flex-direction:column;justify-content:start}.mode-1 .higu-game{font-family:"PMingLiU","新細明體",serif;background:#ffffef;color:#000}.mode-1 .game-workspace{display:flex;flex-direction:column;gap:8px;max-width:1400px;padding:8px}.mode-1 .game-workspace>section{border-radius:0;border:1px solid #999;padding:8px;background:transparent}.mode-1 .message{display:grid;grid-template-columns:170px 1fr;border-radius:0;padding:6px;border-width:0 0 1px;border-color:#aaa;background:transparent}.mode-1 .message-head{display:block;font-size:13px}.mode-1 .higu-player{border:0;border-radius:0;background:transparent;padding:3px}.mode-1 button,.mode-1 input,.mode-1 select,.mode-1 textarea{border-radius:0}.mode-1 .game-workspace .action-panel .inline-form{display:flex}.mode-1 .game-topbar{background:#eee7d3;padding:10px}.mode-1 .message.is-system{background:#dcecd5}.mode-1 .talk-log{height:430px}.mode-1 .game-workspace .player-panel{order:0}.mode-1 .game-workspace .ability-panel{order:1}.mode-1 .game-workspace .action-panel{order:2}.mode-1 .game-workspace .talk-panel{order:3}.mode-1 .game-workspace .compose-panel{order:4}.page-log .gaol-log-shell{width:100%;padding:22px}.page-log .player-grid{margin:18px 0}.page-log .log-stream{margin:20px 0}#abilityResults p{font-size:.88rem;padding:8px;background:#7e98c312;border-radius:6px}.game-toolbar #clock{font-variant-numeric:tabular-nums}dialog{width:min(780px,calc(100% - 24px));max-height:88vh;overflow:auto;border:1px solid #b4c4dc;border-radius:14px;padding:24px;background:#fff;color:#1f2937;box-shadow:0 20px 80px #0005}dialog::backdrop{background:#12243a99}dialog .form-actions{position:sticky;bottom:-24px;background:white;padding:14px 0}.log-hidden{display:none!important}[hidden]{display:none!important}
@media(max-width:900px){.site-header{align-items:start;padding:13px 16px;gap:12px;flex-direction:column}.site-header nav{gap:8px 16px}.site-content{margin-top:18px}.hero{align-items:start;flex-direction:column;min-height:185px}.glass-card{padding:18px}.game-workspace{display:flex;flex-direction:column;padding:12px}.game-workspace .player-panel{order:0}.game-workspace .ability-panel{order:1}.game-workspace .action-panel{order:2}.game-workspace .talk-panel{order:3}.game-workspace .compose-panel{order:4}.game-workspace .action-panel .inline-form{display:flex}.game-workspace .action-panel .inline-form>label{flex:1;min-width:130px}.game-workspace .player-grid,.page-log .player-grid{grid-template-columns:repeat(auto-fill,minmax(125px,1fr))}.higu-game .game-topbar{padding:14px}.game-toolbar{padding:10px 14px}.higu-game .talk-log{height:48vh;max-height:55vh}.mode-2 .message,.mode-1 .message{grid-template-columns:120px 1fr}.form-grid,.two-columns{grid-template-columns:1fr 1fr}.room-item{grid-template-columns:1fr}.gaol-log-header{display:block}}
@media(max-width:540px){.form-grid,.two-columns,.role-reference{grid-template-columns:1fr}.room-links .button{padding:6px 10px}.compose-row{flex-direction:column}.compose-options label{flex:1;min-width:110px}.filter-row label{width:100%;min-width:0}.mode-2 .message,.mode-1 .message{display:block}.mode-2 .message-head,.mode-1 .message-head{display:flex;flex-direction:row}.site-content{width:calc(100% - 20px)}.game-toolbar #connectionState{flex-basis:100%}.mode-switch{flex-wrap:wrap}.higu-player{grid-template-columns:36px 1fr;padding:6px}.higu-player img{width:36px;height:36px}.game-workspace .player-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.inline-form>label{width:100%}.inline-form button{width:100%}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important;transition:none!important}}
.role-art{display:block;max-width:100%;max-height:70px;object-fit:contain;object-position:left;margin-bottom:12px}
.game-workspace:has(.ability-panel[hidden]) .action-panel{grid-row:2}.mode-1 .game-workspace>.action-panel,.mode-2 .game-workspace>.action-panel{align-self:stretch}@media(max-width:900px){.game-workspace>.action-panel{align-self:stretch}}
.game-workspace:has(.ability-panel[hidden]) .action-panel{grid-row:2}.mode-1 .game-workspace>.action-panel,.mode-2 .game-workspace>.action-panel{align-self:stretch}@media(max-width:900px){.game-workspace>.action-panel{align-self:stretch}}
.higu-game .game-workspace .player-panel{position:static!important;inset:auto!important;transform:none!important;max-height:none!important;max-width:none!important;width:auto!important;z-index:auto!important;overflow:visible!important}.higu-game .game-workspace .player-grid{max-height:none!important;overflow:visible!important}
.legacy-reference .reference-notice{border-left:3px solid #c4933e;padding:10px 14px;background:#fff7e4}.reference-scroll{max-width:100%;overflow:auto;margin-top:18px}.reference-scroll>fieldset{border:0;padding:0}.reference-scroll table{border-collapse:collapse;max-width:100%;margin:12px 0}.reference-scroll th,.reference-scroll td{padding:8px;border:1px solid #d7e0ee}.reference-scroll p{margin:12px 0}.reference-scroll img{max-width:100%}

/* 3.0 original dialogue avatars and editor controls; traditional frames do not load this file. */
.mode-3 .higu-game .message.talk-row{padding:0;border:0;background:transparent;border-radius:0;margin:0;gap:8px;box-shadow:none}
.mode-3 .higu-game .message .talk-bubble{min-width:0;max-width:calc(100% - 56px)}
.mode-3 .higu-game .message .talk-avatar-wrap{flex:0 0 48px}
.mode-3 .higu-game .message.is-private .talk-bubble{border-left:3px solid #b194db}
.mode-3 .higu-game .message.is-dead-speaker .talk-avatar{opacity:.68}
.mode-3 .higu-game .message .message-head{flex-wrap:wrap;gap:3px 12px;align-items:baseline;justify-content:flex-start}
.mode-3 .higu-game .message .talk-channel-label{font-size:.72rem;margin-left:5px}
.mode-3 .higu-game .message-body img.talk-smile{display:inline-block;max-width:100%;height:auto;vertical-align:middle}
.mode-3 .higu-game .compose-row{align-items:flex-end}
.mode-3 .higu-game .compose-row .talk-editor-shell{align-self:stretch}
.mode-3 .higu-game .compose-row .smile-toggle-btn{min-width:32px;padding:0}
.mode-3 .higu-game #sayInput{min-height:56px;height:56px;resize:none;overflow-y:hidden;line-height:1.4;border:0;padding:9px 7px 9px 10px}
.mode-3 .higu-game .summary-panel{grid-column:1;grid-row:5}
.mode-3 .higu-game .compose-panel{grid-row:6}
.mode-3 .higu-game #summaryEvents{display:grid;gap:8px}
.mode-3 .higu-game .ability-event{margin:8px 0}
/* Keep focused icon fields from scrolling the card's clipped decoration container. */
.page-icons .glass-card{overflow:clip}
@media(max-width:900px){.mode-3 .higu-game .summary-panel{order:4}.mode-3 .higu-game .compose-panel{order:5}}
@media(max-width:620px){.mode-3 .higu-game #sayInput{min-height:42px;height:42px;padding:7px 4px 7px 8px}.mode-3 .higu-game .compose-row .smile-toggle-btn{min-width:30px}.mode-3 .higu-game .message .talk-avatar-wrap{flex-basis:38px;min-width:38px;width:38px}.mode-3 .higu-game .message .talk-bubble{max-width:calc(100% - 46px)}}
