/* The parents' prize picture picker (spec §24.5): 36 built-in drawings in seven groups, a strip that
   jumps to a group, and a scroll box of equal tiles (§12). Used inside the prize editor sheet. */

:root {
  --ip-box-h: clamp(236px, 40dvh, 360px);
  --ip-cols: 4;
  --ip-gap: 8px;
  --ip-box: var(--surface-sunken);
  --ip-tile: var(--surface);
  --ip-tile-line: var(--line);
  --ip-on: var(--accent);
  --ip-on-soft: var(--accent-soft);
}
@media (min-width: 420px) { :root { --ip-cols: 5; } }
@media (min-width: 600px) { :root { --ip-cols: 6; --ip-gap: 10px; } }
@media (prefers-color-scheme: dark) {
  :root {
    --ip-tile: var(--surface-2);
    --ip-tile-line: transparent;
  }
}

.ip-field { gap: 10px; }
.ip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 36px; }
.ip-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 60%;
  height: 36px;
  padding: 0 12px 0 4px;
  border-radius: var(--r-pill);
  background: var(--ip-on-soft);
  color: var(--ip-on);
  font-size: 14px;
  font-weight: 700;
}
.ip-current-art { display: grid; flex-shrink: 0; width: 28px; height: 28px; }
.ip-current-art svg { width: 100%; height: 100%; }
.ip-current-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.ip {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: var(--r-m);
  background: var(--ip-box);
}
/* Seven equal jump buttons on the box itself (the thumb is the only raised part); small type so
   「出去玩」 fits at 375px. */
.ip-tabs { background: transparent; }
.ip-tabs .seg-item { min-width: 0; padding: 0 1px; font-size: 12.5px; }
.ip-tabs .seg-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ip-tabs .seg-item[aria-selected="true"] { color: var(--ip-on); font-weight: 700; }
@media (min-width: 420px) { .ip-tabs .seg-item { font-size: 14px; } }

.ip-scroll {
  position: relative;
  height: var(--ip-box-h);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-s);
  scrollbar-width: thin;
}
.ip-group + .ip-group { margin-top: 4px; }
.ip-group-label {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  height: 30px;
  padding: 0 4px;
  background: var(--ip-box);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
}
.ip-grid {
  display: grid;
  grid-template-columns: repeat(var(--ip-cols), minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: var(--ip-gap);
  padding: 4px 4px 8px;
}
.ip-tile {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 16px;
  justify-items: center;
  align-items: center;
  gap: 2px;
  aspect-ratio: 1 / 1;
  min-width: 0;
  min-height: 44px;
  padding: 7px 2px 6px;
  border: 2px solid var(--ip-tile-line);
  border-radius: var(--r-s);
  background: var(--ip-tile);
  color: var(--text-2);
  font: inherit;
  transition: transform var(--dur-1) var(--ease-out), border-color var(--dur-2), background-color var(--dur-2);
}
.ip-tile:active { transform: scale(0.94); }
.ip-tile-art { display: grid; width: 100%; height: 100%; min-height: 0; }
.ip-tile-art svg { width: 100%; height: 100%; }
.ip-tile-name {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 11px;
  line-height: 16px;
}
.ip-tile[aria-pressed="true"] {
  border-color: var(--ip-on);
  background: var(--ip-on-soft);
  box-shadow: 0 0 0 3px var(--ip-on-soft);
  color: var(--ip-on);
}
.ip-tile[aria-pressed="true"] .ip-tile-name { font-weight: 700; }
.ip-check {
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ip-on);
  color: var(--bg-elevated);
}
.ip-check svg { width: 13px; height: 13px; stroke-width: 3; }
.ip-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
