:root {
  --bg: #16110d;
  --bg-2: #211812;
  --ink: #f6eee4;
  --muted: #b7a394;
  --line: rgba(246, 238, 228, 0.12);
  --copper: #d9854a;
  --copper-2: #f0b27a;
  --sage: #7ea394;
  --danger: #c45c4a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --radius: 28px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Figtree, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(217, 133, 74, 0.18), transparent 55%),
    radial-gradient(900px 500px at 110% 10%, rgba(126, 163, 148, 0.16), transparent 50%),
    var(--bg);
  letter-spacing: 0.01em;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  z-index: 0;
}

.topbar, .shell, .admin-dot { position: relative; z-index: 1; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px 0;
  gap: 16px;
}

.brand {
  font-family: Syne, serif;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.langs { display: flex; gap: 6px; flex-wrap: wrap; }
.lang-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 6px 8px;
  border-radius: 999px;
}
.lang-link[aria-current="true"] {
  color: var(--bg);
  background: var(--copper-2);
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 96px;
}

.hero, .play-hero, .admin-head { margin-bottom: 28px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--sage);
  margin: 0 0 8px;
}
h1, h2 { font-family: Syne, serif; margin: 0 0 10px; line-height: 1.1; }
h1 { font-size: clamp(2.4rem, 6vw, 5rem); }
.lede, .muted, .empty { color: var(--muted); }

.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.level-card {
  display: block;
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015));
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}
.level-card:hover { transform: translateY(-4px); border-color: rgba(217, 133, 74, 0.55); }
.level-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper-2);
  margin-bottom: 18px;
}
.level-meta {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.level-meta li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}

.player {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 18px 0 8px;
}

.orb {
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #f4c9a0, #d9854a 42%, #8a4a28 78%);
  color: #2a160e;
  box-shadow: 0 20px 50px rgba(217, 133, 74, 0.28);
  position: relative;
  cursor: pointer;
}
.orb-label {
  position: relative;
  z-index: 1;
  font-family: Syne, serif;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0 24px;
}
.orb-rings, .orb-rings::before, .orb-rings::after {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(42, 22, 14, 0.18);
  border-radius: 50%;
}
.orb-rings::before, .orb-rings::after { content: ""; inset: 16%; }
.orb-rings::after { inset: 28%; }
.orb.is-playing .orb-rings {
  animation: pulse 1.8s ease-in-out infinite;
}

.progress {
  width: min(420px, 100%);
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--copper), var(--sage));
}

.player-status { margin: 0; color: var(--muted); }
.player-actions, .row-actions, .sound-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn, input, textarea {
  font: inherit;
}
.btn {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-small { padding: 8px 12px; font-size: 13px; }
.btn-danger { background: var(--danger); color: white; }

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
}

.admin-card, .admin-row, .admin-form {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
}
.admin-head, .admin-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.admin-row-body { flex: 1; min-width: 0; }
.order-actions { display: grid; gap: 4px; }
.order-actions .btn { min-width: 36px; padding: 6px 8px; }
.order-actions .btn:disabled { opacity: 0.35; cursor: default; }
.admin-list { display: grid; gap: 12px; }
.stack, .admin-form { display: grid; gap: 16px; }
.grid-2, .grid-3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
label { display: grid; gap: 8px; font-weight: 600; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #120d0a;
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
}
.sound-picker { border: 1px dashed var(--line); border-radius: 20px; padding: 16px; }
.sound-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  margin-top: 12px;
}
.sound-item {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
  background: rgba(0,0,0,0.18);
  border-radius: 12px;
  padding: 8px 10px;
}
.sound-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 500;
  min-width: 0;
}
.sound-check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sound-item em { margin-left: auto; color: var(--muted); font-style: normal; font-size: 12px; }
.sound-item.is-hidden { display: none; }
.icon-play {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--copper);
  color: #2a160e;
  font-size: 11px;
  cursor: pointer;
  line-height: 1;
}
.icon-play.is-playing { background: var(--sage); }
.preview-card {
  display: grid;
  gap: 16px;
  background: rgba(126, 163, 148, 0.1);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 18px;
}
.preview-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}
.preview-card h2 { margin-bottom: 6px; font-size: 1.3rem; }
.preview-card .progress { width: 100%; }

.notice { padding: 12px 14px; border-radius: 14px; background: rgba(126, 163, 148, 0.12); }
.notice.error { background: rgba(196, 92, 74, 0.16); }
.pack-hint {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(126, 163, 148, 0.12);
  font-weight: 500;
  color: var(--muted);
}
.pack-hint.is-error {
  background: rgba(196, 92, 74, 0.16);
  color: var(--ink);
}

.admin-dot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--copper);
  opacity: 0.18;
  z-index: 2;
}
.admin-dot:hover { opacity: 0.7; }
.page-admin .admin-dot { display: none; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.75; }
}

@media (max-width: 720px) {
  .grid-2, .grid-3, .admin-head, .admin-row, .preview-head { grid-template-columns: 1fr; display: grid; }
  h1 { font-size: 2.3rem; }
}
