/* ============================================================
   PurrCine — Polish layer
   Responsive hardening, touch targets, smooth interactions and
   the immersive AI Drama reel feed. Loaded last.
   ============================================================ */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  overflow-x: hidden;
  min-height: 100dvh;
}
img, video, iframe { max-width: 100%; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

/* Comfortable touch targets on touch devices. */
@media (hover: none) and (pointer: coarse) {
  .icon-btn, .pc-btn, .tool-btn, .watchlist-mini { min-width: 44px; min-height: 44px; }
  .main-nav a, .mobile-nav a, .mobile-dock a { min-height: 44px; }
}

/* iOS safe areas. */
.site-header { padding-top: env(safe-area-inset-top); }
.mobile-dock { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.site-footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.sheet-card, .search-panel { padding-bottom: env(safe-area-inset-bottom); }

/* Fluid type so headings never overflow on small screens. */
h1, .hero-v3-title { overflow-wrap: anywhere; }
.hero-v3-title { font-size: clamp(2rem, 6vw, 4.6rem); line-height: .98; }
.section-title { font-size: clamp(1.35rem, 3.4vw, 2.2rem); }

/* Horizontal card rows: snap + momentum, no layout shift. */
.movie-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(150px, 190px);
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.movie-row > * { scroll-snap-align: start; }

/* Responsive grids that fill the space they are given. */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(12px, 2vw, 22px);
}

/* Two-column page shells collapse gracefully. */
@media (max-width: 1024px) {
  .watch-layout,
  .drama-watch-layout,
  .contact-layout,
  .admin-grid,
  .split-panel { grid-template-columns: 1fr !important; }
  .watch-side { position: static !important; }
}

@media (max-width: 760px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .filter-fields, .filter-actions, .type-toggle { flex-wrap: wrap; }
  .filter-form { gap: 10px; }
  .hero-v3-grid { grid-template-columns: 1fr !important; }
  .hero-v3-poster { display: none !important; }
  .hero-v3-facts { flex-wrap: wrap; gap: 8px; }
  .hero-v3-actions { flex-wrap: wrap; }
  .hero-v3-actions .btn { flex: 1 1 auto; }
  .movie-row { grid-auto-columns: minmax(132px, 44vw); }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
  .section { padding-top: 34px; padding-bottom: 34px; }
  .admin-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .data-table, table { display: block; overflow-x: auto; white-space: nowrap; }
  .search-panel { width: 100%; height: 100%; border-radius: 0; }
  .search-overlay { padding: 0; }
}

@media (max-width: 420px) {
  .admin-cards { grid-template-columns: 1fr !important; }
  .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Smoother micro-interactions everywhere. */
.movie-card, .drama-tile, .continue-card, .genre-chip, .btn, .icon-btn, .search-result-item {
  transition: transform .28s cubic-bezier(.22,.61,.36,1),
              box-shadow .28s cubic-bezier(.22,.61,.36,1),
              background-color .2s ease, border-color .2s ease, color .2s ease;
}
.movie-card:hover, .movie-card:focus-within { transform: translateY(-4px); }
.movie-card:hover .card-poster { box-shadow: 0 24px 50px -24px rgba(0,0,0,.8); }
.btn:active, .icon-btn:active, .watchlist-mini:active { transform: scale(.96); }

/* Reveal animation used across pages. */
.reveal, .pc-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1);
}
.reveal.is-visible, .pc-reveal.pc-in { opacity: 1; transform: none; }

/* Search overlay: actors + titles. */
.search-section-label {
  display: block;
  margin: 14px 4px 8px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted, #9a93a8);
}
.search-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.07);
  background: rgba(255,255,255,.03);
  margin-bottom: 8px;
}
.search-person:hover { background: rgba(255,255,255,.07); }
.search-person img {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none;
  background: rgba(255,255,255,.08);
}
.search-person .sp-copy { min-width: 0; }
.search-person strong { display: block; font-size: 14px; }
.search-person small { color: var(--muted, #9a93a8); font-size: 12px; }

/* ============================================================
   AI Drama — immersive vertical reel feed (TikTok-style)
   Only used on ai-drama.php. Movies & series are untouched.
   ============================================================ */
.drama-reels {
  position: relative;
  height: calc(100dvh - var(--header-h, 74px));
  min-height: 520px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: #05030a;
}
.drama-reels::-webkit-scrollbar { display: none; }

.drama-reel {
  position: relative;
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
}
.drama-reel-media,
.drama-reel-media video,
.drama-reel-media iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: #000;
}
.drama-reel-media video { object-fit: contain; background: #000; }
.drama-reel-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(3,2,6,.92) 0%, rgba(3,2,6,.35) 34%, transparent 60%),
    linear-gradient(to bottom, rgba(3,2,6,.72) 0%, transparent 26%);
}
.drama-reel-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px clamp(14px, 3vw, 30px);
}
.drama-reel-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  padding: 7px 12px; border-radius: 999px;
  backdrop-filter: blur(8px);
}
.drama-reel-brand .dot { width: 7px; height: 7px; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 10px #ff4d6d; }
.drama-reel-counter { font-size: 12px; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; }

.drama-reel-side {
  position: absolute;
  right: clamp(10px, 2.4vw, 22px);
  bottom: clamp(120px, 22vh, 190px);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}
.reel-side-btn {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,8,16,.55);
  color: #fff;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease;
}
.reel-side-btn:hover { background: rgba(255,255,255,.16); }
.reel-side-btn:active { transform: scale(.92); }
.reel-side-btn svg { width: 20px; height: 20px; fill: currentColor; }
.reel-side-btn.is-off { color: #ff6b81; }

.drama-reel-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 0 clamp(16px, 4vw, 40px) clamp(26px, 5vh, 54px);
  max-width: 760px;
  pointer-events: none;
}
.drama-reel-info > * { pointer-events: auto; }
.drama-reel-kicker {
  display: inline-flex; gap: 8px; align-items: center;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--theme-accent, #f8c14e);
  margin-bottom: 8px;
}
.drama-reel-title {
  font-family: var(--display, 'Fraunces', serif);
  font-size: clamp(1.5rem, 4.4vw, 2.6rem);
  line-height: 1.02;
  color: #fff;
  margin: 0 0 8px;
  text-shadow: 0 2px 24px rgba(0,0,0,.6);
}
.drama-reel-sub {
  color: rgba(255,255,255,.78);
  font-size: 13.5px;
  line-height: 1.5;
  max-width: 560px;
  margin: 0 0 12px;
}
.drama-reel-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.drama-reel-meta span {
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 5px 10px; border-radius: 999px;
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.14);
}
.drama-reel-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.drama-reel-actions .btn { pointer-events: auto; }

/* Progress + transport controls. */
.drama-reel-transport {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  padding: 0 clamp(12px, 3vw, 28px) 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reel-progress {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.22);
  cursor: pointer;
  overflow: hidden;
}
.reel-progress > i {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: var(--theme-accent, #f8c14e);
  border-radius: inherit;
  transition: width .12s linear;
}
.reel-progress:hover { height: 7px; }
.reel-transport-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.reel-transport-row .reel-time { font-size: 11px; color: rgba(255,255,255,.7); font-variant-numeric: tabular-nums; min-width: 38px; }
.reel-transport-row .spacer { flex: 1; }
.reel-ctrl {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease;
}
.reel-ctrl:hover { background: rgba(255,255,255,.24); }
.reel-ctrl:active { transform: scale(.9); }
.reel-ctrl svg { width: 18px; height: 18px; fill: currentColor; }
.reel-ctrl.reel-play { width: 52px; height: 52px; background: var(--theme-accent, #f8c14e); color: #140b04; }
.reel-ctrl.reel-play svg { width: 24px; height: 24px; }

/* Big centre play state. */
.reel-big-play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.reel-big-play span {
  width: 78px; height: 78px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(10,8,16,.55);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(8px);
}
.reel-big-play svg { width: 32px; height: 32px; fill: #fff; margin-left: 4px; }
.drama-reel.is-paused .reel-big-play { opacity: 1; pointer-events: auto; }

/* Swipe hint on the first reel. */
.reel-swipe-hint {
  position: absolute;
  left: 50%; bottom: 96px;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(255,255,255,.7);
  animation: reel-bob 2.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes reel-bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }

/* Embed fallback (TikTok / YouTube / iframe) — we cannot control playback,
   so show a clear tap-to-play layer and our own next/skip navigation. */
.drama-reel.is-embed .drama-reel-media { pointer-events: auto; }
.drama-reel.is-embed .reel-progress { opacity: .35; pointer-events: none; }
.drama-reel.is-embed .reel-transport-row .reel-time { display: none; }

@media (max-width: 760px) {
  .drama-reels { height: calc(100dvh - var(--header-h, 64px)); }
  .drama-reel-info { padding-bottom: 74px; }
  .drama-reel-side { bottom: 150px; gap: 10px; }
  .reel-side-btn { width: 42px; height: 42px; }
  .drama-reel-transport { padding-bottom: 6px; }
}

/* Message centre / admin reply thread. */
.message-thread { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.thread-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
}
.thread-bubble.from-user { align-self: flex-start; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); }
.thread-bubble.from-admin { align-self: flex-end; background: color-mix(in srgb, var(--theme-accent, #f8c14e) 18%, transparent); border: 1px solid color-mix(in srgb, var(--theme-accent, #f8c14e) 40%, transparent); }
.thread-bubble small { display: block; margin-top: 4px; font-size: 10.5px; opacity: .6; }
.reply-form textarea { width: 100%; min-height: 84px; resize: vertical; }

/* Skip intro button in the player. */
.skip-intro-btn {
  position: absolute;
  right: 18px;
  bottom: 92px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(8,6,12,.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, background .2s ease;
}
.skip-intro-btn.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.skip-intro-btn:hover { background: rgba(255,255,255,.18); }
.skip-intro-btn svg { width: 16px; height: 16px; fill: currentColor; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal, .pc-reveal { opacity: 1; transform: none; }
}

/* Actor filmography banner + search credit list */
.person-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin: 0 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
}
.person-banner-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid rgba(255,255,255,.14);
}
.person-banner-copy { min-width: 0; }
.person-banner-copy strong { display: block; font-size: 20px; }
.person-banner-copy span { color: var(--muted, #9a93a8); font-size: 13px; }
.person-banner-copy p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted, #b7b0c4); }
.search-person-credits { margin: 0 0 6px 12px; padding-left: 12px; border-left: 2px solid rgba(255,255,255,.08); }
@media (max-width: 560px) {
  .person-banner { flex-direction: column; text-align: center; }
  .person-banner-copy p { display: none; }
}

/* Message threads (admin + member message centre) */
.message-card.is-focused { border-color: var(--theme-accent, #8b5cf6); box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent, #8b5cf6) 35%, transparent); }
.reply-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.thread-who { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }

/* ============================================================
   Notifications centre (public page)
   ============================================================ */
.notif-page { display: grid; gap: clamp(18px, 3vw, 34px); }
.notif-page-block { display: grid; gap: 14px; }
.section-head-tight { margin: 0; }
.notif-page-list {
    display: grid;
    gap: 10px;
    max-height: min(58vh, 560px);
    overflow-y: auto;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}
.notif-page-list .notif-item,
.notif-page .notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--line, #2a2a35) 80%, transparent);
    background: color-mix(in srgb, var(--surface, #14141c) 92%, transparent);
    color: inherit;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
    min-height: 44px;
}
.notif-page .notif-item:hover { transform: translateY(-1px); border-color: var(--gold); }
.notif-page .notif-item.unread {
    border-color: color-mix(in srgb, var(--gold) 55%, transparent);
    background: color-mix(in srgb, var(--gold) 9%, var(--surface, #14141c));
}
.notif-page .notif-item.unread::after {
    content: "";
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--gold);
    margin-left: auto; flex: 0 0 auto; margin-top: 6px;
}
.notif-page .notif-icon { font-size: 1.35rem; line-height: 1; flex: 0 0 auto; }
.notif-page .notif-body { display: grid; gap: 3px; min-width: 0; }
.notif-page .notif-body strong { font-size: .96rem; line-height: 1.35; }
.notif-page .notif-body span { color: var(--muted, #a0a0b0); font-size: .85rem; line-height: 1.45; }
.notif-page .notif-body time { color: var(--muted, #8b8b9a); font-size: .74rem; letter-spacing: .02em; }

.notif-arrivals-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: clamp(10px, 1.6vw, 20px);
}

@media (max-width: 760px) {
    .notif-arrivals-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .notif-page-list { max-height: none; }
    .notif-page .notif-item { padding: 12px 13px; }
}
@media (max-width: 420px) {
    .notif-arrivals-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   AI Drama — picker (choose a series)
   ============================================================ */
.drama-picker { padding-top: clamp(16px, 3vw, 34px); }
.drama-picker-count {
    align-self: center;
    font-size: .78rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted, #a0a0b0);
    border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent);
    border-radius: 999px;
    padding: 6px 14px;
    white-space: nowrap;
}
.drama-picker-chips { flex-wrap: wrap; gap: 8px; margin-bottom: clamp(16px, 2.4vw, 26px); }
.drama-picker-chips .genre-chip.is-active {
    background: var(--gold);
    color: #101018;
    border-color: var(--gold);
}
.drama-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: clamp(14px, 2vw, 26px);
}
.drama-pick-card {
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface, #14141c) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--line, #2a2a35) 85%, transparent);
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.drama-pick-card:hover {
    transform: translateY(-4px);
    border-color: var(--reel-accent, var(--gold));
    box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--reel-accent, #8b5cf6) 70%, transparent);
}
.drama-pick-poster {
    position: relative;
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(160deg, var(--reel-accent, #8b5cf6), var(--reel-accent-2, #e9b85c));
}
.drama-pick-poster img,
.drama-pick-poster .drama-poster-emoji {
    width: 100%; height: 100%;
    object-fit: cover;
    display: grid; place-items: center;
}
.drama-pick-shade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(8,8,14,.82) 100%);
}
.drama-pick-play {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%) scale(.85);
    width: 54px; height: 54px;
    border-radius: 50%;
    display: grid; place-items: center;
    background: rgba(10,10,16,.62);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff; font-size: 1.05rem;
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
}
.drama-pick-card:hover .drama-pick-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.drama-pick-eps {
    position: absolute; right: 10px; bottom: 10px;
    font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
    background: rgba(8,8,14,.72);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    padding: 4px 10px;
    color: #f4f4f8;
}
.drama-pick-copy { display: grid; gap: 6px; padding: 14px 15px 16px; }
.drama-pick-copy h3 { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.drama-pick-copy h3 a { color: inherit; text-decoration: none; }
.drama-pick-copy h3 a:hover { color: var(--gold); }
.drama-pick-meta { margin: 0; font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted, #9a9aac); }
.drama-pick-logline { margin: 0; font-size: .85rem; line-height: 1.5; color: var(--muted, #b0b0c0); }
.drama-pick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ============================================================
   AI Drama — desktop feed shell (rail + phone-width stage)
   ============================================================ */
.drama-feed-shell {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: clamp(16px, 2.4vw, 34px);
    align-items: start;
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(14px, 2vw, 28px) clamp(12px, 2vw, 24px) clamp(20px, 3vw, 40px);
    min-height: 100dvh;
}
.drama-feed-rail {
    position: sticky;
    top: 88px;
    display: grid;
    gap: 10px;
    align-content: start;
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}
.drama-rail-back {
    font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted, #a0a0b0); text-decoration: none;
    min-height: 32px; display: inline-flex; align-items: center;
}
.drama-rail-back:hover { color: var(--gold); }
.drama-rail-poster {
    position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4;
    background: linear-gradient(160deg, var(--reel-accent, #8b5cf6), var(--reel-accent-2, #e9b85c));
}
.drama-rail-poster img, .drama-rail-poster .drama-poster-emoji { width: 100%; height: 100%; object-fit: cover; display: grid; place-items: center; }
/* Poster media is decorative: never swallow clicks meant for the episode rail. */
.drama-rail-poster, .drama-rail-poster video, .drama-rail-poster img,
.drama-rail-poster .drama-poster-video, .drama-rail-poster .drama-poster-frame { pointer-events: none !important; }
.drama-rail-eps { position: relative; z-index: 2; }
.drama-rail-title { margin: 4px 0 0; font-size: 1.15rem; line-height: 1.3; }
.drama-rail-meta { margin: 0; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #9a9aac); }
.drama-rail-logline { margin: 0; font-size: .84rem; line-height: 1.55; color: var(--muted, #b0b0c0); }
.drama-rail-star { margin: 0; font-size: .82rem; }
.drama-rail-star span { color: var(--muted, #9a9aac); }
.drama-rail-eps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.drama-rail-eps a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 10px;
    text-decoration: none; color: inherit;
    font-size: .84rem; min-height: 40px;
    border: 1px solid transparent;
    transition: background .16s ease, border-color .16s ease;
}
.drama-rail-eps a:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.drama-rail-eps a.is-active {
    background: color-mix(in srgb, var(--gold) 16%, transparent);
    border-color: color-mix(in srgb, var(--gold) 45%, transparent);
}
.rail-ep-n {
    flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; font-size: .72rem;
    background: color-mix(in srgb, var(--gold) 22%, transparent);
    color: var(--gold);
}
.rail-ep-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.drama-feed-stage { min-width: 0; }
.drama-feed-shell .drama-reels {
    height: min(calc(100dvh - 130px), 860px);
    max-width: 460px;
    margin: 0 auto;
    border-radius: 22px;
    overflow-y: auto;
    border: 1px solid color-mix(in srgb, var(--line, #2a2a35) 80%, transparent);
    box-shadow: 0 30px 70px -40px rgba(0,0,0,.85);
    scroll-snap-type: y mandatory;
}
.drama-feed-shell .drama-reel { height: 100%; min-height: 100%; }

@media (max-width: 1024px) {
    .drama-feed-shell { grid-template-columns: 1fr; }
    .drama-feed-rail {
        position: static;
        max-height: none;
        overflow: visible;
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 12px 16px;
        align-items: start;
        padding: 0;
    }
    .drama-rail-back { grid-column: 1 / -1; }
    .drama-rail-poster { grid-row: span 4; }
    .drama-rail-eps { grid-column: 1 / -1; max-height: 220px; overflow-y: auto; }
    .drama-feed-shell .drama-reels { max-width: 100%; height: min(calc(100dvh - 210px), 720px); }
}
@media (max-width: 760px) {
    .drama-feed-shell { padding: 0; gap: 0; display: block; }
    .drama-feed-rail { display: none; }
    .drama-feed-shell .drama-reels {
        height: 100dvh; max-width: 100%; border: 0; border-radius: 0; box-shadow: none;
    }
    .drama-picker-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .drama-pick-copy { padding: 10px 11px 12px; }
    .drama-pick-copy h3 { font-size: .92rem; }
    .drama-pick-logline { display: none; }
    .drama-pick-actions .btn { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 420px) {
    .drama-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   Player toolbar + server sheet — mobile-first touch layout
   ============================================================ */
.player-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.player-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: .82rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.tool-btn:active { transform: scale(.97); }

/* Server picker rows: comfortable tap targets, no cramped text. */
.sheet-server {
    min-height: 56px;
    padding: 12px 14px;
    gap: 12px;
    border-radius: 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.sheet-server strong { font-size: .9rem; line-height: 1.3; }
.sheet-server small { font-size: .74rem; line-height: 1.35; }
.sheet-server-state {
    font-size: .68rem;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    white-space: nowrap;
}
.sheet-server.is-active .sheet-server-state { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.sheet-server-icon { width: 40px; height: 40px; border-radius: 12px; }

@media (max-width: 760px) {
    .player-toolbar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
    .server-current { width: 100%; }
    .server-current b { font-size: .82rem; max-width: none; white-space: normal; }
    .player-toolbar-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }
    /* Keep labels visible — icon-only "Servers" was unusable on phones. */
    .player-toolbar-actions .tool-btn span:not(.tool-count) { display: inline; }
    .player-toolbar-actions .tool-btn .tool-count { display: inline-grid; }
    .player-toolbar-actions .tool-btn {
        height: auto;
        min-height: 48px;
        padding: 10px 6px;
        font-size: .76rem;
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    .player-toolbar-actions .tool-btn svg { width: 18px; height: 18px; }
    .player-toolbar-actions .tool-btn-accent { padding: 10px 6px; }

    /* Bottom sheet: taller, scrollable, safe-area aware. */
    .sheet-card {
        width: 100%;
        max-height: 88dvh;
        padding: 18px 14px calc(16px + env(safe-area-inset-bottom));
        border-radius: 20px 20px 0 0;
        -webkit-overflow-scrolling: touch;
    }
    .sheet-head h2 { font-size: 1.15rem; }
    .sheet-server-list { gap: 9px; margin: 14px 0; }
    .sheet-server { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 13px 12px; }
    .sheet-server-nav { flex-direction: column; gap: 8px; }
    .sheet-server-nav .btn { width: 100%; min-height: 46px; }
    .sheet .icon-btn { min-width: 44px; min-height: 44px; }
}

@media (max-width: 420px) {
    .player-toolbar-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .player-toolbar-actions .tool-btn-accent { grid-column: 1 / -1; }
    .sheet-server-state { font-size: .62rem; padding: 4px 8px; }
}

/* ============================================================
   Mobile header: fit every control inside the viewport
   ============================================================ */
@media (max-width: 768px) {
    .nav-actions { gap: 6px !important; min-width: 0; }
    .nav-actions .icon-btn { width: 42px !important; height: 42px !important; }
    .nav-actions .btn-sm { padding: 0 12px !important; font-size: 12.5px !important; }
    .nav-wrap { gap: 8px !important; }
}
@media (max-width: 430px) {
    .brand-word { display: none !important; }
    .nav-actions .btn-sm { padding: 0 11px !important; font-size: 12px !important; }
    .nav-actions { gap: 5px !important; }
}
@media (max-width: 360px) {
    .notif-trigger-guest { display: none !important; }
    .nav-actions .icon-btn { width: 40px !important; height: 40px !important; }
}

/* Grid children must be allowed to shrink (prevents 1–3px page overflow). */
.contact-layout, .download-layout, .contact-form-card, .contact-side,
.drama-feed-shell, .drama-feed-stage, .notif-page, .notif-page-block { min-width: 0; }
.contact-form-card, .contact-side { max-width: 100%; }

/* Guaranteed touch sizes on phones/tablets (independent of pointer detection). */
@media (max-width: 768px) {
    .btn-sm { min-height: 42px; padding: 0 14px; }
    .watchlist-mini { width: 44px; height: 44px; min-width: 44px; min-height: 44px; }
    .genre-chip { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; }
    .reel-ctrl { min-width: 46px; min-height: 46px; }
    .reel-side-btn { width: 46px; height: 46px; min-width: 46px; min-height: 46px; }
    .drama-pick-actions .btn { min-height: 42px; }
    .drama-rail-eps a { min-height: 44px; }
    .notif-page .notif-item { min-height: 56px; }
    .sheet-server-state { min-height: 26px; display: inline-flex; align-items: center; }
    .dropdown-head .link-btn, .user-dropdown a, .user-dropdown button { min-height: 44px; }
    .pc-btn { min-width: 44px; min-height: 44px; }
}

/* Small-screen list + card padding fixes (contact, FAQ, link lists). */
@media (max-width: 430px) {
    .contact-form-card, .contact-side { padding: 18px 15px; }
    .contact-list, .link-list { padding-left: 0; }
    .contact-list li, .link-list li { overflow-wrap: anywhere; word-break: break-word; }
    .contact-list a, .link-list a { overflow-wrap: anywhere; }
}
/* Rooms filter chips — comfortable tap height. */
.live-chip { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 16px; }
@media (max-width: 768px) { .live-chip { min-height: 44px; } }

/* ==========================================================================
   First-visit tour / "How it works"  (3.4.2)
   ========================================================================== */
.tour-root {
    position: fixed; inset: 0; z-index: 9000;
    display: grid; place-items: center;
    padding: 20px;
    opacity: 0; transition: opacity .22s ease;
}
.tour-root.is-visible { opacity: 1; }
.tour-root[hidden] { display: none !important; }

.tour-backdrop {
    position: absolute; inset: 0;
    background: rgba(6, 5, 10, .74);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    backdrop-filter: blur(10px) saturate(120%);
}

.tour-card {
    position: relative;
    width: min(880px, 100%);
    max-height: min(90dvh, 700px);
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(165deg, rgba(30, 24, 38, .98), rgba(16, 13, 22, .99));
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(233, 184, 92, .08) inset;
    transform: translateY(14px) scale(.985);
}
.tour-root.is-visible .tour-card { transform: none; transition: transform .32s cubic-bezier(.22, 1, .36, 1); }

/* ---- left visual panel ---- */
.tour-visual {
    position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px;
    padding: 28px 22px;
    overflow: hidden;
    background:
        radial-gradient(120% 90% at 20% 0%, color-mix(in srgb, var(--gold, #e9b85c) 22%, transparent), transparent 60%),
        linear-gradient(160deg, #241a2e, #14101c);
    border-right: 1px solid rgba(255, 255, 255, .07);
}
.tour-visual.is-accent {
    background:
        radial-gradient(120% 90% at 20% 0%, rgba(233, 184, 92, .3), transparent 62%),
        linear-gradient(160deg, #2c2033, #171220);
}
.tour-visual-glow {
    position: absolute; width: 240px; height: 240px; border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--gold, #e9b85c) 32%, transparent), transparent 68%);
    filter: blur(18px); opacity: .55; top: -40px; right: -60px;
    pointer-events: none;
}
.tour-icon {
    position: relative; z-index: 1;
    width: 62px; height: 62px; border-radius: 18px;
    display: grid; place-items: center;
    color: #1a1420;
    background: linear-gradient(150deg, var(--gold, #e9b85c), #f3d79a);
    box-shadow: 0 14px 30px -12px rgba(233, 184, 92, .8);
}
.tour-icon svg { width: 30px; height: 30px; stroke: currentColor; }

.tour-mock { position: relative; z-index: 1; width: 100%; display: grid; gap: 8px; justify-items: stretch; }
.tour-mock:empty { display: none; }

/* ---- mock: search ---- */
.tm-search {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: 12px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: 10.5px; color: rgba(255, 255, 255, .62);
}
.tm-search-ico {
    width: 12px; height: 12px; flex: 0 0 auto; border-radius: 50%;
    border: 1.6px solid rgba(233, 184, 92, .9); position: relative;
}
.tm-search-ico::after {
    content: ""; position: absolute; width: 5px; height: 1.6px;
    background: rgba(233, 184, 92, .9); right: -4px; bottom: -1px; transform: rotate(45deg);
}
.tm-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tm-chips span {
    font-size: 9.5px; padding: 4px 9px; border-radius: 999px;
    background: rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .6);
}
.tm-chips span.on { background: color-mix(in srgb, var(--gold, #e9b85c) 26%, transparent); color: #f7e6c4; }
.tm-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tm-row i {
    display: block; aspect-ratio: 2 / 3; border-radius: 8px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
}

/* ---- mock: bookmark ---- */
.tm-poster {
    position: relative; aspect-ratio: 16 / 10; border-radius: 12px;
    background: linear-gradient(150deg, #4a3358, #241a2e);
    border: 1px solid rgba(255, 255, 255, .12);
    display: grid; place-items: center;
}
.tm-poster-badge {
    font-size: 9px; letter-spacing: .1em; text-transform: uppercase;
    padding: 5px 10px; border-radius: 999px;
    background: rgba(233, 184, 92, .2); color: #f3d79a;
    border: 1px solid rgba(233, 184, 92, .45);
}
.tm-poster-meta { display: grid; gap: 6px; }
.tm-poster-meta b { display: block; height: 8px; width: 62%; border-radius: 4px; background: rgba(255, 255, 255, .22); }
.tm-poster-meta em { display: block; height: 6px; width: 40%; border-radius: 4px; background: rgba(255, 255, 255, .1); }

/* ---- mock: play ---- */
.tm-stage {
    position: relative; aspect-ratio: 16 / 10; border-radius: 12px;
    background: linear-gradient(150deg, #2a2136, #120f19);
    border: 1px solid rgba(255, 255, 255, .1);
    display: grid; place-items: center;
}
.tm-play {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(233, 184, 92, .92);
    clip-path: none; position: relative;
}
.tm-play::after {
    content: ""; position: absolute; inset: 0; margin: auto;
    width: 0; height: 0;
    border-left: 11px solid #1a1420;
    border-top: 7px solid transparent; border-bottom: 7px solid transparent;
    transform: translateX(2px);
}
.tm-bar {
    position: absolute; left: 10px; right: 10px; bottom: 10px; height: 4px;
    border-radius: 999px; background: rgba(255, 255, 255, .18);
}
.tm-bar i { display: block; height: 100%; width: 42%; border-radius: 999px; background: var(--gold, #e9b85c); }
.tm-skip {
    position: absolute; right: 10px; bottom: 22px;
    font-size: 9px; font-weight: 700; letter-spacing: .04em;
    padding: 5px 9px; border-radius: 7px;
    background: rgba(10, 8, 14, .78); color: #fff;
    border: 1px solid rgba(255, 255, 255, .3);
}

/* ---- mock: servers ---- */
.tm-servers { display: grid; gap: 6px; }
.tm-server {
    display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px;
    padding: 9px 11px; border-radius: 10px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: 10.5px; color: rgba(255, 255, 255, .8);
}
.tm-server em { font-style: normal; font-size: 9px; color: rgba(255, 255, 255, .45); }
.tm-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.tm-server.is-bad { border-color: rgba(255, 107, 107, .4); background: rgba(255, 107, 107, .09); }
.tm-server.is-bad .tm-dot { background: #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 107, 107, .18); }
.tm-server.is-bad em { color: #ff9d9d; }
.tm-server.is-good { border-color: rgba(110, 231, 183, .45); background: rgba(110, 231, 183, .1); }
.tm-server.is-good .tm-dot { background: #6ee7b7; box-shadow: 0 0 0 3px rgba(110, 231, 183, .18); }
.tm-server.is-good em { color: #8ff0c8; }
.tm-arrow {
    margin-top: 2px; font-size: 9.5px; line-height: 1.5; color: rgba(255, 255, 255, .55);
    padding-left: 2px;
}
.tm-arrow b { color: var(--gold, #e9b85c); }

/* ---- mock: reels ---- */
.tm-phone {
    position: relative; width: 92px; height: 150px; margin: 0 auto;
    border-radius: 16px; overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .16);
    background: #0c0a11; display: grid;
}
.tm-reel { display: block; height: 100%; background: linear-gradient(160deg, #3b2a4d, #171221); }
.tm-reel + .tm-reel { border-top: 1px solid rgba(255, 255, 255, .1); }
.tm-reel-ctrl {
    position: absolute; left: 50%; top: 50%; width: 26px; height: 26px;
    transform: translate(-50%, -50%); border-radius: 50%;
    background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .4);
}
.tm-scroll {
    position: absolute; bottom: 6px; left: 0; right: 0; text-align: center;
    font-size: 8px; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .6);
}
.tm-eps { display: flex; gap: 5px; justify-content: center; }
.tm-eps span {
    font-size: 9px; padding: 3px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .6);
}
.tm-eps span.on { background: color-mix(in srgb, var(--gold, #e9b85c) 26%, transparent); color: #f7e6c4; }

/* ---- mock: bell ---- */
.tm-bell { position: relative; width: 54px; height: 54px; margin: 0 auto; display: grid; place-items: center; }
.tm-bell-ico {
    width: 26px; height: 26px; border-radius: 8px 8px 10px 10px;
    border: 2px solid rgba(233, 184, 92, .95); position: relative;
}
.tm-bell-ico::after {
    content: ""; position: absolute; left: 50%; bottom: -6px; width: 8px; height: 3px;
    transform: translateX(-50%); border-radius: 0 0 4px 4px; background: rgba(233, 184, 92, .95);
}
.tm-bell-dot {
    position: absolute; top: 2px; right: 4px;
    min-width: 17px; height: 17px; border-radius: 999px;
    display: grid; place-items: center;
    font-size: 9px; font-weight: 800; color: #1a1420;
    background: var(--gold, #e9b85c);
}
.tm-alert {
    display: grid; gap: 3px; padding: 9px 11px; border-radius: 10px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
}
.tm-alert b { font-size: 10px; color: rgba(255, 255, 255, .88); font-weight: 600; }
.tm-alert em { font-style: normal; font-size: 9px; color: rgba(255, 255, 255, .45); }

/* ---- right content ---- */
.tour-content {
    display: flex; flex-direction: column;
    padding: 24px 28px 20px;
    min-width: 0; overflow-y: auto;
    scrollbar-width: thin;
}
.tour-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-kicker {
    font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: var(--gold, #e9b85c);
}
.tour-x {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    display: grid; place-items: center; cursor: pointer;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .8); transition: background .16s ease, transform .16s ease, color .16s ease;
}
.tour-x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.tour-x:hover { background: rgba(255, 255, 255, .16); color: #fff; transform: rotate(90deg); }

.tour-title {
    margin: 12px 0 0; font-family: Fraunces, Georgia, serif;
    font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem); line-height: 1.15;
    color: #fff; letter-spacing: -.01em;
}
.tour-body {
    margin: 10px 0 0; font-size: .92rem; line-height: 1.62;
    color: rgba(255, 255, 255, .78);
}
.tour-body strong { color: #fff; font-weight: 600; }
.tour-tip {
    margin: 12px 0 0; padding: 10px 12px; border-radius: 10px;
    font-size: .8rem; line-height: 1.55;
    color: rgba(255, 255, 255, .72);
    background: rgba(233, 184, 92, .09);
    border-left: 2px solid rgba(233, 184, 92, .6);
}
.tour-tip strong { color: #f3d79a; }
.tour-tip[hidden] { display: none; }

.tour-dots { display: flex; gap: 6px; margin: 18px 0 0; flex-wrap: wrap; }
.tour-dot {
    width: 22px; height: 5px; border-radius: 999px; padding: 0; cursor: pointer;
    background: rgba(255, 255, 255, .18); border: 0;
    transition: background .2s ease, width .2s ease;
}
.tour-dot:hover { background: rgba(255, 255, 255, .34); }
.tour-dot.is-active { width: 34px; background: var(--gold, #e9b85c); }

.tour-actions {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 20px 0 0; padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}
.tour-skip {
    background: none; border: 0; cursor: pointer; padding: 8px 2px;
    font-size: .82rem; color: rgba(255, 255, 255, .5);
    text-decoration: underline; text-underline-offset: 3px;
    transition: color .16s ease;
}
.tour-skip:hover { color: rgba(255, 255, 255, .85); }
.tour-skip[hidden] { display: none; }
.tour-nav { display: flex; gap: 8px; margin-left: auto; }
.tour-btn {
    min-height: 44px; padding: 0 20px; border-radius: 999px; cursor: pointer;
    font-size: .86rem; font-weight: 600; letter-spacing: .01em;
    border: 1px solid transparent;
    transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}
.tour-btn:active { transform: scale(.97); }
.tour-btn-ghost {
    background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .85);
}
.tour-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.tour-btn-ghost:disabled { opacity: .35; cursor: default; }
.tour-btn-primary {
    background: linear-gradient(150deg, var(--gold, #e9b85c), #f3d79a);
    color: #1a1420; box-shadow: 0 10px 24px -12px rgba(233, 184, 92, .9);
}
.tour-btn-primary:hover { filter: brightness(1.06); }

.tour-never {
    display: flex; align-items: center; gap: 8px;
    margin: 14px 0 0; font-size: .74rem; color: rgba(255, 255, 255, .42);
    cursor: pointer; user-select: none;
}
.tour-never input { accent-color: var(--gold, #e9b85c); width: 15px; height: 15px; cursor: pointer; }

/* ---- floating help button ---- */
.tour-help {
    position: fixed; right: 18px; bottom: 18px; z-index: 8800;
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 46px; padding: 0 16px 0 12px;
    border-radius: 999px; cursor: pointer;
    background: rgba(20, 16, 26, .88);
    border: 1px solid rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .82);
    font-size: .8rem; font-weight: 600;
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .8);
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.tour-help svg {
    width: 20px; height: 20px; flex: 0 0 auto;
    stroke: var(--gold, #e9b85c); stroke-width: 1.7; fill: none;
    stroke-linecap: round; stroke-linejoin: round;
}
.tour-help:hover { transform: translateY(-2px); background: rgba(32, 25, 40, .95); border-color: rgba(233, 184, 92, .5); }
.tour-help:active { transform: translateY(0) scale(.98); }

/* lift the help pill above the mobile dock */
@media (max-width: 860px) {
    .tour-help { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); right: 14px; }
    .tour-help span { display: none; }
    .tour-help { width: 48px; height: 48px; min-height: 48px; padding: 0; justify-content: center; }
}
body.tour-open, html.tour-open { overflow: hidden !important; }

/* ---- responsive tour card ---- */
@media (max-width: 760px) {
    .tour-root { padding: 12px; align-items: center; }
    .tour-card {
        grid-template-columns: 1fr;
        max-height: min(92dvh, 760px);
        border-radius: 20px;
    }
    .tour-visual {
        display: flex; align-items: center; gap: 14px;
        padding: 16px 18px; border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .07);
    }
    .tour-visual-glow { width: 160px; height: 160px; top: -70px; right: -40px; }
    .tour-icon { width: 48px; height: 48px; border-radius: 14px; flex: 0 0 auto; }
    .tour-icon svg { width: 24px; height: 24px; }
    .tour-mock { flex: 1 1 auto; min-width: 0; }
    .tm-phone { width: 62px; height: 104px; margin: 0; }
    .tm-row { grid-template-columns: repeat(3, 1fr); }
    .tour-content { padding: 18px 18px 16px; }
    .tour-title { margin-top: 8px; }
    .tour-body { font-size: .88rem; }
    .tour-actions { flex-wrap: wrap; }
    .tour-btn { padding: 0 16px; }
    .tour-never { font-size: .7rem; }
}
@media (max-width: 420px) {
    .tour-card { max-height: 94dvh; }
    .tour-visual { padding: 12px 14px; }
    .tour-mock { display: none; }
    .tour-content { padding: 14px 14px 12px; }
    .tour-title { font-size: 1.22rem; }
    .tour-body { font-size: .84rem; line-height: 1.55; }
    .tour-tip { font-size: .76rem; padding: 9px 10px; }
    .tour-nav { flex: 1 1 100%; }
    .tour-nav .tour-btn { flex: 1 1 auto; }
    .tour-skip { order: 3; margin-left: auto; }
}

/* ---- "server not responding" helper banner (player) ---- */
.server-trouble {
    position: fixed; left: 50%; bottom: 24px; z-index: 8700;
    transform: translate(-50%, 16px);
    width: min(560px, calc(100vw - 24px));
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center; gap: 12px;
    padding: 12px 12px 12px 14px;
    border-radius: 16px;
    background: rgba(26, 18, 20, .96);
    border: 1px solid rgba(255, 107, 107, .38);
    box-shadow: 0 24px 60px -22px rgba(0, 0, 0, .9);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    opacity: 0; transition: opacity .22s ease, transform .22s cubic-bezier(.22, 1, .36, 1);
}
.server-trouble.is-visible { opacity: 1; transform: translate(-50%, 0); }
.server-trouble-ico {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center; flex: 0 0 auto;
    font-size: 15px; font-weight: 800; color: #ffb4b4;
    background: rgba(255, 107, 107, .16);
    border: 1px solid rgba(255, 107, 107, .4);
}
.server-trouble-copy { display: grid; gap: 2px; min-width: 0; }
.server-trouble-copy strong { font-size: .84rem; color: #fff; font-weight: 600; }
.server-trouble-copy span { font-size: .76rem; color: rgba(255, 255, 255, .6); line-height: 1.4; }
.server-trouble-btn {
    min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
    font-size: .8rem; font-weight: 700; white-space: nowrap;
    color: #1a1420; border: 0;
    background: linear-gradient(150deg, var(--gold, #e9b85c), #f3d79a);
    transition: filter .16s ease, transform .16s ease;
}
.server-trouble-btn:hover { filter: brightness(1.07); }
.server-trouble-btn:active { transform: scale(.97); }
.server-trouble-x {
    width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    display: grid; place-items: center; flex: 0 0 auto;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .7); font-size: 13px; line-height: 1;
    transition: background .16s ease, color .16s ease;
}
.server-trouble-x:hover { background: rgba(255, 255, 255, .18); color: #fff; }

@media (max-width: 620px) {
    .server-trouble {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px));
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "ico copy x" "btn btn btn";
        row-gap: 10px;
        padding: 12px;
    }
    .server-trouble-ico { grid-area: ico; }
    .server-trouble-copy { grid-area: copy; }
    .server-trouble-x { grid-area: x; }
    .server-trouble-btn { grid-area: btn; width: 100%; min-height: 44px; }
}

/* ---- servers sheet: "not loading?" callout ---- */
.sheet-help-note {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    gap: 10px; align-items: start;
    margin: 0 0 12px; padding: 11px 13px;
    border-radius: 12px;
    background: rgba(233, 184, 92, .09);
    border: 1px solid rgba(233, 184, 92, .28);
}
.sheet-help-ico {
    width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
    display: grid; place-items: center;
    font-size: 12px; font-weight: 800; color: #1a1420;
    background: var(--gold, #e9b85c);
}
.sheet-help-note p {
    margin: 0; font-size: .8rem; line-height: 1.5;
    color: rgba(255, 255, 255, .74);
}
.sheet-help-note strong { color: #f3d79a; }

/* keep the help pill clear of the player toolbar */
body.watch-body .tour-help { bottom: 92px; }
@media (max-width: 860px) { body.watch-body .tour-help { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); } }
