/* Shared styles for the standalone test pages
   (/vocal-range-test and /tone-deaf-test).
   Mirrors the dark theme of the main trainer. */

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #161616;
  color: #e4e4e4;
  margin: 0;
  padding: 0;
}

.app {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* extra top padding keeps content clear of the corner brand link */
  padding: 4.5rem 1rem 2rem;
}

/* Brand link pinned to the top-left corner — the standard "logo goes home"
   pattern. Fixed (not absolute) so it survives scroll restoration on reload,
   with a translucent chip background so it reads as deliberate over content. */
.site-brand {
  position: fixed;
  top: 0.75rem;
  left: 0.85rem;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  background: rgba(22, 22, 22, 0.82);
  border: 1px solid #2c2c2c;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}

/* Hover only on devices with a real pointer — prevents the "stuck pressed"
   look after a tap on touch screens */
@media (hover: hover) {
  .site-brand:hover {
    background: rgba(34, 34, 34, 0.92);
    border-color: #454545;
  }
}

.site-brand:focus-visible {
  outline: 2px solid #5ec489;
  outline-offset: 2px;
}

.site-brand:active {
  transform: translateY(1px);
}

.site-brand img {
  display: block;
  width: 21px;
  height: 21px;
}

.site-brand-name {
  color: #e4e4e4;
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.site-brand-tag {
  color: #777;
  font-size: 0.8rem;
  border-left: 1px solid #333;
  padding-left: 0.55rem;
}

h1 {
  font-weight: 300;
  font-size: 1.3rem;
  color: #999;
  margin: 0 0 1.6rem;
  letter-spacing: 0.02em;
  text-align: center;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 640px;
}

[hidden] {
  display: none !important;
}

.intro-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #cfcfcf;
  max-width: 54ch;
  text-align: center;
}

.intro-text p {
  margin: 0 0 0.9rem;
}

.intro-note {
  font-size: 0.83rem;
  color: #888;
  max-width: 50ch;
  text-align: center;
  line-height: 1.5;
  margin-top: 0.4rem;
}

.step-tag {
  font-size: 0.78rem;
  color: #5ec489;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.step-title {
  font-size: 1.35rem;
  font-weight: 400;
  color: #f0f0f0;
  margin-bottom: 0.7rem;
  text-align: center;
}

.step-prompt {
  font-size: 0.92rem;
  color: #b5b5b5;
  line-height: 1.55;
  max-width: 50ch;
  text-align: center;
  margin-bottom: 1.4rem;
}

/* Big live-note display, same look as the trainer */
.display {
  font-size: 6rem;
  font-weight: 200;
  height: 7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5f5f5;
  min-width: 200px;
  line-height: 1;
}

.display.dim {
  color: #555;
}

@keyframes successGlow {
  0% {
    text-shadow: 0 0 0 rgba(94, 196, 137, 0);
  }

  18% {
    text-shadow:
      0 0 20px rgba(150, 235, 180, 1),
      0 0 60px rgba(94, 196, 137, 1),
      0 0 120px rgba(94, 196, 137, 0.65);
  }

  100% {
    text-shadow: 0 0 0 rgba(94, 196, 137, 0);
  }
}

.display.success {
  animation: successGlow 1.6s ease-out;
}

/* Progress bar that fills while a note is held steadily */
.hold-bar {
  width: 260px;
  max-width: 80vw;
  height: 8px;
  border: 1px solid #383838;
  border-radius: 4px;
  background: #222;
  overflow: hidden;
  margin: 0.6rem 0 1rem;
}

.hold-fill {
  height: 100%;
  width: 0%;
  background: #5ec489;
  border-radius: 3px;
  transition: width 0.08s linear;
}

.captured-line {
  font-size: 0.95rem;
  color: #cfcfcf;
  min-height: 1.4em;
  margin-bottom: 1rem;
  text-align: center;
}

.captured-line b {
  color: #5ec489;
  font-weight: 600;
}

.step-hint {
  font-size: 0.83rem;
  color: #c9a35e;
  max-width: 46ch;
  text-align: center;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.mic-status {
  color: #e08a8a;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-top: 0.8rem;
  text-align: center;
}

.mic-status a {
  color: #6aa8ff;
  text-decoration: none;
}

.mic-status a:hover {
  text-decoration: underline;
}

.status-line {
  color: #888;
  font-size: 0.85rem;
  min-height: 1.2em;
  margin-top: 0.6rem;
  text-align: center;
}

/* Buttons — same look as the trainer */
button {
  font-size: 1rem;
  padding: 0.75rem 1.4rem;
  background: #262626;
  color: #e4e4e4;
  border: 1px solid #383838;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

button:hover:not(:disabled) {
  background: #333;
  border-color: #4a4a4a;
}

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

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.primary {
  background: #3d6e50;
  border-color: #3d6e50;
  font-weight: 500;
}

.primary:hover:not(:disabled) {
  background: #4a8060;
  border-color: #4a8060;
}

.buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-top: 0.4rem;
}

.ghost {
  font-size: 0.88rem;
  padding: 0.6rem 1rem;
  color: #b5b5b5;
}

/* Answer buttons for the listening test */
.answers {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.6rem 0 0.4rem;
}

.answers button {
  min-width: 6.4rem;
}

.feedback {
  font-size: 0.98rem;
  min-height: 1.5em;
  margin: 0.8rem 0 0.4rem;
  text-align: center;
}

.feedback.good {
  color: #5ec489;
}

.feedback.bad {
  color: #e08a8a;
}

.trial-progress {
  font-size: 0.8rem;
  color: #777;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

/* Result screen */
.result-big {
  font-size: 3.4rem;
  font-weight: 200;
  color: #f5f5f5;
  line-height: 1.15;
  text-align: center;
  margin: 0.4rem 0 0.5rem;
}

.result-sub {
  font-size: 1rem;
  color: #b5b5b5;
  text-align: center;
  margin-bottom: 0.4rem;
}

.result-type {
  font-size: 1.15rem;
  color: #5ec489;
  text-align: center;
  margin: 0.5rem 0 0.2rem;
}

.result-verdict {
  font-size: 1.7rem;
  font-weight: 300;
  color: #5ec489;
  text-align: center;
  margin: 0.4rem 0 0.8rem;
  line-height: 1.3;
}

.result-scores {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.6rem 0 0.8rem;
}

.result-score {
  text-align: center;
}

.result-score .num {
  font-size: 2rem;
  font-weight: 300;
  color: #f0f0f0;
  font-variant-numeric: tabular-nums;
}

.result-score .lbl {
  font-size: 0.76rem;
  color: #777;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.disclaimer {
  font-size: 0.82rem;
  color: #888;
  max-width: 52ch;
  text-align: center;
  line-height: 1.55;
  margin: 0.6rem 0 1rem;
}

.viz-wrap {
  width: 100%;
  max-width: 620px;
  overflow-x: auto;
  margin: 0.8rem 0 1rem;
}

.viz-wrap svg {
  display: block;
  min-width: 480px;
  width: 100%;
  height: auto;
}

.links-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.6rem;
  width: 100%;
}

.link-btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  background: #202020;
  border: 1px solid #383838;
  border-radius: 6px;
  color: #cfcfcf;
  text-decoration: none;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.15s;
}

.link-btn:hover {
  background: #2a2a2a;
  border-color: #4a4a4a;
  color: #e4e4e4;
}

.link-btn:active {
  transform: translateY(1px);
}

/* SEO content section — same look as the homepage */
.seo-content {
  max-width: 600px;
  margin: 5rem auto 1rem;
  padding: 2.5rem 1rem 0;
  border-top: 1px solid #242424;
  color: #8a8a8a;
  font-size: 0.88rem;
  line-height: 1.65;
}

.seo-content h2 {
  font-size: 1rem;
  font-weight: 400;
  color: #a8a8a8;
  margin: 1.8rem 0 0.5rem;
}

.seo-content h2:first-child {
  margin-top: 0;
}

.seo-content h3 {
  font-size: 0.9rem;
  font-weight: 500;
  color: #9a9a9a;
  margin: 1.3rem 0 0.3rem;
}

.seo-content p,
.seo-content li {
  margin: 0 0 0.65rem;
}

.seo-content ol,
.seo-content ul {
  padding-left: 1.3rem;
}

.seo-content strong {
  color: #bcbcbc;
  font-weight: 500;
}

.seo-content a {
  color: #6aa8ff;
  text-decoration: none;
}

.seo-content a:hover {
  text-decoration: underline;
}

.seo-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.4rem 0 0.9rem;
}

.seo-content th,
.seo-content td {
  text-align: left;
  padding: 0.3rem 0.6rem 0.3rem 0;
  border-bottom: 1px solid #242424;
  font-size: 0.85rem;
}

.seo-content th {
  color: #a8a8a8;
  font-weight: 500;
}

@media (max-width: 540px) {
  .app {
    padding: 4rem 1rem 1.25rem;
  }

  .site-brand {
    top: 0.55rem;
    left: 0.55rem;
    padding: 0.4rem 0.7rem;
  }

  .site-brand-tag {
    display: none;
  }

  h1 {
    font-size: 1.15rem;
    margin-bottom: 1.2rem;
  }

  .display {
    font-size: 4.5rem;
    height: 5rem;
    min-width: 140px;
  }

  .result-big {
    font-size: 2.5rem;
  }

  .result-verdict {
    font-size: 1.35rem;
  }

  .answers button {
    min-width: 5.2rem;
    padding: 0.7rem 0.9rem;
  }
}
