/* Shared chrome + cream theme for standalone Fun & Games pages
   (Music Match, Rhythm Star, Sound Family Sort, Fruit Rhythm).
   John-approved mockups 12:32 AM Nov 30. */
html,body{background:#faf7f0;color:#173b89}
.academy-header{background:#faf7f0!important;color:#173b89!important;border-bottom:1px solid #ead9b8;box-shadow:none}
.academy-header .brand-mark,.academy-header .brand{background:transparent!important;box-shadow:none!important;border:0!important}
.academy-header .crumb{display:none}
.fgp-logohead{display:flex;justify-content:center;align-items:center;padding:10px 16px 8px;background:#faf7f0}
.fgp-logohead .brand{display:flex;justify-content:center;background:transparent}
.fgp-logohead img{width:min(220px,70vw);height:auto;display:block}

.fgp{max-width:920px;margin:0 auto 8px;color:#173b89;padding:0 4px}
.fgp,.fgp-hero{max-width:100%}
.fgp-back{display:inline-flex;align-items:center;gap:.4rem;margin:0 0 12px;padding:.45rem .95rem;background:#fff;color:#173b89;font-weight:800;text-decoration:none;border:2.5px solid #f2c14e;border-radius:999px;box-shadow:0 2px 0 #e0b84a;line-height:1.2}
.fgp-back:focus-visible{outline:3px solid #173b89;outline-offset:3px}
.fgp-hero{border-radius:18px;overflow:hidden;background:#ead9c2;aspect-ratio:2.3/1}
.fgp-hero img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 40%}
.fgp-banner{display:flex;align-items:center;gap:.45rem;margin:-1.45rem 6px 12px;background:#173b89;color:#fff;border:3px solid #f2c14e;border-radius:999px;padding:.2rem 1.05rem .2rem .2rem;box-shadow:0 4px 0 #c9a227;position:relative;z-index:2;min-height:3.4rem}
.fgp-ico{width:3.15em;height:3.15em;flex:0 0 auto;display:flex;align-items:center;justify-content:center;overflow:hidden;border-radius:50%}
.fgp-ico img{max-width:100%;max-height:100%;object-fit:contain}
.fgp-banner h1{margin:0;font-size:clamp(1.1rem,5.1vw,1.85rem);font-weight:800;line-height:1.15;text-wrap:balance;color:#fff;font-family:inherit}
.fgp-banner em{color:#ffcf42;font-style:normal;margin-left:.28em}
.fgp-intro{margin:0 auto 14px;max-width:38rem;text-align:center;background:#fff8e7;border:2px solid #f2c14e;border-radius:1.6rem;padding:.7rem 1.15rem;font-weight:700;color:#173b89;text-wrap:pretty}

/* Colorful hub cards */
.stats-row{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:8px 0 14px}
.stat,.stats-row .stat{background:#fff;border:2px solid #ead9b8;border-radius:16px;padding:.55rem .75rem;min-width:5.5rem}
.level-card[data-id="easy"],.level-card[data-open][data-id="easy"]{background:#d9ecff;border-color:#7eb3e8}
.level-card[data-id="medium"]{background:#eadbff;border-color:#b49ae0}
.level-card[data-id="hard"]{background:#d8f5cf;border-color:#7cbc6a}
.level-card[data-id="daily"],.level-card[data-id="learn"]{background:#ffe7c4;border-color:#e0b36a}
.level-card .fgp-play, .level-card > .stars, .level-card .lock-pill{
  border-radius:999px;padding:.35rem .8rem;font-weight:800;
}
.level-card > .stars{background:#ffcf42;color:#173b89;border:2px solid #173b89;box-shadow:0 2px 0 #173b89}
#app .section h2, main .section h2, .section h2{
  background:#173b89!important;color:#fff!important;display:inline-block;padding:.28rem .9rem;border-radius:999px;
  font-size:.95rem!important;line-height:1.3;max-width:100%;
}

@media (min-width:700px){
  .fgp-hero{aspect-ratio:2.5/1;border-radius:22px}
  .fgp-banner{margin-left:24px;margin-right:24px}
  .level-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* ----- Music Match light restyle ----- */
html.fgp-music,html.fgp-music body,body.fgp-music{background:#faf7f0!important;color:#173b89!important}
body.fgp-music::before,html.fgp-music body::before{display:none!important;background:none!important}
.fgp-music main{max-width:560px;margin:0 auto;padding:8px 14px 40px;text-align:center;color:#173b89}
.fgp-music main>.tag,.fgp-music main>h1,.fgp-music main>.sub{display:none}
.fgp-music .game{background:#fff;border:3px solid #f2c14e;border-radius:24px;box-shadow:0 8px 18px rgba(23,59,137,.08);padding:14px;color:#173b89}
.fgp-music .pill{background:#e8f1ff;color:#173b89;border:2px solid #173b89;border-radius:30px;padding:8px 13px;font-weight:800}
.fgp-music .button{border:3px solid #173b89;border-radius:999px;background:#ffcf42;box-shadow:0 3px 0 #173b89;color:#173b89;padding:10px 14px;font-weight:800}
.fgp-music .button.green{background:#b6f08a;box-shadow:0 3px 0 #173b89;border-color:#173b89;color:#173b89}
.fgp-music .button.purple{background:#e0c4ff;box-shadow:0 3px 0 #173b89;border-color:#173b89;color:#173b89}
.fgp-music .boardwrap{background:#f4e9ff;border:2px solid #c9b0ea;border-radius:20px;box-shadow:none}
.fgp-music .tile{background:linear-gradient(180deg,#f3e8ff,#d7c2f6);border:2px solid #fff;color:#173b89}
.fgp-music .tray{background:#fff8e7;border:3px solid #f2c14e}
.fgp-music .tray-label{color:#173b89}
.fgp-music .msg,.fgp-music .how,.fgp-music footer{color:#173b89}
.fgp-music .overlay .card{background:#fff;color:#173b89;border:3px solid #f2c14e}
.fgp-music a{color:#173b89}

/* ----- Rhythm Star light/cream restyle (including the play stage) ----- */
html.fgp-rhythm,html.fgp-rhythm body,body.fgp-rhythm,#app{background:#faf7f0!important;color:#173b89}
#app{background:#faf7f0!important}
.fgp-rhythm #app{overflow:auto;min-height:100dvh;background:#faf7f0!important}
.fgp-rhythm .screen{background:transparent;color:#173b89}
.fgp-rhythm .top{display:none}
.fgp-rhythm .hero h1{display:none}
.fgp-rhythm .hero{margin:0}
.fgp-rhythm .hero p,.fgp-rhythm .eyebrow{display:none}
.fgp-rhythm .card{background:linear-gradient(125deg,#ffd3ee,#e4d4ff 60%);color:#173b89;box-shadow:0 8px 18px rgba(23,59,137,.1);border:3px solid #f2c14e}
.fgp-rhythm .card p,.fgp-rhythm .card .tag{color:#173b89}
.fgp-rhythm .play{background:#ffcf42;color:#173b89;border:3px solid #173b89;box-shadow:0 3px 0 #173b89;font-weight:800}
.fgp-rhythm .section h3{color:#173b89}
.fgp-rhythm .section span{color:#4d5a70}
.fgp-rhythm .song{background:#fff;border:2px solid #ead9b8;color:#173b89}
.fgp-rhythm .song:nth-child(odd){background:#fff3d6}
.fgp-rhythm .song:nth-child(even){background:#efe6ff}
.fgp-rhythm .song button{background:#ffcf42;color:#173b89;border-radius:50%;width:44px;height:44px;font-weight:800;border:2px solid #173b89}
.fgp-rhythm .notice,.fgp-rhythm .settings,.fgp-rhythm .bottom{color:#173b89}
.fgp-rhythm .bottom{background:#faf7f0}
.fgp-rhythm .bottom a,.fgp-rhythm .bottom button{color:#173b89!important}
.fgp-rhythm #game{background:#faf7f0!important;color:#173b89}
.fgp-rhythm .gamehead button{background:#173b89;color:#fff}
.fgp-rhythm .score{color:#173b89}
.fgp-rhythm .score small{color:#173b89}
.fgp-rhythm .progress{background:#ead9b8}
.fgp-rhythm .track{background:#fff;border-color:#d7c9a4}
.fgp-rhythm .lane{border-color:#ead9b8}
.fgp-rhythm .hitline{background:#173b89;box-shadow:0 0 12px #f2c14e}
.fgp-rhythm .target{border-color:#173b89}
.fgp-rhythm .hint{color:#173b89}
.fgp-rhythm #pausebox .box,.fgp-rhythm #result .box{background:#fff;color:#173b89;border:3px solid #f2c14e}
.fgp-rhythm .muted{color:#4d5a70}

html,body{overflow-x:hidden}
.fgp-music .tray > *{background:#f4e9c8!important;border:2px solid #e2c48a!important;border-radius:12px;box-shadow:none}


/* ===== Tight first-screen chrome (390px), John 12:46 AM review ===== */
.academy-layout:has(.fgp) .topbar{
  padding:4px 10px!important;min-height:0!important;gap:4px!important;
  background:#faf7f0!important;border-bottom:1px solid #ead9b8;
}
.academy-layout:has(.fgp) #location{font-size:.75rem!important;line-height:1.1}
.academy-layout:has(.fgp) .top-actions{gap:4px!important}
.academy-layout:has(.fgp) .top-actions>button,
.academy-layout:has(.fgp) .top-actions>a{
  min-height:34px!important;padding:4px 8px!important;font-size:.75rem!important;
}
.academy-layout:has(.fgp) #main,
.academy-layout #main:has(.fgp){padding-left:0!important;padding-right:0!important;padding-top:4px!important;overflow-x:hidden}
.academy-layout:has(.fgp) .app-header,.academy-layout:has(.fgp) .academy-header{padding-bottom:4px}

.fgp{position:relative;max-width:none;margin:0;padding:0;color:#173b89}
.fgp-hero{
  position:relative;width:100%;margin:0;padding:0;
  border-radius:0!important;overflow:hidden;background:transparent;
  aspect-ratio:auto!important;
}
.fgp-hero img{
  display:block;width:100%!important;height:auto!important;
  object-fit:contain!important;object-position:center center;
  max-width:100%;max-height:190px;
}
.fgp-hero::after{
  content:"";position:absolute;left:0;right:0;bottom:0;height:38%;
  background:linear-gradient(to bottom,rgba(250,247,240,0) 0%,#faf7f0 92%);
  pointer-events:none;z-index:1;
}
.fgp-back{
  position:absolute;top:8px;left:10px;z-index:4;
  margin:0!important;padding:.32rem .8rem;
  font-size:.82rem;background:#fff;color:#173b89;font-weight:800;
  text-decoration:none;border:2.5px solid #f2c14e;border-radius:999px;
  box-shadow:0 2px 0 #e0b84a;line-height:1.15;
}
.fgp-banner{
  display:flex;align-items:center;gap:.4rem;
  margin:-2.1rem 10px 6px;padding:.12rem .85rem .12rem .12rem;
  background:#173b89;color:#fff;border:3px solid #f2c14e;border-radius:999px;
  box-shadow:0 4px 0 #c9a227;position:relative;z-index:3;min-height:3.55rem;
}
.fgp-ico{width:3.4em;height:3.4em;flex:0 0 auto;overflow:hidden;border-radius:50%;display:flex;align-items:center;justify-content:center}
.fgp-ico img{max-width:110%;max-height:110%;object-fit:contain}
.fgp-banner h1{
  margin:0;font-size:clamp(1.7rem,9.4vw,2.5rem);font-weight:900;line-height:1.05;
  text-wrap:nowrap;color:#fff;letter-spacing:-.02em;font-family:inherit;
}
.fgp-banner em{color:#ffcf42;font-style:normal;margin-left:.2em;font-weight:900}
.fgp-intro{
  margin:0 16px 8px;max-width:none;text-align:center;
  background:#fff8e7;border:2px solid #f2c14e;border-radius:999px;
  padding:.32rem .85rem;font-weight:700;font-size:.8rem;line-height:1.25;
  color:#173b89;text-wrap:pretty;
}
.fgp-h2{font-size:clamp(1.05rem,4.4vw,1.45rem)!important;margin:.1rem 12px .15rem!important}
.fgp-lead{margin:0 16px 6px!important;font-size:.86rem;line-height:1.3}
.fgp-playwrap{margin:4px 12px}
.fgp-gold{padding:.55rem 1.1rem;font-size:.95rem}
.fgp-actions{margin:2px 12px 8px;gap:8px}
.fgp-notes{margin:6px 12px;gap:8px}
.fgp-note{padding:.4rem .35rem .5rem}
.fgp-note img{width:52px;height:52px}
.fgp-note strong{font-size:clamp(1.35rem,5.4vw,1.75rem)}
.fgp-kb{margin:8px 12px 6px;padding:6px}
.fgp-kb span{padding:.85rem 0 .28rem}
.fgp-status{margin:.2rem 12px .3rem;font-size:.85rem;min-height:0}
.fgp-pic{padding:8px 8px;margin:2px 16px 8px;max-width:none}
.fgp-pic img{max-height:132px}
.fgp-choices{margin:4px 12px 8px;gap:6px}
.fgp-choice{padding:.55rem .4rem;font-size:.9rem;border-radius:14px}
.fgp-lyric{margin:4px 12px 10px;padding:8px}
.fgp-body,.birthday-room.fgp-body{padding:0 0 8px}
.fgp-stage .fun-support,.fgp-stage>p.muted{margin-left:12px;margin-right:12px}

/* Compact stats chips, single row */
.stats-row{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;margin:4px 10px 8px!important;flex-wrap:nowrap!important;
}
.stat,.stats-row .stat{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:0;padding:.3rem .25rem!important;min-width:0!important;border-radius:14px;
  background:#fff;border:2px solid #ead9b8;
}
.stat b{font-size:.95rem!important;line-height:1.1}
.stat span{font-size:.62rem!important;line-height:1.15;text-align:center}

/* Family / Fruit: 3 compact level cards on the first phone screen */
.level-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px;margin:0 10px 10px}
#app .section, main .section{margin:8px 10px 6px!important;align-items:center}
#app .section .hint, main .section .hint{font-size:.68rem}
#app .section h2, main .section h2, .section h2{
  background:#173b89!important;color:#fff!important;display:inline-block;
  padding:.2rem .7rem;border-radius:999px;font-size:.8rem!important;line-height:1.2;
}
.level-card{
  display:flex!important;flex-direction:column;align-items:center;text-align:center;
  gap:4px!important;padding:8px 5px 10px!important;
  grid-template-columns:none!important;
}
.level-card h3{font-size:.92rem!important}
.level-card p{font-size:.65rem!important;line-height:1.25!important;margin:0!important}
.level-card .level-ico{min-width:0;min-height:0;font-size:1.7rem}
.level-card[data-id="easy"],.level-card[data-level="easy"]{background:#d9ecff!important;border-color:#7eb3e8!important}
.level-card[data-id="medium"],.level-card[data-level="medium"]{background:#eadbff!important;border-color:#b49ae0!important}
.level-card[data-id="hard"],.level-card[data-level="hard"]{background:#d8f5cf!important;border-color:#7cbc6a!important}
.level-card[data-id="daily"],.level-card[data-id="learn"],.level-card[data-mode="learn"],.level-card[data-level="learn"]{background:#e8f4ff!important;border-color:#8bb8e8!important}
.level-card > .stars,.level-card[data-open]::after{
  background:#ffcf42;color:#173b89;border:2px solid #173b89;border-radius:999px;
  padding:.22rem .55rem;font-weight:800;font-size:.72rem;box-shadow:0 2px 0 #173b89;
}
.level-card[data-mode="learn"][data-open]::after{content:"▶ Play";margin-top:4px}
.level-card .lock-pill{background:#173b89;color:#fff;border-radius:999px;padding:.22rem .45rem;font-size:.68rem}

/* Fruit art on Fruit Rhythm / Say the Beat hub cards */
.level-card[data-mode="learn"] .level-ico,
.level-card[data-kind="learn"] .level-ico{font-size:0!important}
.level-card[data-mode="learn"] .level-ico::before,
.level-card[data-kind="learn"] .level-ico::before{content:"🍓";font-size:2rem;line-height:1}
.level-card[data-mode="listen"][data-level="easy"] .level-ico{font-size:0!important}
.level-card[data-mode="listen"][data-level="easy"] .level-ico::before{content:"🍇";font-size:2rem;line-height:1}
.level-card[data-mode="listen"][data-level="medium"] .level-ico{font-size:0!important}
.level-card[data-mode="listen"][data-level="medium"] .level-ico::before{content:"🥭";font-size:2rem;line-height:1}
.level-card[data-mode="listen"][data-level="hard"] .level-ico{font-size:0!important}
.level-card[data-mode="listen"][data-level="hard"] .level-ico::before{content:"🍉";font-size:2rem;line-height:1}

/* Learn is a full-width card above the 3-col listen row */
.level-grid:has([data-mode="learn"]){grid-template-columns:1fr!important}
div.section + .level-grid:has([data-mode="listen"]){grid-template-columns:repeat(3,minmax(0,1fr))!important}

@media (min-width:700px){
  .fgp-hero img{width:100%;height:auto;max-height:240px}
  .fgp-banner{margin-left:24px;margin-right:24px}
  .fgp-back{left:20px;top:12px}
  .fgp-intro{max-width:36rem;margin-left:auto;margin-right:auto}
  .fgp-note img{width:72px;height:72px}
  .level-grid{gap:12px;margin-left:24px;margin-right:24px}
}

/* ----- Music Match: board + action buttons on the first screen ----- */
.fgp-music main{max-width:none!important;padding:0 0 28px!important;text-align:center}
.fgp-logohead{padding:6px 12px 4px!important}
.fgp-logohead img{width:min(200px,64vw)}
.fgp-music .game{
  display:grid;
  grid-template-columns:1fr 1fr auto auto;
  grid-template-areas:
    "level remain remain remain"
    "board board board board"
    "ctrl  ctrl  ctrl  ctrl"
    "msg   msg   msg   msg"
    "tlab  tlab  tlab  tlab"
    "tray  tray  tray  tray"
    "set   mus   .     ."
    "how   how   how   how";
  background:transparent!important;border:0!important;box-shadow:none!important;
  padding:0 10px 16px!important;margin:0;gap:6px 6px;
}
.fgp-music .top{display:contents}
.fgp-music #level{grid-area:level;justify-self:end}
.fgp-music #remaining{grid-area:remain;justify-self:start}
.fgp-music #open-settings{grid-area:set;justify-self:start}
.fgp-music #music{grid-area:mus;justify-self:start}
.fgp-music .boardwrap{grid-area:board;margin:2px 0!important;padding:6px!important}
.fgp-music .board{aspect-ratio:4/3.05!important;max-height:34vh;max-width:100%}
.fgp-music .controls{grid-area:ctrl;margin:2px 0}
.fgp-music .msg{grid-area:msg;margin-top:4px!important;min-height:0!important;padding:8px!important}
.fgp-music .tray-label{grid-area:tlab;margin:8px 0 0;font-size:.75rem}
.fgp-music .tray{grid-area:tray;margin:2px auto 0!important}
.fgp-music .how{grid-area:how}
.fgp-music .pill{padding:5px 10px!important;font-size:.75rem!important;background:#e8f1ff;color:#173b89;border:2px solid #c9d9f0}
.fgp-music #hint{background:#ffcf42!important;color:#173b89!important;border-color:#173b89}
.fgp-music #shuffle,.fgp-music .button.purple{background:#e0c4ff!important;color:#173b89!important;border-color:#173b89}
.fgp-music #undo,.fgp-music .button.green{background:#8ec5ff!important;color:#173b89!important;border-color:#173b89}
.fgp-music #restart{background:#ffcf42!important;color:#173b89!important;border-color:#173b89}
.fgp-music .button{padding:8px 6px!important;font-size:.82rem!important;border-radius:999px}
.fgp-music .tile{
  background:linear-gradient(180deg,#f6edff,#cbb4f5)!important;
  border:2px solid #fff!important;border-radius:16px!important;
  color:#173b89!important;box-shadow:0 3px 0 rgba(90,60,160,.25)!important;
}
.fgp-music .tile .name{color:#173b89}
.fgp-music .boardwrap{background:#f3e9ff!important;border:2px solid #d7c2f6!important;border-radius:18px;box-shadow:none!important}

/* ----- Rhythm Star: featured card + Play Now on the first screen ----- */
.fgp-rhythm .screen{
  padding:4px 12px 72px!important;
  min-height:0!important;
}
.fgp-rhythm .hero{margin:0!important}
.fgp-rhythm .hero p,.fgp-rhythm .eyebrow,.fgp-rhythm .hero h1{display:none!important}
.fgp-rhythm .card{
  margin-top:6px!important;padding:12px 14px 14px!important;
  background:linear-gradient(125deg,#ffd3ee,#e4d4ff 60%)!important;
  border:3px solid #f2c14e!important;border-radius:22px;
}
.fgp-rhythm .card h2{font-size:1.45rem!important;margin:6px 0 2px!important;color:#173b89}
.fgp-rhythm .card p{margin:0;font-size:.85rem}
.fgp-rhythm .card .tag{font-size:.68rem}
.fgp-rhythm .play{margin-top:10px!important;padding:10px 18px}
.fgp-rhythm .section{margin-top:14px}
.fgp-rhythm .bottom{padding:8px}

/* Family / fruit page padding */
#app,main#app{padding:0 0 24px!important}
main#app .fgp, #app .fgp{margin:0}

html,body{overflow-x:hidden}

.fgp-banner h1{font-size:clamp(1.45rem,8.4vw,2.45rem);overflow:hidden;text-overflow:clip}
.fgp[data-fgp="detective"] h1,.fgp[data-fgp="family-sort"] h1,.fgp[data-fgp="color-note"] h1{
  font-size:clamp(1.2rem,6.5vw,2rem);letter-spacing:-.03em
}
.fgp[data-fgp="memory"] h1{font-size:clamp(1.35rem,7.6vw,2.2rem)}

/* ===== Shorter uncropped hero + last-four games (John 12:51 AM) ===== */
@media (min-width:700px){
  .fgp-hero img{max-height:240px}
}
.fgp[data-fgp="crescendo"] h1,
.fgp[data-fgp="turntable"] h1,
.fgp[data-fgp="note-friends"] h1{
  font-size:clamp(1.15rem,6.2vw,2rem);letter-spacing:-.03em
}
.fgp[data-fgp="play-piano"] h1{font-size:clamp(1.45rem,8vw,2.45rem)}

/* Rhythm Star: edge-to-edge hero; shrink how-to so the featured card stays on screen */
.fgp-rhythm #home.screen,.fgp-rhythm .screen{padding-left:0!important;padding-right:0!important}
.fgp-rhythm .card,.fgp-rhythm .section,.fgp-rhythm .song,
.fgp-rhythm .notice,.fgp-rhythm .settings,.fgp-rhythm .bottom,.fgp-rhythm .top{
  margin-left:12px;margin-right:12px
}
.fgp-rhythm .top{display:none!important}
.fgp-rhythm details.notice{font-size:.78rem;line-height:1.35;color:#173b89;margin-top:14px;text-align:left}
.fgp-rhythm details.notice summary{cursor:pointer;font-weight:800;color:#173b89}
.fgp-rhythm .settings{margin-top:8px;font-size:.75rem;color:#173b89!important}

/* Fruit: hide leftover word-mark text, keep emoji art */
.level-card .level-ico{position:relative}
.level-card .level-ico > *:not(svg){position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important}
.level-card[data-mode="learn"][data-open]::after{content:"▶ Play"}

/* Play Piano keyboard — two octaves, colorful degree labels */
.fgp[data-fgp="play-piano"] .studio-choice{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;
  margin:4px 12px 8px;padding:0
}
.fgp[data-fgp="play-piano"] .studio-choice label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.fgp[data-fgp="play-piano"] .studio-choice select,
.fgp[data-fgp="play-piano"] #instrument-choice{
  flex:1 1 140px;min-height:42px;border:2px solid #173b89;border-radius:999px;
  padding:6px 12px;font-weight:800;color:#173b89;background:#fff
}
.fgp[data-fgp="play-piano"] #enable-studio-sound{
  background:#1f9d5b!important;color:#fff!important;border:2px solid #173b89!important;
  border-radius:999px;font-weight:800;padding:.45rem .85rem;min-height:42px
}
.fgp[data-fgp="play-piano"] #stop-studio{
  background:#fff!important;color:#c43b3b!important;border:2px solid #e8a0a0!important;
  border-radius:999px;font-weight:800;padding:.45rem .85rem;min-height:42px
}
.fgp[data-fgp="play-piano"] .instrument-surface{margin:0 10px 8px}
.fgp-piano-kb.studio-keyboard{
  height:168px!important;min-width:calc(var(--n,15) * 32px)!important;
  width:100%;background:#173b89;border-radius:16px;padding:8px 6px 10px;box-sizing:border-box
}
.fgp-piano-kb .studio-white{
  width:calc(100% / var(--n,15))!important;min-width:32px;
  background:#fff;border:1px solid #173b89;border-radius:0 0 8px 8px;
  padding:0 0 8px!important;font-size:0!important;box-shadow:0 3px 0 #c5cdd8
}
.fgp-piano-kb .studio-white span{
  display:inline-flex;align-items:center;justify-content:center;
  width:82%;max-width:34px;min-height:22px;border-radius:8px;
  font-size:.68rem!important;font-weight:800;color:#173b89
}
.fgp-piano-kb .studio-white[data-deg="C"] span{background:#ff8a5b}
.fgp-piano-kb .studio-white[data-deg="D"] span{background:#ffb14a}
.fgp-piano-kb .studio-white[data-deg="E"] span{background:#ffe44a}
.fgp-piano-kb .studio-white[data-deg="F"] span{background:#8ee08a}
.fgp-piano-kb .studio-white[data-deg="G"] span{background:#5fd0c4}
.fgp-piano-kb .studio-white[data-deg="A"] span{background:#7eb6ff}
.fgp-piano-kb .studio-white[data-deg="B"] span{background:#c9a4ff}
.fgp-piano-kb .studio-black{
  width:calc(100% / var(--n,15) * .6)!important;height:56%!important;
  background:#173b89;border-radius:0 0 6px 6px;z-index:2
}
.fgp[data-fgp="play-piano"] .studio-card{
  margin:8px 12px 16px;padding:12px 14px;background:#fff8e7;
  border:2px solid #ead9b8;border-radius:18px
}
.fgp[data-fgp="play-piano"] .studio-heading{gap:12px;margin-bottom:8px}
.fgp[data-fgp="play-piano"] .studio-heading img{width:64px;height:78px}
.fgp[data-fgp="play-piano"] .studio-heading h2{font-size:1.15rem;margin:2px 0}
.fgp[data-fgp="play-piano"] .piano-options{margin:8px 0 0;gap:8px}
.fgp[data-fgp="play-piano"] .record-bar{margin-top:10px;padding-top:10px}
.fgp[data-fgp="play-piano"] .note-bar,.fgp[data-fgp="play-piano"] > p.muted{margin:8px 12px 16px}

/* Turntable Playground — cream, decks on the first screen */
.fgp[data-fgp="turntable"] + .nma-playground,
.nma-playground.fgp-tt, .fgp-tt.nma-turntable{
  background:#faf7f0!important;color:#173b89!important;padding:0 12px 24px
}
body:has(.fgp[data-fgp="turntable"]) , body:has(.nma-playground.fgp-tt){background:#faf7f0}
.fgp-tt > header h1,.fgp-tt > header .nma-kicker,.fgp-tt > header > p:first-of-type{display:none!important}
.fgp-tt .nma-start-music, .nma-playground.fgp-tt [data-tt-enable],
.fgp-tt .nma-start-music{
  display:block;width:min(100%,320px);margin:10px auto 8px;text-align:center;
  background:#ffcf42!important;color:#173b89!important;border:3px solid #173b89!important;
  border-radius:999px!important;font-weight:900;font-size:1.15rem;padding:.7rem 1.2rem;
  box-shadow:0 4px 0 #173b89
}
.fgp-tt .nma-decks, .nma-playground.fgp-tt .nma-decks{
  background:linear-gradient(180deg,#d8c7ff,#b8a0f0);border:3px solid #173b89;
  border-radius:22px;padding:10px 8px;margin:4px 0 10px
}
.fgp-tt .nma-challenges{margin-top:16px}
.fgp-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:6px 12px 8px}
.fgp-fact{background:#fff;border:2px solid #ead9b8;border-radius:14px;padding:6px 4px;text-align:center;font-size:.68rem;font-weight:700;color:#173b89;line-height:1.25}
.fgp-fact b{display:block;font-size:.8rem}

/* Note Friends */
body.fgp-friends, html:has(body.fgp-friends){background:#faf7f0!important}
body.fgp-friends{margin:0;color:#173b89}
body.fgp-friends .topbar, body.fgp-friends header.topbar{
  background:#faf7f0!important;box-shadow:none!important;border:0!important
}
body.fgp-friends .rainbow{display:none!important}
body.fgp-friends .back-row, body.fgp-friends #screen-home .title-row{display:none!important}
body:has(#screen-home.active) .lily{display:none!important}
body.fgp-friends .game-grid{
  display:grid!important;grid-template-columns:1fr 1fr;gap:8px;margin:4px 12px 10px
}
body.fgp-friends .game-card{
  border-radius:18px!important;padding:10px 8px!important;min-height:0;
  display:flex;flex-direction:column;align-items:flex-start;gap:4px;
  border:2px solid #ead9b8;box-shadow:0 3px 0 rgba(23,59,137,.08)
}
body.fgp-friends .game-card.c-sing{background:#ffe4f0!important;border-color:#f3b0c8!important}
body.fgp-friends .game-card.c-find{background:#dceeff!important;border-color:#8bb8e8!important}
body.fgp-friends .game-card.c-chain{background:#eadbff!important;border-color:#b49ae0!important}
body.fgp-friends .game-card.c-wheel{background:#ffd6e8!important;border-color:#f0a0c0!important}
body.fgp-friends .game-card b{font-size:.95rem;color:#173b89}
body.fgp-friends .game-card small{font-size:.68rem;color:#3d4d6e;font-weight:600}
body.fgp-friends .meet{margin:8px 12px;padding:10px 8px 12px;background:#fff8e7;border:2px solid #ead9b8;border-radius:18px}
body.fgp-friends .meet h2,.body.fgp-friends .meet-head h2{
  background:#173b89;color:#fff;display:inline-block;padding:.2rem .7rem;border-radius:999px;
  font-size:.85rem!important;margin:0
}
body.fgp-friends .inst-row{margin:8px 12px 20px;padding:8px;background:#fff;border:2px solid #ead9b8;border-radius:16px}

/* Crescendo Challenge — cream theme, menu on the first screen */
body.fgp-crescendo{
  --bg:#faf7f0;--bg-2:#f3eee4;--card:#ffffff;--ink:#173b89;--muted:#3d4d6e;
  --gold:#e0b84a;--gold-2:#c9a227;--gold-hi:#ffe9a0;--line:#ead9b8;
  --glass:#ffffff;--glass-2:#fff8e7;--shadow:0 8px 24px rgba(23,59,137,.12);
  --correct:#1f9d5b;--wrong:#c43b3b;--safe:#e0b84a;
  background:#faf7f0!important;color:#173b89!important
}
body.fgp-crescendo .stage-bg{display:none!important}
body.fgp-crescendo.start-menu .app{
  position:absolute!important;left:-9999px!important;height:0!important;overflow:hidden!important
}
body.fgp-crescendo .top{background:transparent!important;color:#173b89}
body.fgp-crescendo.start-menu .top{display:none!important}
body.fgp-crescendo .overlay{
  background:transparent!important
}
body.fgp-crescendo.start-menu .overlay,
body.fgp-crescendo.start-menu #ov{
  position:static!important;inset:auto!important;display:block!important;
  background:transparent!important;padding:0 0 28px;z-index:2
}
body.fgp-crescendo.start-menu .card, body.fgp-crescendo.start-menu #card{
  background:transparent!important;box-shadow:none!important;border:0!important;
  color:#173b89!important;max-width:none!important;margin:0!important;padding:0 10px 16px!important;
  width:auto!important
}
body.fgp-crescendo.start-menu .wordmark,
body.fgp-crescendo.start-menu #card > h2,
body.fgp-crescendo.start-menu #card > p{display:none!important}
body.fgp-crescendo .rules{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:4px 0 10px
}
body.fgp-crescendo .rules > div{
  display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;
  padding:8px 6px 10px;border-radius:16px;border:2px solid #ead9b8;background:#fff;
  font-size:.68rem;line-height:1.25;font-weight:600;color:#3d4d6e
}
body.fgp-crescendo .rules > div:nth-child(1){background:#e8f1ff;border-color:#8bb8e8}
body.fgp-crescendo .rules > div:nth-child(2){background:#f3e8ff;border-color:#b49ae0}
body.fgp-crescendo .rules > div:nth-child(3){background:#ffe8f0;border-color:#f0a0c0}
body.fgp-crescendo .rules b{display:block;color:#173b89;font-size:.82rem;margin-bottom:2px}
body.fgp-crescendo .rules .ico{width:32px;height:32px;color:#173b89}
body.fgp-crescendo .label{
  background:#173b89;color:#fff!important;display:inline-block;padding:.2rem .75rem;
  border-radius:999px;font-size:.8rem;margin:8px auto 6px;text-align:center
}
body.fgp-crescendo .seg, body.fgp-crescendo .big{
  display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:0 0 8px
}
body.fgp-crescendo .seg button, body.fgp-crescendo .big .btn, body.fgp-crescendo .big button{
  border-radius:16px!important;border:2px solid #ead9b8!important;min-height:72px;
  font-weight:800;color:#173b89!important;font-size:.82rem;padding:8px 4px;line-height:1.2;
  box-shadow:none!important
}
body.fgp-crescendo .seg button:nth-child(1), body.fgp-crescendo .big button:nth-child(1){background:#fff4c8!important;border-color:#e0b84a!important}
body.fgp-crescendo .seg button:nth-child(2), body.fgp-crescendo .big button:nth-child(2){background:#e4f4d8!important;border-color:#8ec07a!important}
body.fgp-crescendo .seg button:nth-child(3), body.fgp-crescendo .big button:nth-child(3){background:#eadbff!important;border-color:#b49ae0!important}
body.fgp-crescendo .seg button.on{outline:3px solid #173b89;outline-offset:0}
body.fgp-crescendo .link, body.fgp-crescendo button.link{
  display:block;margin:14px auto 0;background:none;border:0;color:#5a6a8a;
  font-size:.78rem;text-decoration:underline;font-weight:600
}
body.fgp-crescendo:not(.start-menu) .fgp{display:none}
body.fgp-crescendo:not(.start-menu){
  background:#faf7f0!important
}
body.fgp-crescendo .q, body.fgp-crescendo .answers, body.fgp-crescendo .meta,
body.fgp-crescendo .status, body.fgp-crescendo .climb{color:#173b89}
body.fgp-crescendo .ans, body.fgp-crescendo button.ans{
  background:#fff!important;color:#173b89!important;border:2px solid #ead9b8!important
}

.fgp-logohead button.brand,.fgp-logohead .logo-btn{background:none;border:0;padding:0;cursor:pointer}
.fgp-logohead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 12px 4px;background:#faf7f0}

/* Turntable: decks first on the phone screen; compact cream mixer */
.fgp-tt.nma-playground, .nma-playground.fgp-tt{
  display:flex;flex-direction:column;
}
.fgp-tt > header{order:2;padding:0!important;margin:0}
.fgp-tt .nma-decks{order:1;margin:0 0 8px!important}
.fgp-tt .nma-master,.fgp-tt .nma-challenges,.fgp-tt .nma-links,.fgp-tt .nma-small{order:3}
.fgp[data-fgp="turntable"] .fgp-lead{margin-top:2px;margin-bottom:4px;font-size:.8rem}
.fgp[data-fgp="turntable"] .fgp-facts{margin:2px 12px 6px}
.fgp-tt [data-tt-status]{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
.fgp-tt .nma-start-music, .fgp-tt [data-tt-enable]{margin:6px auto 10px!important;padding:.55rem 1.1rem;font-size:1.05rem}
.fgp-tt .nma-decks{
  background:linear-gradient(180deg,#e4d7ff,#cbb6f6)!important;
  color:#173b89!important;
}
.fgp-tt .nma-decks section, .fgp-tt .nma-deck, .fgp-tt [class*="deck"]{
  color:#173b89;
}
.fgp-tt .nma-crossfader{order:1}

/* Play Piano: keep Enable / Stop on one row with the instrument menu */
.fgp[data-fgp="play-piano"] .studio-choice{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
}
.fgp[data-fgp="play-piano"] #enable-studio-sound,
.fgp[data-fgp="play-piano"] #stop-studio{
  padding:.4rem .7rem!important;min-height:40px;white-space:nowrap;font-size:.8rem
}

.fgp-tt .nma-decks{
  display:grid!important;
  grid-template-columns:1fr 1fr;
  gap:6px;
  align-items:start;
}
.fgp-tt .nma-crossfader{grid-column:1/-1;padding:4px 8px}
.fgp-tt .nma-deck{padding:6px!important;margin:0!important;background:rgba(255,255,255,.55);border-radius:14px}
.fgp-tt .nma-deck h2{font-size:.95rem;margin:0 0 4px;color:#173b89}
.fgp-tt .nma-deck .nma-record, .fgp-tt .nma-record, .fgp-tt .nma-deck svg{
  max-width:120px;max-height:120px;margin:0 auto;display:block
}
.fgp-tt .nma-play-buttons{display:flex;gap:4px;flex-wrap:wrap}
.fgp-tt .nma-play-buttons button, .fgp-tt .nma-deck button, .fgp-tt .nma-deck select{
  min-height:36px;font-size:.75rem
}

/* fix turntable child order: decks, then start, then pads */
.fgp-tt.nma-playground > *{order:5}
.fgp-tt .nma-decks{order:1!important}
.fgp-tt > header{order:2!important}
.fgp-tt .nma-pads{order:3!important}
.fgp-tt .nma-master{order:4!important}
.fgp-tt .nma-challenges,.fgp-tt .nma-links,.fgp-tt .nma-small{order:6}

/* Play Piano controls: dropdown on its own row, buttons side by side below */
.fgp[data-fgp="play-piano"] .studio-choice{
  display:flex!important;flex-wrap:wrap;gap:8px;align-items:center;
}
.fgp[data-fgp="play-piano"] #instrument-choice,
.fgp[data-fgp="play-piano"] .studio-choice select{flex:1 1 100%;min-width:0;max-width:100%}
.fgp[data-fgp="play-piano"] #enable-studio-sound,
.fgp[data-fgp="play-piano"] #stop-studio{flex:1 1 auto}

.fgp-tt .nma-decks{
  display:grid!important;
  grid-template-columns:1fr 1fr!important;
  grid-template-areas:"a b" "fader fader";
  gap:6px!important;
}
.fgp-tt .nma-deck-a{grid-area:a}
.fgp-tt .nma-deck-b{grid-area:b}
.fgp-tt .nma-crossfader{grid-area:fader;grid-column:auto}
.fgp-tt .nma-deck .nma-record, .fgp-tt .nma-record{
  max-width:88px!important;max-height:88px!important
}
.fgp-tt .nma-deck label, .fgp-tt .nma-deck .nma-deck-title{font-size:.72rem}
.fgp-tt .nma-deck input[type=range]{height:22px}
