:root {
  color-scheme: dark;
  --bg: #0c0e12;
  --ink: #f3e6c4;
  --muted: #cbb992;
  --line: #8a6a32;
  --button: #a97832;
  --button-press: #7c5620;
  --field: #1c1814;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", sans-serif;
}

body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(8, 10, 16, 0.18) 0%, rgba(8, 10, 16, 0.82) 46%, #0c0e12 72%),
    url("banner.jpg?v=2") center center / cover no-repeat;
}

a { color: #e6c878; }

button, input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  border-radius: 16px;
  background: var(--button);
  min-height: 3.4rem;
  padding: 0.75rem 1rem;
  font-weight: 650;
  touch-action: manipulation;
}

button:active { background: var(--button-press); }

button.text {
  background: transparent;
  color: var(--muted);
  min-height: 2.4rem;
}

#join {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.8rem;
  width: min(100%, 34rem);
  margin: 0 auto;
  padding: 1.5rem 1.15rem calc(1.5rem + env(safe-area-inset-bottom));
}

#join[hidden], #live[hidden] { display: none !important; }

.mark {
  width: 84px;
  height: 84px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e6c878;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  line-height: 1.15;
  color: #f3e6c4;
}

.lede, .hint, .status {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.code-label { font-size: 0.85rem; }

.code {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--field);
  color: #e6c878;
  min-height: 3.6rem;
  text-align: center;
  font-size: 1.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

#live {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

#stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

#frame {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  touch-action: manipulation;
}

.frame-note {
  position: absolute;
  margin: 0;
  color: var(--muted);
  pointer-events: none;
}

#bar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.session {
  margin: 0;
  text-align: center;
  color: #e6c878;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

#session.skill-up {
  color: #fff6d0;
  text-shadow: 0 0 12px rgba(255, 214, 110, 0.95);
}

button.art,
button.art:active {
  background: transparent;
  padding: 0;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  line-height: 0;
}

button.art img {
  display: block;
  width: 100%;
  height: auto;
}

button.art:active img {
  filter: brightness(0.82);
}

.volume {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.volume input {
  flex: 1;
  accent-color: #e6c878;
  height: 1.6rem;
}

#live.splash::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  border: 24px solid #ffe7a3;
  box-shadow:
    inset 0 0 96px rgba(255, 214, 110, 0.95),
    inset 0 0 28px #fff6d0;
  animation: splash-fade 0.9s ease-out forwards;
}

@keyframes splash-fade {
  0%, 35% { opacity: 1; }
  100% { opacity: 0; }
}

.home-link {
  color: #e6c878;
}

#hear-note[hidden], #home-link[hidden], #frame-note[hidden], #host-download[hidden] { display: none; }
