:root {
  --bg: #0b0b0f;
  --panel: #14141c;
  --line: #2a2a38;
  --text: #f2f0ea;
  --dim: #8a8798;
  --accent: #ffb020;
  --hit: #4ade80;
  --miss: #f4506a;
  --font: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}

#app {
  width: 100%;
  max-width: 620px;
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

h1 {
  font-size: 20px;
  letter-spacing: 0.18em;
  margin: 0;
  font-weight: 800;
}

.tagline { color: var(--dim); font-size: 12px; letter-spacing: 0.08em; }

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.hud div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.hud .label { font-size: 10px; color: var(--dim); letter-spacing: 0.14em; white-space: nowrap; }
.hud .value { font-size: clamp(20px, 6vw, 26px); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }

#timerBar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 28px;
}

#timerFill {
  height: 100%;
  width: 100%;
  background: var(--accent);
  transition: width 0.2s linear;
}

.prompt {
  text-align: center;
  margin-bottom: 24px;
}

.prompt .label { font-size: 10px; color: var(--dim); letter-spacing: 0.2em; }

#promptWord {
  font-size: clamp(34px, 9vw, 56px);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 6px 0 10px;
  word-break: break-all;
}

#promptVowels {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

#promptVowels span {
  min-width: 26px;
  padding: 3px 0;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

form { display: flex; gap: 8px; margin-bottom: 12px; }

input {
  flex: 1;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font);
  font-size: 20px;
  padding: 14px 16px;
  outline: none;
}

input:focus { border-color: var(--accent); }

button {
  background: var(--accent);
  color: #17130a;
  border: none;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 clamp(12px, 4vw, 22px);
  white-space: nowrap;
  cursor: pointer;
}

button:disabled { opacity: 0.4; cursor: default; }

.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

#feedback {
  min-height: 24px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 22px;
}

#feedback.hit { color: var(--hit); }
#feedback.miss { color: var(--miss); }

#chain { list-style: none; padding: 0; margin: 0; }

#chain li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  animation: rise 0.25s ease-out;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

#chain .word { font-size: 19px; font-weight: 700; }
#chain .vowels { color: var(--accent); font-size: 12px; letter-spacing: 0.14em; }
#chain .gain { margin-left: auto; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
#chain .flag { font-size: 10px; color: var(--dim); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

.screen {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 24px;
}

.screen h2 { margin: 0 0 14px; font-size: 22px; letter-spacing: 0.1em; }
.screen p { color: var(--dim); font-size: 14px; line-height: 1.8; margin: 0 0 18px; }
.screen ul { color: var(--dim); font-size: 14px; line-height: 1.9; padding-left: 20px; margin: 0 0 22px; }
.screen b { color: var(--text); }

#finalLyric {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  line-height: 2;
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 18px;
}

.row { display: flex; gap: 8px; }
.row button { flex: 1; padding: 14px 0; }

.hidden { display: none; }
