* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0f1115;
  color: #e8eaf0;
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  padding: env(safe-area-inset-top) 20px calc(env(safe-area-inset-bottom) + 20px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 26px;
}
h1 { font-size: 1.5rem; font-weight: 700; color: #8b7cf6; }

section { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; }

.tagline { color: #9aa0b0; text-align: center; margin-bottom: 12px; line-height: 1.4; }
.small { color: #9aa0b0; font-size: 0.9rem; text-align: center; }
.song { text-align: center; font-size: 1.05rem; color: #c9cede; word-break: break-word; }

button.big {
  width: 100%;
  padding: 18px;
  font-size: 1.15rem;
  font-weight: 600;
  border: none;
  border-radius: 14px;
  background: #8b7cf6;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button.big:active { transform: scale(0.98); }
button.big.alt { background: #262a35; color: #e8eaf0; }
button.big.play { background: #34c07c; }
button:disabled { opacity: 0.45; }

.code {
  font-size: 3.4rem;
  font-weight: 800;
  letter-spacing: 0.35em;
  text-align: center;
  color: #8b7cf6;
  padding: 10px 0 4px 0.35em; /* left pad balances letter-spacing */
}

#codeInput {
  width: 100%;
  padding: 16px;
  font-size: 2rem;
  text-align: center;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  background: #1a1e27;
  border: 2px solid #333a4a;
  border-radius: 14px;
  color: #e8eaf0;
  outline: none;
}
#codeInput:focus { border-color: #8b7cf6; }

.bar { width: 100%; height: 10px; background: #1a1e27; border-radius: 5px; overflow: hidden; }
.fill { height: 100%; width: 0%; background: #8b7cf6; transition: width 0.15s; }

.pill {
  background: #1a1e27;
  border: 1px solid #333a4a;
  color: #9aa0b0;
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 999px;
}

.status {
  margin-top: auto;
  padding-top: 24px;
  color: #6b7280;
  font-size: 0.85rem;
  text-align: center;
  min-height: 2em;
}

.countdown {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7rem;
  font-weight: 800;
  color: #34c07c;
}

.hidden { display: none !important; }
