:root {
  --bg: #060b14;
  --bg-soft: #0d1320;
  --panel: rgba(12, 17, 27, 0.82);
  --panel-strong: rgba(17, 23, 35, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #edf6ff;
  --muted: rgba(237, 246, 255, 0.74);
  --accent: #ff6b8b;
  --accent-2: #ffd166;
  --accent-3: #5eead4;
  --accent-4: #8aa6ff;
  --glass: rgba(10, 14, 24, 0.7);
  --good: rgba(94, 234, 212, 0.12);
  --bad: rgba(255, 107, 139, 0.08);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 18px 48px rgba(12, 16, 27, 0.6);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 107, 139, 0.18), transparent 18%),
    radial-gradient(circle at 85% 12%, rgba(90, 128, 255, 0.18), transparent 25%),
    radial-gradient(circle at 50% 100%, rgba(94, 234, 212, 0.12), transparent 30%),
    linear-gradient(180deg, #040812 0%, #0a101b 30%, #0d1422 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.025), rgba(255,255,255,0.01)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 2px,
      rgba(255,255,255,0.015) 2px,
      rgba(255,255,255,0.015) 3px
    );
}

img,
video {
  display: block;
  max-width: 100%;
}

button,
a,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar,
.page-shell,
.auth-modal {
  position: relative;
  z-index: 2;
}

.topbar {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-mark {
  width: 2.45rem;
  height: 2.45rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #120812;
  font-size: 1.05rem;
  font-weight: 900;
  box-shadow: 0 14px 22px rgba(255, 107, 139, 0.42);
}

.brand-text {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  letter-spacing: 0.16em;
  text-transform: lowercase;
  font-weight: 900;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-toggle {
  display: inline-flex;
  padding: 0.35rem;
  gap: 0.35rem;
  border-radius: 999px;
  background: rgba(12, 18, 29, 0.74);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.lang-btn,
.ghost-btn,
.logout-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #140d12;
  box-shadow: 0 12px 26px rgba(255, 209, 102, 0.18);
}

.ghost-btn,
.logout-btn {
  background: rgba(255,255,255,0.02);
  border-color: var(--line);
}

.brand-admin-trigger {
  display: inline-block;
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
  padding: 0 0.06em;
}

.brand-admin-trigger:hover,
.brand-admin-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.lang-btn:hover,
.ghost-btn:hover,
.logout-btn:hover,
.lang-btn:focus-visible,
.ghost-btn:focus-visible,
.logout-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 12px 24px rgba(94, 234, 212, 0.12);
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.75rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 22, 33, 0.9), rgba(10, 14, 22, 0.9));
  border: 1px solid var(--line);
  border-radius: 28px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.2rem;
  padding: 1rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.9rem 0.5rem 0.9rem 0.4rem;
}

.eyebrow,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 0.5rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(138, 166, 255, 0.08);
  color: #dfe9ff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.62rem;
  font-weight: 800;
}

.hero-copy h1 {
  margin: 1rem 0 0.85rem;
  font-size: clamp(3.3rem, 5vw, 6.2rem);
  letter-spacing: -0.08em;
  line-height: 0.88;
}

.lead {
  margin: 0;
  max-width: 60ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.08rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.08rem;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.button:hover,
.button:focus-visible,
.qr-card:hover,
.qr-card:focus-visible,
.quick-link:hover,
.quick-link:focus-visible,
.record:hover,
.record:focus-within {
  transform: translateY(-2px);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #120d13;
  box-shadow: 0 18px 36px rgba(255, 107, 139, 0.2);
}

.button.soft {
  background: rgba(255,255,255,0.025);
  border-color: var(--line);
  color: var(--text);
}

.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-weight: 700;
}

.hero-art {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(160deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    rgba(9, 14, 22, 0.7);
}

.hero-art video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.08) brightness(0.82);
}

.art-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(10, 14, 24, 0.74);
  color: #edf6ff;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.floating-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10, 14, 24, 0.7);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.pulse-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.7);
  animation: pulse 2s infinite;
}

.stats-grid,
.story-grid,
.qr-grid,
.quick-grid {
  display: grid;
  gap: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
  justify-content: center;
}

.stat-card span {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-card strong {
  font-size: clamp(1.3rem, 2vw, 2rem);
  letter-spacing: -0.05em;
}

.story-grid {
  grid-template-columns: 1.2fr 0.8fr;
}

.info-card,
.bio-card,
.story-panel,
.qr-panel,
.quick-panel,
.player-panel,
.logs-panel {
  padding: 1rem;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.panel-head h2,
.player-meta h3 {
  margin: 0;
  font-size: clamp(1.5rem, 2vw, 2.1rem);
  letter-spacing: -0.05em;
}

.write-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
  align-items: center;
}

.write-copy {
  display: grid;
  gap: 0.7rem;
}

.write-copy p {
  margin: 0;
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.9rem 0.95rem;
  border-radius: 16px;
  line-height: 1.7;
}

.write-copy .good {
  background: var(--good);
  border: 1px solid rgba(94, 234, 212, 0.2);
  color: #f0fffb;
}

.write-copy .bad {
  background: var(--bad);
  border: 1px solid rgba(255, 107, 139, 0.14);
  color: rgba(255,255,255,0.9);
}

.write-copy span:first-child {
  font-weight: 900;
}

.write-layout img {
  width: 100%;
  min-height: 220px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.02);
}

.bio-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  padding: 0;
  margin: 1rem 0 0;
}

.tag-list li {
  padding: 0.52rem 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: #e9f2ff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.story-quote {
  padding: 1.05rem 1.15rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 209, 102, 0.16);
  background: linear-gradient(135deg, rgba(255, 107, 139, 0.08), rgba(138, 166, 255, 0.08));
  color: #f2f6ff;
  line-height: 1.75;
}

.story-text {
  display: grid;
  gap: 0.9rem;
}

.story-text p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.qr-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem;
  text-align: center;
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.qr-card img {
  width: min(170px, 100%);
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.qr-card strong,
.qr-card span {
  display: block;
}

.qr-card span {
  color: var(--muted);
  font-size: 0.8rem;
}

.quick-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.02);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-link:hover,
.quick-link:focus-visible {
  border-color: rgba(94, 234, 212, 0.7);
  box-shadow: 0 18px 30px rgba(94, 234, 212, 0.1);
}

.player-panel {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.2rem;
  align-items: center;
}

.player-visual {
  display: flex;
  justify-content: center;
}

.record {
  position: relative;
  width: min(240px, 75vw);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 8px solid rgba(255,255,255,0.12);
  background: radial-gradient(circle at center, #1b2530 0 18%, #0d131f 18% 28%, #080d17 29% 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.record img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.record::before {
  content: '';
  position: absolute;
  inset: 50%;
  width: 22%;
  height: 22%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255,255,255,0.98);
  box-shadow: inset 0 0 0 8px rgba(8, 13, 19, 0.06);
  z-index: 2;
}

.record.is-playing {
  animation: spin 4.8s linear infinite;
}

.center-btn {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 92px;
  height: 92px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.97);
  color: #090d17;
  font-size: 1.8rem;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.34);
}

.player-meta {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 1rem;
  background: rgba(4, 7, 14, 0.8);
  backdrop-filter: blur(10px);
}

.modal.active {
  display: flex;
}

.modal img {
  max-width: min(92vw, 540px);
  max-height: 90vh;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 72px rgba(0,0,0,0.5);
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.94);
  color: #0b1220;
  font-size: 1.4rem;
}

.auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(12px);
}

.auth-modal.hidden {
  display: none;
}

.auth-card {
  width: min(420px, 92vw);
  padding: 1.5rem 1.4rem 1.2rem;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(18, 25, 35, 0.96), rgba(9, 13, 20, 0.96));
  border: 1px solid var(--line);
  box-shadow: 0 26px 65px rgba(0,0,0,0.45);
  text-align: center;
}

.auth-kicker {
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.64rem;
  font-weight: 800;
}

.auth-card h2 {
  margin: 0.8rem 0 0.2rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.06em;
}

.auth-card p {
  margin: 0 0 1rem;
  color: var(--muted);
}

#loginForm {
  display: grid;
  gap: 0.8rem;
}

#passwordInput {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  color: var(--text);
  padding: 0.9rem 1rem;
  outline: none;
}

#passwordInput:focus {
  border-color: rgba(94, 234, 212, 0.7);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12);
}

#loginForm button {
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #120d13;
  font-weight: 900;
}

.auth-error {
  min-height: 1.5em;
  margin-top: 0.8rem;
  color: #ff9aad;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.logs-panel {
  display: block;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,0.02);
}

.logs-panel table {
  width: 100%;
  border-collapse: collapse;
}

.logs-panel th,
.logs-panel td {
  padding: 0.8rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
}

.logs-panel th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.02);
}

.logs-panel td {
  color: var(--text);
  word-break: break-word;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(94, 234, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .hero,
  .story-grid,
  .player-panel {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .qr-grid,
  .quick-grid,
  .write-layout {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-left: 0.2rem;
  }
}

@media (max-width: 640px) {
  .topbar,
  .page-shell {
    width: min(100% - 1rem, 1200px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .hero {
    padding: 0.75rem;
  }

  .hero-art {
    min-height: 290px;
  }

  .cta-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .record {
    width: min(210px, 68vw);
  }
}
