/* PRISM 1.3 — compact room browser, authored pickers and direct touch pads.
   Loaded after style.css and menu.css. Canvas geometry remains owned by Core. */

/* A common picker surface on desktop and on phones. */
.pr-gallery-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  flex: none;
  margin-bottom: 14px;
}
.pr-gallery-intro {
  margin: 0;
  flex: 1;
  color: var(--pr-muted);
  font-size: 12px;
  line-height: 1.5;
}
.pr-gallery-filters > .pr-chapter-mobile { display: none; }
.pr-gallery-filters > .pr-gallery-difficulty {
  display: block;
  flex: 0 0 178px;
  min-height: 0;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
}
.pr-picker-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid var(--pr-rim);
  border-radius: 12px;
  background: var(--pr-noise), linear-gradient(135deg,var(--pr-surface-raised),var(--pr-surface-soft));
  color: var(--pr-ink);
  box-shadow: 0 1px 0 #f1e7c91c inset, 0 3px 9px #08252a0d;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color .15s ease, background-color .15s ease;
}
.pr-picker-trigger-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pr-picker-trigger-copy > small {
  display: block;
  color: var(--pr-muted);
  font-size: 10px;
  font-weight: 450;
  line-height: 1.15;
  letter-spacing: .045em;
}
.pr-picker-trigger-copy > b {
  display: block;
  max-width: 100%;
  color: var(--pr-ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  hyphens: auto;
}
.pr-picker-chevron { flex: none; width: 15px; height: 15px; color: var(--pr-gold); transition: transform .15s ease; }
.pr-picker-trigger[aria-expanded=true] { border-color: var(--pr-gold); box-shadow: 0 0 0 1px var(--pr-gold), 0 1px 0 #e9d8b52e inset; }
.pr-picker-trigger[aria-expanded=true] .pr-picker-chevron { transform: rotate(180deg); }
.pr-picker-trigger:focus-visible,
.pr-picker-close:focus-visible,
.pr-picker-option:focus-visible,
.pr-touch-pad:focus-visible { outline: 2px solid var(--pr-gold); outline-offset: 3px; }

.pr-picker-veil {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: max(16px,var(--pr-safe-top),env(safe-area-inset-top,0px)) max(16px,var(--pr-safe-right),env(safe-area-inset-right,0px)) max(16px,var(--pr-safe-bottom),env(safe-area-inset-bottom,0px)) max(16px,var(--pr-safe-left),env(safe-area-inset-left,0px));
  overflow: hidden;
  background: #031b29a8;
  isolation: isolate;
  touch-action: pan-y;
}
.pr-picker-sheet {
  display: flex;
  flex-direction: column;
  width: min(540px,100%);
  min-width: 0;
  min-height: 0;
  max-height: min(680px,100%);
  box-sizing: border-box;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--pr-rim);
  border-radius: 24px;
  background: var(--pr-noise), linear-gradient(145deg,var(--pr-surface-raised),var(--pr-surface) 70%);
  color: var(--pr-ink);
  box-shadow: 0 26px 80px #03192473, 0 1px 0 #f3e5bd3b inset, 0 0 0 5px #c0c6a60a;
  animation: pr-picker-enter .18s ease-out both;
}
.pr-picker-head { display: flex; align-items: center; gap: 14px; flex: none; min-width: 0; margin-bottom: 12px; }
.pr-picker-head h2 { min-width: 0; margin: 0; font-size: 23px; line-height: 1.2; font-weight: 620; letter-spacing: -.025em; overflow-wrap: anywhere; }
.pr-picker-close {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  margin-left: auto;
  padding: 10px;
  border: 1px solid var(--pr-rim-soft);
  border-radius: 50%;
  background: var(--pr-surface-soft);
  color: var(--pr-ink);
  cursor: pointer;
  touch-action: manipulation;
}
.pr-picker-close > svg { width: 21px; height: 21px; }
.pr-picker-note { flex: none; margin: 0 0 12px; color: var(--pr-muted); font-size: 12px; line-height: 1.5; }
.pr-picker-options {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 0;
  flex: 1 1 auto;
  padding: 3px 4px 4px;
  margin: 0 -4px -4px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--pr-gold) transparent;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.pr-picker-option {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: 76px minmax(0,1fr) 19px;
  align-items: center;
  gap: 12px;
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  box-sizing: border-box;
  padding: 9px;
  border: 1px solid var(--pr-rim-soft);
  border-radius: 15px;
  background: var(--pr-noise), linear-gradient(115deg,var(--pr-surface-soft),var(--pr-surface));
  color: var(--pr-ink);
  box-shadow: 0 1px 0 #e4e6d70e inset;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: pan-y;
}
.pr-picker-option[aria-selected=true] { border-color: var(--pr-gold); background-color: var(--pr-surface-raised); box-shadow: 0 0 0 1px var(--pr-gold), 0 1px 0 #f1e2ba25 inset; }
.pr-picker-art { display: block; width: 76px; aspect-ratio: 4/3; overflow: hidden; border: 1px solid #d9c9945c; border-radius: 9px; background: var(--pr-stone); }
.pr-picker-art > canvas { display: block; width: 100%; height: 100%; border-radius: inherit; }
.pr-picker-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 76px;
  min-height: 56px;
  box-sizing: border-box;
  border: 1px solid var(--pr-rim-soft);
  border-radius: 11px;
  background: linear-gradient(135deg,#b6c7a51a,#e0bc6812);
  color: var(--pr-gold);
}
.pr-picker-symbol > svg { width: 23px; height: 23px; }
.pr-picker-symbol > b { font-size: 22px; font-weight: 550; font-variant-numeric: tabular-nums; }
.pr-picker-option-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.pr-picker-option-copy > b { color: var(--pr-ink); font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pr-picker-option-copy > small { color: var(--pr-muted); font-size: 11px; font-weight: 400; line-height: 1.45; overflow-wrap: anywhere; }
.pr-picker-check { width: 19px; height: 19px; color: var(--pr-gold); opacity: 0; }
.pr-picker-option[aria-selected=true] .pr-picker-check { opacity: 1; }
:root[data-kit-motyw=jasny] .pr-picker-veil { background: #183e4278; }
:root[data-kit-motyw=jasny] .pr-picker-sheet { box-shadow: 0 25px 75px #173c4540, 0 1px 0 #fffceb inset, 0 0 0 5px #edf0db22; }
:root[data-kit-motyw=jasny] .pr-picker-option[aria-selected=true] { background: var(--pr-noise), linear-gradient(115deg,#f8f2df,#e7e8d7); }

/* Preserve the existing desktop controls inside their new wrapper. */
.pr-classic-controls { display: contents; }
.pr-touch-controls { display: none; }

/* Direct touch steering belongs below the playable area. No moving targets,
   expensive blur, animated canvas texture or global touch-fire indicator. */
:root[data-pr-touch=true] #pr-app {
  grid-template-rows: 92px minmax(0,1fr) 116px;
  box-sizing: border-box;
  padding: max(var(--pr-safe-top),env(safe-area-inset-top,0px)) max(var(--pr-safe-right),env(safe-area-inset-right,0px)) max(var(--pr-safe-bottom),env(safe-area-inset-bottom,0px)) max(var(--pr-safe-left),env(safe-area-inset-left,0px));
}
:root[data-pr-touch=true] .pr-classic-controls { display: none; }
:root[data-pr-touch=true] .pr-play-foot { display: block; min-height: 0; padding: 7px 12px 9px; }
:root[data-pr-touch=true] .pr-touch-controls { display: grid; grid-template-rows: auto minmax(0,1fr); gap: 5px; width: 100%; height: 100%; min-width: 0; min-height: 0; }
.pr-touch-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; margin: 0; padding: 0 3px; color: #c5dace; }
.pr-touch-caption > span { flex: none; font-size: 10px; line-height: 1.35; font-weight: 600; color: #e5d3ab; }
.pr-touch-caption > small { min-width: 0; font-size: 10px; line-height: 1.35; text-align: right; color: #accbc0; }
.pr-touch-pads { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; min-width: 0; min-height: 0; }
.pr-touch-controls[data-count="1"] .pr-touch-pads { grid-template-columns: minmax(0,1fr); }
.pr-touch-pad {
  --pr-pad-accent: #a0e4d3;
  --pr-pad-ink: #d8f0e5;
  --pr-pad-muted: #a4c5bd;
  --pr-pad-rim: #87c3b170;
  --pr-pad-top: #27534f;
  --pr-pad-bottom: #163b43;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-rows: auto minmax(22px,1fr);
  gap: 6px;
  align-content: center;
  width: 100%;
  min-width: 0;
  min-height: 68px;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 11px;
  overflow: hidden;
  border: 1px solid var(--pr-pad-rim);
  border-radius: 17px;
  background: var(--pr-noise), linear-gradient(135deg,var(--pr-pad-top),var(--pr-pad-bottom) 80%);
  color: var(--pr-pad-ink);
  box-shadow: 0 1px 0 #eef0cb29 inset, 0 3px 0 #082a32, 0 5px 14px #061f2826;
  font: inherit;
  text-align: left;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.pr-touch-pad[data-player="1"] { --pr-pad-accent:#f0cc8e; --pr-pad-ink:#f4e4bf; --pr-pad-muted:#d1c6a8; --pr-pad-rim:#d5b47770; --pr-pad-top:#555341; --pr-pad-bottom:#2d413e; }
.pr-touch-pad.pr-held { border-color: var(--pr-pad-accent); box-shadow: 0 0 0 1px var(--pr-pad-accent), 0 1px 0 #fff6 inset, 0 3px 0 #082a32; cursor: grabbing; }
.pr-pad-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.pr-pad-player { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pr-pad-player > i { display: grid; place-items: center; flex: none; width: 21px; height: 21px; box-sizing: border-box; border: 1px solid var(--pr-pad-rim); border-radius: 7px; background: #0f303b26; color: var(--pr-pad-accent); font-size: 12px; line-height: 1; font-style: normal; font-weight: 700; }
.pr-pad-player > b { min-width: 0; color: var(--pr-pad-ink); font-size: 11px; line-height: 1.25; font-weight: 600; overflow-wrap: anywhere; }
.pr-pad-status { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; color: var(--pr-pad-muted); }
.pr-pad-status > svg { flex: none; width: 14px; height: 14px; color: var(--pr-pad-accent); opacity: .65; }
.pr-pad-status > small { min-width: 0; font-size: 10px; line-height: 1.25; text-align: right; overflow-wrap: anywhere; }
.pr-held .pr-pad-status { color: var(--pr-pad-accent); }
.pr-held .pr-pad-status > svg { opacity: 1; }
.pr-pad-track { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 22px; color: var(--pr-pad-accent); }
.pr-pad-track > svg { flex: none; width: 16px; height: 16px; opacity: .8; }
.pr-pad-groove { position: relative; display: block; flex: 1; height: 24px; min-width: 0; }
.pr-pad-groove::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; background: var(--pr-pad-accent); opacity: .22; box-shadow: 0 1px 0 #082f3933; }
.pr-pad-groove::after { content: ""; position: absolute; left: clamp(4px,var(--pr-pad-hunter,50%),calc(100% - 4px)); top: 50%; width: 6px; height: 6px; border: 1px solid var(--pr-pad-accent); background: var(--pr-pad-accent); border-radius: 1px; transform: translate(-50%,-50%) rotate(45deg); opacity: .85; }
.pr-pad-knob { position: absolute; z-index: 1; left: clamp(11px,var(--pr-pad-position,50%),calc(100% - 11px)); top: 50%; display: block; width: 22px; height: 22px; box-sizing: border-box; border: 2px solid var(--pr-pad-accent); border-radius: 50%; background: var(--pr-pad-bottom); box-shadow: 0 0 0 3px #c6e8cd10; transform: translate(-50%,-50%); opacity: 0; transition: opacity .12s ease; }
.pr-held .pr-pad-knob { opacity: 1; }
:root[data-kit-motyw=jasny] .pr-touch-caption > span { color: #745c2f; }
:root[data-kit-motyw=jasny] .pr-touch-caption > small { color: #3d685d; }
:root[data-kit-motyw=jasny] .pr-touch-pad { --pr-pad-accent:#256d61; --pr-pad-ink:#244f46; --pr-pad-muted:#4b7063; --pr-pad-rim:#598d756b; --pr-pad-top:#edf1dc; --pr-pad-bottom:#c7ddc8; box-shadow:0 1px 0 #fffced inset,0 3px 0 #7b9a83,0 5px 14px #3e62521a; }
:root[data-kit-motyw=jasny] .pr-touch-pad[data-player="1"] { --pr-pad-accent:#86602b; --pr-pad-ink:#5b4b2d; --pr-pad-muted:#7a704f; --pr-pad-rim:#9c7c467d; --pr-pad-top:#f5ecd4; --pr-pad-bottom:#ddd4b1; }
:root[data-kit-motyw=jasny] .pr-touch-pad.pr-held { box-shadow:0 0 0 1px var(--pr-pad-accent),0 1px 0 #fffdf0 inset,0 3px 0 #82967b; }

:root[data-pr-touch=true] .pr-play-head { display: grid; grid-template-rows: 44px 44px; gap: 0; margin: 0 12px; padding: 4px 0 0; min-height: 0; }
:root[data-pr-touch=true] .pr-context { min-width: 0; min-height: 44px; gap: 8px; padding: 0 54px 0 0; }
:root[data-pr-touch=true] .pr-context > div { min-width: 0; flex: 1; }
:root[data-pr-touch=true] .pr-context h2 { width: 100%; max-width: none; font-size: 13px; }
:root[data-pr-touch=true] .pr-context p { max-width: 100%; margin-top: 3px; font-size: 10px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-pr-touch=true] .pr-context > [data-pr=room-info] { width: 44px; height: 44px; min-height: 44px; flex: none; }
:root[data-pr-touch=true] .pr-scorebar { gap: 9px; min-width: 0; min-height: 44px; padding: 0; }
:root[data-pr-touch=true] .pr-score-stat { flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
:root[data-pr-touch=true] .pr-score-stat > span { font-size: 10px; line-height: 1.15; letter-spacing: .015em; }
:root[data-pr-touch=true] .pr-score-stat > b { font-size: 18px; line-height: 1.1; }
:root[data-pr-touch=true] .pr-hearts { min-height: 44px; }
:root[data-pr-touch=true] .pr-play-progress { bottom: 0; }
:root[data-pr-touch=true] .pr-arena { min-height: 0; margin: 0 10px; border-radius: 18px; }
:root[data-pr-touch=true] .pr-arena-goal { top: 8px; left: 9px; right: 9px; gap: 8px; }
:root[data-pr-touch=true] .pr-orb-counter,
:root[data-pr-touch=true] .pr-combo { padding: 5px 8px; font-size: 10px; }
:root[data-pr-touch=true] .pr-powerups { top: 45px; right: 8px; gap: 4px; }
:root[data-pr-touch=true] .pr-first-shot { top: 51px; width: max-content; max-width: min(290px,calc(100% - 24px)); box-sizing: border-box; padding: 8px 11px; border-radius: 12px; background: #173f47ed; border-color: #c2d2a94d; color: #edf2df; box-shadow: 0 4px 12px #06232d26; backdrop-filter: none; -webkit-backdrop-filter: none; font-size: 11px; line-height: 1.4; }
:root[data-pr-touch=true] #pr-app[data-party=local] .pr-first-shot { top: 51px; max-width: min(290px,calc(100% - 24px)); padding: 8px 11px; font-size: 11px; line-height: 1.4; }
:root[data-pr-touch=true] .kit-hud { top: calc(4px + max(var(--pr-safe-top),env(safe-area-inset-top,0px))); left: calc(12px + max(var(--pr-safe-left),env(safe-area-inset-left,0px))); right: calc(12px + max(var(--pr-safe-right),env(safe-area-inset-right,0px))); }
:root[data-pr-touch=true] .kit-hud .kit-btn { width: 44px; height: 44px; min-height: 44px; }
:root[data-pr-touch=true] .pr-touch-coop-note { display: block; font-size: 11px; line-height: 1.45; }
:root[data-pr-touch=true] .pr-key-players { gap: 8px; }
:root[data-pr-touch=true] .pr-key-players > div { min-width: 0; padding: 8px; }
:root[data-pr-touch=true] .pr-key-players span { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
:root[data-kit-motyw=jasny][data-pr-touch=true] .pr-play-head { padding-left: 8px; padding-right: 8px; }
:root[data-kit-motyw=jasny][data-pr-touch=true] .pr-first-shot { background: #f1efddf5; color: #214b43; border-color: #a1926066; }

/* Phone gallery: keep the real art, reclaim duplicated headings and spacing. */
@media(max-width:700px) {
  .pr-levels-layer.kit-warstwa { padding: max(8px,var(--pr-safe-top)) max(8px,var(--pr-safe-right)) max(8px,var(--pr-safe-bottom)) max(8px,var(--pr-safe-left)); }
  .pr-levels-layer.kit-warstwa .kit-karta { padding: 12px; border-radius: 18px; min-height: 0; }
  .pr-levels-layer .pr-sheet-head { min-height: 44px; margin-bottom: 8px; gap: 9px; }
  .pr-levels-layer .pr-sheet-head .kit-tytul { font-size: 22px; line-height: 1.2; }
  .pr-gallery-filters { display: grid; grid-template-columns: minmax(0,1fr) minmax(112px,.65fr); align-items: stretch; gap: 8px; margin-bottom: 9px; }
  .pr-gallery-intro { display: none; }
  .pr-gallery-filters > .pr-chapter-mobile,
  .pr-gallery-filters > .pr-gallery-difficulty { display: block; width: auto; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; background: none; }
  .pr-gallery-filters .pr-picker-trigger { height: 100%; min-height: 48px; padding: 7px 9px; border-radius: 11px; gap: 7px; }
  .pr-picker-trigger-copy > b { font-size: 11px; }
  .pr-picker-chevron { width: 13px; height: 13px; }
  .pr-gallery-content { min-height: 0; gap: 8px; }
  .pr-room-collection { min-height: 0; padding: 0 2px 4px; }
  .pr-levels-layer .pr-chapter-heading { display: flex; align-items: center; gap: 8px; margin: 2px 1px 8px; }
  .pr-levels-layer .pr-chapter-heading h3 { display: none; }
  .pr-chapter-heading .pr-eyebrow { margin: 0; line-height: 1.4; letter-spacing: .06em; }
  .pr-chapter-completion { max-width: none; font-size: 10px; line-height: 1.4; white-space: nowrap; }
  .pr-room-grid { gap: 9px; }
  .pr-room-card-art { aspect-ratio: 4/3; }
  .pr-room-card-copy { padding: 7px 4px 5px; }
  .pr-room-card-name { font-size: 11px; line-height: 1.3; }
  .pr-room-inspector { min-height: 0; grid-template-columns: minmax(0,1fr) minmax(122px,.83fr); gap: 9px; padding: 9px; border-radius: 13px; margin: 0; }
  .pr-inspector-heading { margin-bottom: 4px; }
  .pr-inspector-body h3 { margin: 0; font-size: 14px; line-height: 1.3; }
  .pr-room-inspector .pr-room-kind { display: none; }
  .pr-room-facts { padding: 5px 0 0; gap: 12px; }
  .pr-room-entry-note:not(.pr-unlock-note) { display: none; }
  .pr-room-entry > .kit-btn { min-height: 46px; padding: 10px 7px; font-size: 11px; line-height: 1.3; gap: 5px; }
  .pr-unlock-note { margin-bottom: 6px; font-size: 10px; line-height: 1.35; }
  .pr-gallery-footer { min-height: 18px; padding-top: 7px; margin-top: 7px; font-size: 10px; line-height: 1.35; }
  .pr-picker-veil { align-items: flex-end; padding: max(10px,var(--pr-safe-top),env(safe-area-inset-top,0px)) max(10px,var(--pr-safe-right),env(safe-area-inset-right,0px)) max(10px,var(--pr-safe-bottom),env(safe-area-inset-bottom,0px)) max(10px,var(--pr-safe-left),env(safe-area-inset-left,0px)); }
  .pr-picker-sheet { width: 100%; max-height: 100%; padding: 16px; border-radius: 23px 23px 17px 17px; }
  .pr-picker-head { margin-bottom: 10px; gap: 10px; }
  .pr-picker-head h2 { font-size: 22px; }
  .pr-picker-note { font-size: 11px; line-height: 1.45; margin-bottom: 10px; }
  .pr-picker-option { grid-template-columns: 68px minmax(0,1fr) 17px; gap: 9px; padding: 8px; min-height: 74px; border-radius: 13px; }
  .pr-picker-art { width: 68px; border-radius: 8px; }
  .pr-picker-symbol { width: 68px; min-height: 54px; }
  .pr-picker-option-copy > b { font-size: 13px; }
  .pr-picker-option-copy > small { font-size: 11px; line-height: 1.4; }
  .pr-picker-check { width: 17px; height: 17px; }
  :root[data-pr-touch=true] .pr-score-stat.pr-best { display: none; }
  :root[data-pr-touch=true] .pr-hearts-duo { gap: 7px; }
}

@media(max-width:420px) {
  .pr-touch-controls[data-count="2"] .pr-pad-player { flex: 1; }
  .pr-touch-controls[data-count="2"] .pr-pad-player > b { white-space: nowrap; overflow-wrap: normal; }
  .pr-touch-controls[data-count="2"] .pr-pad-status { flex: none; }
  .pr-touch-controls[data-count="2"] .pr-pad-status > small { display: none; }
  .pr-touch-controls[data-count="2"] .pr-pad-status > svg { width: 16px; height: 16px; }
}

@media(max-width:700px) and (orientation:portrait) {
  :root[data-pr-touch=true] .pr-touch-caption > span { display: none; }
  :root[data-pr-touch=true] .pr-touch-caption > small { width: 100%; text-align: center; }
}

@media(max-width:360px) {
  .pr-levels-layer.kit-warstwa .kit-karta { padding: 10px; }
  .pr-levels-layer .pr-sheet-head .kit-tytul { font-size: 20px; }
  .pr-gallery-filters { gap: 6px; grid-template-columns: minmax(0,1fr) 112px; }
  .pr-gallery-filters .pr-picker-trigger { padding: 7px 8px; gap: 5px; }
  .pr-room-inspector { grid-template-columns: minmax(0,1fr) 112px; gap: 7px; padding: 8px; }
  .pr-inspector-body h3 { font-size: 13px; }
  .pr-room-entry > .kit-btn { font-size: 10px; padding: 9px 5px; gap: 4px; }
  .pr-room-grid { gap: 8px; }
  .pr-picker-sheet { padding: 12px; }
  .pr-picker-head h2 { font-size: 20px; }
  .pr-picker-options { gap: 8px; }
  .pr-picker-option { grid-template-columns: 60px minmax(0,1fr) 16px; gap: 8px; }
  .pr-picker-art,.pr-picker-symbol { width: 60px; }
  .pr-picker-option-copy > b { font-size: 12px; }
  .pr-picker-symbol > b { font-size: 20px; }
  .pr-picker-symbol > svg { width: 20px; height: 20px; }
  :root[data-pr-touch=true] #pr-app { grid-template-rows: 92px minmax(0,1fr) 110px; }
  :root[data-pr-touch=true] .pr-play-foot { padding: 6px 10px 8px; }
  :root[data-pr-touch=true] .pr-play-head { margin: 0 10px; }
  :root[data-pr-touch=true] .pr-arena { margin: 0 8px; border-radius: 16px; }
  :root[data-pr-touch=true] .pr-touch-caption > span { display: none; }
  :root[data-pr-touch=true] .pr-touch-caption > small { width: 100%; text-align: center; }
  .pr-touch-pads { gap: 9px; }
  .pr-touch-pad { padding: 8px 9px; border-radius: 14px; gap: 5px; }
  .pr-pad-player { gap: 5px; }
  .pr-pad-player > b { font-size: 10px; }
  .pr-pad-status { gap: 3px; }
  .pr-pad-status > small { font-size: 10px; }
  .pr-pad-track { gap: 6px; }
  :root[data-pr-touch=true] .kit-hud { left: calc(10px + max(var(--pr-safe-left),env(safe-area-inset-left,0px))); right: calc(10px + max(var(--pr-safe-right),env(safe-area-inset-right,0px))); }
}

/* Short landscape phones keep both thumbs below the entire visible arena. */
@media(max-height:520px) and (orientation:landscape) {
  .pr-gallery-filters { display: grid; grid-template-columns: minmax(0,1fr) 158px; align-items: stretch; gap: 10px; margin: 0 0 8px; position: static; }
  .pr-gallery-intro { display: none; }
  .pr-gallery-filters > .pr-chapter-mobile,
  .pr-gallery-filters > .pr-gallery-difficulty { display: block; width: auto; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; background: none; }
  .pr-gallery-filters .pr-picker-trigger { min-height: 44px; height: 100%; padding: 6px 10px; }
  .pr-picker-trigger-copy { gap: 2px; }
  .pr-picker-trigger-copy > b { font-size: 11px; }
  .pr-levels-layer.kit-warstwa .kit-karta { padding: 10px 12px; }
  .pr-levels-layer .pr-sheet-head { min-height: 44px; margin-bottom: 5px; }
  .pr-levels-layer .pr-sheet-head .kit-tytul { font-size: 21px; }
  .pr-levels-layer .pr-chapter-heading { display: none; }
  .pr-gallery-content { grid-template-columns: minmax(0,1fr) 218px; gap: 12px; }
  .pr-room-inspector { display: flex; min-height: 0; flex-direction: column; margin: 0; padding: 8px; overflow: hidden; gap: 0; }
  .pr-inspector-body { min-height: 0; flex: 1; padding: 0; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain; touch-action: pan-y; }
  .pr-inspector-heading { margin-bottom: 5px; }
  .pr-inspector-body h3 { font-size: 14px; line-height: 1.25; margin: 0 0 5px; }
  .pr-room-inspector .pr-room-kind,.pr-room-inspector .pr-room-advice { display: none; }
  .pr-room-inspector .pr-room-facts { padding: 5px 0; border: 0; }
  .pr-room-inspector .pr-room-entry { flex: none; margin: 0; padding-top: 7px; }
  .pr-room-entry-note:not(.pr-unlock-note) { display: none; }
  .pr-room-entry > .kit-btn { min-height: 44px; padding: 8px; font-size: 11px; }
  .pr-gallery-footer { padding-top: 6px; margin-top: 6px; min-height: 15px; font-size: 10px; }
  .pr-picker-veil { align-items: center; padding-top: max(8px,var(--pr-safe-top)); padding-bottom: max(8px,var(--pr-safe-bottom)); }
  .pr-picker-sheet { width: min(620px,100%); max-height: 100%; padding: 12px 16px; border-radius: 19px; }
  .pr-picker-head { margin-bottom: 6px; }
  .pr-picker-head h2 { font-size: 21px; }
  .pr-picker-note { margin-bottom: 7px; font-size: 11px; line-height: 1.35; }
  .pr-picker-options { gap: 7px; }
  .pr-picker-option { min-height: 68px; grid-template-columns: 64px minmax(0,1fr) 18px; padding: 7px 9px; }
  .pr-picker-art,.pr-picker-symbol { width: 64px; }
  .pr-picker-symbol { min-height: 48px; }
  .pr-picker-option-copy { gap: 3px; }
  .pr-picker-option-copy > b { font-size: 12px; }
  :root[data-pr-touch=true] #pr-app { grid-template-rows: 54px minmax(0,1fr) 88px; }
  :root[data-pr-touch=true] .pr-play-head { grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 44px; gap: 14px; align-items: center; margin: 0 14px; padding: 4px 51px 0 0; }
  :root[data-pr-touch=true] .pr-context { padding: 0; }
  :root[data-pr-touch=true] .pr-context h2 { font-size: 12px; max-width: 28vw; }
  :root[data-pr-touch=true] .pr-context p { max-width: 28vw; }
  :root[data-pr-touch=true] .pr-scorebar { gap: 18px; padding: 0 4px 0 0; }
  :root[data-pr-touch=true] .pr-score-stat.pr-best { display: none; }
  :root[data-pr-touch=true] .pr-score-stat > b { font-size: 17px; }
  :root[data-pr-touch=true] .pr-arena { margin: 0 12px; border-radius: 15px; }
  :root[data-pr-touch=true] .pr-play-foot { padding: 5px 14px 7px; }
  :root[data-pr-touch=true] .pr-touch-controls { gap: 3px; }
  :root[data-pr-touch=true] .pr-touch-caption { padding: 0 3px; }
  :root[data-pr-touch=true] .pr-touch-caption > span { display: block; }
  :root[data-pr-touch=true] .pr-touch-caption > small { width: auto; text-align: right; }
  .pr-touch-pads { gap: 14px; }
  .pr-touch-pad { min-height: 58px; grid-template-rows: auto minmax(20px,1fr); padding: 6px 12px; gap: 3px; border-radius: 13px; }
  .pr-pad-player > i { height: 20px; width: 20px; }
  .pr-pad-track { min-height: 20px; }
  .pr-pad-groove { height: 20px; }
  .pr-pad-knob { width: 20px; height: 20px; }
  :root[data-pr-touch=true] .pr-first-shot,
  :root[data-pr-touch=true] #pr-app[data-party=local] .pr-first-shot { top: 42px; max-width: 55%; padding: 6px 10px; font-size: 10px; line-height: 1.4; }
  :root[data-pr-touch=true] .pr-powerups { top: 8px; right: 100px; flex-direction: row; }
  :root[data-pr-touch=true] .kit-hud { left: calc(14px + max(var(--pr-safe-left),env(safe-area-inset-left,0px))); right: calc(14px + max(var(--pr-safe-right),env(safe-area-inset-right,0px))); }
  :root[data-kit-motyw=jasny][data-pr-touch=true] .pr-play-head { padding: 4px 51px 0 8px; }
}

@media(max-height:520px) and (orientation:landscape) and (max-width:650px) {
  .pr-gallery-content { grid-template-columns: minmax(0,1fr) 188px; gap: 9px; }
  .pr-room-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pr-gallery-filters { grid-template-columns: minmax(0,1fr) 128px; gap: 8px; }
  :root[data-pr-touch=true] .pr-play-head { gap: 9px; }
  :root[data-pr-touch=true] .pr-scorebar { gap: 10px; }
  :root[data-pr-touch=true] .pr-context h2,
  :root[data-pr-touch=true] .pr-context p { max-width: 22vw; }
  :root[data-pr-touch=true] .pr-touch-caption > span { display: none; }
  :root[data-pr-touch=true] .pr-touch-caption > small { width: 100%; text-align: center; }
}

@media(max-height:590px) and (orientation:portrait) {
  .pr-levels-layer .pr-chapter-mobile { margin-right: 0; }
  .pr-levels-layer .pr-gallery-filters { margin-bottom: 7px; }
  .pr-levels-layer .pr-chapter-heading { margin-bottom: 7px; }
  .pr-picker-sheet { padding: 12px; }
  .pr-picker-head { margin-bottom: 7px; }
  .pr-picker-note { margin-bottom: 8px; }
  :root[data-pr-touch=true] .pr-touch-caption > span { display: none; }
  :root[data-pr-touch=true] .pr-touch-caption > small { width: 100%; text-align: center; }
  :root[data-pr-touch=true] .pr-touch-coop-note { font-size: 10px; line-height: 1.4; }
}

@media(hover:hover) and (pointer:fine) {
  .pr-picker-trigger:hover { border-color: var(--pr-gold); }
  .pr-picker-option:hover { border-color: var(--pr-gold); background-color: var(--pr-surface-raised); }
  .pr-picker-close:hover { border-color: var(--pr-gold); }
}
@keyframes pr-picker-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media(prefers-reduced-motion:reduce) {
  .pr-picker-sheet { animation: none; }
  .pr-picker-trigger,.pr-picker-chevron,.pr-touch-pad,.pr-pad-knob { transition: none; }
}
