* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #990000;
  color: #f5e9d4;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#root {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.view-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  color: #f5e9d4;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: rgba(255, 255, 255, 0.08); }

.nav-link.active {
  background: #d4a017;
  color: #3a1a00;
  font-weight: 600;
}

.loading {
  color: #888;
  font-size: 0.9rem;
}

/* Passcode gate */
.gate {
  margin: auto;
  width: 100%;
  max-width: 360px;
  padding: 1.5rem;
}

.gate h1 {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 1rem;
  color: #f5e9d4;
}

#passcode-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#passcode {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  border-radius: 6px;
  outline: none;
  letter-spacing: 0.05em;
}

#passcode:focus {
  border-color: #f5e9d4;
}

#submit-btn {
  background: #d4a017;
  color: #3a1a00;
  border: none;
  padding: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

#submit-btn:hover { background: #e8b42a; }
#submit-btn:disabled { background: #8a6a10; color: #d4a017; cursor: not-allowed; }

.error {
  color: #ffd8d8;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
  min-height: 1.2em;
}

/* Player */
.player-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: transparent;
}

#player {
  width: 60vw;
  max-width: 60vw;
  max-height: 75vh;
  background: #000;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

/* Audio */
.audio-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: transparent;
}

.audio-title {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
  color: #f5e9d4;
}

#audio-player {
  width: 60vw;
  max-width: 60vw;
  background: #1a1a1f;
  border-radius: 6px;
}

.logout-btn {
  background: #d4a017;
  color: #3a1a00;
  border: none;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.logout-btn:hover { background: #e8b42a; }
.logout-btn:disabled { background: #8a6a10; color: #d4a017; cursor: not-allowed; }

body.audio-only .nav-link[data-view="video"] { display: none; }
