/* The transcript scrolls; the composer stays in view. Utilities open on demand. */
.life-tools { display:contents; }
#close-life-tools, #close-choices, .chat-tools { display:none; }
#turn-error { display:flex; align-items:center; gap:10px; padding:8px 0; color:#f0bfa3; font:12px/1.5 system-ui,sans-serif; }
#turn-error.hidden { display:none; }
#turn-error button { padding:10px; min-width:56px; border:1px solid #a76a45; border-radius:8px; background:#36241e; color:#ffdbc3; }
.awaiting-roll .typed-move-head, .awaiting-roll .typed-move-row { display:none; }
.roll-controls p { margin:0 0 8px; font:12px/1.4 system-ui,sans-serif; color:#e8c58f; }
.roll-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.roll-buttons button { min-height:44px; padding:8px; border:1px solid #655942; border-radius:8px; background:#20282e; color:#f4eadb; font:600 13px/1.3 system-ui,sans-serif; cursor:pointer; }
.roll-buttons button[data-action-id="roll"] { background:#e96820; color:#160d06; border-color:#e96820; }
.roll-buttons button:disabled { opacity:.5; cursor:wait; }
@media(max-width:700px) {
  html.chat-active, html.chat-active body { height:100%; min-height:0; overflow:hidden; overscroll-behavior:none; }
  html.chat-active body { position:fixed; inset:0; width:100%; }
  .game-screen { position:fixed; inset:0; height:var(--chat-height,100dvh); min-height:0; padding:0; overflow:hidden; display:flex; flex-direction:column; }
  .game-screen { top:var(--chat-top,0px); bottom:auto; }
  .keyboard-open .game-header { height:36px; }
  .keyboard-open .chat-tools { padding:4px 12px; }
  .keyboard-open .typed-move { padding-bottom:6px; }
  .keyboard-open .scene-board { display:none; }
  .game-screen.hidden { display:none; }
  .game-header { flex:none; height:48px; padding:0 12px; border-bottom:1px solid #303941; }
  .game-layout { flex:1; min-height:0; height:auto; display:flex; padding:0; overflow:hidden; }
  .play-column { flex:1; min-height:0; height:100%; gap:0; display:flex; overflow:hidden; }
  .chat-tools { display:flex; flex:none; gap:8px; padding:8px 12px; background:#10161c; border-bottom:1px solid #303941; }
  .chat-tools button { flex:1; min-height:36px; padding:6px; border:1px solid #3b454f; border-radius:8px; background:#1c252e; color:#e6d9c5; font-size:12px; }
  .play-main { flex:1; min-height:0; gap:0; overflow:hidden; }
  .scene-board { flex:none; margin:0; padding:8px 14px; border:0; border-radius:0; }
  .scene-board-top { gap:8px; grid-template-columns:1.2fr 1fr; }
  .scene-board-top span { display:none; }
  .scene-board-top strong { font-size:10px; line-height:1.4; margin:0; color:#9cabb8; }
  .scene-board-top > div:nth-child(2) { text-align:right; }
  .story-feed { flex:1; height:auto; max-height:none; min-height:0; margin:0; border:0; border-radius:0; padding:18px 16px 24px; gap:24px; overflow-y:auto; }
  .story-entry p { font-size:16px; line-height:1.75; }
  .typed-move { flex:none; margin:0; padding:8px 12px calc(8px + env(safe-area-inset-bottom)); border:0; border-top:1px solid #55503e; border-radius:0; }
  .typed-move-head { display:none; }
  .typed-move-row { gap:6px 8px; grid-template-columns:minmax(0,1fr) 54px; }
  .typed-mode { gap:6px; }
  .typed-mode button { min-height:28px; padding:4px 8px; flex:0 0 56px; font-size:10px; }
  #typed-move-input { min-height:54px; height:58px; max-height:96px; padding:9px 12px; resize:none; }
  .typed-move button[type="submit"] { min-width:0; min-height:44px; }
  #turn-status:not(:empty) { flex:none; padding:6px 14px; font-size:11px; }
  .life-tools, .choice-dock, .scene-panel { display:none; }
  .life-tools.chat-popup-open, .choice-dock.chat-popup-open, .scene-panel[open] { display:block; position:fixed; z-index:200; left:10px; right:10px; top:56px; bottom:150px; max-height:none; padding:16px; margin:0; border:1px solid #576370; border-radius:14px; background:#101820; overflow-y:auto; box-shadow:0 20px 80px #000c; }
  .life-tools.chat-popup-open { bottom:20px; }
  #close-life-tools, #close-choices { display:block; width:100%; min-height:44px; margin-bottom:14px; text-align:left; border:0; border-bottom:1px solid #394653; background:none; color:#efc58f; }
  .mobile-utilities { margin-bottom:0; }
  .scene-panel[open] img { max-height:45dvh; }
  .scene-panel summary { color:#efc58f; }
  .choice-dock.chat-popup-open .suggested-row { display:grid; }
  .choice-dock.chat-popup-open #more-dock { max-height:none; }
  .intel-panel.mobile-open { z-index:300; }
  #critical-banner { max-height:35dvh; overflow-y:auto; }
  #roll-card { flex:none; margin:8px 12px 0; padding:10px; max-height:23dvh; overflow-y:auto; }
  #roll-card .eyebrow { margin:0 0 6px; font-size:9px; }
  #roll-card h3 { margin:0 0 8px; font-size:13px; line-height:1.35; overflow-wrap:anywhere; }
  #roll-card .range-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
  #roll-card .range-grid > div { padding:6px; }
  #roll-card .range-grid span { font-size:9px; overflow-wrap:anywhere; }
  #roll-card .range-grid strong { font-size:14px; }
}
