/* GazeTo — selection screen redesign styles (AssistUK)
   Restyles ScreenMySelection ("Meine Auswahl" hub). Presentation only —
   behaviour (touch + mouse + gaze-dwell, pagination, playlist, star-toggle,
   close button) lives in screens/my-selection.js. */

.screen-my-selection {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 70px);
  box-sizing: border-box;
}

/* Hub (Mein Bereich) locks page scrolling — eye-gaze users can't scroll, the
   curated selection paginates instead. Class toggled by ScreenMySelection. */
body.hub-noscroll { overflow: hidden; }
body.hub-noscroll #app-content { overflow: hidden; }

.r-sel-page {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 28px 24px 24px;
  box-sizing: border-box;
}

/* ── Header (eyebrow + big serif title + count) + action cluster ── */
.r-sel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.r-sel-head__text { min-width: 0; }
.r-sel-head__actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Big, obvious round close/back button — gaze-friendly (≥64px). */
.r-sel-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  min-width: 72px;
  border-radius: 50%;
  border: 2px solid var(--c-border-strong, rgba(0,0,0,0.14));
  background: var(--c-bg-primary, #fff);
  color: var(--c-fg1, #1d1d1f);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-md, 0 4px 18px rgba(0,0,0,0.06));
  transition: background var(--transition-base, 0.2s ease), transform 0.12s ease, box-shadow var(--transition-base, 0.2s ease), color var(--transition-base, 0.2s ease);
}
.r-sel-close:hover {
  background: var(--c-accent, #4b698c);
  color: #fff;
  transform: scale(1.05);
  box-shadow: var(--shadow-lg, 0 12px 36px rgba(0,0,0,0.12));
}
.r-sel-close svg, .r-sel-close i { width: 34px; height: 34px; }

/* ── Tile grid — 4 columns, big touch/gaze targets ── */
.r-sel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 26px;
  flex: 1;
  min-height: 0;
  align-content: start;
}

/* Tiles reuse .act-tile / .act-tile__* from redesign.css; we just make them
   larger and ensure the star reads as "active" (already in the selection). */
.r-sel-tile { position: relative; }
.r-sel-tile .act-tile__media { aspect-ratio: 16/10; }
.r-sel-tile .act-tile__title {
  font-size: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.r-sel-tile .act-tile__body { padding: 16px 18px 20px; }

/* Larger star hit-area on the hub (removes from selection). */
.r-sel-tile .act-tile__star {
  width: 52px;
  height: 52px;
  font-size: 28px;
}

/* ── Pagination — large round arrow buttons (≥64px for gaze) ── */
.r-sel-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 8px 8px;
}
.r-sel-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  min-width: 96px;
  border-radius: 50%;
  border: 3px solid var(--c-accent, #4b698c);
  background: var(--c-bg-primary, #fff);
  color: var(--c-accent, #4b698c);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-md, 0 4px 18px rgba(0,0,0,0.08));
  transition: background var(--transition-base, 0.2s ease), color var(--transition-base, 0.2s ease), transform 0.12s ease, box-shadow var(--transition-base, 0.2s ease);
}
.r-sel-page-btn:hover {
  background: var(--c-accent, #4b698c);
  color: #fff;
  transform: scale(1.06);
  box-shadow: var(--shadow-lg, 0 12px 36px rgba(0,0,0,0.12));
}
.r-sel-page-btn svg, .r-sel-page-btn i { width: 44px; height: 44px; }

.r-sel-page-indicator {
  font-family: var(--f-heading, 'Oswald', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-fg2, #555e6e);
}

/* ── Empty state ── */
.r-sel-empty {
  max-width: 620px;
  margin: 48px auto;
  padding: 40px 32px;
  text-align: center;
  background: var(--c-bg-primary, #fff);
  border: 1px solid var(--c-border, rgba(0,0,0,0.08));
  border-radius: 24px;
  box-shadow: var(--shadow-md, 0 4px 18px rgba(0,0,0,0.06));
}
.r-sel-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--c-bg-tertiary, #e3e6ec);
  color: #f59e0b;
}
.r-sel-empty__icon svg, .r-sel-empty__icon i { width: 44px; height: 44px; }
.r-sel-empty__title {
  font-family: var(--f-display, 'Merriweather', serif);
  font-weight: 900;
  font-size: 1.8rem;
  color: var(--c-fg1, #1d1d1f);
  margin: 0 0 14px;
}
.r-sel-empty__text {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--c-fg2, #555e6e);
  margin: 0 0 28px;
}

/* ── Responsive (legacy grid) ── */
@media (max-width: 1100px) {
  .r-sel-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .r-sel-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .r-sel-head { flex-direction: column; }
  .r-sel-head__actions { width: 100%; justify-content: space-between; }
  .r-sel-page-btn { width: 72px; height: 72px; min-width: 72px; }
  .r-sel-page-btn svg, .r-sel-page-btn i { width: 34px; height: 34px; }
}

/* ==========================================================================
   Immersive "Mein Bereich" Hub — the client (gaze user) surface.
   Full-bleed, calm, very large dwellable targets, minimal text, high contrast.
   ========================================================================== */

.screen-my-selection.hub {
  position: relative;
  /* Fit fully between the top status bar and the fixed bottom-nav (~64px) so
     NOTHING needs scrolling — eye-gaze users cannot scroll. Override the base
     .screen-my-selection min-height (which otherwise forces extra height). */
  height: calc(100dvh - 150px);
  height: calc(100vh - 150px);
  min-height: calc(100dvh - 150px);
  min-height: calc(100vh - 150px);
  max-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  color: #fff;
  background: radial-gradient(ellipse at 30% 18%, #1a3a6a 0%, #0a1830 60%, #050b1a 100%);
  overflow: hidden;
}

/* Soft ambient blobs behind the content — purely decorative, no interaction. */
.hub__bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hub__bg::before, .hub__bg::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(120px);
}
.hub__bg::before {
  width: 620px; height: 620px; background: #4b698c; opacity: 0.55;
  top: -200px; right: -120px;
}
.hub__bg::after {
  width: 520px; height: 520px; background: #6366f1; opacity: 0.28;
  bottom: -220px; left: 6%;
}

.hub__inner {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 40px 20px;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Header (greeting only — no exit button) ── */
.hub-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  flex-shrink: 0;
}
.hub-top__greet {
  font-family: var(--f-display, 'Merriweather', serif);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  text-shadow: 0 4px 18px rgba(0,0,0,0.4);
}
.hub-top__sub {
  margin-top: 8px;
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-size: clamp(15px, 1.6vw, 19px);
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.01em;
}

/* Big, single-click/dwell exit back to the support-person dashboard. */
.hub-exit {
  flex-shrink: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 96px;
  padding: 14px 18px;
  border-radius: 24px;
  border: 2px solid rgba(255,255,255,0.22);
  background: rgba(0,0,0,0.32);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.12s ease, border-color 0.2s ease;
}
.hub-exit:hover { background: rgba(0,0,0,0.5); transform: scale(1.04); border-color: rgba(255,255,255,0.5); }
.hub-exit svg, .hub-exit i { width: 40px; height: 40px; }
.hub-exit__label {
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Kiosk lock (Mein Bereich) ──
   When the lock is on, the gaze user cannot leave the hub: the app chrome (top
   statusbar + bottom nav + footer) is hidden, and the only way out is a
   deliberate PRESS-AND-HOLD on the exit badge (pointer/touch only, never
   gaze-dwell). */
body.hub-locked #statusbar,
body.hub-locked .bottom-nav,
body.hub-locked #app-footer { display: none !important; }

.hub-exit--hold { position: relative; overflow: hidden; }
.hub-exit--hold.is-holding {
  background: rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.6);
}
.hub-exit__fill {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 6px;
  width: 0%;
  background: var(--color-primary-light, #6388ad);
  transition: width 0.06s linear;
  pointer-events: none;
}

/* ── Sections ── */
.hub-section {
  margin-top: 22px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
/* Szenen-Sektion braucht keinen flex-grow wenn Favoriten vorhanden */
.hub-section--scenes { flex: 0 0 auto; }
.hub-section__title {
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-weight: 700;
  font-size: clamp(16px, 1.8vw, 22px);
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.92);
  margin: 0 0 14px;
  flex-shrink: 0;
}

/* ── Primary action tiles ── */
.hub-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  flex-shrink: 0;
}
.hub-action {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 96px;
  padding: 0 26px;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  color: #fff;
  text-align: left;
  box-shadow: 0 20px 44px rgba(0,0,0,0.4), inset 0 0 0 2px rgba(255,255,255,0.10);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hub-action:hover { box-shadow: 0 28px 60px rgba(0,0,0,0.5), inset 0 0 0 3px rgba(255,255,255,0.25); }
.hub-action--play { background: linear-gradient(135deg, #4D96FF 0%, #2c4d80 100%); }
.hub-action--all { background: linear-gradient(135deg, #6BCB77 0%, #2f7a4a 100%); }
.hub-action__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
}
.hub-action__icon svg, .hub-action__icon i { width: 38px; height: 38px; }
.hub-action__text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hub-action__label {
  font-family: var(--f-display, 'Merriweather', serif);
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.1;
}
.hub-action__sub {
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-weight: 600;
  font-size: clamp(13px, 1.5vw, 16px);
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.9);
}

/* ── Favourites grid (big launch tiles) ── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  flex: 1;
  min-height: 0;
  align-content: stretch;
  overflow: hidden;
}

/* ── Paginated selection (no scrolling for eye-gaze): fixed grid of tiles,
   big Zurück/Weiter arrows. Each tile = a 2×2 block of the 10×6 gaze grid →
   5 cols × 3 rows = up to 15 per page. The exact column/row count is set
   inline by the screen (gridColsForViewport) so it always matches the page
   size; the values here are the wide-screen default / fallback. ── */
.hub-section--paged { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.hub-grid--paged {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-content: stretch;
}
/* Fixed rows divide the height evenly, so tiles keep a consistent size even
   when a page is only partly filled (no more giant stretched tiles). */
.hub-grid--paged .hub-tile,
.hub-grid--paged .hub-scene { min-height: 0; }
.hub-pagination {
  flex-shrink: 0;
  padding: 14px 8px 2px;
  margin-top: auto;
}
.hub-pagination .r-sel-page-btn.is-disabled,
.hub-pagination .r-sel-page-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}
/* On the dark hub, lift the page indicator + arrow contrast. */
.hub-pagination .r-sel-page-indicator { color: rgba(255,255,255,0.92); }
.hub-tile {
  position: relative;
  min-height: 160px;
  border: none;
  border-radius: 28px;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  background: var(--tile-color, #4b698c);
  box-shadow: 0 22px 46px rgba(0,0,0,0.4), inset 0 0 0 2px rgba(255,255,255,0.10);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hub-tile:hover {
  /* No scale — the tile must stay put in its grid cell (scaling made it look
     "versetzt" / offset on hover). A glow ring is enough hover feedback. */
  box-shadow: 0 30px 70px rgba(0,0,0,0.5), 0 0 0 4px var(--tile-color, #4b698c), 0 0 60px var(--tile-color, #4b698c);
}
.hub-tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.hub-tile:hover .hub-tile__img { transform: scale(1.07); }
.hub-tile__glow { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,0.72) 100%); }
.hub-tile__body { position: absolute; left: 22px; right: 22px; bottom: 20px; }
.hub-tile__title {
  font-family: var(--f-display, 'Merriweather', serif);
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.12;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}
.hub-tile__star {
  position: absolute;
  top: 14px; right: 14px;
  width: 64px; height: 64px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #FFD93D;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.12s ease;
  z-index: 2;
}
.hub-tile__star:hover { background: rgba(0,0,0,0.62); transform: scale(1.08); }
.hub-tile__star svg, .hub-tile__star i { width: 32px; height: 32px; fill: currentColor; }

/* ── Meine Szenen ── */
.hub-scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.hub-scene {
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.hub-scene__media { position: relative; height: 180px; background: #16294a; }
.hub-scene__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-scene__placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.5);
}
.hub-scene__placeholder svg, .hub-scene__placeholder i { width: 64px; height: 64px; }
.hub-scene__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 18px 14px;
  font-family: var(--f-display, 'Merriweather', serif);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.75));
}

/* Big dwellable action buttons (≥64px tall). */
.hub-scene__actions { display: flex; gap: 2px; }
.hub-scene__btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 68px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-weight: 700;
  font-size: 18px;
  transition: filter 0.2s ease, transform 0.12s ease;
}
.hub-scene__btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.hub-scene__btn svg, .hub-scene__btn i { width: 26px; height: 26px; }
.hub-scene__btn--play { background: #4D96FF; }
.hub-scene__btn--edit { background: rgba(255,255,255,0.14); }

/* "Neue Szene" tile — dashed, inviting. */
.hub-scene--new {
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 248px;
  border: 3px dashed rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  color: #fff;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}
.hub-scene--new:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.7); transform: scale(1.02); }
.hub-scene__new-icon {
  display: grid; place-items: center;
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
}
.hub-scene__new-icon svg, .hub-scene__new-icon i { width: 44px; height: 44px; }
.hub-scene__new-label {
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}

/* ── Friendly empty states ── */
.hub-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 24px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}
.hub-empty--scenes { grid-column: auto; }
.hub-empty__icon {
  display: grid; place-items: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #FFD93D;
}
.hub-empty__icon svg, .hub-empty__icon i { width: 40px; height: 40px; }
.hub-empty__text {
  margin: 0;
  max-width: 36ch;
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-size: 17px;
  line-height: 1.5;
  color: rgba(255,255,255,0.82);
}

/* ── Slim sponsor footer strip ── */
.hub-sponsor {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px 24px;
  background: rgba(0,0,0,0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.1);
}
.hub-sponsor__label {
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
.hub-sponsor__mark { display: inline-flex; align-items: center; }
.hub-sponsor__logo { height: 24px; width: auto; opacity: 0.9; }
.hub-sponsor__placeholder {
  font-family: var(--f-heading, 'DM Sans', sans-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.85);
}

/* ── Responsive (hub) ── */
@media (max-width: 760px) {
  .hub__inner { padding: 16px 18px 16px; }
  .hub-top { flex-direction: row; margin-bottom: 14px; }
  .hub-top__greet { font-size: clamp(20px, 5vw, 28px); }
  .hub-actions { gap: 12px; }
  .hub-action { min-height: 80px; padding: 0 18px; }
  .hub-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .hub-scene-grid { grid-template-columns: 1fr; }
  .hub-tile { min-height: 140px; }
  .hub-section { margin-top: 16px; }
}
