/* Phone: room and thumb dock. Tablet: room and a dedicated family console. */
#game[data-ui-profile="phone"],#game[data-ui-profile="tablet"] { padding:10px; }
#game[data-ui-profile="phone"] .chooser { width:100%; }
#game[data-ui-profile="phone"]:not(:has(.touch-header)) .game-layout { display:block; }
#game[data-ui-profile="phone"]:not(:has(.touch-header)) .room-panel { display:none; }
.parent-touch-playing #game { max-width:1400px; display:flex; flex-direction:column; gap:6px; }
.touch-header { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.touch-header h1 { font-size:22px; margin:0; }
.touch-header p { font-size:12px; color:var(--muted); margin:2px 0 0; }
.touch-header .toolbar { margin:0; flex-wrap:nowrap; gap:5px; }
.touch-header button { font-size:12px; padding:7px 10px; }
.parent-touch-playing .family-strip { position:static; margin:0; padding:5px; gap:5px; box-shadow:none; }
.parent-touch-playing .family-strip>button { gap:2px; padding:6px 8px; }
.parent-touch-playing .family-strip>button>strong { font-size:13px; }
.parent-touch-playing .family-strip>button>span { font-size:11px; }
.parent-touch-playing .family-strip .strip-need { -webkit-line-clamp:2; }
.touch-extra { display:flex; gap:5px; flex-wrap:wrap; }
.touch-extra button { width:100%; padding:5px 10px; font-size:12px; background:#fff0cb; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.touch-timers { display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:6px; font-size:11px; }
.touch-timers .task-progress { gap:5px; }
.touch-timers .task-slot { padding:5px 7px; gap:1px; border-radius:8px; }
.touch-timers .task-slot>strong { font-size:11px; display:-webkit-box!important; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; }
.touch-timers .task-slot>span { font-size:10px; }
.touch-timers .task-slot progress { height:6px; }
.touch-timers>button { padding:6px; min-width:48px; font-size:12px; }
.touch-play-area { min-width:0; }
.parent-touch-playing .room-panel { position:relative; top:0; border-radius:14px; width:100%; box-shadow:none; }
.parent-touch-playing .room-heading { padding:7px 10px; }
.parent-touch-playing .room-heading h2 { font-size:17px; }
.parent-touch-playing .doors { padding:5px; gap:5px; }
.parent-touch-playing .doors button { font-size:12px; padding:5px; min-height:48px; }
.parent-touch-playing .activity-caption { display:none; }
.touch-console { min-width:0; background:#fffdf9; border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.touch-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:4px; padding:5px; background:#f1ebe4; }
.touch-tabs button { padding:5px; min-height:48px; font-size:12px; font-weight:700; }
.touch-tabs button[aria-pressed="true"] { background:var(--accent); color:white; border-color:var(--accent); }
.touch-pane { padding:8px; min-width:0; }
.touch-pane[hidden] { display:none!important; }
.need-picker { display:flex; gap:6px; align-items:center; font-size:12px; margin-bottom:6px; }
.need-picker select { font:inherit; color:var(--ink); background:#fff; border:1px solid var(--line); border-radius:8px; padding:5px; min-height:44px; min-width:0; flex:1; }
.touch-pane .need { padding:8px 10px; border-radius:10px; }
.touch-pane .need-top { display:flex; }
.touch-pane .need-top span { margin:0; }
.touch-pane .need p { font-size:14px; margin:5px 0; }
.touch-pane .need small { font-size:12px; margin:4px 0; }
.touch-pane .need .patience { display:flex; font-size:11px; }
.touch-pane .patience meter { width:80px; margin:0; }
.touch-pane .need-actions { flex-direction:row; gap:5px; margin-top:6px; position:sticky; bottom:0; background:#fffdf9; }
.touch-pane .need-actions button { min-height:48px; font-size:12px; padding:5px; }
.touch-pane .hint { font-size:12px; }
.touch-pane h3 { margin-bottom:6px; }
.touch-pane .hands { padding:8px; border-radius:10px; }
.touch-pane .hands button { min-height:48px; }
.touch-pane .hands img { height:24px; }
.touch-pane .energy { padding:8px; margin-top:6px; }
.touch-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.touch-actions button { min-height:48px; width:100%; font-size:12px; padding:6px; }
.touch-actions .recipe-control { min-width:0; }
.touch-actions .action-guidance { font-size:11px; margin:3px 0; }
.touch-message { font-size:12px; line-height:1.4; margin:0; padding:5px 8px; background:#edf3e9; border-radius:8px; }
.parent-touch-playing>#parent-music { display:none!important; }
.touch-music-slot.parent-music { width:100%; padding:4px; margin:0; border:0; }
.touch-music-slot .jke-music { grid-template-columns:repeat(3,minmax(0,1fr)); }
.touch-music-slot .jke-music>strong,.touch-music-slot .jke-music-label,.touch-music-slot .jke-music-volume { grid-column:1/-1; }
.touch-music-slot .jke-music button { white-space:normal; font-size:12px; padding:6px; }
.parent-touch-playing dialog { max-height:calc(100dvh - 30px); overflow:auto; padding:20px; }
#game[data-ui-profile="phone"] .touch-header { flex-direction:column; align-items:stretch; }
#game[data-ui-profile="phone"] .touch-header>div:first-child { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
#game[data-ui-profile="phone"] .touch-header h1 { font-size:18px; }
#game[data-ui-profile="phone"] .touch-header p { font-size:11px; }
#game[data-ui-profile="phone"] .touch-header .toolbar { display:grid; grid-template-columns:repeat(4,1fr); }
#game[data-ui-profile="phone"] .touch-header button { min-height:48px; padding:5px; }
#game[data-ui-profile="phone"] .family-strip { grid-template-columns:repeat(4,minmax(0,1fr))!important; padding:3px; }
#game[data-ui-profile="phone"] .family-strip>button { padding:4px; gap:1px; }
#game[data-ui-profile="phone"] .family-strip>button>span { font-size:10px; line-height:1.25; }
#game[data-ui-profile="phone"] .touch-play-area { display:flex; flex-direction:column; gap:6px; }
#game[data-ui-profile="phone"] .stage { aspect-ratio:auto; height:clamp(200px,calc(100dvh - 530px),260px); }
#game[data-ui-profile="phone"] .room-art { object-fit:cover; object-position:center bottom; }
#game[data-ui-profile="phone"] .parent-piece { width:26%; height:62%; }
#game[data-ui-profile="phone"] .parent-piece.hand-pose { width:32%; height:74%; }
#game[data-ui-profile="phone"] .kid-piece { width:22%; height:52%; }
#game[data-ui-profile="phone"] .kid-piece.kay { width:18%; height:38%; }
#game[data-ui-profile="phone"] .family-strip>button>span { font-size:10px; line-height:1.15; margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#game[data-ui-profile="phone"] .family-strip>button>strong { font-size:12px; line-height:1.2; }
#game[data-ui-profile="phone"] .family-strip .strip-need { -webkit-line-clamp:1; }
#game[data-ui-profile="phone"] .touch-timers .task-slot>span { display:none!important; }
#game[data-ui-profile="phone"] .touch-header button,#game[data-ui-profile="phone"] .touch-tabs button { min-height:44px; }
#game[data-ui-profile="phone"] .touch-header { flex-direction:row; align-items:center; }
#game[data-ui-profile="phone"] .touch-header>div:first-child { display:block; flex:1; min-width:0; }
#game[data-ui-profile="phone"] .touch-header h1 { font-size:16px; }
#game[data-ui-profile="phone"] .touch-header p { font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#game[data-ui-profile="phone"] .touch-header .toolbar { grid-template-columns:repeat(3,1fr); width:52%; }
#game[data-ui-profile="phone"] .touch-header [data-action="sound"] { display:none; }
.parent-touch-playing #game[data-ui-profile="phone"],#game[data-ui-profile="phone"] .touch-play-area { gap:4px; }
#game[data-ui-profile="phone"] { padding:8px; }
#game[data-ui-profile="phone"] .touch-pane { padding:6px; }
#game[data-ui-profile="phone"] .need-picker { margin-bottom:4px; }
#game[data-ui-profile="phone"] .touch-timers { grid-template-columns:1fr auto; }
#game[data-ui-profile="phone"] .touch-timers>.task-slots { display:none; }
#game[data-ui-profile="phone"] .touch-pane { max-height:min(280px,max(140px,calc(100dvh - var(--touch-pane-top, 575px) - max(32px,env(safe-area-inset-bottom))))); overflow-y:auto; overscroll-behavior:contain; }
#game[data-ui-profile="tablet"] .touch-play-area { display:flex; flex-direction:column; gap:8px; }
#game[data-ui-profile="tablet"] .touch-console { display:grid; grid-template-columns:1fr 1fr; align-items:start; }
#game[data-ui-profile="tablet"] .touch-tabs { grid-column:1/-1; }
#game[data-ui-profile="tablet"] #touch-needs { grid-row:2/4; }
#game[data-ui-profile="tablet"] #touch-here { grid-column:2; }
#game[data-ui-profile="tablet"] #touch-hands { grid-column:2; }
#game[data-ui-profile="tablet"] #touch-music { grid-column:1/-1; }
#game[data-ui-profile="tablet"] .stage { height:clamp(260px,34dvh,440px); aspect-ratio:auto; }
@media(orientation:landscape) {
  #game[data-ui-profile="tablet"] .touch-play-area { display:grid; grid-template-columns:minmax(0,1fr) 340px; align-items:start; }
  #game[data-ui-profile="tablet"] .touch-console { display:flex; flex-direction:column; }
  #game[data-ui-profile="tablet"] .touch-pane { width:100%; }
  #game[data-ui-profile="tablet"] .stage { height:clamp(240px,42dvh,420px); }
  #game[data-ui-profile="phone"] .touch-header { flex-direction:row; align-items:center; }
  #game[data-ui-profile="phone"] .touch-header>div:first-child { display:block; }
  #game[data-ui-profile="phone"] .family-strip { grid-template-columns:repeat(4,minmax(0,1fr))!important; }
  #game[data-ui-profile="phone"] .touch-play-area { display:grid; grid-template-columns:minmax(0,1fr) minmax(260px,.8fr); align-items:start; }
  #game[data-ui-profile="phone"] .family-strip>button { display:grid!important; grid-template-columns:1fr 1fr; align-items:center; gap:2px; }
  #game[data-ui-profile="phone"] .family-strip>button>.strip-need { -webkit-line-clamp:1; }
  #game[data-ui-profile="phone"] .stage { height:clamp(140px,36dvh,190px); }
  #game[data-ui-profile="phone"] .touch-pane { max-height:min(166px,max(140px,calc(100dvh - var(--touch-pane-top, 227px) - 8px))); }
}
