/* PlayerShare — modern dark UI system */
:root {
  --bg: #070a12;
  --bg-2: #0b0f1a;
  --surface: #111726;
  --surface-2: #161d2f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eaf0ff;
  --muted: #9aa6c2;
  --faint: #6b7793;
  --brand: #7c5cff;
  --brand-2: #29e0c9;
  --brand-3: #ff5ca8;
  --good: #2fd27a;
  --warn: #ffb020;
  --bad: #ff5d6c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --glow: 0 0 50px rgba(124, 92, 255, 0.35);
  --content: 1180px;
  --grad: linear-gradient(120deg, var(--brand) 0%, var(--brand-3) 55%, var(--brand-2) 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 600px at -10% 10%, rgba(41, 224, 201, 0.12), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }

.container { width: min(100% - 40px, var(--content)); margin-inline: auto; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(7, 10, 18, 0.7);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: min(100% - 40px, var(--content)); margin-inline: auto;
  display: flex; align-items: center; gap: 24px; height: 68px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad);
  box-shadow: var(--glow);
}
.brand-name { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.03em; }
.brand-name strong { color: var(--brand-2); }
.nav-links { display: flex; gap: 22px; margin-left: 12px; }
.nav-links a { color: var(--muted); font-size: .95rem; font-weight: 500; transition: color .15s; }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: .95rem;
  cursor: pointer; border: 1px solid transparent; transition: transform .12s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); color: #0a0a12; box-shadow: 0 8px 30px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { box-shadow: 0 12px 40px rgba(124, 92, 255, 0.5); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-danger { background: rgba(255, 93, 108, 0.12); border-color: rgba(255, 93, 108, 0.4); color: #ffb3ba; }
.btn-danger:hover { background: rgba(255, 93, 108, 0.2); }

/* ---------- Flash ---------- */
.flash {
  width: min(100% - 40px, var(--content)); margin: 16px auto 0;
  padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500;
  border: 1px solid var(--border-strong);
}
.flash-error { background: rgba(255, 93, 108, 0.12); border-color: rgba(255, 93, 108, 0.4); }
.flash-success { background: rgba(47, 210, 122, 0.12); border-color: rgba(47, 210, 122, 0.4); }
.flash-info { background: rgba(124, 92, 255, 0.12); border-color: rgba(124, 92, 255, 0.4); }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 60px; position: relative; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  background: rgba(124, 92, 255, 0.12); border: 1px solid rgba(124, 92, 255, 0.3); color: #c8bcff;
  margin-bottom: 20px;
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 700; }
.hero h1 .grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.2rem; color: var(--muted); max-width: 38ch; }
.hero-cta { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-trust { margin-top: 26px; color: var(--faint); font-size: .9rem; display: flex; gap: 22px; flex-wrap: wrap; }
.hero-trust b { color: var(--text); }

.hero-art {
  position: relative; border-radius: 22px; padding: 14px;
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.25), rgba(41, 224, 201, 0.12));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.hero-window { border-radius: 14px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--border); }
.hero-window-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.hero-window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a3350; }
.hero-window-body { padding: 22px; }
.hero-fake-client {
  aspect-ratio: 765 / 503; border-radius: 10px;
  background:
    radial-gradient(400px 200px at 30% 20%, rgba(124,92,255,.3), transparent),
    radial-gradient(300px 200px at 80% 90%, rgba(41,224,201,.25), transparent),
    #0a0e1a;
  display: grid; place-items: center; color: var(--faint); font-weight: 600;
  border: 1px solid var(--border);
}

/* ---------- Sections ---------- */
.section { padding: 70px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 46px; }
.section-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-icon {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(124, 92, 255, 0.14); border: 1px solid rgba(124, 92, 255, 0.3);
  font-size: 1.4rem; margin-bottom: 16px;
}
.card h3 { font-size: 1.2rem; }
.card p { color: var(--muted); margin: 0; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; position: relative; }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--grad); color: #0a0a12; font-weight: 800; margin-bottom: 14px;
}
.step h3 { font-size: 1.05rem; }
.step p { color: var(--muted); font-size: .95rem; margin: 0; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.stat { text-align: center; padding: 30px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat b { display: block; font-size: 2.4rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--muted); }

/* CTA */
.cta {
  text-align: center; padding: 56px 30px; border-radius: 24px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), rgba(255, 92, 168, 0.12), rgba(41, 224, 201, 0.16));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.cta h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.cta p { color: var(--muted); font-size: 1.1rem; max-width: 46ch; margin-inline: auto; }

/* ---------- Auth / forms ---------- */
.auth-wrap { max-width: 460px; margin: 60px auto; padding: 0 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 30px; box-shadow: var(--shadow); }
.panel-lg { max-width: 760px; }
.panel h1 { font-size: 1.7rem; }
.panel .sub { color: var(--muted); margin-top: -.4em; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field .hint { color: var(--faint); font-size: .82rem; font-weight: 400; }
.input, .textarea, select.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25);
}
.textarea { min-height: 120px; resize: vertical; }
.file {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 16px;
  background: var(--bg-2); width: 100%; color: var(--muted);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 16px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.role-opt { position: relative; }
.role-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.role-opt span {
  display: block; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.role-opt span b { display: block; }
.role-opt span small { color: var(--muted); }
.role-opt input:checked + span { border-color: var(--brand); background: rgba(124, 92, 255, 0.12); }

/* ---------- Dashboard / client grid ---------- */
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 40px 0 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 2rem; margin: 0; }
.page-head p { color: var(--muted); margin: 4px 0 0; }

.grid-clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; padding-bottom: 60px; }
.client-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s, border-color .18s, box-shadow .18s; display: flex; flex-direction: column;
}
.client-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.client-banner { aspect-ratio: 16 / 9; background: linear-gradient(135deg, #1a2138, #0c1120); object-fit: cover; width: 100%; }
.client-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.client-body h3 { font-size: 1.2rem; margin: 0; }
.client-body .desc { color: var(--muted); font-size: .94rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.client-meta { display: flex; gap: 12px; color: var(--faint); font-size: .85rem; margin-top: auto; }
.client-actions { display: flex; gap: 8px; padding: 0 18px 18px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-ready { background: rgba(47, 210, 122, 0.15); color: #8af0b8; }
.badge-processing { background: rgba(255, 176, 32, 0.15); color: #ffd486; }
.badge-failed { background: rgba(255, 93, 108, 0.15); color: #ffb3ba; }
.badge-disabled { background: rgba(154, 166, 194, 0.15); color: var(--muted); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.empty { text-align: center; padding: 70px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty h3 { color: var(--text); }

/* ---------- Client detail ---------- */
.detail-hero { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-top: 30px; }
.detail-hero img { width: 100%; max-height: 340px; object-fit: cover; }
.detail-hero .overlay {
  position: absolute; inset: 0; display: flex; align-items: end; padding: 28px;
  background: linear-gradient(0deg, rgba(7,10,18,.92), rgba(7,10,18,.2) 60%, transparent);
}
.detail-title h1 { font-size: 2.4rem; margin: 0; }
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 28px; padding: 30px 0 60px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; font-weight: 600; }

/* ---------- Play page ---------- */
.play-body { background: #05070d; }
.play-shell { width: min(100% - 24px, 1100px); margin: 24px auto; }
.play-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.play-bar h1 { font-size: 1.05rem; margin: 0; }
.play-bar .spacer { margin-left: auto; }
.play-stage {
  background: #02040a; border: 1px solid var(--border); border-top: 0;
  display: grid; place-items: center; min-height: 60vh; position: relative; overflow: hidden;
}
.cheerpj-display { width: 765px; height: 503px; max-width: 100%; }
.play-status {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center;
  color: var(--muted); padding: 30px;
}
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--brand); margin: 0 auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.play-status.is-error { color: #ffb3ba; }
.play-log {
  display: none; white-space: pre-wrap; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .8rem; color: #9fb0d0; background: #04060c; border: 1px solid var(--border); border-top: 0;
  max-height: 220px; overflow: auto; padding: 12px 16px; margin: 0;
}
.play-log.is-open { display: block; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 60px; background: rgba(0,0,0,.25); }
.footer-inner { width: min(100% - 40px, var(--content)); margin-inline: auto; display: grid; grid-template-columns: 1.4fr 2fr; gap: 40px; padding: 50px 0 30px; }
.footer-brand p { color: var(--muted); max-width: 36ch; margin-top: 10px; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h4 { font-size: .9rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.footer-cols a { display: block; color: var(--muted); padding: 4px 0; font-size: .95rem; }
.footer-cols a:hover { color: var(--text); }
.footer-base { text-align: center; color: var(--faint); padding: 20px; border-top: 1px solid var(--border); font-size: .9rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .features, .stats { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
  .role-pick { grid-template-columns: 1fr; }
}
