:root {
  --ink: #f9edda;
  --muted: #ddcbb8;
  --night: #142e2d;
  --leaf: #1b473e;
  --terracotta: #9f4939;
  --red: #bf3934;
  --paper: #f4dfbd;
  --shadow: 0 26px 70px rgba(7, 22, 20, .38);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  min-height: 100svh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--night);
  font-family: "Avenir Next", "Gill Sans", sans-serif;
}
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(230,166,83,.4); color: #fff6e6; }
:focus-visible { outline: 2px solid #e6a653; outline-offset: 2px; }
input { caret-color: #e6a653; }
.scene, .scene svg, .grain { position: fixed; inset: 0; width: 100%; height: 100%; }
.scene { z-index: -3; transition: transform 1.1s cubic-bezier(.16,1,.3,1); }
.scene svg { object-fit: cover; transform: scale(1.015); animation: settle 1.4s cubic-bezier(.2,.75,.2,1) both; }
.scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,25,24,.55), transparent 42%, rgba(8,25,24,.28)), linear-gradient(0deg, rgba(6,18,17,.5), transparent 45%);
}
.grain {
  z-index: -2; opacity: .13; pointer-events: none; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}
.topbar {
  height: 70px; padding: 0 28px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  font-size: 13px; letter-spacing: .03em; text-shadow: 0 1px 15px rgba(0,0,0,.45);
  animation: fade-down .7s .1s both;
}
.topbar a { justify-self: end; color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.topbar a:hover { border-color: currentColor; }
.live { display: flex; align-items: center; gap: 8px; text-transform: uppercase; font-size: 11px; letter-spacing: .16em; }
.live i { width: 8px; height: 8px; display: block; border-radius: 50%; background: #4ddc8a; box-shadow: 0 0 14px #4ddc8a; animation: pulse 2.2s infinite; }
main {
  width: min(1180px, calc(100% - 44px)); margin: 16px auto 145px; display: grid; grid-template-columns: 1fr 460px; gap: 72px; align-items: center;
}
.identity { text-align: center; align-self: center; transform: translateY(-22px); text-shadow: 0 5px 24px rgba(26,25,18,.32); animation: rise .9s .15s both; }
h1 {
  margin: 0; font-family: "Noto Serif Devanagari", "Kohinoor Devanagari", serif; font-size: clamp(88px, 11vw, 172px); line-height: 1.04;
  letter-spacing: -.01em; font-weight: 800; filter: drop-shadow(0 7px 0 rgba(110,32,29,.22));
}
/* "Mini" rides above the shirorekha, with the pun on MiniMax said quietly. */
.mini {
  /* Devanagari ink sits high in its line box, so "Mini" needs real clearance
     above the shirorekha or the two collide. Measured, not guessed. */
  display: block; margin-bottom: 1.15em; color: #e6a653;
  font-family: "Iowan Old Style", Georgia, serif; font-style: italic; font-weight: 600;
  font-size: .23em; line-height: 1.2; letter-spacing: .04em; text-indent: .06em;
}
.tagline { margin: 10px auto 0; max-width: 34ch; font-family: "Iowan Old Style", Georgia, serif; font-style: italic; font-size: 17px; line-height: 1.5; }
.composer {
  color: var(--ink); padding: 25px 26px 24px; border: 1px solid rgba(249,237,218,.16); border-radius: 9px;
  background: linear-gradient(160deg, rgba(15,38,37,.68), rgba(56,28,23,.62)); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.09);
  transform: rotate(.15deg); animation: rise .9s .28s both; position: relative;
}
.composer::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(230,166,83,.14); border-radius: 5px; pointer-events: none; }
.composer-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 15px; border-bottom: 1px solid rgba(249,237,218,.14); }
h2 { margin: 0; font: 700 30px/1 "Iowan Old Style", Georgia, serif; letter-spacing: -.03em; }
.price { padding: 5px 9px; border: 1px solid rgba(249,237,218,.24); border-radius: 20px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.peek { margin-top: 17px; animation: rise .5s both; }
.peek-toggle {
  width: 100%; display: grid; gap: 1px; padding: 9px 12px; border: 1px dashed rgba(230,166,83,.4); border-radius: 6px;
  color: var(--muted); background: transparent; cursor: pointer; text-align: left;
  transition: border-color .2s, color .2s, background .2s;
}
.peek-toggle strong { font: 700 13px/1.3 "Iowan Old Style", Georgia, serif; color: #e6a653; }
.peek-toggle small { font-size: 10px; font-style: italic; letter-spacing: .03em; opacity: .85; }
.peek-toggle:hover { border-color: #e6a653; color: var(--ink); background: rgba(230,166,83,.08); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.field-row .field { margin-top: 17px; }
select {
  width: 100%; height: 43px; padding: 0 10px; border: 1px solid rgba(249,237,218,.2); border-radius: 4px; outline: 0;
  color: var(--ink); background: rgba(8,24,23,.45); cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #e6a653 50%), linear-gradient(135deg, #e6a653 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat;
}
select:focus { border-color: #e6a653; box-shadow: 0 0 0 3px rgba(230,166,83,.14); }
select option { color: #2f2720; background: #f2e3c2; }
/* Something to read, nothing to operate. */
.lyric-reveal {
  margin-top: 9px; padding: 14px 16px; border-left: 1px solid rgba(230,166,83,.5); border-radius: 0 5px 5px 0;
  background: linear-gradient(90deg, rgba(230,166,83,.09), transparent);
  animation: rise .5s both;
}
.reveal-language { display: block; margin-bottom: 7px; color: #dfc39a; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.reveal-lines {
  margin: 0; max-height: 190px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(230,166,83,.4) transparent;
  color: var(--ink); font: italic 15px/1.72 "Iowan Old Style", Georgia, serif; white-space: pre-wrap;
}
.reveal-lines::-webkit-scrollbar { width: 4px; }
.reveal-lines::-webkit-scrollbar-thumb { border-radius: 2px; background: rgba(230,166,83,.4); }
.cost-hint { margin: 9px 0 0; color: #b39a7f; font-size: 10px; text-align: center; }
.field { display: block; margin-top: 17px; }
.field > span { display: flex; justify-content: space-between; margin-bottom: 6px; color: #dfc39a; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.field em { color: #b99f83; font-style: normal; font-weight: 600; letter-spacing: .04em; text-transform: lowercase; }
input {
  width: 100%; height: 43px; padding: 0 12px; border: 1px solid rgba(249,237,218,.2); border-radius: 4px; outline: 0;
  color: var(--ink); background: rgba(8,24,23,.45); box-shadow: inset 0 1px 3px rgba(0,0,0,.2);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
input:focus { border-color: #e6a653; background: rgba(8,24,23,.68); box-shadow: 0 0 0 3px rgba(230,166,83,.14); }
input::placeholder { color: #b3a08a; opacity: 1; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 62px; letter-spacing: .08em; }
.reveal { position: absolute; right: 5px; top: 5px; height: 33px; padding: 0 8px; border: 0; color: #e6a653; background: transparent; font-size: 10px; font-weight: 800; text-transform: uppercase; cursor: pointer; }
.field small { display: block; margin-top: 5px; color: #b39a7f; font-size: 10px; }
.notice { min-height: 18px; margin: 10px 0 3px; color: #ff9d8a; font-size: 11px; font-weight: 650; }
.notice.working { color: #8fd0b0; }
.generate {
  width: 100%; height: 49px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 3px;
  color: #fff8ec; background: #a83d34; box-shadow: 0 5px 0 #723029, 0 12px 24px rgba(112,43,34,.2); cursor: pointer; font-weight: 750; transition: transform .15s, background .15s, box-shadow .15s;
}
.generate:hover { background: #b8463b; transform: translateY(-1px); box-shadow: 0 6px 0 #723029, 0 14px 25px rgba(112,43,34,.24); }
.generate:active { transform: translateY(4px); box-shadow: 0 1px 0 #723029; }
.generate:disabled { cursor: wait; filter: saturate(.45); }
.arrow { font-size: 20px; }
.player-shell {
  position: fixed; z-index: 5; bottom: 25px; min-height: 88px;
  left: calc((100vw - min(1180px, 100vw - 44px)) / 2);
  width: min(680px, calc(min(1180px, 100vw - 44px) - 492px));
  display: grid; grid-template-columns: 72px 1fr 55px 48px 48px 54px; align-items: center; gap: 9px; padding: 10px 15px 10px 10px; border: 1px solid rgba(255,255,255,.2); border-radius: 52px;
  background: rgba(122,54,45,.93); box-shadow: 0 20px 55px rgba(8,19,18,.42), inset 0 1px rgba(255,255,255,.15); backdrop-filter: blur(12px);
  animation: player-up .85s .5s both;
}
.player-shell:has(.performance-entry[hidden]) { grid-template-columns: 72px 1fr 55px 48px 54px; }
.record { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: repeating-radial-gradient(circle, #202322 0 3px, #101313 4px 6px); box-shadow: 0 4px 14px rgba(0,0,0,.35); }
.record-label { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #e6a653; color: #67362e; font: 800 14px Georgia, serif; }
.player-shell.playing .record { animation: spin 4s linear infinite; }
.track { min-width: 0; }
.track strong, .track > span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track strong { font: 600 14px/1.3 "Iowan Old Style", Georgia, serif; }
.track > span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.timeline { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; margin-top: 9px; }
#seek { appearance: none; height: 3px; padding: 0; border: 0; border-radius: 2px; background: rgba(255,255,255,.26); box-shadow: none; cursor: pointer; }
#seek::-webkit-slider-thumb { appearance: none; width: 9px; height: 9px; border-radius: 50%; background: white; opacity: 0; transition: opacity .2s; }
.player-shell:hover #seek::-webkit-slider-thumb { opacity: 1; }
#timecode { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.play { width: 49px; height: 49px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #29322e; background: #fffaf0; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,.18); }
.play:disabled { opacity: .45; cursor: default; }
.player-icon { width: 20px; height: 20px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.play .player-icon { width: 19px; height: 19px; }
.play .play-icon { fill: currentColor; stroke: none; transform: translateX(1px); }
.play .pause-icon { display: none; }
.player-shell.playing .play-icon { display: none; }
.player-shell.playing .pause-icon { display: block; }
.player-action, .share, .download { width: 44px; height: 45px; display: grid; grid-template-rows: 22px 10px; row-gap: 2px; align-content: center; justify-items: center; border: 0; color: var(--ink); background: transparent; cursor: pointer; }
.player-action svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.player-action span, .share span, .download span { margin: 0; font-size: 8px; line-height: 1; text-transform: uppercase; letter-spacing: .08em; }
.player-action:hover { color: #fff; }
.player-action[hidden] { display: none; }
.share:disabled { opacity: .35; cursor: default; }
.download { width: 42px; text-decoration: none; opacity: 1; }
.download[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.performance {
  position: fixed; z-index: 4; inset: 0; display: grid; place-items: center; padding: 74px 24px 132px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 47%, transparent 12%, rgba(5,20,19,.13) 62%, rgba(4,15,15,.46) 110%);
  animation: performance-in .55s ease-out both;
}
.performance[hidden] { display: none; }
.performance::after {
  content: ""; position: absolute; inset: auto 0 0; height: 42%; pointer-events: none;
  background: linear-gradient(0deg, rgba(5,17,16,.32), transparent);
}
.performance-close {
  position: absolute; z-index: 2; top: 22px; right: 26px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid rgba(249,237,218,.35); border-radius: 50%; color: var(--ink); background: rgba(11,34,32,.42); backdrop-filter: blur(8px); cursor: pointer;
}
.performance-close:hover { color: #fff; border-color: #e6a653; background: rgba(11,34,32,.72); }
.performance-close svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.performance-content { position: relative; z-index: 1; width: min(720px, 100%); text-align: center; text-shadow: 0 3px 20px rgba(0,0,0,.8); }
.performance-status {
  min-height: 1.5em; color: #fff3de; font: italic clamp(23px, 4vw, 40px)/1.35 "Iowan Old Style", Georgia, serif;
  text-wrap: balance; animation: rise .5s both;
}
.performance-status::after { content: ""; display: block; width: 42px; height: 1px; margin: 18px auto 0; background: #e6a653; box-shadow: 0 0 14px rgba(230,166,83,.5); }
.performance .peek { width: min(360px, 100%); margin: 24px auto 0; }
.performance .peek-toggle { background: rgba(10,32,30,.48); backdrop-filter: blur(8px); text-shadow: 0 2px 12px #000; }
.performance .lyric-reveal {
  position: relative; margin: 0 auto; padding: 25px 34px 28px; border-block: 1px solid rgba(230,166,83,.34); border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(7,27,25,.74) 12%, rgba(35,25,21,.72) 50%, rgba(7,27,25,.74) 88%, transparent);
  box-shadow: 0 25px 55px rgba(4,15,14,.2); backdrop-filter: blur(9px); text-align: left;
}
.performance .reveal-language { color: #e9c27f; text-align: center; }
.performance-timing { display: block; margin: 4px 0 14px; color: #cfbda8; font-size: 10px; font-style: italic; letter-spacing: .03em; text-align: center; }
.performance-timing[hidden] { display: none; }
.performance .reveal-lines { max-height: max(140px, min(52svh, 430px, calc(100svh - 340px))); font-size: clamp(18px, 2.3vw, 25px); line-height: 1.55; text-align: center; }
.lyric-line { display: block; color: rgba(249,237,218,.78); transition: color .35s, text-shadow .35s, transform .35s; }
.lyric-line[hidden] { display: none; }
.lyric-line + .lyric-line { margin-top: .2em; }
.lyric-line:not([hidden]) { animation: lyric-arrive .5s cubic-bezier(.16,1,.3,1) both; }
.lyric-line.lyric-cue { margin-block: .95em .4em; color: #e6a653; font: 800 10px/1.2 "Avenir Next", "Gill Sans", sans-serif; letter-spacing: .16em; text-transform: uppercase; }
.lyric-primary { display: block; color: #fff8ec; }
.lyric-secondary { display: block; margin-top: .1em; color: #d8c3aa; font-size: .68em; line-height: 1.35; }
.performance-replay {
  margin-top: 22px; padding: 11px 19px; display: inline-flex; align-items: center; gap: 9px; border: 1px solid rgba(249,237,218,.5); border-radius: 24px;
  color: var(--ink); background: rgba(11,34,32,.68); backdrop-filter: blur(8px); cursor: pointer; font: 700 15px/1.2 "Iowan Old Style", Georgia, serif;
}
.performance-replay[hidden] { display: none; }
.performance-replay svg { width: 18px; fill: none; stroke: #e6a653; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.performance-replay:hover { border-color: #e6a653; background: rgba(65,39,29,.78); }
.performance[data-stage="playing"] .performance-status { display: none; }
.performance-open main, .performance-open .topbar { opacity: 0; pointer-events: none; transition: opacity .35s; }
.performance-open .scene { transform: scale(1.018); }
.media-diagnostics-open {
  position: fixed; z-index: 20; top: 76px; right: 14px; padding: 7px 10px; border: 1px solid #f0bf64; border-radius: 999px;
  color: #17120b; background: #f0bf64; box-shadow: 0 6px 20px rgba(0,0,0,.3); cursor: pointer; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase;
}
.media-diagnostics {
  position: fixed; z-index: 1000; inset: 0; padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  overflow: auto; color: #f7f1e7; background: rgba(5,10,10,.96); font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.media-diagnostics[hidden] { display: none; }
.media-diagnostics-sheet { width: min(840px, 100%); margin: 0 auto; }
.media-diagnostics-kicker { margin: 0 0 8px; color: #f0bf64; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.media-diagnostics h2 { color: #fff; font: 800 clamp(25px, 6vw, 42px)/1.1 "Avenir Next", sans-serif; letter-spacing: -.03em; }
.media-diagnostics-headline { margin: 14px 0 0; padding: 12px; border: 1px solid #7a6a50; border-radius: 6px; color: #f8dda8; background: #211d16; font: 700 14px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.media-diagnostics.is-fatal .media-diagnostics-headline { border-color: #ff725e; color: #fff; background: #481a16; }
.media-diagnostics-help { color: #c9c0b3; font-size: 12px; line-height: 1.5; }
.media-diagnostics-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.media-diagnostics-actions button { min-height: 42px; padding: 8px 12px; border: 1px solid #907f65; border-radius: 5px; color: #fff; background: #29251f; cursor: pointer; font-size: 12px; font-weight: 750; }
.media-diagnostics-actions button:first-child { border-color: #f0bf64; color: #21170a; background: #f0bf64; }
.media-diagnostics pre { margin: 0; padding: 14px; max-height: 58svh; overflow: auto; border: 1px solid #403b34; border-radius: 6px; color: #d6e4dc; background: #0b1110; font-size: 10px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
/* While a song is being written or played, the courtyard lamps breathe. */
.scene.is-performing svg { animation: settle 1.4s cubic-bezier(.2,.75,.2,1) both, breathe 3.6s 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { filter: brightness(1.11) saturate(1.06); } }
@keyframes settle { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: scale(1.015); } }
@keyframes fade-down { from { opacity: 0; transform: translateY(-10px); } }
@keyframes rise { from { opacity: 0; transform: translateY(25px); } }
@keyframes player-up { from { opacity: 0; transform: translateY(30px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; transform: scale(.85); } }
@keyframes performance-in { from { opacity: 0; } }
@keyframes lyric-arrive { from { opacity: 0; filter: blur(3px); transform: translateY(7px); } }
@media (max-width: 900px) {
  body { overflow-y: auto; }
  main { grid-template-columns: 1fr; gap: 16px; margin-top: 0; margin-bottom: 145px; }
  .identity { transform: none; }
  h1 { font-size: clamp(76px, 22vw, 132px); }
  .tagline { margin-top: 6px; }
  .composer { width: min(520px, 100%); margin: 0 auto; }
  .player-shell { left: 16px; right: 16px; width: auto; max-width: 720px; margin-inline: auto; }
}
@media (max-width: 560px) {
  .topbar { height: 58px; padding: 0 16px; }
  .topbar a { font-size: 0; }
  .topbar a span { font-size: 14px; }
  main { width: calc(100% - 24px); margin-bottom: 130px; }
  .identity { margin-top: 5px; }
  .tagline { font-size: 14px; }
  .composer { padding: 20px 18px; }
  .composer h2 { font-size: 26px; }
  .field-row, .modes { grid-template-columns: 1fr; }
  .player-shell { bottom: 12px; min-height: 72px; grid-template-columns: 52px 1fr 43px 43px 43px 43px; gap: 8px; padding: 8px 12px 8px 8px; }
  .player-shell:has(.performance-entry[hidden]) { grid-template-columns: 52px 1fr 43px 43px 43px; }
  .record { width: 50px; height: 50px; }
  .record-label { width: 22px; height: 22px; font-size: 11px; }
  .play { width: 41px; height: 41px; }
  .download { width: 40px; }
  #timecode { display: none; }
  .timeline { grid-template-columns: 1fr; }
  .performance { padding: 64px 14px 100px; align-items: center; }
  .performance-close { top: 12px; right: 12px; }
  .performance .lyric-reveal { padding: 18px 14px; }
  .performance .reveal-lines { max-height: max(140px, min(55svh, calc(100svh - 330px))); font-size: 18px; line-height: 1.55; }
}
@media (max-height: 500px) {
  /* Landscape phones: shrink the sheet's chrome so the lyrics and the replay
     button stay clear of the fixed player bar instead of sliding beneath it. */
  .performance { padding: 46px 20px 92px; }
  .performance-status { font-size: clamp(18px, 3vh, 26px); }
  .performance-status::after { margin-top: 10px; }
  .performance .peek { margin-top: 12px; }
  .performance .lyric-reveal { padding: 14px 22px 16px; }
  .performance-timing { margin: 2px 0 8px; }
  .performance .reveal-lines { max-height: max(88px, calc(100svh - 302px)); }
  .performance-replay { margin-top: 12px; padding: 8px 16px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
