/* Piano Trainer 3 — base : tokens, thème, accueil, configuration */

/* 1. Design tokens */
.pt3 {
  --pt3-bg:        #fff8ee;
  --pt3-surface:   #ffffff;
  --pt3-surface-2: #fdf0dc;
  --pt3-text:      #2b2438;
  --pt3-muted:     #6b6378;
  --pt3-accent:    #6c4ae0;
  --pt3-accent-2:  #8b6cf5;
  --pt3-good:      #1f9d55;
  --pt3-good-bg:   #dff7e8;
  --pt3-bad:       #e0453a;
  --pt3-bad-bg:    #fde4e1;
  --pt3-near:      #e08a00;
  --pt3-near-bg:   #fff0cf;
  --pt3-target:    #2563eb;
  --pt3-line:      #e7dcc9;
  --pt3-radius:    18px;
  --pt3-shadow:    0 4px 18px rgba(60, 40, 120, .14);
  --pt3-transition: .2s ease;
  --pt3-c-C: #e5484d; --pt3-c-D: #f08c2b; --pt3-c-E: #e9b500; --pt3-c-F: #3fae66;
  --pt3-c-G: #2f9bd6; --pt3-c-A: #5865d8; --pt3-c-B: #a45bd0;
}
.pt3[data-theme="dark"] {
  --pt3-bg: #1b1726; --pt3-surface: #2a2438; --pt3-surface-2: #352d47;
  --pt3-text: #f4eefc; --pt3-muted: #b2a8c6; --pt3-accent: #9b82ff; --pt3-accent-2: #b7a5ff;
  --pt3-good: #4cd68a; --pt3-good-bg: #1b3b2b; --pt3-bad: #ff7a70; --pt3-bad-bg: #482321;
  --pt3-near: #ffb84a; --pt3-near-bg: #43331a; --pt3-target: #6ea0ff; --pt3-line: #4a3f62;
  --pt3-shadow: 0 4px 18px rgba(0, 0, 0, .4);
}
@media (prefers-color-scheme: dark) {
  .pt3[data-theme="auto"] {
    --pt3-bg: #1b1726; --pt3-surface: #2a2438; --pt3-surface-2: #352d47;
    --pt3-text: #f4eefc; --pt3-muted: #b2a8c6; --pt3-accent: #9b82ff; --pt3-accent-2: #b7a5ff;
    --pt3-good: #4cd68a; --pt3-good-bg: #1b3b2b; --pt3-bad: #ff7a70; --pt3-bad-bg: #482321;
    --pt3-near: #ffb84a; --pt3-near-bg: #43331a; --pt3-target: #6ea0ff; --pt3-line: #4a3f62;
  }
}

/* 2. Layout général (plein écran) */
body.app-bare { background: #fff8ee; }
.app-bare-main { min-height: 100vh; }
.pt3 {
  min-height: 100vh; background: var(--pt3-bg); color: var(--pt3-text);
  font-family: ui-rounded, "Nunito", "Segoe UI", system-ui, sans-serif; line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
.pt3 *, .pt3 *::before, .pt3 *::after { box-sizing: border-box; }
.pt3 button { margin: 0; font-family: inherit; }
.pt3 [hidden] { display: none !important; }
.pt3-screen { max-width: 920px; margin: 0 auto; padding: 12px 16px 40px; }
.pt3-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pt3 :focus-visible { outline: 3px solid var(--pt3-accent); outline-offset: 2px; }
.pt3 h1, .pt3 h2, .pt3 h3 { font-family: inherit; letter-spacing: 0; }

/* 3. Accueil */
.pt3-home-head { display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.pt3-back { color: var(--pt3-muted); text-decoration: none; font-size: .95rem; }
.pt3-back:hover { color: var(--pt3-accent); }
.pt3-hero { text-align: center; padding: 8px 0 20px; }
.pt3-logo { font-size: clamp(3rem, 12vw, 4.5rem); }
.pt3-hero h1 { font-size: clamp(2rem, 7vw, 3rem); margin: 4px 0; }
.pt3-tagline { font-size: clamp(1rem, 3.4vw, 1.25rem); color: var(--pt3-muted); margin-bottom: 18px; }
.pt3-tagline strong { color: var(--pt3-accent); }
.pt3-progress-line { margin-top: 12px; color: var(--pt3-muted); font-size: .95rem; }

.pt3-path { list-style: none; margin: 0 auto; padding: 0; max-width: 560px; display: flex; flex-direction: column; gap: 10px; }
.pt3-sep { text-align: center; font-weight: 800; color: var(--pt3-muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 2px; }
.pt3-node {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--pt3-surface); border: 2px solid var(--pt3-line); border-radius: var(--pt3-radius);
  padding: 12px 16px; cursor: pointer; color: inherit; box-shadow: var(--pt3-shadow);
  transition: transform var(--pt3-transition), border-color var(--pt3-transition);
}
.pt3-node:hover { transform: translateY(-2px); border-color: var(--pt3-accent-2); }
.pt3-node-ico {
  flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.7rem; background: var(--pt3-surface-2);
}
.pt3-node-txt { flex: 1; min-width: 0; }
.pt3-node-title { display: block; font-weight: 800; font-size: 1.05rem; }
.pt3-node-sub { display: block; color: var(--pt3-muted); font-size: .88rem; }
.pt3-node-stars { flex: none; letter-spacing: 2px; font-size: 1rem; color: #e9b500; }
.pt3-node.is-next { border-color: var(--pt3-accent); animation: pt3-pulse 2s ease-in-out infinite; }
.pt3-node.is-done .pt3-node-ico { background: var(--pt3-good-bg); }
.pt3-node.is-song .pt3-node-ico { background: #ffe4f0; }
.pt3-node .pt3-dim { color: var(--pt3-line); }
@keyframes pt3-pulse { 50% { box-shadow: 0 0 0 6px rgba(108, 74, 224, .18); } }
.pt3-foot { text-align: center; color: var(--pt3-muted); font-size: .85rem; margin-top: 28px; }

/* 4. Configuration */
.pt3-setup { max-width: 560px; margin: 0 auto; }
.pt3-setup h2 { font-size: 1.6rem; margin: 10px 0 16px; text-align: center; }
.pt3-choices { display: flex; flex-direction: column; gap: 10px; }
.pt3-choice {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--pt3-surface); border: 2px solid var(--pt3-line); border-radius: var(--pt3-radius);
  padding: 14px 16px; cursor: pointer; color: inherit; font-size: 1rem;
}
.pt3-choice small { display: block; color: var(--pt3-muted); }
.pt3-choice-ico { font-size: 2rem; }
.pt3-choice[aria-checked="true"] { border-color: var(--pt3-accent); background: var(--pt3-surface-2); }
.pt3-test { margin-top: 18px; background: var(--pt3-surface); border-radius: var(--pt3-radius); padding: 18px; box-shadow: var(--pt3-shadow); text-align: center; }
.pt3-test-msg { font-weight: 700; margin-bottom: 12px; }
.pt3-meter { height: 14px; border-radius: 7px; background: var(--pt3-surface-2); overflow: hidden; }
.pt3-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3fae66, #e9b500, #e5484d); transition: width .08s linear; }
.pt3-test-note { font-size: 2.6rem; font-weight: 900; margin: 12px 0 4px; min-height: 3.4rem; }
.pt3-hint { color: var(--pt3-muted); font-size: .9rem; margin: 8px 0 12px; }
