/* ===========================================================================
   Lamha - public share page and player.
   Bright on purpose. Everything sits on white and light blue; the only dark
   surface on the page is the video frame itself, which is where dark belongs.
   Logical properties everywhere, so RTL is the same stylesheet, not a second one.
   =========================================================================== */

:root {
  --lam-ink:        #0b1220;
  --lam-ink-2:      #1e293b;
  --lam-muted:      #64748b;
  --lam-faint:      #94a3b8;
  --lam-line:       #e5eaf4;
  --lam-line-soft:  #eef2fa;
  --lam-card:       #ffffff;
  --lam-bg:         #f5f8ff;
  --lam-bg-2:       #eef3ff;

  --lam-brand:      #2563eb;
  --lam-brand-ink:  #1d4ed8;
  --lam-indigo:     #4f46e5;
  --lam-cyan:       #06b6d4;
  --lam-amber:      #f59e0b;
  --lam-rose:       #f43f5e;
  --lam-green:      #10b981;

  --lam-grad:       linear-gradient(135deg, #4f46e5 0%, #2563eb 48%, #06b6d4 100%);
  --lam-grad-soft:  linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);

  --lam-r-lg:       22px;
  --lam-r-md:       14px;
  --lam-r-sm:       10px;

  --lam-sh-1:       0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .04);
  --lam-sh-2:       0 2px 6px rgba(15, 23, 42, .06), 0 14px 40px -12px rgba(37, 99, 235, .22);
  --lam-sh-3:       0 6px 14px rgba(15, 23, 42, .07), 0 34px 70px -24px rgba(37, 99, 235, .32);

  --lam-font:       ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
                    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --lam-shell-max:  1220px;
  --lam-gutter:     clamp(14px, 3vw, 34px);
}

[dir="rtl"] {
  --lam-font: system-ui, "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic",
              "Dubai", "Geeza Pro", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.lam-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--lam-font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--lam-ink);
  background: var(--lam-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* --- the soft colour wash behind everything ------------------------------ */

.lam-aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.lam-aurora i {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .5;
}
.lam-aurora i:nth-child(1) {
  width: 46vw; height: 46vw; min-width: 320px; min-height: 320px;
  top: -14vw; inset-inline-start: -10vw;
  background: radial-gradient(circle at 40% 40%, #c7d7ff, transparent 68%);
}
.lam-aurora i:nth-child(2) {
  width: 40vw; height: 40vw; min-width: 280px; min-height: 280px;
  top: 8vh; inset-inline-end: -12vw;
  background: radial-gradient(circle at 50% 50%, #ccf3f8, transparent 68%);
}
.lam-aurora i:nth-child(3) {
  width: 34vw; height: 34vw; min-width: 240px; min-height: 240px;
  bottom: -12vw; inset-inline-start: 34%;
  background: radial-gradient(circle at 50% 50%, #ffe9d1, transparent 70%);
  opacity: .38;
}

/* --- top bar -------------------------------------------------------------- */

.lam-top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px var(--lam-gutter);
  max-width: var(--lam-shell-max);
  margin-inline: auto;
}

.lam-logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--lam-ink);
  font-weight: 750;
  font-size: 18px;
  letter-spacing: -.01em;
  border-radius: var(--lam-r-sm);
}
/* logo.svg carries its own rounded tile: no clipping radius, just the lift. */
.lam-logo-mark { display: block; flex: none; filter: drop-shadow(0 4px 10px rgba(59, 108, 246, .24)); }
.lam-logo-word { line-height: 1; }

.lam-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lam-lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--lam-line);
  background: rgba(255, 255, 255, .8);
  color: var(--lam-ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.lam-lang:hover { background: #fff; border-color: #cfdcf7; transform: translateY(-1px); }

/* --- buttons -------------------------------------------------------------- */

.lam-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .14s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.lam-btn svg { flex: none; }
.lam-btn:active { transform: translateY(1px); }

.lam-btn-primary {
  color: #fff;
  background: var(--lam-grad);
  box-shadow: 0 2px 6px rgba(37, 99, 235, .24), 0 12px 26px -10px rgba(37, 99, 235, .55);
}
.lam-btn-primary:hover { box-shadow: 0 3px 9px rgba(37, 99, 235, .3), 0 18px 34px -12px rgba(37, 99, 235, .6); }

.lam-btn-soft {
  color: var(--lam-ink-2);
  background: rgba(255, 255, 255, .82);
  border-color: var(--lam-line);
  box-shadow: var(--lam-sh-1);
}
.lam-btn-soft:hover { background: #fff; border-color: #cfdcf7; color: var(--lam-brand-ink); }

.lam-btn-ghost {
  color: var(--lam-brand-ink);
  background: #eef2ff;
  border-color: #dbe4ff;
}
.lam-btn-ghost:hover { background: #e4ebff; }

.lam-btn-wide { width: 100%; padding-block: 12px; font-size: 15px; }

:where(a, button, input, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(37, 99, 235, .42);
  outline-offset: 2px;
}

/* --- page shell ----------------------------------------------------------- */

.lam-main {
  position: relative;
  z-index: 2;
  padding: 6px var(--lam-gutter) 48px;
}

.lam-shell {
  max-width: var(--lam-shell-max);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

@media (min-width: 1060px) {
  .lam-shell { grid-template-columns: minmax(0, 1fr) 356px; gap: 28px; }
  .lam-side { position: sticky; top: 16px; }
}

.lam-stage { min-width: 0; }

/* --- title block ---------------------------------------------------------- */

.lam-titleblock { margin: 4px 2px 14px; }

.lam-title {
  margin: 0 0 8px;
  font-size: clamp(21px, 3.1vw, 31px);
  line-height: 1.22;
  font-weight: 760;
  letter-spacing: -.021em;
  color: var(--lam-ink);
  overflow-wrap: anywhere;
}

.lam-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--lam-muted);
  font-size: 13.5px;
}
.lam-owner { font-weight: 650; color: var(--lam-ink-2); }
.lam-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--lam-faint); }

.lam-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--lam-grad);
  color: #fff;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: .02em;
  box-shadow: 0 2px 6px rgba(37, 99, 235, .3);
}

.lam-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  border: 1px solid transparent;
}
.lam-chip-own  { background: #ecfdf5; color: #047857; border-color: #bbf7d0; }
.lam-chip-lock { background: #eff6ff; color: var(--lam-brand-ink); border-color: #dbeafe; }
.lam-chip-exp  { background: #fff7ed; color: #b45309; border-color: #fed7aa; }

/* --- the player ----------------------------------------------------------- */

.lam-player {
  position: relative;
  border-radius: var(--lam-r-lg);
  background: #fff;
  padding: 8px;
  box-shadow: var(--lam-sh-3);
  outline: 1px solid rgba(255, 255, 255, .9);
}

.lam-frame {
  position: relative;
  aspect-ratio: var(--lam-ar, 16 / 9);
  width: 100%;
  max-height: min(74vh, 780px);
  border-radius: 15px;
  overflow: hidden;
  background: #070b14;
  isolation: isolate;
}

@supports not (aspect-ratio: 16 / 9) {
  .lam-frame { height: 0; padding-top: 56.25%; }
  .lam-frame > .lam-video, .lam-frame > .lam-shot { position: absolute; inset: 0; }
}

.lam-video, .lam-shot {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #070b14;
}
.lam-shot { object-fit: contain; cursor: zoom-in; }
.lam-is-shot .lam-frame { background: #0f172a; }

/* Cursor hides with the controls while playing. */
.lam-player.is-idle .lam-frame { cursor: none; }

/* --- big centre play ------------------------------------------------------ */

.lam-bigplay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: radial-gradient(60% 60% at 50% 50%, rgba(2, 6, 18, .28), rgba(2, 6, 18, .06) 70%, transparent);
  cursor: pointer;
  transition: opacity .22s ease;
  z-index: 3;
}
.lam-bigplay span {
  display: grid;
  place-items: center;
  width: 78px; height: 78px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 10px 34px rgba(2, 6, 18, .42);
  transition: transform .18s cubic-bezier(.2, .8, .3, 1.3), box-shadow .18s ease;
}
.lam-bigplay:hover span { transform: scale(1.07); box-shadow: 0 14px 44px rgba(2, 6, 18, .5); }
.lam-bigplay svg { fill: var(--lam-brand); margin-inline-start: 4px; }
[dir="rtl"] .lam-bigplay svg { margin-inline-start: 0; margin-inline-end: -4px; }
.lam-player.is-playing .lam-bigplay { opacity: 0; pointer-events: none; }

/* --- spinner -------------------------------------------------------------- */

.lam-spinner {
  position: absolute;
  inset-inline-start: 50%;
  top: 50%;
  translate: -50% -50%;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3.5px solid rgba(255, 255, 255, .26);
  border-top-color: #fff;
  animation: lam-spin .8s linear infinite;
  z-index: 4;
  pointer-events: none;
}
@keyframes lam-spin { to { transform: rotate(360deg); } }
.lam-art-spin { transform-origin: 60px 60px; animation: lam-spin 1.15s linear infinite; }

/* --- controls ------------------------------------------------------------- */

.lam-controls {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 6;
  padding: 40px 10px 8px;
  background: linear-gradient(to top, rgba(4, 8, 18, .88) 0%, rgba(4, 8, 18, .55) 46%, rgba(4, 8, 18, 0) 100%);
  color: #fff;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .22s ease, transform .22s ease;
}
.lam-player.is-idle .lam-controls { opacity: 0; transform: translateY(8px); pointer-events: none; }

.lam-controls-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-inline: 2px;
}
.lam-spacer { flex: 1 1 auto; min-width: 4px; }

.lam-cbtn {
  display: inline-grid;
  place-items: center;
  width: 38px; height: 38px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background .14s ease, transform .14s ease;
}
.lam-cbtn:hover { background: rgba(255, 255, 255, .17); }
.lam-cbtn:active { transform: scale(.93); }
.lam-cbtn svg { pointer-events: none; }
.lam-cbtn.is-on { color: #7dd3fc; }

.lam-time {
  direction: ltr;              /* a timeline is not a sentence; it stays LTR */
  unicode-bidi: isolate;
  font-size: 12.5px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  padding-inline: 8px;
  white-space: nowrap;
  color: rgba(255, 255, 255, .94);
}
.lam-time-sep { opacity: .55; margin-inline: 3px; }

.lam-rate-label {
  font-size: 12px;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

/* --- seek bar ------------------------------------------------------------- */

.lam-progress {
  position: relative;
  direction: ltr;              /* deliberate: video time runs left-to-right in both languages */
  height: 20px;
  margin-inline: 4px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.lam-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .28);
  overflow: hidden;
  transition: height .14s ease;
}
.lam-progress:hover .lam-progress-track,
.lam-progress.is-dragging .lam-progress-track { height: 7px; }

.lam-progress-buffer {
  position: absolute;
  inset-block: 0;
  background: rgba(255, 255, 255, .34);
}
.lam-progress-hover {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 0;
  background: rgba(255, 255, 255, .22);
}
.lam-progress-played {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #60a5fa 0%, #22d3ee 100%);
}
.lam-progress-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px; height: 13px;
  translate: -50% -50%;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(2, 6, 18, .25), 0 2px 7px rgba(2, 6, 18, .5);
  opacity: 0;
  transition: opacity .14s ease, transform .14s ease;
  pointer-events: none;
}
.lam-progress:hover .lam-progress-knob,
.lam-progress.is-dragging .lam-progress-knob { opacity: 1; }
.lam-progress.is-dragging .lam-progress-knob { transform: scale(1.18); }

.lam-scrubtip {
  position: absolute;
  bottom: 26px;
  left: 0;
  translate: -50% 0;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(4, 8, 18, .92);
  color: #fff;
  font-size: 11.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .12s ease;
  pointer-events: none;
}
.lam-progress:hover .lam-scrubtip,
.lam-progress.is-dragging .lam-scrubtip { opacity: 1; }

/* --- volume --------------------------------------------------------------- */

.lam-vol { display: flex; align-items: center; }
.lam-vol-slider {
  position: relative;
  width: 0;
  opacity: 0;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
  transition: width .18s ease, opacity .18s ease, margin .18s ease;
  overflow: hidden;
}
.lam-vol:hover .lam-vol-slider,
.lam-vol:focus-within .lam-vol-slider,
.lam-vol-slider.is-dragging { width: 74px; opacity: 1; margin-inline-end: 6px; }
.lam-vol-track {
  width: 100%; height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .3);
  position: relative;
}
.lam-vol-fill {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  border-radius: 999px;
  background: #fff;
}

/* --- popovers (speed + shortcuts) ---------------------------------------- */

.lam-pop {
  position: absolute;
  bottom: 54px;
  inset-inline-end: 8px;
  min-width: 132px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(10, 16, 30, .96);
  box-shadow: 0 18px 44px rgba(2, 6, 18, .55);
  z-index: 8;
}
.lam-pop[hidden] { display: none; }
.lam-pop-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .5);
}
.lam-pop-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: start;
}
.lam-pop-item:hover { background: rgba(255, 255, 255, .13); }
.lam-pop-item[aria-checked="true"] { color: #7dd3fc; }
.lam-pop-item[aria-checked="true"]::after { content: "\2713"; font-size: 13px; }

.lam-keys {
  position: absolute;
  inset-inline-start: 50%;
  top: 50%;
  translate: -50% -50%;
  z-index: 12;
  width: min(430px, calc(100% - 32px));
  padding: 18px 20px 14px;
  border-radius: 18px;
  background: rgba(10, 16, 30, .96);
  color: #fff;
  box-shadow: 0 24px 64px rgba(2, 6, 18, .6);
}
.lam-keys[hidden] { display: none; }
.lam-keys h3 { margin: 0 0 12px; font-size: 15px; font-weight: 700; }
.lam-keys dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
.lam-keys dt { margin: 0; }
.lam-keys dd { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .84); }
.lam-keys kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  direction: ltr;
}
.lam-keys-close {
  position: absolute;
  top: 10px; inset-inline-end: 10px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: rgba(255, 255, 255, .12);
  color: #fff; cursor: pointer;
}

/* --- CTA buttons ---------------------------------------------------------- */

.lam-cta-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  padding: 14px;
}

/* Physical corners on purpose: the author picked a spot on the screen. */
.lam-cta {
  position: absolute;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 28px);
  padding: 10px 16px;
  border-radius: 11px;
  border: 2px solid transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 6, 18, .3);
  opacity: 0;
  transform: translateY(6px) scale(.98);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2, .8, .3, 1.2), filter .15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lam-cta.is-shown { opacity: 1; transform: none; }
.lam-cta:hover { filter: brightness(1.07); }
.lam-cta[data-place="tl"] { top: 0; left: 0; }
.lam-cta[data-place="tr"] { top: 0; right: 0; }
.lam-cta[data-place="bl"] { bottom: 0; left: 0; }
.lam-cta[data-place="br"] { bottom: 0; right: 0; }
.lam-player.is-controls .lam-cta[data-place="bl"],
.lam-player.is-controls .lam-cta[data-place="br"] { bottom: 50px; }

/* Embed only: 'below' buttons ride along the bottom of the frame. */
.lam-cta-bottom {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-inline: 8px;
  transition: bottom .22s ease;
}
.lam-player.is-controls .lam-cta-bottom { bottom: 50px; }
.lam-cta.lam-cta-inrow { position: static; }

.lam-below {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.lam-below:empty { display: none; }
.lam-below .lam-cta {
  position: static;
  opacity: 0;
  max-width: 100%;
  box-shadow: var(--lam-sh-1);
  padding: 11px 18px;
  font-size: 14px;
}
.lam-below .lam-cta.is-shown { opacity: 1; }
.lam-below-embed { padding-inline: 10px; margin-top: 10px; }

/* --- inline error panel (NAS unreachable) -------------------------------- */

.lam-offline {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(160deg, #0b1220 0%, #16213c 100%);
  color: #fff;
  text-align: center;
}
.lam-offline[hidden] { display: none; }
.lam-offline-inner { max-width: 380px; }
.lam-offline h2 { margin: 0 0 6px; font-size: clamp(16px, 2.4vw, 19px); font-weight: 700; }
.lam-offline p { margin: 0 0 14px; font-size: 13.5px; color: rgba(255, 255, 255, .78); line-height: 1.55; }
.lam-offline-icon {
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: rgba(244, 63, 94, .16);
  color: #fda4af;
}
.lam-offline .lam-btn {
  background: rgba(255, 255, 255, .95);
  color: var(--lam-brand-ink);
}

/* --- comments ------------------------------------------------------------- */

.lam-card {
  background: var(--lam-card);
  border: 1px solid var(--lam-line);
  border-radius: var(--lam-r-lg);
  box-shadow: var(--lam-sh-2);
  padding: 18px;
}

.lam-card-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lam-card-title::before {
  content: "";
  width: 4px; height: 17px;
  border-radius: 99px;
  background: var(--lam-grad);
  flex: none;
}

.lam-muted { color: var(--lam-muted); }
.lam-comments-empty { margin: 4px 0 14px; font-size: 13.5px; }

.lam-comment-list {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: min(48vh, 440px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-inline-end: 4px;
}
.lam-comment {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  animation: lam-fade .28s ease both;
}
@keyframes lam-fade { from { opacity: 0; transform: translateY(6px); } }

.lam-comment-av {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11.5px; font-weight: 750; color: #fff;
  background: var(--lam-grad);
}
.lam-comment-av.is-guest { background: linear-gradient(135deg, #94a3b8, #64748b); }
.lam-comment-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  font-size: 12.5px; color: var(--lam-muted);
}
.lam-comment-name { font-weight: 680; color: var(--lam-ink-2); }
.lam-comment-body {
  margin: 2px 0 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--lam-ink-2);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.lam-ts {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 0;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--lam-brand-ink);
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  cursor: pointer;
  transition: background .14s ease, transform .14s ease;
}
.lam-ts:hover { background: #dbeafe; transform: translateY(-1px); }

.lam-cform { position: relative; display: flex; flex-direction: column; gap: 9px; }
/* Clipped in place rather than parked off-screen: an off-screen offset makes
   the page horizontally scrollable, and in RTL it does so spectacularly. */
.lam-hp {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}

.lam-input, .lam-textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--lam-r-md);
  border: 1.5px solid var(--lam-line);
  background: #fbfcff;
  font: inherit;
  font-size: 14px;
  color: var(--lam-ink);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.lam-input::placeholder, .lam-textarea::placeholder { color: var(--lam-faint); }
.lam-input:focus, .lam-textarea:focus {
  outline: none;
  background: #fff;
  border-color: #9dbcfa;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .13);
}
.lam-input.is-error { border-color: #fca5a5; background: #fff5f5; }
.lam-textarea { min-height: 76px; resize: vertical; line-height: 1.55; }

.lam-cform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.lam-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--lam-muted);
  cursor: pointer;
  user-select: none;
}
.lam-check input { accent-color: var(--lam-brand); width: 15px; height: 15px; }
.lam-check code {
  font-variant-numeric: tabular-nums;
  direction: ltr;
  font-weight: 700;
  color: var(--lam-brand-ink);
}

.lam-error { margin: 0; color: #b91c1c; font-size: 13px; font-weight: 600; }

/* --- toast ---------------------------------------------------------------- */

.lam-toast {
  position: fixed;
  z-index: 60;
  bottom: 22px;
  inset-inline-start: 50%;
  translate: -50% 0;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(11, 18, 32, .95);
  color: #fff;
  font-size: 13.5px;
  font-weight: 650;
  box-shadow: 0 12px 34px rgba(2, 6, 18, .34);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.lam-toast.is-on { opacity: 1; transform: none; }

/* --- dead-end state pages ------------------------------------------------- */

.lam-state {
  position: relative;
  z-index: 2;
  min-height: 62vh;
  display: grid;
  place-items: center;
  padding: 24px var(--lam-gutter) 56px;
}
.lam-state-card {
  width: min(520px, 100%);
  text-align: center;
  background: var(--lam-card);
  border: 1px solid var(--lam-line);
  border-radius: 26px;
  box-shadow: var(--lam-sh-3);
  padding: clamp(26px, 5vw, 44px) clamp(20px, 5vw, 40px);
}
.lam-art { width: 116px; height: 116px; margin: 0 auto 14px; display: block; }
.lam-state-card h1 {
  margin: 0 0 8px;
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 760;
  letter-spacing: -.02em;
}
.lam-state-card > p {
  margin: 0 auto;
  max-width: 40ch;
  color: var(--lam-muted);
  font-size: 14.5px;
  line-height: 1.65;
}
.lam-state-hint {
  margin-top: 10px !important;
  font-size: 12.5px !important;
  color: var(--lam-faint) !important;
}
.lam-state-actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lam-pwform { margin-top: 20px; text-align: start; display: flex; flex-direction: column; gap: 12px; }
.lam-field { display: block; }
.lam-field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  font-weight: 680;
  color: var(--lam-ink-2);
}

/* --- footer --------------------------------------------------------------- */

.lam-footer {
  position: relative;
  z-index: 2;
  padding: 10px var(--lam-gutter) 30px;
  text-align: center;
}
.lam-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--lam-line);
  background: rgba(255, 255, 255, .8);
  color: var(--lam-muted);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.lam-footer-brand:hover { background: #fff; color: var(--lam-brand-ink); transform: translateY(-1px); }

/* --- embed variant -------------------------------------------------------- */

body.lam-embed {
  background: #0b1220;
  min-height: 0;
}
body.lam-embed .lam-aurora { display: none; }
body.lam-embed .lam-player {
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  outline: 0;
  background: #0b1220;
}
body.lam-embed .lam-frame { border-radius: 0; max-height: none; }
body.lam-embed.lam-state-page { display: grid; place-items: center; }
body.lam-embed .lam-state { min-height: 100vh; padding: 16px; }
body.lam-embed .lam-state-card { box-shadow: none; border-radius: 18px; }

.lam-embed-credit {
  position: fixed;
  top: 10px;
  inset-inline-start: 10px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(8, 13, 25, .62);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12.5px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .22s ease, transform .22s ease, background .15s ease;
}
body.lam-embed:hover .lam-embed-credit,
.lam-embed-credit:focus-visible { opacity: 1; transform: none; }
.lam-embed-credit:hover { background: rgba(8, 13, 25, .82); }
.lam-embed-credit-title {
  font-weight: 680;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lam-embed-credit-cta { color: #7dd3fc; font-weight: 700; white-space: nowrap; }

/* --- narrow screens ------------------------------------------------------- */

@media (max-width: 640px) {
  .lam-player { padding: 5px; border-radius: 18px; }
  .lam-frame { border-radius: 13px; max-height: none; }
  .lam-controls { padding: 34px 6px 6px; }
  .lam-cbtn { width: 36px; height: 36px; }
  .lam-vol-slider { display: none; }
  .lam-bigplay span { width: 64px; height: 64px; }
  .lam-card { padding: 15px; border-radius: 18px; }
  .lam-comment-list { max-height: none; }
  .lam-embed-credit { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  /* Nobody on a phone needs the keyboard-shortcut card, and the row is tight. */
  .lam-keys-btn { display: none; }
}

@media (max-width: 420px) {
  body.lam-body { font-size: 14.5px; }
  .lam-time { padding-inline: 5px; font-size: 11.5px; }
  .lam-cbtn { width: 33px; height: 33px; border-radius: 9px; }
  .lam-cbtn svg { width: 18px; height: 18px; }
  .lam-btn { padding: 8px 12px; font-size: 12.5px; }
  .lam-btn-soft span { display: none; }   /* icons only; the labels no longer fit */
  .lam-cta { padding: 8px 12px; font-size: 12.5px; max-width: calc(100% - 20px); }
  .lam-cta-layer { padding: 10px; }
  .lam-meta { font-size: 12.5px; gap: 6px; }
  .lam-top { padding-block: 10px; }
}

/* --- motion / contrast preferences --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .lam-spinner, .lam-art-spin { animation: lam-spin 1.6s linear infinite !important; }
}

@media (prefers-contrast: more) {
  :root { --lam-line: #b6c3da; --lam-muted: #47566d; }
  .lam-progress-track { background: rgba(255, 255, 255, .5); }
}

@media print {
  .lam-aurora, .lam-controls, .lam-bigplay, .lam-toast, .lam-cta-layer { display: none !important; }
}
