:root {
  --bg: #1b1026;
  --card: #2a1a3a;
  --line: #45305c;
  --text: #f7f0ff;
  --muted: #b9a6cf;
  --accent: #ff5c8a;
  --accent-ink: #2a0614;
  --good: #58e0a0;
  --warn: #ffc857;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  padding-top: calc(14px + env(safe-area-inset-top));
}

.logo { font-weight: 800; font-size: 20px; letter-spacing: 0.3px; }
a.logo { text-decoration: none; }
.room-code { font-weight: 700; letter-spacing: 3px; color: var(--muted); }

main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 6px 18px 28px;
}

h1 { font-size: 28px; line-height: 1.15; margin: 10px 0 6px; }
h2 { font-size: 20px; margin: 22px 0 8px; }
p { margin: 8px 0; }

.muted { color: var(--muted); }
a { color: var(--text); }
.center { text-align: center; }
.small { font-size: 14px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0;
}

label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }

input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: #1f1330;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%23b9a6cf' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input.code { text-transform: uppercase; letter-spacing: 6px; font-weight: 700; text-align: center; font-size: 24px; }

button {
  width: 100%;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  padding: 15px 16px;
  margin-top: 14px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}

button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.link { background: none; color: var(--muted); font-weight: 500; padding: 8px; margin-top: 18px; text-decoration: underline; }
button:disabled { opacity: 0.45; cursor: default; }

.error {
  background: #4a1626;
  border: 1px solid #a33a5a;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

.notice {
  background: #3a2c12;
  border: 1px solid #8a6a1f;
  color: #ffe1a3;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}

.sub { display: block; color: var(--muted); font-size: 14px; }

.big-code { font-size: 54px; font-weight: 800; letter-spacing: 10px; text-align: center; margin: 6px 0; }
.qr { display: block; margin: 12px auto; width: 190px; height: 190px; border-radius: 12px; background: #fff; padding: 8px; }

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
ul.list li:last-child { border-bottom: 0; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; }
.dot.on { background: var(--good); }
.grow { flex: 1; min-width: 0; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--line); color: var(--text); }
.tag.good { background: var(--good); color: #06281a; }
.tag.warn { background: var(--warn); color: #2b2000; }
.tag.bad { background: #a33a5a; }

.choice {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 600;
  margin-top: 10px;
}
.choice.picked { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice span { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }

.lyrics { font-size: 19px; line-height: 1.5; }
.lyrics .section { margin: 0 0 16px; }
.lyrics .line { display: block; border-radius: 8px; padding: 2px 6px; margin: 0 -6px; transition: opacity 0.3s, background 0.3s; }
.lyrics mark { background: rgba(255, 200, 87, 0.22); color: var(--warn); border-radius: 4px; padding: 0 2px; }
.lyrics.following .line { opacity: 0.5; }
.lyrics.following .line.sung { opacity: 0.35; }
.lyrics.following .line.active { opacity: 1; background: rgba(255, 92, 138, 0.16); font-weight: 600; }

.winner { font-size: 24px; font-weight: 800; }

footer {
  position: sticky;
  bottom: 0;
  background: #140b1d;
  border-top: 1px solid var(--line);
  padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
}
footer[hidden] { display: none; }
.now-title { font-weight: 700; margin-bottom: 6px; }
audio { width: 100%; }
