:root {
  --ink: #0b0b0b;
  --paper: #f7c93a;
  --paper-soft: #ffe073;
  --cream: #fff5d0;
  --white: #ffffff;
  --muted: #5a4b23;
  --line: rgba(11, 11, 11, 0.18);
  --danger: #b42318;
  --ok: #126b38;
  --panel: rgba(255, 248, 218, 0.94);
  --shadow: 8px 8px 0 rgba(11, 11, 11, 0.9);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #111;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.42) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 20%, rgba(0, 0, 0, 0.18) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(255,255,255,0.15) 0 25%, transparent 25% 50%, rgba(0,0,0,0.04) 50% 75%, transparent 75%),
    var(--paper);
  background-size: auto, auto, 34px 34px, auto;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

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

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a,
.lang button,
.ghost {
  min-height: 38px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, 0.35);
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: 3px 3px 0 var(--ink);
}

.lang {
  display: flex;
  gap: 7px;
  align-items: center;
}

.lang button.active {
  background: var(--ink);
  color: var(--paper);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(330px, 0.94fr);
  gap: 28px;
  align-items: end;
  min-height: 540px;
  border: 4px solid var(--ink);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 48px);
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.22), transparent 42%),
    var(--paper);
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  width: min(54vw, 620px);
  aspect-ratio: 1;
  right: 25%;
  top: 32px;
  background: rgba(255, 236, 144, 0.86);
  clip-path: polygon(50% 0, 60% 35%, 98% 35%, 68% 57%, 80% 95%, 50% 72%, 20% 95%, 32% 57%, 2% 35%, 40% 35%);
  transform: rotate(-6deg);
}

.hero::after {
  content: "";
  position: absolute;
  left: 34px;
  bottom: -48px;
  width: 94px;
  height: 360px;
  border-radius: 48px 48px 12px 12px;
  background:
    linear-gradient(90deg, transparent 0 20%, rgba(255,255,255,0.35) 20% 28%, transparent 28%),
    linear-gradient(#f4f4f4 0 8%, #151515 8% 100%);
  border: 4px solid var(--ink);
  transform: rotate(-8deg);
  box-shadow: 10px 10px 0 rgba(0,0,0,0.18);
}

.hero-copy,
.panel,
.queue-board,
.admin-frame {
  position: relative;
  z-index: 1;
}

.kicker {
  display: inline-block;
  padding: 7px 10px;
  margin: 0 0 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  font-size: 0.86rem;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 680px;
  margin-bottom: 14px;
  font-size: clamp(3.2rem, 10vw, 7.8rem);
  line-height: 0.83;
  text-transform: uppercase;
  font-weight: 1000;
  letter-spacing: 0;
}

.tagline {
  max-width: 580px;
  margin-bottom: 26px;
  color: #1d1604;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 750;
}

.event-pill,
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255,255,255,0.42);
  padding: 8px 13px;
  font-weight: 900;
}

.panel {
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 20px;
}

.panel h2 {
  margin-bottom: 14px;
  font-size: 1.35rem;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-weight: 950;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fffdf1;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
}

.field textarea {
  min-height: 82px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.search-wrap {
  position: relative;
}

.results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fffdf1;
  box-shadow: 5px 5px 0 var(--ink);
}

.result {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 11px;
  color: var(--ink);
  text-align: left;
}

.result:hover,
.result:focus {
  background: var(--paper-soft);
}

.result strong {
  font-weight: 950;
}

.result span,
.hint,
.small {
  color: var(--muted);
  font-size: 0.9rem;
}

.selected-song {
  display: none;
  border: 2px dashed var(--ink);
  border-radius: 6px;
  padding: 10px;
  background: rgba(255, 224, 115, 0.45);
}

.selected-song.show {
  display: block;
}

.checks {
  display: grid;
  gap: 10px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 750;
}

.check input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn,
.danger,
.ok {
  min-height: 46px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 950;
  text-transform: uppercase;
}

.btn.primary {
  background: var(--ink);
  color: var(--paper);
}

.btn:hover,
.nav a:hover,
.lang button:hover,
.ghost:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--ink);
}

.danger {
  background: #ffd0ca;
  color: var(--danger);
}

.ok {
  background: #d7f7df;
  color: var(--ok);
}

.message {
  display: none;
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 11px;
  background: #fffdf1;
  font-weight: 820;
}

.message.show {
  display: block;
}

.message.error {
  color: var(--danger);
}

.message.success {
  color: var(--ok);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.58);
}

.modal.show {
  display: grid;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(720px, calc(100vh - 36px));
  overflow: auto;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: var(--cream);
  box-shadow: var(--shadow);
  padding: 22px;
}

.terms-content {
  white-space: pre-wrap;
  line-height: 1.55;
}

.queue-page {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.queue-board {
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: rgba(11,11,11,0.94);
  color: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.queue-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 4px solid var(--ink);
}

.queue-head h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 5.2rem);
}

.now {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.16);
}

.now-label {
  color: var(--paper);
  font-weight: 1000;
  text-transform: uppercase;
}

.now-title {
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.95;
  font-weight: 1000;
  text-transform: uppercase;
}

.now-meta {
  margin-top: 8px;
  color: #f7e8a9;
  font-size: 1.2rem;
  font-weight: 800;
}

.queue-list {
  display: grid;
  gap: 0;
}

.queue-item {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  padding: 16px 22px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

.queue-pos {
  color: var(--paper);
  font-weight: 1000;
  font-size: 1.5rem;
}

.admin-body {
  background: #f1bc22;
}

.admin-frame {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side {
  position: sticky;
  top: 16px;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: rgba(255,248,218,0.92);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px;
}

.side h1 {
  font-size: 2rem;
  line-height: 0.92;
  margin-bottom: 16px;
}

.tabs {
  display: grid;
  gap: 8px;
}

.tab {
  display: block;
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: #fff9df;
  padding: 10px;
  text-align: left;
  font-weight: 950;
  color: var(--ink);
  text-decoration: none;
}

.tab.active {
  background: var(--ink);
  color: var(--paper);
}

.admin-content {
  display: grid;
  gap: 16px;
}

.toolbar,
.cards,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.metric {
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff9df;
  padding: 14px;
  min-width: 0;
  text-align: center;
}

.metric strong {
  display: block;
  font-size: clamp(1.45rem, 5vw, 2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric span {
  display: block;
  margin-top: 4px;
  font-size: 0.9rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fffdf1;
}

.drag-handle {
  min-height: 30px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 5px 8px;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
  cursor: grab;
}

tr.dragging {
  opacity: 0.45;
}

tr.drag-over {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
  background: var(--paper-soft);
}

tr.song-inactive td {
  background: #ffe1dc;
}

tr.song-inactive:hover td {
  background: #ffd2ca;
}

.inactive-cell {
  color: #9d1717;
  font-weight: 950;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.login-card {
  width: min(420px, calc(100% - 28px));
  margin: 12vh auto;
}

.login-card h1 {
  font-size: 3.2rem;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .hero,
  .admin-frame {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 72px;
  }

  .hero::after {
    left: auto;
    right: 18px;
    bottom: -120px;
    height: 280px;
    opacity: 0.72;
  }

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

  .side {
    position: relative;
    top: 0;
  }

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

  .now {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

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

  .hero {
    border-width: 3px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .panel {
    padding: 14px;
  }

  .cards,
  .tabs {
    grid-template-columns: 1fr;
  }
}
