.chat-shell{position:absolute;left:50%;bottom:8px;transform:translateX(-50%);z-index:70;width:min(760px,72%);pointer-events:auto}.chat-log{min-height:0;max-height:56px;overflow:auto;margin:0 6px 5px;padding:4px 9px;border-radius:10px;background:rgba(61,36,24,.82);color:#fff7e6;font-size:11px;line-height:1.3}.chat-line.system b{color:#ffd45c}.chat-line.player b{color:#ff94bd}.chat-entry{height:56px;display:grid;grid-template-columns:44px 1fr 52px;gap:5px;align-items:center;padding:6px 8px;border:4px solid #5d3422;border-radius:16px;background:linear-gradient(#ffe6ba,#e8b77d);box-shadow:0 5px 0 #432519}.chat-entry button{border:0;background:transparent;font-size:25px}.chat-entry input{min-width:0;height:34px;border:2px solid #9c765b;border-radius:11px;background:#fff;color:#4c2a1d;padding:0 10px;font:inherit;outline:none}.chat-entry input:focus{border-color:#e85d8e}.chat-send{border:3px solid #713324!important;border-radius:10px!important;background:#ef6092!important;color:#fff!important;font-size:18px!important;font-weight:900!important;height:38px}.boot-failure{position:fixed;inset:auto 10px 10px;z-index:999;background:#7b2222;color:#fff;padding:10px;border-radius:10px;font-weight:700}.boot-failure[hidden]{display:none}@media(max-width:760px){.gamecol{justify-content:flex-start!important;padding-top:0!important}.canvas-wrap{margin-top:56px;width:100vw;aspect-ratio:16/9}.chat-shell{width:100%;bottom:0}.chat-log{display:none}.chat-entry{height:58px;border-radius:0;border-width:3px;border-left:0;border-right:0;border-bottom:0;grid-template-columns:38px 1fr 48px;padding:5px 6px}.chat-entry input{height:35px;font-size:14px}.chat-entry button{font-size:21px}body{padding-bottom:58px}.mobile-controls{top:56px;bottom:58px}.tcq-authenticated .account-gate[hidden]+*{} }
@media(min-width:761px){.dpad{display:none!important}}

/* v0.6.1 — portrait mobile rebalance. The game viewport owns all space above the chat bar. */
@media (max-width:760px) and (orientation:portrait){
  :root{--tcq-chat-h:calc(60px + env(safe-area-inset-bottom,0px))}
  html,body,main,.layout,.gamecol{width:100%!important;height:100dvh!important;min-height:0!important}
  body{padding:0!important;overflow:hidden!important}
  .gamecol{position:relative!important;display:block!important;overflow:hidden!important}
  .canvas-wrap{
    position:absolute!important;
    inset:0 0 var(--tcq-chat-h) 0!important;
    width:100vw!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    margin:0!important;
    aspect-ratio:auto!important;
    border-radius:0!important;
    box-shadow:none!important;
    overflow:hidden!important;
  }
  #game{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:fill!important}

  .chat-shell{
    position:absolute!important;
    left:0!important;right:0!important;bottom:0!important;
    transform:none!important;
    width:100%!important;height:var(--tcq-chat-h)!important;
    padding:0 0 env(safe-area-inset-bottom,0px)!important;
    background:linear-gradient(#ffe5b6,#e8b77a)!important;
    z-index:120!important;
  }
  .chat-log{display:none!important}
  .chat-entry{
    height:60px!important;
    grid-template-columns:38px minmax(0,1fr) 48px!important;
    gap:5px!important;
    padding:5px 7px!important;
    border:0!important;border-top:3px solid #6c3a26!important;border-radius:0!important;
    box-shadow:inset 0 2px #fff7d9!important;
    background:transparent!important;
  }
  .chat-entry input{height:40px!important;font-size:15px!important;border-width:2px!important;border-radius:13px!important}
  .chat-entry button{font-size:21px!important}
  .chat-send{height:42px!important;border-radius:12px!important}

  .mobile-controls{position:absolute!important;inset:0!important;z-index:90!important;pointer-events:none!important}
  .dpad{
    position:absolute!important;left:10px!important;bottom:14px!important;
    display:grid!important;grid-template-columns:repeat(3,42px)!important;grid-template-rows:repeat(2,42px)!important;
    gap:4px!important;transform:none!important;opacity:.92!important;pointer-events:auto!important;
  }
  .dpad>span{display:none!important}
  .dpad button{width:42px!important;height:42px!important;border-radius:12px!important;font-size:15px!important;padding:0!important}
  .dpad button[data-dir="up"]{grid-column:2!important;grid-row:1!important}
  .dpad button[data-dir="left"]{grid-column:1!important;grid-row:2!important}
  .dpad button[data-dir="down"]{grid-column:2!important;grid-row:2!important}
  .dpad button[data-dir="right"]{grid-column:3!important;grid-row:2!important}

  .hud-top-left{left:6px!important;top:6px!important;gap:2px!important}
  .hud-icon-btn{width:39px!important;height:39px!important;filter:drop-shadow(0 2px 1px rgba(62,31,20,.35))!important}
  .hud-status{
    right:5px!important;top:5px!important;width:158px!important;min-height:62px!important;
    padding:5px 6px 5px 49px!important;border-width:3px!important;border-radius:11px!important;
    box-shadow:0 3px 0 #2d190f,0 6px 12px #0004!important;
  }
  .hud-avatar{left:4px!important;top:4px!important;width:42px!important;height:50px!important;border-width:2px!important;border-radius:9px!important}
  .hud-name-row{font-size:9px!important;line-height:1.05!important}
  .hud-exp{height:5px!important;margin:3px 0!important}
  .hud-currencies{gap:1px!important}
  .hud-currency{font-size:8px!important;padding:1px 2px!important;gap:2px!important}
  .hud-currency img{width:11px!important;height:11px!important}
  .hud-scene-pill{top:50px!important;font-size:8px!important;padding:3px 8px!important;border-width:2px!important;box-shadow:0 2px 0 #3a2118!important}

  .hud-side{top:38%!important;transform:translateY(-50%)!important}
  .hud-side.left{left:-3px!important}.hud-side.right{right:-3px!important}
  .hud-side-btn{width:72px!important;filter:drop-shadow(0 3px 1px rgba(57,28,18,.32))!important}
  .hud-interact{right:7px!important;bottom:12px!important;width:72px!important;height:60px!important;filter:drop-shadow(0 3px 1px rgba(57,28,18,.35))!important}

  .farm-quick-dock{
    left:50%!important;bottom:12px!important;max-width:calc(100% - 230px)!important;
    transform:translateX(-50%)!important;padding:3px!important;border-width:2px!important;border-radius:11px!important;
    overflow-x:auto!important;scrollbar-width:none!important;white-space:nowrap!important;
  }
  .farm-quick-dock::-webkit-scrollbar{display:none!important}
  .farm-seed-buttons{display:flex!important;gap:3px!important;width:max-content!important}
  .farm-seed-chip{min-width:58px!important;font-size:7px!important;padding:2px 3px!important;border-width:1px!important;border-radius:7px!important}
  .farm-seed-chip>b{padding:3px 4px!important;border-radius:6px!important}
  .farm-seed-chip.selected{outline-width:2px!important;transform:translateY(-1px)!important}

  .toast{
    top:72px!important;bottom:auto!important;left:50%!important;
    width:auto!important;max-width:70vw!important;
    padding:6px 9px!important;border-width:2px!important;border-radius:10px!important;
    box-shadow:0 3px 0 #4a291c,0 6px 12px #0003!important;
    font-size:10px!important;line-height:1.25!important;text-align:center!important;
  }
  .player-speech{max-width:58vw!important;padding:6px 9px!important;border-width:2px!important;border-radius:10px!important;font-size:10px!important}
  .player-speech::after{bottom:-8px!important;width:11px!important;height:11px!important;border-width:0 2px 2px 0!important}

  .tcq-sheet{padding:6px!important}
  .tcq-panel{width:min(94vw,520px)!important;max-height:88%!important;padding:11px!important;border-width:3px!important;border-radius:16px!important}
  .shop-modal{inset:3%!important}
  .panel{inset:6px 6px calc(var(--tcq-chat-h) + 6px) 6px!important;width:auto!important;max-height:none!important}
}

@media (max-width:760px) and (orientation:landscape){
  :root{--tcq-chat-h:52px}
  .canvas-wrap{width:100vw!important;height:calc(100dvh - var(--tcq-chat-h))!important;max-height:none!important;aspect-ratio:auto!important;margin:0!important}
  .chat-shell{width:100%!important;bottom:0!important}
  .chat-entry{height:52px!important}
  .hud-side-btn{width:70px!important}
  .hud-interact{width:66px!important;height:54px!important;bottom:8px!important}
  .dpad{bottom:8px!important;transform:scale(.76)!important;transform-origin:left bottom!important}
}

/* v0.6.2 mobile input + touch navigation overrides */
.chat-entry input,.account-box input{font-size:16px!important}
@media(max-width:760px){
  .chat-entry input,.account-box input{font-size:16px!important}
  .dpad{display:none!important}
}

/* v0.6.2.2 — keep area label on the same top HUD row. */
@media (max-width:760px) and (orientation:portrait){
  .hud-scene-pill{top:14px!important}
  .hud-side{top:42%!important}
  .hud-side.left{left:-3px!important}
  .hud-quick-actions{top:42%!important;right:-3px!important}
}

/* v0.8.2 */
.chat-line.online b{color:#8ee7b2}.chat-line.online span{color:#effff5}
