:root {
  color-scheme: dark;
  --bg: #120c0b;
  --bg2: #1b1110;
  --panel: rgba(34, 23, 22, .78);
  --panel2: rgba(17, 12, 13, .82);
  --line: rgba(232, 177, 91, .22);
  --line-strong: rgba(252, 165, 86, .45);
  --cream: #fff4dc;
  --text: #f5e9d5;
  --muted: #bcae9a;
  --brass: #e8b15b;
  --amber: #ffcf78;
  --rose: #ff8e74;
  --copper: #bf6f3d;
  --red: #ff6b66;
  --green: #8de6b3;
  --shadow: 0 22px 70px rgba(0, 0, 0, .42);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 142, 116, .18), transparent 34rem),
    radial-gradient(circle at 88% 14%, rgba(232, 177, 91, .16), transparent 31rem),
    linear-gradient(145deg, #120c0b 0%, #160f11 45%, #0b0a0d 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}
a { color: var(--amber); }
.aurora { position: fixed; inset: auto; pointer-events: none; z-index: -1; filter: blur(14px); opacity: .72; }
.aurora.a1 { width: 36vw; height: 36vw; left: -12vw; top: 12vh; border-radius: 999px; background: radial-gradient(circle, rgba(255, 142, 116, .2), transparent 68%); animation: drift 18s ease-in-out infinite alternate; }
.aurora.a2 { width: 42vw; height: 42vw; right: -14vw; top: 3vh; border-radius: 999px; background: radial-gradient(circle, rgba(232, 177, 91, .18), transparent 70%); animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(5vw,4vh,0) scale(1.12); } }

header {
  position: sticky; top: 0; z-index: 10;
  display: flex; gap: .75rem; align-items: center;
  padding: calc(env(safe-area-inset-top, 0) + .85rem) clamp(1rem, 3vw, 1.6rem) .85rem;
  background: rgba(18, 12, 11, .78);
  border-bottom: 1px solid rgba(232, 177, 91, .18);
  backdrop-filter: blur(18px);
}
.brand { font-size: 1.45rem; font-weight: 900; color: var(--cream); text-decoration: none; letter-spacing: -.04em; }
.brand span { color: var(--brass); }
.live-dot { color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .28rem .6rem; font: 11px ui-monospace, Menlo, monospace; }
.live-dot::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px var(--green); margin-right: .45rem; vertical-align: 0; }
.back { margin-left: auto; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font: 12px ui-monospace, monospace; color: var(--muted); text-decoration: none; background: rgba(255,255,255,.03); }
.back:hover { color: var(--cream); border-color: var(--line-strong); }

.media-stage { max-width: 1180px; margin: 0 auto; padding: 1rem clamp(1rem, 3vw, 1.4rem) calc(env(safe-area-inset-bottom, 0) + 5rem); }
.media-hero {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr); gap: 1rem;
  margin: .5rem 0 1rem;
  border: 1px solid rgba(232, 177, 91, .22);
  background:
    linear-gradient(120deg, rgba(255, 142, 116, .12), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(255, 207, 120, .18), transparent 38%),
    rgba(27, 17, 16, .72);
  border-radius: 26px;
  padding: clamp(1rem, 3vw, 1.45rem);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.media-hero::after { content: ''; position: absolute; inset: auto -10% -30% 25%; height: 55%; background: radial-gradient(ellipse, rgba(232,177,91,.16), transparent 70%); pointer-events: none; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { display: inline-flex; color: var(--amber); border: 1px solid rgba(255, 207, 120, .26); background: rgba(255, 207, 120, .08); border-radius: 999px; padding: .32rem .65rem; font: 700 11px ui-monospace, Menlo, monospace; text-transform: uppercase; letter-spacing: .08em; }
h1 { margin: .8rem 0 .45rem; color: var(--cream); font-size: clamp(2rem, 5vw, 4.1rem); line-height: .94; letter-spacing: -.075em; max-width: 760px; }
.hero-copy p { max-width: 660px; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.15rem); line-height: 1.55; margin: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.2rem; }
.hero-btn { min-height: 44px; border-radius: 999px; padding: .7rem 1rem; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text); cursor: pointer; font-weight: 800; box-shadow: none; }
.hero-btn.primary { background: linear-gradient(135deg, var(--amber), var(--rose)); color: #1a0e08; border-color: transparent; box-shadow: 0 12px 40px rgba(255, 142, 116, .22); }
.hero-btn:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.hero-board { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; align-self: stretch; }
.hero-card { min-height: 132px; border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: .9rem; background: rgba(15, 10, 11, .62); box-shadow: inset 0 1px 0 rgba(255,255,255,.05); display: flex; flex-direction: column; justify-content: flex-end; gap: .18rem; }
.hero-card.hot { background: linear-gradient(145deg, rgba(255, 207, 120, .18), rgba(255, 142, 116, .1)); border-color: rgba(255, 207, 120, .32); }
.hero-card span { font: 900 clamp(2rem, 5vw, 3.2rem)/1 ui-sans-serif, system-ui; color: var(--cream); letter-spacing: -.06em; }
.hero-card b { color: var(--cream); font-size: .95rem; }
.hero-card small { color: var(--muted); font: 11px/1.35 ui-monospace, Menlo, monospace; }

h2 { font-size: .82rem; color: var(--amber); text-transform: uppercase; letter-spacing: .09em; margin: 0 0 .75rem; }
.meta { color: var(--muted); font-size: 13px; line-height: 1.5; }
.empty { color: #8e806f; padding: 1rem; }
.ok { color: var(--green); } .fail { color: #ff9d8d; }

.tabs { display: flex; gap: .5rem; overflow-x: auto; margin-bottom: 1rem; position: sticky; top: calc(env(safe-area-inset-top, 0) + 56px); z-index: 9; background: linear-gradient(180deg, rgba(18,12,11,.95), rgba(18,12,11,.82)); padding: .45rem 0; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; appearance: none; min-height: 40px; padding: .56rem .95rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(20, 13, 14, .84); font: 800 13px ui-sans-serif, system-ui; cursor: pointer; white-space: nowrap; transition: transform .15s, color .15s, border-color .15s, background .15s; }
.tab:hover { color: var(--cream); border-color: var(--line-strong); transform: translateY(-1px); }
.tab.on { color: #1a0e08; background: linear-gradient(135deg, var(--amber), var(--rose)); border-color: transparent; box-shadow: 0 10px 30px rgba(255, 142, 116, .18); }
.tab .cnt { display: inline-block; min-width: 18px; text-align: center; font: 800 11px ui-monospace, monospace; opacity: .78; margin-left: 4px; }
.pane[hidden] { display: none; }

.panel { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 14px 42px rgba(0,0,0,.22); backdrop-filter: blur(14px); }
.upload { display: grid; grid-template-columns: 1fr auto; gap: .7rem; align-items: end; }
@media (max-width: 760px) { .media-hero { grid-template-columns: 1fr; } .hero-board { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .upload { grid-template-columns: 1fr; } .hero-board { grid-template-columns: 1fr; } .live-dot { display: none; } }
input, button { font: inherit; }
input[type=file] { width: 100%; border: 1px dashed rgba(232,177,91,.35); border-radius: 12px; padding: .85rem; background: rgba(9, 7, 8, .62); color: var(--muted); }
button { min-height: 40px; border: 1px solid rgba(232,177,91,.32); background: rgba(232,177,91,.08); color: var(--amber); border-radius: 10px; padding: .55rem .8rem; cursor: pointer; transition: color .15s, border-color .15s, transform .15s; }
button:hover { color: var(--cream); border-color: var(--line-strong); transform: translateY(-1px); }

.grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
@media (min-width: 760px) { .grid { grid-template-columns: 1fr 1fr; } }
.group { margin-top: 1rem; } .group:first-child { margin-top: 0; }
.group-title { font-size: .78rem; color: var(--cream); text-transform: uppercase; letter-spacing: .08em; margin: .2rem 0 .65rem; }
.cue, .imgcard, .vidcard, .voicecard, .prodcard { border: 1px solid rgba(232,177,91,.18); background: var(--panel2); border-radius: 15px; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.cue { padding: .85rem; }
.cue-head { display: flex; gap: .5rem; align-items: baseline; margin-bottom: .45rem; }
.cue b { color: var(--cream); }
.id { font: 10px ui-monospace, Menlo, monospace; color: #8e806f; text-transform: uppercase; }
.pill { display: inline-block; font: 10px ui-monospace, Menlo, monospace; color: var(--amber); border: 1px solid rgba(232,177,91,.25); background: rgba(232,177,91,.08); border-radius: 999px; padding: .16rem .45rem; margin: .1rem .18rem .45rem 0; }
audio { width: 100%; margin-top: .45rem; }
.prompt { font: 12px/1.45 ui-monospace, Menlo, monospace; color: var(--muted); background: rgba(9,7,8,.7); border: 1px solid rgba(232,177,91,.16); border-radius: 10px; padding: .65rem; margin-top: .6rem; word-break: break-all; }

.imggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .7rem; }
.imgcard { position: relative; padding: .55rem; display: flex; flex-direction: column; gap: .45rem; transition: transform .16s, border-color .16s; }
.imgcard:hover, .vidcard:hover, .prodcard:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.imgcard img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 11px; background: #09090b; cursor: zoom-in; }
.imgcard .iname, .vidcard .vname { font: 11px/1.35 ui-monospace, Menlo, monospace; color: var(--muted); word-break: break-all; }
.imgcard .isize, .vidcard .vmeta, .prodact { font: 10px ui-monospace, Menlo, monospace; color: #8e806f; }
.imgcard .iact, .prodact { display: flex; gap: .4rem; justify-content: space-between; align-items: center; }
.imgcard .iact a, .vidcard .vmeta a, .prodact a { color: var(--muted); text-decoration: none; border: 1px solid rgba(232,177,91,.18); padding: .2rem .48rem; border-radius: 999px; background: rgba(255,255,255,.03); }
.imgcard .iact a:hover, .vidcard .vmeta a:hover, .prodact a:hover { color: var(--cream); border-color: var(--line-strong); }
.imgcard .idel { cursor: pointer; background: none; border: 1px solid rgba(255,107,102,.3); color: #ff9d8d; font: 10px ui-monospace, Menlo, monospace; padding: .2rem .48rem; border-radius: 999px; min-height: auto; }
.imgcard .idel:hover { background: rgba(255,107,102,.14); }
.seqbadge { position: absolute; top: 10px; left: 10px; background: linear-gradient(135deg, var(--rose), var(--copper)); color: #fff; font: 800 13px/1 ui-monospace, Menlo, monospace; padding: .34rem .52rem; border-radius: 8px; z-index: 2; pointer-events: none; letter-spacing: .04em; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

.vidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.vidcard { padding: .6rem; display: flex; flex-direction: column; gap: .45rem; transition: transform .16s, border-color .16s; }
.vidcard video { width: 100%; aspect-ratio: 16/9; background: #09090b; border-radius: 12px; cursor: pointer; }
.vidcard .vmeta { display: flex; justify-content: space-between; gap: .45rem; }
.vidcard .src { font: 10px ui-monospace, Menlo, monospace; color: var(--amber); }

.prodgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: .8rem; }
.prodcard { padding: .9rem; display: flex; flex-direction: column; gap: .65rem; transition: transform .16s, border-color .16s; background: linear-gradient(145deg, rgba(255, 207, 120, .11), rgba(17, 12, 13, .86)); }
.prodcard:first-child, .prodcard:nth-child(2) { border-color: rgba(255,207,120,.42); box-shadow: 0 18px 50px rgba(255, 142, 116, .08), inset 0 1px 0 rgba(255,255,255,.06); }
.prodhead { display: flex; align-items: flex-start; gap: .58rem; }
.prodhead b { color: var(--cream); line-height: 1.18; font-size: 1rem; }
.prodkind { flex: 0 0 auto; font: 800 10px ui-monospace, Menlo, monospace; color: #1a0e08; background: linear-gradient(135deg, var(--amber), var(--rose)); border-radius: 999px; padding: .24rem .5rem; text-transform: uppercase; }
.prodmeta { color: #ddccb5; font: 12px/1.4 ui-monospace, Menlo, monospace; }
.prodstatus { color: var(--amber); font: 11px/1.35 ui-monospace, Menlo, monospace; word-break: break-word; }
.prodact { margin-top: auto; }

.voicegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.voicecard { padding: .85rem; display: flex; flex-direction: column; gap: .5rem; }
.voicecard b { color: var(--cream); font-size: 1rem; }
.voicecard .vtags { display: flex; flex-wrap: wrap; gap: .25rem; }
.voicecard .vid { font: 10px ui-monospace, Menlo, monospace; color: #7a6e61; word-break: break-all; }

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