/* Fit the playable board and its controls to the visible viewport, without
   clipping content or preventing scrolling on small/zoomed screens. */
body[data-theme] {min-height:100dvh;}
body[data-theme] .app-shell {width:100%;max-width:1000px;height:100dvh;padding:8px 14px;display:flex;flex-direction:column;gap:8px;}
body[data-theme] .topbar {flex:0 0 auto;min-height:50px;padding:4px 12px;gap:10px;border-radius:18px;flex-wrap:nowrap;}
body[data-theme] .brand {font-size:18px;gap:9px;white-space:nowrap;}
body[data-theme] .brand svg {width:30px;height:30px;}
body[data-theme] .topbar nav {width:auto;margin:0 0 0 auto;gap:5px;flex-wrap:nowrap;}
.nav-action {display:inline-flex;align-items:center;justify-content:center;gap:7px;}
.nav-icon {width:18px;height:18px;flex-shrink:0;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;fill:none;}
body[data-theme] nav button {padding:8px 11px;min-width:44px;min-height:44px;font-size:12px;}
body[data-theme] main {flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;}
body[data-theme] .intro {flex:0 0 auto;min-height:0;margin:0;padding:8px 12px;gap:12px;flex-direction:row;align-items:center;border-radius:18px;}
body[data-theme] .intro>div:first-child {flex-shrink:1;max-width:48%;min-width:0;}
body[data-theme] .intro .eyebrow,body[data-theme] .sea-tip {display:none;}
body[data-theme] .intro h1 {font-size:19px;line-height:1.15;white-space:normal;letter-spacing:-.025em;}
body[data-theme] .preferences {align-self:center;max-width:none;flex-shrink:0;gap:6px;}
body[data-theme] .preferences select,body[data-theme] .preferences button {padding:7px 9px;min-height:44px;}
body[data-theme] .swimmer-0 {width:65px;height:65px;top:-11px;right:45%;}
body[data-theme] .swimmer-1 {width:42px;height:42px;top:7px;right:39%;}
body[data-theme] .swimmer-2,body[data-theme] .swimmer-3 {display:none;}
body[data-theme] .sea-scene {opacity:.4;}
body[data-theme] .scoreboard {flex:0 0 auto;margin:0;gap:8px;}
body[data-theme] .player {min-height:54px;padding:7px 12px;gap:10px;border-radius:17px;}
body[data-theme] .player h2 {font-size:12px;line-height:1.2;margin:0 0 3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
body[data-theme] .player span {font-size:10px;line-height:1.2;}
body[data-theme] .player strong {font-size:28px;}
body[data-theme] .avatar {width:30px;height:30px;font-size:10px;}
body[data-theme] .table {flex:1;min-height:302px;display:flex;flex-direction:column;gap:6px;padding:12px 14px;border-radius:22px;}
body[data-theme] .table-heading {flex:0 0 auto;min-height:16px;font-size:12px;}
body[data-theme] .board-wrap {width:100%;max-width:none;height:0;min-height:240px;flex:1;margin:0;aspect-ratio:auto!important;}
body[data-theme] #board {display:block;}
body[data-theme] .progress-row {flex:0 0 auto;margin:0;font-size:10px;}
body[data-theme] progress {flex:0 0 auto;}
body[data-theme] #timer-wrap {flex:0 0 auto;margin:0;}
body[data-theme] .timer-label {margin-bottom:3px;font-size:10px;}
body[data-theme] .legend {flex:0 0 auto;margin:0;padding:4px 8px;font-size:10px;line-height:1.3;}
body[data-theme] .actions {flex:0 0 auto;gap:8px;margin:0;}
body[data-theme] .actions button {min-height:44px;padding:8px 15px;font-size:12px;}
body[data-theme] .announcement {flex:0 0 auto;min-height:14px;margin:0;font-size:11px;line-height:1.25;}
body[data-theme] .keyboard-help {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}
body[data-theme] footer {display:none;}
body[data-theme] .room-banner {flex:0 0 auto;margin:0;padding:5px 10px;gap:8px;flex-direction:row;align-items:center;border-radius:16px;}
body[data-theme] .room-banner strong {font-size:11px;line-height:1.25;display:block;}
body[data-theme] .room-banner p {display:none;}
body[data-theme] .room-banner button {width:auto;min-height:44px;font-size:11px;padding:6px 10px;}
body[data-theme] .notice {flex:0 0 auto;margin:0;padding:6px 10px;font-size:11px;}
.menu-actions {display:grid;gap:12px;margin:22px 0;}
body[data-theme].toolbar-in-menu .intro {display:none;}
#menu-preferences {margin-top:18px;}
body[data-theme] #menu-dialog .preferences {display:grid;grid-template-columns:1fr;gap:10px;width:100%;}
body[data-theme] #menu-dialog .preferences select,body[data-theme] #menu-dialog #sound {font-size:14px;min-height:44px;}
body[data-theme] #menu-dialog #sound::before {content:none;}
@media(max-width:700px) {
  body[data-theme] .app-shell {padding:6px 10px;gap:6px;}
  body[data-theme] main {gap:6px;}
  body[data-theme] .topbar {padding:3px 8px;min-height:48px;}
  body[data-theme] .intro {padding:5px 8px;min-height:0;}
  body[data-theme] .intro>div:first-child {display:none;}
  body[data-theme] .preferences {display:grid;grid-template-columns:minmax(70px,.8fr) minmax(100px,1.2fr) 44px;gap:5px;width:100%;}
  body[data-theme] .preferences select {width:100%;min-width:0;font-size:11px;padding:7px;}
  #language {order:1;}#theme {order:2;}#sound {order:3;}
  body[data-theme] #sound {font-size:0;padding:0;min-width:44px;}
  #sound::before {content:'♫';font-size:20px;line-height:1;}
  #sound[aria-pressed="false"]::before {content:'♪';opacity:.45;text-decoration:line-through;}
  body[data-theme] .player {min-height:48px;padding:6px 10px;gap:7px;}
  body[data-theme] .player strong {font-size:25px;}
  body[data-theme] .table {padding:9px 10px;min-height:290px;gap:5px;}
  body[data-theme] .actions button {padding:7px 12px;}
}
@media(min-width:701px){#sound::before{content:none;}}
@media(max-width:520px) {
  .nav-label {position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;}
  body[data-theme] .brand {font-size:17px;}
  body[data-theme] .brand {min-width:0;}
  body[data-theme] .brand span {overflow:hidden;text-overflow:ellipsis;}
  body[data-theme] .brand svg {flex-shrink:0;}
  body[data-theme] .topbar nav {flex-shrink:0;}
  body[data-theme] nav button {padding:8px;}
}
@media(max-width:350px) {body[data-theme] .brand span {font-size:15px;}body[data-theme] .brand {gap:5px;}body[data-theme] .topbar {padding:3px 5px;gap:4px;}body[data-theme] .brand svg {width:25px;height:25px;}body[data-theme] .topbar nav {gap:3px;}body[data-theme] .avatar {display:none;}}
@media(max-height:700px) and (max-width:700px){body[data-theme] .app-shell{gap:4px;padding:4px 8px;}body[data-theme] main{gap:4px;}body[data-theme] .player{min-height:44px;padding:4px 9px;}body[data-theme] .player span{display:none;}body[data-theme] .player h2{margin:0;}body[data-theme] .intro{padding:3px 6px;}body[data-theme] .table{padding:7px 9px;min-height:282px;}body[data-theme] .announcement{font-size:10px;min-height:13px;}}
@media(max-height:500px) and (min-width:600px){
  body[data-theme] .app-shell{padding:5px 10px;gap:5px;max-width:1150px;}
  body[data-theme] .topbar{min-height:46px;padding:1px 10px;}
  body[data-theme] main{display:grid;grid-template-columns:minmax(0,1fr) 280px;grid-template-rows:auto auto auto minmax(0,1fr) auto;gap:6px 12px;}
  body[data-theme] .table{grid-column:1;grid-row:1/-1;min-height:282px;padding:7px 10px;}
  body[data-theme] .intro{grid-column:2;grid-row:1;padding:4px 6px;}
  body[data-theme] .intro>div:first-child{display:none;}
  body[data-theme] .preferences{display:grid;grid-template-columns:minmax(65px,.8fr) minmax(95px,1.2fr) 44px;width:100%;gap:4px;}
  body[data-theme] .preferences select{width:100%;min-width:0;font-size:11px;padding:6px;}
  body[data-theme] #sound{font-size:0;padding:0;}body[data-theme] #sound::before{content:'♫';font-size:20px;}
  body[data-theme] #language{order:1;}body[data-theme] #theme{order:2;}body[data-theme] #sound{order:3;}
  body[data-theme] .scoreboard{grid-column:2;grid-row:2;gap:6px;}
  body[data-theme] .player{padding:6px 8px;min-height:48px;gap:5px;}
  body[data-theme] .avatar{display:none;}
  body[data-theme] .player h2{font-size:11px;}
  body[data-theme] .player strong{font-size:24px;}
  body[data-theme] .room-banner{grid-column:2;grid-row:3;}
  body[data-theme] .actions{grid-column:2;grid-row:4;align-self:end;gap:5px;}
  body[data-theme] .actions button{padding:7px 9px;font-size:11px;}
  body[data-theme] .announcement{grid-column:2;grid-row:5;}
  body[data-theme] .notice{grid-column:2;grid-row:3;}
}

/* Object decorations retain the existing full-sized edge hit targets. */
body[data-theme] .coral {color:var(--coral-color);}
body[data-theme] .coral[data-object]:not([data-object="coral"]) path {stroke:currentColor;}
.line-choices {display:grid;gap:12px;margin:18px 0;}
.line-choice {display:grid;grid-template-columns:minmax(0,1fr) 84px;align-items:center;gap:8px;}
.line-choice label {min-width:0;display:grid;gap:6px;}
.line-choice select {width:100%;min-height:44px;}
.line-preview {width:84px;height:38px;overflow:visible;}
body[data-theme] .line-preview .coral {display:inline;--coral-color:var(--p1);}
body[data-theme] #line-preview-2 .coral {--coral-color:var(--p2);}

body[data-theme] .coral[data-object]:not([data-object="coral"]) path[fill="currentColor"] {fill:currentColor;}
