/* =====================================================================
   DFF Karaoke — kiosk UI
   Brand: Arthouse Black #1E1E19 · Premiere Grey #B9B4AF
          Avant-garde Blue #3241F0 · Flashback White #FFFFFF
   Sizing: everything is in rem; the root scales with the screen so the
   same layout works on 1080p landscape and portrait totems.
   ===================================================================== */

:root {
  --black: #1E1E19;
  --black-2: #262620;
  --black-3: #313129;
  --grey: #B9B4AF;
  --grey-dim: #8D8983;
  --blue: #3241F0;
  --blue-hi: #4C5AFF;
  --blue-line: rgba(170, 178, 255, .7);
  --white: #FFFFFF;
  --line: rgba(255, 255, 255, .16);
  --danger: #FF6B5A;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --pad: 4rem;
  --font: 'Suisse Intl', 'Inter Tight', 'IBM Plex Sans Arabic', 'Helvetica Neue', Arial, sans-serif;
  --font-ar: 'IBM Plex Sans Arabic', 'Inter Tight', sans-serif;
}

html {
  font-size: min(1.0417vw, 1.852vh);   /* 20px at 1920×1080 */
  background: var(--black);
}
@media (orientation: portrait) {
  html { font-size: min(1.852vw, 1.0417vh); --pad: 3.5rem; }   /* 20px at 1080×1920 */
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--white);
  background: var(--black);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
  cursor: default;
}
body.hide-cursor, body.hide-cursor * { cursor: none !important; }
[lang="ar"] { font-family: var(--font-ar); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
svg { display: block; }
img { -webkit-user-drag: none; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.grain {
  position: fixed; inset: -50%; z-index: 1; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)} 60%{transform:translate(-2%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; z-index: 20; left: 0; right: 0; top: 0;
  height: 7rem; padding: 0 var(--pad);
  display: flex; align-items: center; gap: 3rem;
  opacity: 0; transform: translateY(-1rem); pointer-events: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
body:not([data-screen="attract"]) .topbar { opacity: 1; transform: none; pointer-events: auto; }
body[data-screen="sing"] .topbar, body[data-screen="saving"] .topbar, body[data-screen="done"] .topbar { opacity: 0; pointer-events: none; }
.topbar-logo { height: 3.4rem; width: auto; }
.steps { list-style: none; display: flex; gap: .5rem; margin: 0 auto; padding: 0; }
.steps li {
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem 1.2rem; font-size: 1rem; font-weight: 500; color: var(--grey-dim);
  border: 1px solid transparent; transition: all .4s var(--ease);
}
.steps li span { font-variant-numeric: tabular-nums; font-size: .85rem; letter-spacing: .08em; opacity: .8; }
.steps li.on { color: var(--white); border-color: var(--blue-line); background: rgba(50, 65, 240, .22); }
.steps li.past { color: var(--grey); }
@media (orientation: portrait) { .steps { display: none; } .topbar { justify-content: space-between; } }

.ghost-btn {
  display: inline-flex; align-items: center; gap: .6rem;
  height: 3.6rem; padding: 0 1.4rem;
  font-size: 1.05rem; font-weight: 500; color: var(--grey);
  border: 1px solid var(--line);
  transition: background .2s, color .2s, transform .15s;
}
.ghost-btn svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; }
.ghost-btn:active { transform: scale(.97); background: rgba(255, 255, 255, .08); color: var(--white); }

/* ---------- screens ---------- */
#app { position: fixed; inset: 0; z-index: 5; }
.screen {
  position: absolute; inset: 0;
  padding: 9rem var(--pad) var(--pad);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(3rem);
  transition: opacity .55s var(--ease), transform .7s var(--ease), visibility 0s .7s;
}
.screen.leaving { transform: translateX(-3rem); }
.screen.active {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .55s var(--ease) .12s, transform .8s var(--ease) .12s, visibility 0s;
}

.eyebrow {
  margin: 0 0 1.2rem; font-size: 1rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--grey);
}
.eyebrow [lang="ar"] { letter-spacing: 0; font-size: 1.1rem; }
.title { margin: 0; font-size: 3.6rem; line-height: 1.02; letter-spacing: -.025em; font-weight: 600; }
.sub { margin: .9rem 0 0; font-size: 1.4rem; line-height: 1.4; color: var(--grey); }

/* ---------- primary CTA ---------- */
.cta {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 1rem;
  height: 5.2rem; padding: 0 2.6rem; min-width: 18rem;
  font-size: 1.45rem; font-weight: 600; letter-spacing: -.01em;
  background: var(--blue); color: var(--white);
  box-shadow: inset 0 0 0 1px var(--blue-line), 0 1.2rem 3rem -1.2rem rgba(50, 65, 240, .8);
  transition: transform .15s var(--ease), background .2s, opacity .3s, box-shadow .3s;
}
.cta svg { width: 1.7rem; height: 1.7rem; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .3s var(--ease); }
.cta:active { transform: scale(.97); background: var(--blue-hi); }
.cta.is-disabled { background: var(--black-3); box-shadow: inset 0 0 0 1px var(--line); color: var(--grey-dim); }
.cta:not(.is-disabled) svg { animation: nudge 1.6s var(--ease) infinite; }
@keyframes nudge { 0%, 60%, 100% { transform: none } 30% { transform: translateX(.35rem) } }
.cta-light { background: var(--white); color: var(--black); box-shadow: none; }
.cta-light:active { background: var(--grey); }

/* =====================================================================
   0 · ATTRACT
   ===================================================================== */
.attract { padding: var(--pad); cursor: pointer; }
.attract-inner { position: relative; flex: 1; display: grid; grid-template-rows: auto 1fr auto; }
.attract-logo { width: 17rem; height: auto; }
.attract-copy { align-self: center; max-width: 60rem; }
.wordmark {
  margin: 0; font-weight: 700; letter-spacing: -.045em; line-height: .9;
  font-size: 10.5rem;
}
.wordmark span { display: block; }
/* second line gets the DFF "motion blur" treatment: a ghosted trail behind the word */
.wordmark span:nth-child(2) {
  color: #D4D8FF;
  text-shadow:
    -.05em 0 .04em rgba(255, 255, 255, .14),
    -.12em 0 .07em rgba(140, 150, 255, .12),
    -.22em 0 .1em rgba(50, 65, 240, .22);
  animation: smear 6s var(--ease-in-out) infinite;
}
@keyframes smear {
  0%, 100% { text-shadow: -.05em 0 .04em rgba(255,255,255,.14), -.12em 0 .07em rgba(140,150,255,.12), -.22em 0 .1em rgba(50,65,240,.22); }
  50% { text-shadow: -.025em 0 .02em rgba(255,255,255,.1), -.06em 0 .04em rgba(140,150,255,.1), -.1em 0 .06em rgba(50,65,240,.18); }
}
.attract .lede { margin: 2.4rem 0 0; font-size: 1.75rem; line-height: 1.4; color: var(--grey); max-width: 38rem; }

.touch-cta { display: flex; align-items: center; gap: 2rem; }
.touch-ring { position: relative; width: 6.5rem; height: 6.5rem; flex: none; }
.touch-ring i {
  position: absolute; inset: 0; border: 2px solid var(--white);
  animation: frameStack 2.6s var(--ease) infinite;
}
.touch-ring i:nth-child(2) { animation-delay: .25s; }
.touch-ring i:nth-child(3) { animation-delay: .5s; background: var(--blue); border-color: var(--blue-line); }
@keyframes frameStack {
  0% { transform: translate(0, 0); opacity: 1; }
  50% { transform: translate(-1rem, 1rem); opacity: .6; }
  100% { transform: translate(0, 0); opacity: 1; }
}
.touch-text strong { display: block; font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; }
.touch-text [lang="ar"] { display: block; font-size: 1.6rem; color: var(--grey); margin-top: .3rem; text-align: left; }
.attract .touch-text strong { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }

@media (orientation: portrait) {
  .wordmark { font-size: 9rem; }
  .attract-copy { align-self: end; margin-bottom: 6rem; }
}

/* =====================================================================
   1 · REGISTER
   ===================================================================== */
.register { padding-bottom: 2rem; transition-property: opacity, transform, visibility, padding; }
.register > * { transform: translateY(var(--lift, 0px)); transition: transform .45s var(--ease), opacity .3s; }
.register.lifted .register-head { opacity: 0; }
.register-head { margin-bottom: 2.6rem; transition: all .5s var(--ease); }
.form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 2rem;
  max-width: 92rem; width: 100%;
}
.field-name { grid-column: 1 / -1; }
.field { position: relative; display: block; }
.field-label { display: block; font-size: 1.05rem; font-weight: 500; color: var(--grey); margin-bottom: .6rem; letter-spacing: .01em; }
.field input {
  width: 100%; height: 5.4rem; padding: 0 1.6rem;
  font: 500 1.9rem/1 var(--font); color: var(--white); letter-spacing: -.01em;
  background: rgba(30, 30, 25, .66); border: 1px solid var(--line); border-radius: 0;
  outline: none; caret-color: var(--blue-hi);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: border-color .25s, box-shadow .25s, background .25s;
  user-select: text; -webkit-user-select: text;
}
.field input::placeholder { color: rgba(185, 180, 175, .45); }
.field input:focus { border-color: var(--blue-hi); box-shadow: 0 0 0 1px var(--blue-hi), 0 0 0 .5rem rgba(50, 65, 240, .25); background: rgba(30, 30, 25, .85); }
.field.valid input { border-color: rgba(255, 255, 255, .34); }
.field.valid::after {
  content: ''; position: absolute; right: 1.5rem; bottom: 1.9rem; width: 1.6rem; height: .8rem;
  border-left: 3px solid var(--blue-hi); border-bottom: 3px solid var(--blue-hi); transform: rotate(-45deg);
}
.field-error {
  position: absolute; left: 0; top: 100%; margin-top: .35rem;
  font-size: .95rem; color: var(--danger); opacity: 0; transform: translateY(-.3rem); transition: all .25s;
}
.field-hint { position: absolute; left: 0; top: 100%; margin-top: .35rem; z-index: 2; font-size: 1.05rem; color: var(--white); background: rgba(50, 65, 240, .35); border: 1px solid var(--blue-line); padding: .4rem .8rem; text-align: left; }
.field-hint[hidden] { display: none; }
.field-hint b { font-weight: 600; }
.field-hint u { color: var(--blue-hi); text-underline-offset: .2em; }
.field.invalid input { border-color: var(--danger); }
.field.invalid .field-error { opacity: 1; transform: none; }

.checks { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr; gap: 1.2rem 2rem; margin-top: .8rem; }
.check {
  display: flex; align-items: center; gap: 1.2rem; text-align: left;
  min-height: 5rem; padding: 1rem 1.4rem;
  border: 1px solid var(--line); background: rgba(30, 30, 25, .5);
  transition: border-color .25s, background .25s;
}
.check .box {
  flex: none; width: 2.4rem; height: 2.4rem; border: 2px solid var(--grey); display: grid; place-items: center;
  transition: all .25s var(--ease);
}
.check .box svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: var(--white); stroke-width: 3; stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .3s var(--ease) .05s; }
.check[aria-checked="true"] { border-color: var(--blue-line); background: rgba(50, 65, 240, .18); }
.check[aria-checked="true"] .box { background: var(--blue); border-color: var(--blue); }
.check[aria-checked="true"] .box svg { stroke-dashoffset: 0; }
.check-text { font-size: 1.15rem; line-height: 1.35; color: var(--white); }
.check-text a { color: var(--white); text-decoration: underline; text-decoration-color: var(--blue-hi); text-underline-offset: .25em; text-decoration-thickness: 2px; padding: .4rem 0; }
.check-text em { display: block; font-style: normal; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; color: var(--grey-dim); margin-top: .25rem; }
.check.invalid { border-color: var(--danger); }
.check.invalid em.req { color: var(--danger); }

.form-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 1rem; }
.hint { margin: 0; font-size: 1.15rem; color: var(--grey-dim); }

/* keyboard open: compact the form so everything fits above the keys */
body.kb-open .register { padding-top: 8rem; }
body.kb-open .register-head { margin-bottom: 1.2rem; }
body.kb-open .register-head .sub { display: none; }
body.kb-open .register-head .title { font-size: 2.4rem; }
body.kb-open .checks, body.kb-open .form-foot { display: none; }
/* Portrait totem (32" 1080×1920): anchor the form low, near the guest's hands,
   and let it ride up just above the keyboard when typing. */
@media (orientation: portrait) {
  .register { justify-content: flex-end; padding-bottom: 7rem; }
  body.kb-open .register { padding-top: 9rem; padding-bottom: calc(var(--kbh, 32rem) + 2.4rem); }
  .register-head { margin-bottom: 3.4rem; }
  .register-head .title, body.kb-open .register-head .title { font-size: 4.6rem; }
  body.kb-open .register-head .sub { display: block; }
  .register-head .sub { font-size: 1.6rem; }
  .form { grid-template-columns: 1fr; gap: 2.2rem; }
  .field-label { font-size: 1.2rem; }
  .field input { height: 6.2rem; font-size: 2.2rem; padding: 0 1.8rem; }
  .field.valid::after { bottom: 2.3rem; }
  .checks { grid-template-columns: 1fr; gap: 1.2rem; margin-top: .6rem; }
  body.kb-open .checks { display: grid; }
  .check { min-height: 6rem; padding: 1.2rem 1.6rem; }
  .check .box { width: 2.8rem; height: 2.8rem; }
  .check-text { font-size: 1.4rem; }
  .form-foot { flex-direction: column-reverse; align-items: stretch; gap: 1.4rem; margin-top: 1.6rem; }
  .form-foot .cta { width: 100%; height: 6.6rem; font-size: 1.9rem; }
  .hint { text-align: center; font-size: 1.25rem; }
  .register > * { transform: none; }
}

/* =====================================================================
   ON-SCREEN KEYBOARD
   ===================================================================== */
.kb {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  padding: 1.4rem var(--pad) 1.8rem;
  background: rgba(22, 22, 18, .9);
  backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-top: 1px solid var(--line);
  transform: translateY(105%); transition: transform .45s var(--ease);
}
body.kb-open .kb { transform: none; }
.kb-rows { max-width: 96rem; margin: 0 auto; display: flex; flex-direction: column; gap: .7rem; }
.kb-row { display: flex; gap: .7rem; justify-content: center; }
.kb-key {
  flex: 1 1 0; min-width: 0; height: 4.6rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem; font-weight: 500; color: var(--white);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1);
  transition: background .08s, transform .08s;
  position: relative;
}
.kb-key svg { width: 1.9rem; height: 1.9rem; fill: none; stroke: currentColor; stroke-width: 2; }
.kb-key.w15 { flex-grow: 1.5; } .kb-key.w2 { flex-grow: 2; } .kb-key.w3 { flex-grow: 3; } .kb-key.w6 { flex-grow: 6; }
.kb-key.mod { background: rgba(255, 255, 255, .03); font-size: 1.2rem; color: var(--grey); }
.kb-key.sug { font-size: 1.2rem; background: rgba(50, 65, 240, .16); border-color: rgba(170, 178, 255, .3); }
.kb-key.go { background: var(--blue); border-color: var(--blue-line); font-size: 1.3rem; font-weight: 600; color: var(--white); gap: .6rem; }
.kb-key.on { background: rgba(255, 255, 255, .85); color: var(--black); }
.kb-key.pressed, .kb-key:active { background: var(--blue); transform: translateY(1px) scale(.98); }
.kb-key.go.pressed, .kb-key.go:active { background: var(--blue-hi); }
.kb-key .pop {
  position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -.4rem);
  min-width: 100%; padding: .6rem 1rem; background: var(--white); color: var(--black);
  font-size: 2.2rem; font-weight: 600; text-align: center; pointer-events: none;
}
.kb.arabic .kb-key { font-family: var(--font-ar); font-size: 2rem; }
.kb-key.lang { font-family: var(--font-ar); font-size: 1.5rem; }
.kb.numeric .kb-rows { max-width: 40rem; }
.kb.numeric .kb-key { height: 4.3rem; font-size: 2rem; }
.kb.numeric .kb-rows { gap: .55rem; }
.kb.numeric .kb-row { gap: .55rem; }
@media (orientation: portrait) { .kb-key { height: 5.4rem; } }

/* =====================================================================
   2 · SONGS
   ===================================================================== */
.songs { padding-bottom: 0; }
.songs-head { margin-bottom: 2rem; }
.name-tag { color: var(--grey); font-weight: 400; }

/* category chips — horizontally scrollable if they don't fit */
.song-tabs {
  display: flex; gap: .8rem; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--pad)) 1.8rem; padding: .2rem var(--pad);
  overscroll-behavior-x: contain; touch-action: pan-x;
}
.song-tabs::-webkit-scrollbar { display: none; }
.song-tabs[hidden] { display: none; }
.song-tab {
  flex: none; display: inline-flex; align-items: center; gap: .8rem;
  height: 4.4rem; padding: 0 1.6rem; font-size: 1.25rem; font-weight: 600; color: var(--grey);
  border: 1px solid var(--line); background: rgba(30, 30, 25, .6);
  transition: background .2s, color .2s, border-color .2s, transform .12s;
}
.song-tab span { font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .65; }
.song-tab.on { background: var(--white); color: var(--black); border-color: var(--white); }
.song-tab:active { transform: scale(.96); }

/* scrolling grid with a fade that hints there's more below */
.song-grid-wrap { position: relative; flex: 1; min-height: 0; }
.song-grid-wrap::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 6rem; pointer-events: none;
  background: linear-gradient(180deg, rgba(30, 30, 25, 0), var(--black));
}
.song-grid {
  height: 100%;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); grid-auto-rows: 22rem; gap: 1.4rem;
  align-content: start; overflow-y: auto; scrollbar-width: none;
  padding-bottom: 7rem; overscroll-behavior: contain; touch-action: pan-y;
}
.song-grid::-webkit-scrollbar { display: none; }
.song {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 0; padding: 1.6rem; text-align: left; overflow: hidden;
  background: var(--black-2); border: 1px solid var(--line);
  opacity: 0; transform: translateY(2rem);
  transition: transform .5s var(--ease), border-color .25s, opacity .5s var(--ease);
}
.song[hidden] { display: none; }
.screen.active .song { opacity: 1; transform: none; }
.song canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; transition: transform .6s var(--ease); }
.song > *:not(canvas) { position: relative; z-index: 1; }
.song-meta { display: flex; justify-content: space-between; gap: 1rem; width: 100%; font-size: .95rem; font-weight: 600; letter-spacing: .06em; color: var(--grey); }
.song-meta .dur { font-variant-numeric: tabular-nums; font-weight: 500; }
.song-title { margin: 0; font-size: 2.2rem; line-height: 1; letter-spacing: -.03em; font-weight: 700; text-wrap: balance; }
.song-artist { margin: .6rem 0 0; font-size: 1.15rem; color: rgba(255, 255, 255, .78); }
.song .song-play {
  position: absolute; right: 1.6rem; bottom: 1.6rem; z-index: 2;
  width: 4rem; height: 4rem; display: grid; place-items: center;
  background: var(--white); color: var(--black);
  transition: transform .3s var(--ease);
}
.song-play svg { width: 1.5rem; height: 1.5rem; fill: currentColor; margin-left: .2rem; }
.song:active { transform: scale(.97); border-color: var(--blue-line); }
.song:active canvas { transform: scale(1.05); }
.song.picked { border-color: var(--white); }
.song.picked .song-play { background: var(--blue); color: var(--white); transform: scale(1.12); }
/* Title block sits above the play button and never grows past it: it can shrink,
   and title / subtitle / artist are line-clamped so a long name can't run under the button */
.song .song-body { min-height: 0; overflow: hidden; margin-bottom: 5rem; display: flex; flex-direction: column; align-self: stretch; }
.song-body > p { flex: none; }
.song-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; padding-bottom: .08em; }
.song-title.long { font-size: 1.9rem; line-height: 1.02; }
.song-title.xlong { font-size: 1.6rem; line-height: 1.05; }
.song-sub { margin: .35rem 0 0; font-size: 1.1rem; font-weight: 600; line-height: 1.2; color: rgba(255, 255, 255, .85);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (orientation: portrait) {
  .songs-head .title { font-size: 4.6rem; }
  .songs-head .sub { font-size: 1.5rem; }
  .song-tab { height: 5rem; font-size: 1.4rem; padding: 0 1.8rem; }
  .song-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 21rem; gap: 1.4rem; }
  .song { padding: 1.8rem; }
  .song-title { font-size: 2.6rem; }
  .song-artist { font-size: 1.3rem; }
  .song-meta { font-size: .95rem; }
  .song .song-play { width: 4.6rem; height: 4.6rem; right: 1.8rem; bottom: 1.8rem; }
  .song .song-body { margin-bottom: 5.8rem; }
  .song-title.long { font-size: 2.15rem; }
  .song-title.xlong { font-size: 1.8rem; }
  .song-sub { font-size: 1.25rem; }
}

/* =====================================================================
   3 · COUNTDOWN
   ===================================================================== */
.countdown { align-items: center; justify-content: center; text-align: center; }
.cd-wrap { display: flex; flex-direction: column; align-items: center; }
.cd-title { margin: 0; font-size: 5.2rem; line-height: 1; letter-spacing: -.035em; font-weight: 700; max-width: 70rem; text-wrap: balance; }
.cd-artist { margin: .9rem 0 0; font-size: 1.8rem; color: rgba(255, 255, 255, .78); }
.countdown .eyebrow { color: rgba(255, 255, 255, .7); }
.cd-number-wrap { position: relative; width: 17rem; height: 17rem; margin: 3.4rem 0 2.6rem; display: grid; place-items: center; }
.cd-number {
  font-size: 11rem; font-weight: 700; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums;
}
.cd-number.tick { animation: tick 1s var(--ease); }
@keyframes tick { 0% { transform: scale(1.6); opacity: 0; filter: blur(10px); } 25% { transform: scale(1); opacity: 1; filter: blur(0); } 85% { opacity: 1; } 100% { transform: scale(.85); opacity: .0; filter: blur(4px); } }
.cd-number.loading { font-size: 1.6rem; font-weight: 500; letter-spacing: 0; color: var(--grey); animation: breathe 1.6s infinite; }
.cd-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cd-ring rect { fill: rgba(50, 65, 240, .18); stroke: var(--white); stroke-width: 2; stroke-dasharray: 100; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; }
.cd-mic { display: flex; align-items: center; gap: 1.2rem; padding: 1rem 1.6rem; border: 1px solid var(--line); background: rgba(30, 30, 25, .6); font-size: 1.25rem; color: var(--grey); }
.cd-change { margin-top: 2.4rem; }
.cd-mic.warn { border-color: var(--danger); color: #FFB2A8; }
.mic-icon img { display: block; height: 2.2rem; width: auto; }

.meter { display: inline-flex; gap: .22rem; align-items: center; height: 1.6rem; }
.meter i { width: .4rem; height: 100%; background: rgba(255, 255, 255, .15); transition: background .06s; }
.meter i.on { background: var(--white); }
.meter i.hot { background: var(--blue-hi); }

/* =====================================================================
   4 · SING
   ===================================================================== */
.sing { padding-top: var(--pad); justify-content: space-between; }
.sing > *:not(.bgvideo) { position: relative; z-index: 1; }

/* background video: two stacked players crossfade from clip to clip */
.bgvideo { position: absolute; inset: 0; z-index: 0; overflow: hidden; background: var(--black); opacity: 0; transition: opacity 1.2s var(--ease); }
.bgvideo.on { opacity: 1; }
.bgvideo video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1s var(--ease-in-out);
}
.bgvideo video.show { opacity: 1; }
/* brand-tinted scrim keeps lyrics legible over any footage */
.bgvideo-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(30, 30, 25, .82) 0%, rgba(30, 30, 25, .38) 22%, rgba(30, 30, 25, .5) 50%, rgba(30, 30, 25, .42) 74%, rgba(30, 30, 25, .9) 100%),
    radial-gradient(ellipse at 50% 50%, rgba(30, 30, 25, .35) 0%, rgba(30, 30, 25, 0) 70%),
    rgba(50, 65, 240, .1);
}
.bgvideo.on ~ .lyrics { filter: drop-shadow(0 .2rem 1.4rem rgba(0, 0, 0, .55)); }
.bgvideo.on ~ .lyrics .ly-next, .bgvideo.on ~ .lyrics .ly-prev, .bgvideo.on ~ .lyrics .ly-next2 { color: rgba(255, 255, 255, .72); }
.bgvideo.on ~ .lyrics .ly-cur .w { background: linear-gradient(90deg, var(--white) var(--p), rgba(255, 255, 255, .5) var(--p)); -webkit-background-clip: text; background-clip: text; }
.sing-top { display: flex; justify-content: space-between; align-items: center; }
.now { display: flex; align-items: center; gap: 1.6rem; }
.rec {
  display: inline-flex; align-items: center; gap: .6rem; height: 2.6rem; padding: 0 1rem;
  font-size: .95rem; font-weight: 600; letter-spacing: .16em; border: 1px solid rgba(255, 107, 90, .5); color: #FFB2A8;
}
.rec i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--danger); animation: breathe 1.2s infinite; }
.now-title { font-size: 1.6rem; font-weight: 600; letter-spacing: -.01em; }
.now-artist { font-size: 1.1rem; color: var(--grey); margin-top: .15rem; }
.sing-time { font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--grey); }
.sing-time .sep { margin: 0 .5rem; opacity: .5; }
.sing-time #tCur { color: var(--white); }

.lyrics {
  position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; gap: 1.6rem; padding: 2rem 0;
}
.ly { max-width: 92%; line-height: 1.12; letter-spacing: -.025em; transition: opacity .35s var(--ease), transform .45s var(--ease); text-wrap: balance; }
.ly-prev { font-size: 2.2rem; color: var(--grey-dim); opacity: .55; font-weight: 500; min-height: 2.5rem; }
.ly-cur { font-size: 5rem; font-weight: 700; min-height: 5.6rem; }
.ly-next { font-size: 2.8rem; font-weight: 500; color: var(--grey); min-height: 3.2rem; }
.ly-next2 { font-size: 2.2rem; font-weight: 500; color: var(--grey-dim); opacity: .5; min-height: 2.5rem; }
.ly.swap { animation: lyIn .45s var(--ease); }
@keyframes lyIn { from { opacity: 0; transform: translateY(1.2rem); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.ly-cur .w {
  --p: 0%;
  background: linear-gradient(90deg, var(--white) var(--p), rgba(255, 255, 255, .32) var(--p));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ly-cur .w.done { --p: 100%; }
.ly-cur.upcoming .w { --p: 0%; }
.ly-cur .w.now { text-shadow: none; }
.ly-status {
  order: -1; display: none; flex-direction: column; align-items: center; gap: 1.6rem;
  pointer-events: none; margin-bottom: 1.6rem;
}
.ly-status.show { display: flex; animation: lyIn .45s var(--ease); }
.lyrics.status-on .ly-cur, .lyrics.status-on .ly-prev { display: none; }
.ly-status .label { font-size: 1.3rem; letter-spacing: .22em; text-transform: uppercase; color: var(--grey); }
.ly-status .big { font-size: 3.4rem; font-weight: 600; letter-spacing: -.02em; }
.ly-status .dots { display: flex; gap: 1rem; }
.ly-status .dots i { width: 2.4rem; height: 2.4rem; border: 2px solid var(--white); transition: all .2s; }
.ly-status .dots i.on { background: var(--blue); border-color: var(--blue-line); transform: translate(-.3rem, .3rem); }

.sing-bottom { display: flex; flex-direction: column; gap: 1.6rem; }
@media (orientation: portrait) {
  .lyrics { gap: 2.4rem; }
  .ly-prev { font-size: 2.4rem; }
  .ly-cur { font-size: 6rem; min-height: 6.8rem; }
  .ly-next { font-size: 3.2rem; }
  .ly-next2 { font-size: 2.5rem; }
  .ly-status .big { font-size: 4.2rem; }
  .hold-btn { height: 5.6rem; min-width: 20rem; font-size: 1.4rem; }
  .now-title { font-size: 1.9rem; }
  .cd-title { font-size: 6.2rem; max-width: 90%; }
  .cd-artist { font-size: 2.2rem; }
  .cd-number-wrap { width: 22rem; height: 22rem; margin: 4.4rem 0 3.4rem; }
  .cd-number { font-size: 14rem; }
  .cd-mic { font-size: 1.4rem; }
}
.progress { position: relative; height: .5rem; background: rgba(255, 255, 255, .12); }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--white); }
.progress i::after { content: ''; position: absolute; right: -.4rem; top: 50%; width: 1.2rem; height: 1.2rem; transform: translateY(-50%); background: var(--blue); border: 2px solid var(--white); }
.sing-controls { display: flex; justify-content: space-between; align-items: center; }
.vu { display: flex; align-items: center; gap: 1rem; }
.meter-wide { height: 2rem; }

.hold-btn {
  position: relative; overflow: hidden; height: 4.6rem; padding: 0 2rem; min-width: 16rem;
  border: 1px solid var(--line); font-size: 1.2rem; font-weight: 500; color: var(--grey);
  background: rgba(30, 30, 25, .5);
}
.hold-btn .hold-fill { position: absolute; inset: 0; background: var(--white); transform-origin: left; transform: scaleX(0); }
.hold-btn .hold-label { position: relative; mix-blend-mode: difference; color: var(--white); }
.hold-btn.holding .hold-fill { transform: scaleX(1); transition: transform 1.4s linear; }

/* =====================================================================
   5 · SAVING
   ===================================================================== */
.saving { justify-content: center; }
.saving-inner { max-width: 60rem; }
.saving .title { font-size: 5rem; }
.save-bar { position: relative; height: .6rem; margin: 3.4rem 0 2.4rem; background: rgba(255, 255, 255, .12); overflow: hidden; }
.save-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--white); transition: width .4s var(--ease); }
.save-bar i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(50, 65, 240, .9), transparent); animation: sweep 1.2s linear infinite; }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.save-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.save-steps li { display: flex; align-items: center; gap: 1rem; font-size: 1.4rem; color: var(--grey-dim); transition: color .3s; }
.save-steps li::before { content: ''; width: 1.3rem; height: 1.3rem; border: 2px solid currentColor; flex: none; transition: all .3s; }
.save-steps li.on { color: var(--white); }
.save-steps li.on::before { animation: breathe 1s infinite; border-color: var(--blue-hi); }
.save-steps li.ok { color: var(--grey); }
.save-steps li.ok::before { background: var(--blue); border-color: var(--blue); }

/* =====================================================================
   6 · DONE
   ===================================================================== */
.done { justify-content: center; }
.done-inner {
  display: grid; grid-template-columns: 1fr auto; column-gap: 6rem; align-items: center;
  grid-template-areas: "copy qr" "btn qr";
}
.done-copy { grid-area: copy; align-self: end; }
.qr-card { grid-area: qr; }
.done-btn { grid-area: btn; justify-self: start; align-self: start; }
.done-title { margin: 0; font-size: 5rem; line-height: 1; letter-spacing: -.035em; font-weight: 700; text-wrap: balance; }
.done-title-ar { margin: 1.2rem 0 0; font-size: 3rem; line-height: 1.3; font-weight: 600; text-align: left; }
.done-sub-ar { margin-top: .4rem !important; text-align: left; }
.done-note { margin: 2rem 0 0; font-size: 1.35rem; line-height: 1.45; color: var(--grey); max-width: 46rem; }
.done-note:empty { display: none; }
.done-note strong { color: var(--white); font-weight: 600; }
.done-mic { display: block; height: 6rem; width: auto; margin-bottom: 2.4rem; }
.done .sub { font-size: 1.7rem; max-width: 46rem; margin-top: 1.6rem; }
.done .sub strong { color: var(--white); font-weight: 600; }
.err-code { display: block; margin-top: 1.2rem; font: 500 1rem/1.4 ui-monospace, Consolas, monospace; color: var(--grey-dim); letter-spacing: .02em; }
.done .cta { margin-top: 3.4rem; }
.cta-count {
  display: grid; place-items: center; min-width: 2.6rem; height: 2.6rem; padding: 0 .4rem;
  font-size: 1.1rem; font-variant-numeric: tabular-nums; border: 1.5px solid currentColor; opacity: .7;
}
.qr-card {
  width: 22rem; padding: 2rem; background: var(--white); color: var(--black);
  box-shadow: -1rem 1rem 0 var(--blue), -2rem 2rem 0 rgba(50, 65, 240, .4);
}
.qr-card .qr svg { width: 100%; height: auto; }
.qr-card p { margin: 1.4rem 0 0; font-size: 1.2rem; line-height: 1.35; }
.qr-card.hidden { visibility: hidden; }
@media (orientation: portrait) {
  .done { justify-content: center; padding-top: 5rem; padding-bottom: 5rem; }
  .done-inner { grid-template-columns: 1fr; grid-template-areas: "copy" "qr" "btn"; row-gap: 0; }
  .done-title { font-size: 5.6rem; }
  .done-title-ar { font-size: 3.4rem; }
  .done-note { font-size: 1.5rem; }
  .done .sub { font-size: 1.9rem; }
  .qr-card { justify-self: center; width: 24rem; padding: 2rem; margin: 3.4rem 0 4.4rem 2rem; }
  .qr-card p { font-size: 1.5rem; text-align: center; }
  .done .cta.done-btn { margin-top: 0; width: 100%; height: 6.6rem; font-size: 1.9rem; justify-self: stretch; }
}

/* =====================================================================
   SHEET / MODALS / TOAST
   ===================================================================== */
.sheet { position: fixed; inset: 0; z-index: 40; visibility: hidden; transition: visibility 0s .5s; }
.sheet.open { visibility: visible; transition: none; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(10, 10, 8, .6); opacity: 0; transition: opacity .4s; }
.sheet.open .sheet-scrim { opacity: 1; }
.sheet-panel {
  position: absolute; left: 50%; bottom: 0; width: min(80rem, 100%); max-height: 82%;
  display: flex; flex-direction: column;
  background: var(--black-2); border: 1px solid var(--line); border-bottom: 0;
  transform: translate(-50%, 100%); transition: transform .5s var(--ease);
}
.sheet.open .sheet-panel { transform: translate(-50%, 0); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 1.6rem 2.4rem; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; font-size: 2rem; font-weight: 600; }
.sheet-body { padding: 2rem 2.4rem 3rem; overflow-y: auto; font-size: 1.2rem; line-height: 1.6; color: var(--grey); user-select: text; touch-action: pan-y; overscroll-behavior: contain; }
.sheet-body h4 { color: var(--white); font-size: 1.3rem; margin: 1.8rem 0 .4rem; }

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(10, 10, 8, .7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.modal.open { opacity: 1; visibility: visible; transition: opacity .3s; }
.modal-card { width: min(46rem, 90%); padding: 3rem; background: var(--black-2); border: 1px solid var(--line); box-shadow: -1rem 1rem 0 rgba(50, 65, 240, .55); transform: translateY(1rem); transition: transform .4s var(--ease); }
.modal.open .modal-card { transform: none; }
.modal-card h3 { margin: 0 0 .8rem; font-size: 2.6rem; font-weight: 600; letter-spacing: -.02em; }
.modal-card p { margin: 0; font-size: 1.35rem; color: var(--grey); line-height: 1.45; }
.modal-card p strong { color: var(--white); font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.4rem; align-items: center; }
.modal-actions .cta { min-width: 0; height: 4.4rem; font-size: 1.25rem; }

.admin .modal-card { width: min(58rem, 92%); }
.adm-row { display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: 1.15rem; }
.adm-row select, .adm-row input[type=number] { font: inherit; color: var(--white); background: var(--black); border: 1px solid var(--line); height: 3rem; padding: 0 .8rem; max-width: 28rem; }
.adm-row input[type=range] { width: 20rem; accent-color: var(--blue); }
.adm-row input[type=checkbox] { width: 1.8rem; height: 1.8rem; accent-color: var(--blue); }
.adm-info { margin-top: 1rem !important; font-size: 1rem !important; font-family: ui-monospace, monospace; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 3rem; transform: translate(-50%, 2rem);
  padding: 1.2rem 2rem; background: var(--white); color: var(--black); font-size: 1.2rem; font-weight: 500;
  opacity: 0; transition: all .4s var(--ease); pointer-events: none; max-width: 80%;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* =====================================================================
   Client design notes (18 Nov): start screen on DFF blue, mic graphic,
   bilingual header and sub-header.
   ===================================================================== */
body { transition: background-color .7s var(--ease); }
body[data-screen="attract"] { background: var(--blue); }
.attract-mic { display: block; height: 9rem; width: auto; margin-bottom: 3rem; }
.attract .wordmark { font-size: 8.4rem; }
.attract .wordmark span:nth-child(2) {
  color: var(--white);
  text-shadow: -.05em 0 .04em rgba(30, 30, 25, .16), -.12em 0 .07em rgba(30, 30, 25, .12), -.22em 0 .1em rgba(30, 30, 25, .1);
  animation: none;
}
.wordmark-ar { margin: 1.6rem 0 0; font-size: 4.6rem; line-height: 1.25; font-weight: 600; text-align: left; }
.attract-sub { margin-top: 3rem; display: grid; gap: 1.2rem; max-width: 46rem; }
.attract-sub p { margin: 0; font-size: 1.9rem; line-height: 1.4; color: rgba(255, 255, 255, .9); }
.attract-sub p[lang="ar"] { font-size: 1.9rem; text-align: left; }
.attract .touch-text [lang="ar"] { color: rgba(255, 255, 255, .85); }
.attract .touch-ring i:nth-child(3) { background: var(--black); border-color: var(--white); }
@media (orientation: portrait) {
  .attract .wordmark { font-size: 7.6rem; }
  .attract-mic { height: 11rem; }
  .attract-sub p, .attract-sub p[lang="ar"] { font-size: 2.1rem; }
}

/* terms sheet: numbered waiver clauses */
.sheet-body ol { margin: 1rem 0 0; padding-left: 1.6rem; display: grid; gap: 1rem; }
.sheet-body strong { color: var(--white); }
