:root {
  --bg: linear-gradient(135deg, #f7f4ea 0%, #d8e8f1 100%);
  --panel: rgba(255, 252, 246, 0.88);
  --panel-border: rgba(31, 42, 68, 0.12);
  --ink: #1f2a44;
  --muted: #5e6a7f;
  --accent: #cc7a00;
  --accent-strong: #a85f00;
  --blue: #2f6fed;
  --blue-strong: #2155ba;
  --green: #2f8f5b;
  --green-strong: #226a43;
  --success-bg: #e8f7df;
  --success-border: #6d9f3b;
  --error-bg: #fde6e0;
  --error-border: #c65742;
  --white-key: #fffdf8;
  --white-key-border: #c8c6c2;
  --black-key: #20222a;
  --selected: #f4b860;
  --answer: #88bf6a;
  --shadow: 0 18px 40px rgba(31, 42, 68, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.app {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px;
}

.panel,
.keyboard-shell,
.overview-shell {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 24px;
  margin-bottom: 20px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.mode-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.mode-pill {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border: 1px solid var(--panel-border);
  box-shadow: none;
}

.mode-pill--active {
  background: var(--ink);
  color: #fff;
}

.mode-description {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

select,
button {
  font: inherit;
}

select {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.volume-controls {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.volume-controls label,
.wrong-hint-panel label {
  font-weight: 700;
  color: var(--ink);
}

input[type="range"] {
  width: 100%;
}

.wrong-hint-panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.76);
  display: grid;
  gap: 8px;
}

.chord-options {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--panel-border);
}

.chord-options__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  margin-bottom: 12px;
}

.ultimate-voicing-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--ink);
  font-weight: 700;
}

.ultimate-voicing-controls select {
  min-width: 120px;
}

.chord-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.chord-choice-grid--six {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.chord-submit-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.chord-choice {
  text-align: left;
  border: 1px solid rgba(31, 42, 68, 0.14);
  background: #fff;
  color: var(--ink);
  min-height: 72px;
}

.chord-choice:hover {
  background: #f5f7fb;
}

.chord-choice--selected {
  background: #e6eefc;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.12);
}

.chord-choice__title {
  display: block;
  font-weight: 800;
}

.chord-choice__subtitle {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.is-hidden {
  display: none;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  cursor: pointer;
  background: #e9edf3;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 20px rgba(204, 122, 0, 0.2);
}

button.primary:hover {
  background: var(--accent-strong);
}

button.secondary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(47, 111, 237, 0.2);
}

button.secondary:hover {
  background: var(--blue-strong);
}

button.submit {
  background: var(--green);
  color: #fff;
  min-width: 240px;
  box-shadow: 0 10px 20px rgba(47, 143, 91, 0.22);
}

button.submit:hover {
  background: var(--green-strong);
}

button.replay {
  background: #d9485f;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(217, 72, 95, 0.28);
}

button.replay:hover {
  background: #b93149;
}

.status-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.prompt,
.hover-note {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.prompt {
  flex: 1 1 420px;
}

.hover-note {
  min-width: 220px;
  text-align: center;
  font-weight: 700;
}

.feedback {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 2px solid transparent;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.feedback__title {
  font-weight: 800;
}

.feedback--idle {
  background: rgba(234, 239, 246, 0.9);
}

.feedback--success {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.feedback--error {
  background: var(--error-bg);
  border-color: var(--error-border);
}

.keyboard-shell {
  padding: 18px;
}

.overview-shell {
  margin-top: 20px;
  padding: 18px;
}

.overview__header h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.overview__header p {
  margin: 0 0 14px;
  color: var(--muted);
}

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  color: var(--muted);
  font-size: 0.95rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.swatch--white {
  background: var(--white-key);
}

.swatch--black {
  background: var(--black-key);
}

.swatch--selected {
  background: var(--selected);
}

.swatch--answer {
  background: var(--answer);
}

.keyboard-wrapper {
  overflow-x: auto;
  padding: 8px 4px 12px;
}

.keyboard {
  position: relative;
  min-width: 1248px;
  height: 320px;
  user-select: none;
}

.keyboard--mini {
  min-width: 2756px;
  width: 2756px;
  height: 320px;
  transform: scale(0.34);
  transform-origin: top left;
}

.key {
  position: absolute;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.key:hover {
  transform: translateY(1px);
}

.key--white {
  width: 52px;
  height: 308px;
  background: linear-gradient(180deg, #fffdf8 0%, #f2eee8 100%);
  border: 1px solid var(--white-key-border);
  border-radius: 0 0 10px 10px;
  box-shadow: inset 0 -10px 16px rgba(0, 0, 0, 0.07);
}

.key--black {
  width: 30px;
  height: 192px;
  background: linear-gradient(180deg, #373a45 0%, #111317 100%);
  border: 1px solid #090b0d;
  border-radius: 0 0 7px 7px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28);
  z-index: 3;
}

.key--selected.key--white {
  background: linear-gradient(180deg, #ffd9a2 0%, #f4b860 100%);
}

.key--selected.key--black {
  background: linear-gradient(180deg, #ffca72 0%, #d98a1f 100%);
}

.key--answer.key--white {
  background: linear-gradient(180deg, #d7f1c8 0%, #88bf6a 100%);
}

.key--answer.key--black {
  background: linear-gradient(180deg, #afd98c 0%, #5c8f3e 100%);
}

.key--overview-answer.key--white {
  background: linear-gradient(180deg, #cfe6ff 0%, #5a8fe0 100%);
}

.key--overview-answer.key--black {
  background: linear-gradient(180deg, #8fb6ef 0%, #315b9d 100%);
}

.key__center-c {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 0.9rem;
  font-weight: 700;
  color: #b44d15;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.key__mini-dot {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #16376a;
  pointer-events: none;
}

.overview-wrapper {
  overflow: hidden;
  height: 116px;
  padding: 2px 0 6px;
  background: transparent;
}

.submit-row {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

@media (max-width: 900px) {
  .panel__header {
    flex-direction: column;
    align-items: start;
  }

  .controls {
    width: 100%;
    justify-content: space-between;
  }

  .chord-choice-grid {
    grid-template-columns: 1fr;
  }

  .keyboard {
    min-width: 1008px;
    height: 260px;
  }

  .keyboard--mini {
    min-width: 2756px;
    width: 2756px;
    height: 320px;
    transform: scale(0.245);
  }

  .key--white {
    width: 42px;
    height: 248px;
  }

  .key--black {
    width: 24px;
    height: 156px;
  }

  .key__center-c {
    bottom: 14px;
    font-size: 0.78rem;
  }

  .overview-wrapper {
    height: 86px;
  }
}
/* 頁末 */
footer {
	background: transparent;
	text-align: right;
	padding: 26px 0;
	position: relative;
	bottom: 0;
	width: 100%;
}
footer p {
	color: #444;
	font-size: 0.875rem;
	text-align: right;
}

footer a {
  color: #444;
  text-decoration: none;
}

footer a:hover,
footer a:focus {
  color: #444;
  text-decoration: underline;
}

.wrapper {
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 24px;
}
