/*
 * tot.css: Tater Tot mode (kids), in the Baked Potato Shrine style but
 * friendlier: big buttons (at least 64px to tap), lots of color, very
 * little text. Phones: one column. Wide screens and iPads: two columns.
 */
:root {
  --comic: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
html {
  background: #006699 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><rect fill="%23006699" width="100" height="100"/><circle fill="%23009999" cx="50" cy="50" r="30"/></svg>');
}
body {
  margin: 0 auto;
  max-width: 1280px;
  padding: 16px 16px 40px;
  font-family: var(--comic);
  color: #ffff00;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: var(--comic); cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible { outline: 4px dashed #ff00ff; outline-offset: 3px; }

/* --- header ---------------------------------------------------------- */
.tot-header {
  background: linear-gradient(to bottom, #ffcc33, #ff8800);
  border: 5px ridge #ffd700;
  box-shadow: 5px 5px 0 #000;
  padding: 14px 12px;
  text-align: center;
}
h1 {
  margin: 0;
  font-size: clamp(30px, 8vw, 54px);
  line-height: 1.1;
  color: #fff;
  text-shadow: 3px 3px #ff3300, 5px 5px #000;
}
/* The tater tot drawing (tot.svg): there's no emoji for one. */
.tot-icon { width: 1em; height: 1em; vertical-align: -0.12em; }
.tot-icon.flip { transform: scaleX(-1); }
.tot-icon.small { width: 1.4em; height: 1.4em; vertical-align: -0.35em; }
@media (max-width: 480px) { h1 .tot-icon.flip { display: none; } }   /* one tot fits on a phone, two wrap */
.subtitle { margin: 6px 0 0; color: #663300; font-weight: 700; font-size: clamp(14px, 3.5vw, 20px); }
.grownups { text-align: center; margin: 12px 0 18px; }
.grownups a {
  display: inline-block; padding: 6px 12px;
  background: #000; color: #00ffff; border: 2px outset #444;
  text-decoration: none; font-weight: 700; font-size: 14px;
}

/* --- layout ------------------------------------------------------------- */
.tot {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "pick" "play" "chords" "hear" "xylo";
}
.pick-panel { grid-area: pick; }
.play-panel { grid-area: play; }
.chords { grid-area: chords; }
.hear-panel { grid-area: hear; }
.xylo-panel { grid-area: xylo; }
@media (min-width: 900px) {
  .tot {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    grid-template-areas: "pick chords" "play chords" "hear xylo";
    align-items: start;
  }
}

.panel {
  background: #fff;
  color: #000;
  border: 3px solid #000;
  box-shadow: 5px 5px 0 #000;
  padding: 14px;
  min-width: 0;
}
h2 { margin: 0 0 10px; color: #ff0000; font-size: 24px; text-decoration: underline; }
.tip { margin: 10px 0 0; font-size: 15px; color: #333; }

/* --- instruments --------------------------------------------------------- */
.instruments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.inst {
  min-height: 84px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(to bottom, #f4f4f4, #c8c8c8);
  border: 3px outset #ddd;
  box-shadow: 3px 3px 0 #000;
  color: #000;
  font-size: 14px; font-weight: 700;
  padding: 6px 2px;
}
.inst .pic { font-size: 38px; line-height: 1; }
.inst[aria-checked="true"] { background: linear-gradient(to bottom, #fff2a8, #ffd700); border-style: inset; box-shadow: none; transform: translate(3px, 3px); }

/* --- play along --------------------------------------------------------- */
.play-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.big-btn {
  min-height: 64px;
  padding: 10px 18px;
  border: 3px outset #ffcc00;
  box-shadow: 4px 4px 0 #000;
  font-size: 22px; font-weight: 700;
  color: #000;
}
.big-btn:active { border-style: inset; box-shadow: 1px 1px 0 #000; transform: translate(3px, 3px); }
.play { background: linear-gradient(to bottom, #9bff6a, #2fbf2f); flex: 1 1 150px; }
.play.on { background: linear-gradient(to bottom, #ff8a8a, #e00000); color: #fff; border-color: #ff6666; }
.new-song { background: linear-gradient(to bottom, #ffff66, #ff9900); flex: 1 1 150px; }
.speeds { display: flex; gap: 6px; }
.speed {
  width: 64px; height: 64px;
  font-size: 32px;
  background: linear-gradient(to bottom, #f4f4f4, #c8c8c8);
  border: 3px outset #ddd;
  box-shadow: 3px 3px 0 #000;
  padding: 0;
}
.speed[aria-checked="true"] { background: linear-gradient(to bottom, #fff2a8, #ffd700); border-style: inset; box-shadow: none; transform: translate(3px, 3px); }
.song-strip { display: flex; gap: 8px; margin-top: 14px; align-items: stretch; }
.song-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 4px;
  border: 3px solid #000;
  background: var(--c);
  color: #000;
  text-align: center;
  font-weight: 700; font-size: 20px;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
  opacity: .55;
}
.song-chip .face { display: block; font-size: 24px; }
.song-chip.now { opacity: 1; outline: 5px solid #ffff00; outline-offset: 2px; }
.song-key { margin: 8px 0 0; font-size: 14px; color: #333; }
.stars-row { margin: 12px 0 0; font-size: 22px; font-weight: 700; min-height: 1.5em; }
.stars { display: inline-block; padding: 4px 12px; background: #000; color: #ffff00; border: 2px solid #ffd700; font-family: "Courier New", monospace; }
.cheer { color: #c2185b; }

/* --- the four big chords ------------------------------------------------ */
.chords { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chord {
  position: relative;
  min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--c);
  border: 4px solid #000;
  box-shadow: 6px 6px 0 #000;
  color: #000;
  padding: 10px 6px;
  transition: transform .08s;
}
.chord:active, .chord.hit { transform: translate(4px, 4px); box-shadow: 2px 2px 0 #000; }
.chord .face { font-size: 46px; line-height: 1; }
.chord .name { font-size: clamp(38px, 10vw, 60px); font-weight: 700; line-height: 1; color: #fff; text-shadow: 3px 3px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000; }
.chord .feel { font-size: 17px; font-weight: 700; background: rgba(255, 255, 255, .85); padding: 1px 8px; }
.chord .dots { display: flex; gap: 4px; margin-top: 4px; }
.dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 4px;
  border-radius: 15px;
  background: var(--c);
  border: 2px solid #000;
  color: #fff;
  font-weight: 700; font-size: 14px;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
}
.chord.glow { outline: 8px solid #ffff00; outline-offset: 3px; animation: glow .5s infinite alternate; }
@keyframes glow { from { box-shadow: 6px 6px 0 #000, 0 0 0 0 #ffff00; } to { box-shadow: 6px 6px 0 #000, 0 0 30px 10px #ffff00; } }
.chord .next-badge {
  position: absolute; top: -12px; right: -8px;
  background: #000; color: #ffff00; border: 2px solid #ffff00;
  font-size: 13px; padding: 2px 6px;
}
.burst {
  position: absolute; left: 50%; top: 40%;
  font-size: 54px;
  pointer-events: none;
  animation: burst .8s ease-out forwards;
}
@keyframes burst { from { transform: translate(-50%, -50%) scale(.4); opacity: 1; } to { transform: translate(-50%, -160%) scale(1.4); opacity: 0; } }

/* --- what you're hearing ------------------------------------------------ */
.hear-text { font-size: 22px; font-weight: 700; margin: 0 0 10px; min-height: 1.4em; }
.hear-text .dot { margin: 0 2px; }
.mini-keys { position: relative; height: 96px; border: 3px solid #000; background: #000; }
.mk { position: absolute; top: 0; bottom: 0; border: 1px solid #000; }
.mk.white { background: #fff; }
.mk.black { background: #222; height: 58%; bottom: auto; z-index: 1; }
.mk.lit { background: var(--c); }
.mk .lbl {
  position: absolute; left: 0; right: 0; bottom: 4px;
  text-align: center; font-size: 12px; font-weight: 700; color: #fff;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
}
.mk.black .lbl { bottom: 2px; font-size: 10px; }

/* --- xylophone ------------------------------------------------------------ */
.xylo { display: flex; gap: 6px; align-items: center; height: 220px; padding: 8px 4px; background: #8a5a2b; border: 3px solid #000; }
.bar {
  flex: 1 1 0;
  min-width: 0;
  height: var(--size);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 8px 0;
  background: var(--c);
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: 2px 2px 0 #000;
  color: #fff;
  font-weight: 700;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
}
.bar .nm { font-size: 20px; }
.bar .sol { font-size: 13px; }
.bar:active, .bar.hit { filter: brightness(1.35); transform: translateY(2px); }

footer { text-align: center; color: #fff; text-shadow: 1px 1px #000; margin-top: 30px; }
footer a { color: #ffff66; }

@media (max-width: 420px) {
  .instruments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chord { min-height: 140px; }
}
/* Phones: eight bars side by side would be too thin for small fingers, so
   the xylophone stands up like a ladder: do at the bottom, full-width bars
   getting shorter as the notes go up. */
@media (max-width: 560px) {
  .xylo { flex-direction: column-reverse; height: auto; gap: 6px; padding: 8px; }
  .bar {
    flex: none;
    width: var(--size); height: 48px;
    flex-direction: row; padding: 0 14px;
  }
  .bar .nm { font-size: 20px; }
  .bar .sol { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .chord.glow { animation: none; box-shadow: 6px 6px 0 #000, 0 0 24px 8px #ffff00; }
  .burst { animation: none; display: none; }
  .chord { transition: none; }
}
