/* Only the canvas captures drawing gestures; the rest of the page can scroll. */
html { scroll-padding-bottom: 90px; }
body { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
input, select, textarea { font-size: 16px; }
#task-text { scroll-margin-bottom: 150px; }
.vector-art, canvas { max-width: 100%; }
.drawing-board, .drawing-board * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.player b, .task-card h2 { overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .doodle-scene { display: none; }
  .home-hero { padding-top: 21px; gap: 22px; }
  .hero-copy h1 { font-size: 29px; margin: 12px 0; }
  .hero-copy .intro { font-size: 12px; }
  .hero-tags { margin-top: 12px; }
  .entry-card { padding-top: 22px; }
  .entry-card h2 { font-size: 25px; }
  .tabs button, .avatar-option, .nav-link, .more-avatars, .seat-actions button,
  .chain-tabs button, .tool, .back-link { min-height: 44px; }
  .avatar-option { width: 38px; min-width: 34px; height: 44px; padding: 4px; }
  .all-avatars .avatar-option { width: 100%; height: 44px; }
  .avatar-picker { flex-wrap: wrap; justify-content: flex-start; gap: 7px; }
  .entry-card input { font-size: 16px; }
  .button { min-height: 48px; }
  .header { gap: 8px; }
  .header nav { gap: 5px; }
  .brand small { display: none; }
  .brand { font-size: 17px; }
  .account { max-width: 105px; font-size: 11px; min-height: 44px; overflow-wrap: anywhere; }
  .play-top h1 { font-size: 24px; }
  .play-top { gap: 10px; }
  .task-card { padding: 13px 16px; }
  .task-card h2 { font-size: 20px; line-height: 1.6; }
  .task-bottom { margin-top: 5px; }
  .stage-rail { margin: 15px 0; padding: 12px 4px; }
  .stage-count b { font-size: 29px; }
  .drawing-board { overflow: visible; }
  .drawing-tools { padding: 14px 10px; }
  .palette { gap: 6px; }
  .swatch { width: 32px; height: 32px; min-width: 32px; margin: 3px; }
  .tool-row { gap: 6px; }
  .tool { font-size: 12px; padding: 10px 8px; }
  .width-control { font-size: 11px; }
  .width-control input { width: 65px; min-height: 44px; }
  .board-footer { position: sticky; bottom: 0; padding: 11px 12px calc(11px + env(safe-area-inset-bottom, 0px)); background: #fffefa; z-index: 2; }
  .board-footer .button { min-height: 48px; }
  .guess-card { padding-bottom: 24px; }
  .guess-card input { font-size: 16px; }
  .pack-list button, .join-requests button { min-height: 44px; }
  .join-requests button { min-width: 44px; }
  .room-settings form select { font-size: 16px; }
  .header .nav-link:first-child { display: none; }
  .back-link { margin: 12px 0; }
  .page-heading { gap: 12px; margin-bottom: 19px; }
  .paper-panel { padding: 19px; }
  .seed-panel { padding: 24px 18px; }
  .seed-panel h2 { font-size: 23px; }
  .seed-panel .button, .room-settings .button { min-height: 48px; }
  .prompt-choice { min-height: 50px; }
  .play-page { padding-bottom: 15px; }
  .guess-card form .button { margin-top: 14px; }
  .replay-controls .button { width: 100%; }
  .room-settings .danger-link { min-height: 44px; }
  .pack-list small { font-size: 12px; }
}
@media (max-width: 360px) {
  .header { padding: 12px; }
  .brand-icon { display: none; }
  .brand { font-size: 16px; }
  .header nav .nav-link { font-size: 11px; padding: 8px 5px; }
  .account { padding: 8px; font-size: 10px; max-width: 95px; }
  .avatar-picker { gap: 5px; }
  .avatar-option { width: 34px; min-width: 30px; }
  .hero-copy h1 { font-size: 27px; }
  .swatch { width: 28px; height: 28px; min-width: 28px; }
  .players { grid-template-columns: repeat(2, 1fr); }
  .panel-heading { flex-wrap: wrap; }
  .all-avatars { grid-template-columns: repeat(5, 1fr); }
}
@media (max-height: 500px) and (orientation: landscape) {
  .header { padding-top: 10px; padding-bottom: 10px; }
  .play-top h1 { font-size: 22px; }
  .stage-rail { margin: 8px 0; }
  .drawing-layout { grid-template-columns: 170px 1fr; }
  .task-card { display: block; padding: 14px; }
  .task-card h2 { font-size: 17px; }
  .task-card .task-star { display: none; }
  .board-footer { position: static; }
}
