:root {
  --bg: #0a0a0d;
  --bg-vignette: radial-gradient(ellipse at top, #1a1420 0%, #0a0a0d 55%, #050506 100%);
  --panel: #15121a;
  --panel-border: #2a2233;
  --gold: #c9a227;
  --gold-bright: #e8c65a;
  --crimson: #a41e34;
  --crimson-bright: #d92e49;
  --text: #ece7e0;
  --muted: #8d8494;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, sans-serif;
  background: var(--bg) var(--bg-vignette);
  color: var(--text);
  padding: 24px;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.03em;
}

.jester-rule {
  height: 6px;
  background: repeating-linear-gradient(
    -45deg,
    var(--crimson) 0px, var(--crimson) 10px,
    var(--gold) 10px, var(--gold) 20px,
    #0a0a0d 20px, #0a0a0d 30px
  );
  border-radius: 3px;
  margin: 10px 0 24px;
  opacity: 0.85;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.6rem;
  margin: 0;
  color: var(--gold-bright);
  text-shadow: 0 0 18px rgba(201, 162, 39, 0.35);
}

.tagline {
  color: var(--muted);
  font-style: italic;
  margin: 4px 0 0;
}

a {
  color: var(--gold-bright);
}

.page {
  max-width: 960px;
  margin: 0 auto;
}

.center-page {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-card {
  width: min(360px, 92vw);
  margin-top: 24px;
}

.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: #0e0c12;
  border-radius: 10px;
  padding: 4px;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

.tab-btn.active {
  background: var(--crimson);
  color: white;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  background: #0e0c12;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  padding: 12px;
  font-size: 1rem;
  margin-bottom: 12px;
}

input:focus {
  outline: none;
  border-color: var(--gold);
}

.btn {
  background: var(--crimson);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn:hover {
  background: var(--crimson-bright);
}

.btn.gold {
  background: var(--gold);
  color: #14100a;
}

.btn.gold:hover {
  background: var(--gold-bright);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--muted);
}

.btn.ghost:hover {
  border-color: var(--crimson);
  color: var(--text);
}

.btn.full {
  width: 100%;
}

.error-text {
  color: var(--crimson-bright);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 4px 0 0;
}

header.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.whoami {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-title {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  margin: 28px 0 12px;
}

.room-list {
  display: grid;
  gap: 12px;
}

.room-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
}

.room-row:hover {
  border-color: var(--gold);
}

.badge {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}

.badge.online {
  background: rgba(58, 176, 100, 0.18);
  color: #5fd88a;
  border: 1px solid rgba(95, 216, 138, 0.4);
}

.badge.offline {
  background: rgba(160, 160, 160, 0.12);
  color: var(--muted);
  border: 1px solid var(--panel-border);
}

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-form input {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
}

.empty {
  color: var(--muted);
}

.host-panel {
  border: 1px solid var(--gold);
  background: rgba(201, 162, 39, 0.07);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 18px 0;
}

.host-panel code {
  display: block;
  background: #0e0c12;
  padding: 10px;
  border-radius: 6px;
  margin-top: 8px;
  word-break: break-all;
  font-size: 0.85rem;
  color: var(--gold-bright);
}

.volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--muted);
}

.volume-row input[type="range"] {
  flex: 1;
}

.dropzone {
  border: 2px dashed var(--panel-border);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 20px;
}

.dropzone.dragover {
  border-color: var(--crimson);
  background: rgba(164, 30, 52, 0.08);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.sound-cell {
  position: relative;
}

.sound-btn {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 18px 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}

.sound-btn:hover {
  border-color: var(--gold);
}

.sound-btn:active {
  transform: scale(0.96);
  background: var(--crimson);
}

.delete-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--crimson);
  color: white;
  border: 2px solid var(--bg);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
