:root {
  font-family: -apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Hiragino Kaku Gothic ProN",sans-serif;
  font-size:16px; line-height:1.5; color:#1c1c1e; background:#fff; font-synthesis:none;
  --primary:#1c1c1e; --secondary:#3c3c43; --tertiary:#6d6d72; --disabled:#aeaeb2;
  --line:#dedee3; --soft:#f7f7f8;
}
* { box-sizing:border-box; }
body { margin:0; -webkit-font-smoothing:antialiased; }
button,input,textarea { font:inherit; color:inherit; }
a { color:inherit; text-decoration:none; }
button,summary,a { -webkit-tap-highlight-color:transparent; }
button { cursor:pointer; min-height:44px; border:1px solid var(--line); border-radius:12px; background:#fff; padding:10px 14px; font-weight:550; transition:background .15s; }
button:hover:not(:disabled) { background:var(--soft); }
button:disabled { cursor:not-allowed; color:var(--disabled); }
button:focus-visible,summary:focus-visible,a:focus-visible { outline:2px solid var(--primary); outline-offset:3px; }
input,textarea { width:100%; min-width:0; background:#fff; border:1px solid var(--line); border-radius:14px; outline:none; font-size:16px; }
input { min-height:58px; padding:16px 18px; }
input:focus { border-color:var(--primary); }
input::placeholder,textarea::placeholder { color:var(--tertiary); opacity:1; }
h1,h2,p { margin:0; }
h1 { font-size:30px; line-height:1.35; font-weight:700; letter-spacing:-.8px; word-break:keep-all; }
h2 { font-size:22px; line-height:1.4; font-weight:650; letter-spacing:-.5px; }
p { color:var(--secondary); }
small { color:var(--tertiary); }
header { height:64px; padding:0 24px; flex-shrink:0; display:flex; align-items:center; justify-content:space-between; }
.brand { font-size:26px; font-weight:750; letter-spacing:-1px; }
.user-tag { font-size:14px; color:var(--secondary); max-width:60%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.primary { background:var(--primary); color:#fff; border-color:var(--primary); }
.primary:hover:not(:disabled) { background:var(--secondary); }
.primary:disabled { background:#fff; color:var(--disabled); border-color:var(--line); }
.secondary { background:#fff; color:var(--primary); }
.text-button { padding:8px; font-size:13px; border-color:transparent; background:transparent; color:var(--secondary); font-weight:500; }
.wide { width:100%; }
.landing { max-width:480px; min-height:calc(var(--viewport-height,100dvh) - 64px); padding:42px 24px max(24px,env(safe-area-inset-bottom)); margin:auto; display:flex; flex-direction:column; }
.hero { margin-bottom:42px; }
.join-card,#entry { display:flex; flex-direction:column; flex:1; }
.entry-submit { margin-top:auto; padding-top:32px; }
.entry-submit button { min-height:56px; font-size:17px; border-radius:16px; }
#app[data-view=room] { display:flex; flex-direction:column; height:var(--viewport-height,100dvh); overflow:hidden; }
#app[data-view=room] header { height:54px; }
.room-layout { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto minmax(0,1fr); gap:12px; padding:10px 20px 14px; flex:1; min-height:0; }
.room-layout>* { min-width:0; }
.room-top { min-height:48px; display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.room-top h1 { font-size:20px; letter-spacing:-.5px; }
.room-top-actions { display:flex; align-items:center; gap:4px; margin-left:auto; }
.room-top-actions button { font-size:13px; padding:9px 10px; white-space:nowrap; }
.room-top-actions .text-button { padding:9px 6px; }
.player-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.participant { position:relative; min-width:0; min-height:42px; border:1px solid var(--line); border-radius:10px; background:#fff; }
.participant.self { display:flex; align-items:center; gap:8px; padding:10px; border-color:var(--primary); }
.participant>summary { display:flex; align-items:center; gap:8px; padding:10px; list-style:none; cursor:pointer; min-height:42px; }
.participant>summary::-webkit-details-marker { display:none; }
.participant strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:550; }
.seat { color:var(--tertiary); font-size:11px; font-variant-numeric:tabular-nums; flex-shrink:0; }
.offline-marker { color:var(--tertiary); }
.person-actions { position:absolute; left:0; top:46px; width:175px; padding:8px; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 10px 26px #00000012; z-index:20; }
.participant:nth-child(even) .person-actions { left:auto; right:0; }
.person-actions button { display:block; width:100%; border:0; border-radius:8px; font-size:14px; text-align:left; }
.person-actions>strong { display:block; font-weight:400; font-size:12px; color:var(--tertiary); padding:10px 14px 4px; }
.game-panel { min-height:0; max-height:39dvh; overflow:auto; }
.game-panel:empty { display:none; }
.room-layout:has(.game-panel:empty) { grid-template-rows:auto auto minmax(0,1fr); }
.card { border:1px solid var(--line); border-radius:20px; padding:18px; background:#fff; }
.secret-line { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.category { font-size:13px; color:var(--tertiary); }
.secret-word { font-size:32px; line-height:1.3; margin-top:3px; overflow-wrap:anywhere; }
.help-toggle { font-size:14px; white-space:nowrap; flex-shrink:0; }
.clues { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:16px; }
.clues button { font-size:14px; font-weight:500; min-height:44px; padding:9px; }
.vote-card { padding:16px 0 0; }
.vote-heading h2 { font-size:17px; }
.vote-card p { color:var(--tertiary); font-size:14px; margin-top:6px; }
.vote-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; }
.vote-options button { font-size:14px; overflow-wrap:anywhere; }
.vote-options .chosen { border-color:var(--primary); color:var(--primary); }
.result-card h2 { font-size:22px; }
.result-details { margin-top:8px; }
.result-details>summary { cursor:pointer; font-size:14px; padding:8px 0; color:var(--tertiary); }
.reveals>div { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:7px 0; font-size:14px; }
.reveals>div>* { min-width:0; overflow-wrap:anywhere; }
.reveals b { font-weight:500; }
.reveals small { font-size:11px; }
.answer-pair { margin-top:10px; font-size:16px; }
.answer-pair strong { font-weight:500; }
.answer-pair span { color:var(--tertiary); }
.result-card p,.spectator { font-size:14px; color:var(--tertiary); }
.chat-panel { display:flex; flex-direction:column; min-height:0; min-width:0; }
.messages { overflow:auto; flex:1; min-height:0; padding:8px 0 16px; overscroll-behavior:contain; }
.message { margin:16px 0 0; max-width:min(88%,480px); width:fit-content; }
.message:first-child { margin-top:0; }
.message.grouped { margin-top:4px; }
.message-author { display:flex; align-items:center; gap:8px; margin:0 4px 4px; font-size:13px; color:var(--secondary); }
.bubble { padding:8px 12px; font-size:16px; line-height:24px; border:1px solid var(--line); border-radius:4px 16px 16px; background:#fff; white-space:pre-wrap; overflow-wrap:anywhere; }
.mine { margin-left:auto; }
.mine .message-author { justify-content:flex-end; }
.grouped .bubble { border-radius:16px; }
.mine .bubble { border-radius:16px 4px 16px 16px; border-color:#bdbdc5; }
.original { margin-top:4px; font-size:14px; color:var(--tertiary); }
.original summary { padding:5px 3px; font-size:12px; cursor:pointer; }
.translation-status { display:block; font-size:12px; color:var(--tertiary); margin:6px 3px; }
#chat-form { display:flex; align-items:flex-end; flex-shrink:0; gap:4px; border:1px solid var(--line); border-radius:16px; padding:4px; margin-bottom:env(safe-area-inset-bottom); background:#fff; }
#chat-form:focus-within { border-color:var(--primary); }
#message { border:0; box-shadow:none; border-radius:12px; resize:none; min-height:44px; max-height:120px; padding:10px 12px; line-height:24px; background:transparent; }
.send-button { display:grid; place-items:center; width:44px; height:44px; min-width:44px; padding:0; border:0; border-radius:10px; background:transparent; flex-shrink:0; }
.send-button img { display:block; width:24px; height:24px; }
.send-button:disabled { opacity:.35; }
.connection { background:#fff; border-bottom:1px solid var(--line); color:var(--tertiary); font-size:13px; padding:8px 20px; text-align:center; flex-shrink:0; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
#toast { position:fixed; bottom:90px; left:50%; transform:translateX(-50%); max-width:90vw; width:max-content; background:var(--primary); color:white; padding:12px 18px; font-size:14px; border-radius:12px; opacity:0; pointer-events:none; z-index:40; }
#toast.show { opacity:1; }
@media(min-width:760px) {
 header { padding:0 36px; }
 .landing { min-height:min(740px,calc(var(--viewport-height,100dvh) - 64px)); padding-top:64px; }
 #app[data-view=room] header { height:68px; }
 .room-layout,.room-layout:has(.game-panel:empty) { width:min(1080px,100%); margin:auto; padding:24px 28px; gap:20px 32px; grid-template-columns:310px minmax(0,1fr); grid-template-rows:auto auto minmax(0,1fr); }
 .room-top { grid-column:1/-1; }
 .room-top h1 { font-size:26px; }
 .players-panel { grid-column:1; grid-row:2; }
 .game-panel { grid-column:1; grid-row:3; max-height:none; }
 .chat-panel { grid-column:2; grid-row:2/4; border:1px solid var(--line); border-radius:22px; padding:12px 20px 16px; }
 .secret-word { font-size:36px; }
 .player-list { grid-template-columns:1fr; }
 .person-actions { left:0; right:auto; }
}
@media(max-height:620px) and (max-width:759px) {
 .landing { padding-top:24px; }
 #app[data-view=room] header { height:40px; }
 .room-layout { padding-top:4px; gap:6px; }
 .room-top { min-height:42px; }
 .room-top h1 { font-size:17px; }
 .room-top-actions button { padding:8px 6px; font-size:12px; }
 .player-list { gap:4px; grid-template-columns:repeat(3,minmax(0,1fr)); }
 .participant,.participant>summary { min-height:34px; }
 .participant.self,.participant>summary { padding:6px; gap:4px; }
 .participant strong { font-size:12px; }
 .game-panel { max-height:28dvh; }
 .card { padding:12px 14px; }
 .secret-word { font-size:26px; }
 .clues { display:flex; overflow-x:auto; margin-top:12px; }
 .clues button { flex-shrink:0; }
}
@media(prefers-reduced-motion:reduce) { button { transition:none; } }
