@import url("fonts.css");
:root {
  --ink: #294b42;
  --green: #42735b;
  --cream: #fffdf6;
  --orange: #ed965e;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}
button:hover {
  filter: brightness(0.94);
}
button:focus-visible {
  outline: 3px solid #ed965e;
  outline-offset: 3px;
}
header {
  height: 92px;
  border-bottom: 1px solid #e8e9dc;
  display: flex;
  align-items: center;
  padding: 0 3.3%;
  gap: 24px;
}
.brand {
  font-family: Fredoka, sans-serif;
  font-weight: 600;
  font-size: 43px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -2px;
}
.brand span {
  color: var(--orange);
}
.tag {
  font-size: 11px;
  letter-spacing: 2px;
  flex: 1;
}
header button {
  font-size: 13px;
  border: 1px solid #e1e5d8;
  border-radius: 22px;
  padding: 10px 15px;
}
main {
  max-width: 1600px;
  margin: auto;
  display: grid;
  grid-template-columns: 200px minmax(420px, 1fr) 265px;
  gap: 32px;
  padding: 36px 3.3% 20px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.6px;
  font-weight: 700;
  color: #779080;
}
h1,
h2,
b,
strong {
  font-weight: 500;
}
h1,
h2,
.buddy > b,
.primary {
  font-family: Fredoka, sans-serif;
}
h2 {
  font-size: 20px;
  margin: 10px 0 24px;
}
nav {
  display: grid;
  gap: 9px;
}
nav button {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 13px;
  padding: 12px 15px;
  border-radius: 15px;
  font-size: 14px;
  border: 1px solid transparent;
}
nav button span {
  font-size: 25px;
}
nav button.active {
  background: #eaf0d9;
  border-color: #d9e2c6;
  font-weight: 700;
}
nav button.active:after {
  content: "•";
  margin-left: auto;
  color: #6c925b;
}
.party-note {
  margin-top: 38px;
  padding: 22px 18px;
  border-radius: 20px;
  background: #f6f0df;
  border: 1px dashed #e4d6b4;
}
.party-note > span {
  font-size: 30px;
  display: block;
  margin-bottom: 13px;
}
.party-note b {
  font-family: Fredoka;
  font-size: 19px;
  line-height: 1.4;
}
.party-note p {
  font-size: 12px;
  line-height: 1.6;
  color: #829080;
}
.party-note #partyProgress {
  letter-spacing: 6px;
  color: #89a67c;
}
.game-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
h1 {
  font-size: 32px;
  letter-spacing: -0.7px;
  margin: 9px 0;
}
h1 em {
  font-style: normal;
  color: #dc8d5e;
}
.game-heading p {
  font-size: 14px;
  margin: 0;
  color: #819082;
}
.language {
  font-size: 11px;
  border: 1px solid #e6e7dc;
  border-radius: 20px;
  padding: 8px;
  white-space: nowrap;
}
#world {
  height: 478px;
  border: 6px solid white;
  border-radius: 27px;
  position: relative;
  overflow: hidden;
  background: #f3ead8;
  box-shadow:
    0 3px 0 #e7e5d7,
    0 8px 25px #465b3b08;
}
.scene-top {
  position: absolute;
  z-index: 3;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
}
.scene-top > span {
  font-size: 13px;
  border-radius: 20px;
  background: #fffdf5d9;
  padding: 9px 13px;
}
.scene-top button {
  border-radius: 50%;
  width: 34px;
  background: #fffdf5;
}
.window {
  position: absolute;
  top: 86px;
  left: 9%;
  width: 105px;
  height: 125px;
  background: linear-gradient(#d1e6dd, #ecf4d9);
  border: 9px solid #fffdf2;
  border-radius: 55px 55px 6px 6px;
  box-shadow: 0 0 0 2px #dfcdaa;
}
.window:after,
.window:before {
  content: "";
  position: absolute;
  background: #fffdf2;
  top: 0;
  bottom: 0;
  width: 6px;
  left: 45%;
}
.window:after {
  top: 55%;
  left: 0;
  right: 0;
  height: 6px;
  width: auto;
}
.picture {
  position: absolute;
  right: 15%;
  top: 100px;
  padding: 12px;
  border: 5px solid #d4b88c;
  border-radius: 5px;
  font-size: 26px;
  background: #fdf7e4;
  transform: rotate(5deg);
}
.shelf {
  position: absolute;
  left: 32%;
  top: 165px;
  width: 130px;
  border-bottom: 8px solid #c4a680;
  font-size: 35px;
}
.shelf span {
  float: right;
}
.sofa {
  position: absolute;
  right: 8%;
  bottom: 82px;
  width: 210px;
  height: 115px;
  background: #d7b69d;
  border-radius: 40px 40px 16px 16px;
  border: 5px solid #c6a58c;
  display: flex;
  align-items: end;
  padding: 12px;
  gap: 5px;
}
.sofa i {
  height: 45px;
  flex: 1;
  background: #e3c4ad;
  border-radius: 12px;
}
.floor {
  position: absolute;
  bottom: 0;
  height: 95px;
  width: 100%;
  background: #dfc9a1;
  z-index: 0;
  border-top: 3px solid #d0b991;
}
.rug {
  position: absolute;
  bottom: 17px;
  left: 20%;
  width: 60%;
  height: 86px;
  border-radius: 50%;
  background: #c8d5b3;
  z-index: 1;
  border: 8px solid #dbe0bf;
}
.avatar-stage {
  position: absolute;
  z-index: 2;
  bottom: 10px;
  left: 22%;
  width: 150px;
  height: 160px;
}
.avatar-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.avatar-stage > span#decoration {
  position: absolute;
  top: 8px;
  left: 49px;
  font-size: 40px;
}
#confused {
  position: absolute;
  left: 25px;
  top: 0;
  font-size: 35px;
}
.speech {
  position: absolute;
  bottom: 32px;
  right: 15px;
  z-index: 2;
  max-width: 190px;
  background: #fffdf3;
  border-radius: 16px;
  padding: 12px;
  font-size: 12px;
}
.drop {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 23px;
  background: #fffdf6;
  box-shadow:
    0 5px 0 #decfb8,
    0 5px 15px #7e685719;
  z-index: 4;
  font-size: 40px;
  border: 2px solid #fff;
  transition: background 0.3s;
}
.drop.good {
  background: #c8e7a9;
  border-color: #8eb767;
}
.drop.good:after {
  content: "✓";
  position: absolute;
  right: -5px;
  top: -8px;
  font-size: 18px;
  background: #50865b;
  color: white;
  border-radius: 50%;
  width: 23px;
  height: 23px;
}
#intro {
  position: absolute;
  inset: 0;
  background: #f7f3e7e8;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  backdrop-filter: blur(3px);
}
#intro > span {
  font-family: Fredoka;
  font-size: 25px;
  color: #6e8b63;
}
#intro h2 {
  font-size: 37px;
  line-height: 1.15;
  margin: 18px 0;
}
#intro p {
  font-size: 15px;
  line-height: 1.7;
  color: #758273;
}
.primary {
  background: var(--green);
  color: white;
  padding: 15px 30px;
  border-radius: 18px;
  font-size: 19px;
  box-shadow: 0 4px 0 #2e5141;
}
small {
  display: block;
  font-size: 11px;
  margin-top: 16px;
  color: #7d8b7c;
}
.game-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 22px;
}
.mic {
  background: #e49467;
  color: white;
  border-radius: 50%;
  font-size: 25px;
  width: 55px;
  height: 55px;
  box-shadow: 0 4px 0 #d27c51;
}
.mic.listening {
  animation: pulse 1s infinite;
  background: #75a36a;
}
.game-controls b {
  font-size: 14px;
}
.game-controls p {
  font-size: 12px;
  color: #7c8c7d;
  margin: 5px 0;
}
.game-controls > button:last-child {
  margin-left: auto;
  border: 1px solid #dce4d2;
  padding: 9px;
  border-radius: 20px;
  font-size: 11px;
}
.hint {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid #e8eadf;
  margin-top: 24px;
  padding-top: 18px;
  font-size: 11px;
  color: #8b9484;
  gap: 10px;
}
.wallet {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #eef2de;
  border-radius: 18px;
  padding: 17px;
}
.wallet > span {
  font-size: 33px;
  color: #d9aa47;
}
.wallet strong {
  font-family: Fredoka;
  font-size: 30px;
}
.wallet small {
  margin: 0;
  font-size: 10px;
}
.confusion {
  border-left: 1px solid #d7dec7;
  margin-left: auto;
  padding-left: 16px;
  text-align: center;
}
.confusion span {
  color: #aaac99;
  margin-right: 8px;
}
.buddy {
  margin-top: 24px;
  text-align: center;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title h2 {
  margin: 0;
  font-size: 19px;
}
.section-title button {
  font-size: 11px;
  text-decoration: underline;
  color: #819277;
}
.buddy-preview {
  height: 150px;
  background: #f2f0e6;
  border-radius: 90px 90px 24px 24px;
  margin: 18px 25px 10px;
  position: relative;
}
.buddy-preview img {
  height: 145px;
  width: 145px;
}
.buddy-preview .spark {
  position: absolute;
  right: 15px;
  top: 22px;
  font-size: 32px;
  color: #d9ad63;
}
#miniDecoration {
  position: absolute;
  top: 10px;
  left: 66px;
  font-size: 32px;
}
.buddy > b {
  font-size: 19px;
}
.buddy p,
.sub {
  font-size: 11px;
  color: #87927f;
  margin: 7px 0 24px;
}
.shop-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid #e8e7da;
  border-radius: 16px;
  margin-bottom: 9px;
  padding: 10px;
}
.shop-item > span {
  font-size: 27px;
  width: 43px;
  background: #f5edde;
  border-radius: 11px;
  text-align: center;
  padding: 5px;
}
.shop-item b {
  font-size: 13px;
  display: block;
}
.shop-item small {
  margin: 4px 0 0;
  font-size: 10px;
}
.shop-item em {
  font-style: normal;
  font-size: 11px;
  margin-left: auto;
  background: #edf1df;
  padding: 6px;
  border-radius: 12px;
}
.collection {
  display: flex;
  width: 100%;
  justify-content: space-between;
  font-size: 12px;
  background: #eff0e4;
  padding: 15px;
  border-radius: 13px;
  margin-top: 20px;
}
.saved {
  text-align: center;
  font-size: 10px;
  color: #9ba48e;
}
footer {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 3.3%;
  font-size: 11px;
  color: #99a18f;
  display: flex;
  justify-content: space-between;
}
dialog {
  border: 0;
  border-radius: 28px;
  padding: 35px;
  max-width: 460px;
  width: 90%;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 20px 100px #294b4240;
}
dialog::backdrop {
  background: #294b4260;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 28px;
  margin: 15px 0;
}
dialog p {
  line-height: 1.7;
  font-size: 14px;
}
.close {
  position: absolute;
  right: 13px;
  top: 8px;
  font-size: 26px;
}
.big-emoji {
  font-size: 80px;
  display: block;
}
.practice-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 20px 0;
}
.practice-buttons button {
  border-radius: 15px;
  background: #edf1df;
  padding: 15px;
}
.word-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.word-grid button {
  background: #f1f3e6;
  border-radius: 15px;
  padding: 13px;
  font-size: 30px;
}
.word-grid img {
  width: 90px;
  height: 90px;
}
#transition {
  position: absolute;
  inset: 0;
  background: white;
  z-index: 9;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 80px;
  animation: fade 2s;
}
#transition h2 {
  font-size: 22px;
}
@keyframes fade {
  0%,
  100% {
    opacity: 0;
  }
  40%,
  70% {
    opacity: 1;
  }
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px #bf8d9f33;
  }
}
@media (min-width: 1450px) {
  #world {
    height: 550px;
  }
}
@media (max-width: 1150px) {
  main {
    grid-template-columns: 160px minmax(350px, 1fr) 220px;
    gap: 20px;
  }
  .language {
    display: none;
  }
  h1 {
    font-size: 28px;
  }
  .tag {
    font-size: 9px;
  }
  .hint > span:last-child {
    display: none;
  }
}
@media (max-width: 900px) {
  main {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  main > aside:first-child .eyebrow,
  main > aside:first-child h2,
  .party-note {
    display: none;
  }
  nav {
    display: flex;
    overflow: auto;
  }
  nav button {
    white-space: nowrap;
    padding: 9px;
  }
  nav button span {
    font-size: 22px;
  }
  .buddy {
    margin: 0;
    grid-row: span 2;
  }
  .wallet {
    grid-column: 1/-1;
  }
  .game-heading {
    margin-top: 5px;
  }
  .game-wrap {
    min-width: 0;
  }
  header {
    height: 75px;
    padding: 0 20px;
  }
  .brand {
    font-size: 35px;
  }
  .tag {
    display: none;
  }
  header button {
    font-size: 11px;
    padding: 8px;
    margin-left: auto;
  }
  footer {
    display: none;
  }
  .speech {
    max-width: 140px;
  }
  #world {
    height: 450px;
  }
  .game-controls {
    gap: 10px;
  }
  .game-controls p {
    max-width: 200px;
  }
  .game-controls > button:last-child {
    font-size: 10px;
  }
  .hint {
    font-size: 10px;
  }
}
/* Mobile: keep picture targets and speech controls reachable, including iOS safe areas. */
button {
  touch-action: manipulation;
}
header button,
.scene-top button,
.section-title button,
.close {
  min-height: 44px;
  min-width: 44px;
}
.close {
  top: 5px;
  right: 8px;
}
.scene-top button {
  height: 44px;
  width: 44px;
}
.word-grid button {
  min-width: 56px;
  min-height: 56px;
}
dialog {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.game-controls > button:last-child {
  min-height: 44px;
}
header {
  padding-top: env(safe-area-inset-top);
}
body {
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 600px) {
  main {
    padding: 14px;
    gap: 16px;
  }
  header {
    gap: 8px;
    padding-left: 14px;
    padding-right: 14px;
  }
  header button {
    font-size: 12px;
  }
  h1 {
    font-size: 28px;
  }
  .game-heading .eyebrow {
    font-size: 10px;
  }
  #world {
    height: min(460px, 60svh);
    min-height: 330px;
  }
  .avatar-stage {
    left: 9%;
    width: 130px;
    height: 140px;
  }
  .sofa {
    right: 5%;
    width: 165px;
  }
  .speech {
    right: 10px;
    max-width: 135px;
    font-size: 12px;
  }
  .drop {
    width: 65px;
    height: 65px;
    font-size: 36px;
  }
  .game-controls {
    flex-wrap: wrap;
  }
  .game-controls > div {
    flex: 1;
    min-width: 180px;
  }
  .game-controls p {
    max-width: none;
    font-size: 14px;
    line-height: 1.45;
  }
  .game-controls > button:last-child {
    margin-left: 70px;
    font-size: 13px;
  }
  .hint {
    font-size: 13px;
    line-height: 1.5;
  }
  .right {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .buddy-preview {
    margin-left: 0;
    margin-right: 0;
  }
  .buddy-preview img {
    width: 120px;
  }
  .shop-item {
    padding: 8px;
    gap: 6px;
  }
  .shop-item > span {
    width: 34px;
    font-size: 23px;
  }
  .shop-item b {
    font-size: 12px;
  }
  .shop-item small {
    font-size: 11px;
  }
  .shop-item em {
    font-size: 12px;
    padding: 4px;
  }
  .collection {
    grid-column: 1/-1;
    min-height: 48px;
    font-size: 14px;
  }
  .saved {
    grid-column: 1/-1;
    font-size: 12px;
  }
  .party-note p,
  .sub,
  .buddy p {
    font-size: 13px;
  }
  .wallet small {
    font-size: 12px;
  }
  .buddy-preview #miniDecoration {
    left: calc(50% - 16px);
  }
  #intro h2 {
    font-size: 30px;
  }
  #intro small {
    font-size: 12px;
  }
  nav button {
    min-height: 48px;
  }
  .practice-buttons button {
    min-width: 70px;
    min-height: 54px;
  }
  #helper {
    font-size: 14px;
    line-height: 1.5;
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
main > * {
  min-width: 0;
}
nav {
  max-width: 100%;
}
/* A bespoke hanok storybook world, with crisp interactive picture stickers. */
:root {
  --ink: #4b465b;
  --green: #756590;
  --orange: #e9a075;
  --cream: #fffaf7;
}
body {
  background:
    radial-gradient(ellipse at 85% 5%, #fae8ed88, transparent 45%), #fffaf7;
}
.brand {
  color: #695b7c;
}
.brand > span {
  color: #e79da3;
}
.game-heading h1 em {
  color: #c989a0;
}
#world {
  background-image: url("assets/hanok-playroom.webp") !important;
  background-size: cover;
  background-position: center;
  border-color: #fff7f6;
  box-shadow:
    0 5px 0 #e2d4dc,
    0 12px 38px #80688418;
}
#world .window,
#world .picture,
#world .shelf,
#world .sofa,
#world .floor,
#world .rug {
  display: none;
}
#world .speech {
  background: #fffcf6f2;
  border: 2px solid #e8cee1;
  font-size: 14px;
  bottom: 22px;
  color: #725b7e;
  box-shadow: 0 4px 0 #d9b8cc66;
}
#intro {
  background: #fff9f0b8;
  backdrop-filter: blur(1px);
}
#intro h2 {
  color: #72587e;
  text-shadow: 0 2px white;
}
#intro > span {
  color: #a56c8b;
  background: #fff9f0d9;
  border: 1px solid #edccdb;
  padding: 7px 18px;
  border-radius: 30px;
}
.primary {
  background: #8a719a;
  box-shadow: 0 4px 0 #6b537c;
}
.drop {
  background: #fffcf7f5;
  border: 3px solid #ffe6ed;
  box-shadow:
    0 5px 0 #c99daf,
    0 8px 20px #77567920;
  border-radius: 25px;
}
.drop:before {
  content: "✦";
  position: absolute;
  top: -12px;
  left: -8px;
  color: #dfab72;
  font-size: 20px;
}
.drop.good {
  background: #dcf2cd;
  border-color: #aaca9d;
  box-shadow: 0 5px 0 #8ead7b;
}
.buddy-preview {
  background: radial-gradient(circle, #fff5df, #f5e0ed);
  border: 1px solid #edcfe0;
}
.wallet {
  background: #eee6f3;
}
.collection {
  background: #f0e6f1;
}
.shop-item {
  border-color: #eedce6;
  background: #ffffff70;
}
.party-note {
  background: #f8eaf0;
  border-color: #e6c8d8;
}
nav button.active {
  background: #f2e4ef;
  border-color: #e7cddd;
}
nav button.active:after {
  color: #ab779d;
}
.mic {
  background: #bf8d9f;
  box-shadow: 0 4px 0 #a6728c;
}
.scene-top > span {
  background: #fff9f3eb;
  border: 1px solid #edcfcb;
  color: #795d70;
}
.spark {
  animation: twinkle 3s ease-in-out infinite;
}
.avatar-stage {
  width: 180px;
  height: 180px;
  left: 12%;
  bottom: 6px;
  filter: drop-shadow(0 7px 4px #805f5525);
}
#avatar {
  animation: bob 3s ease-in-out infinite;
}
.avatar-stage.party #avatar {
  animation: partyHop 0.45s ease-in-out infinite alternate;
}
.korean-cheer {
  position: absolute;
  z-index: 5;
  left: 50%;
  top: 43%;
  transform: translate(-50%, -50%);
  padding: 15px 25px;
  border-radius: 30px;
  background: #fff9eff5;
  color: #986d9b;
  font-family: Fredoka, sans-serif;
  font-size: 27px;
  text-align: center;
  box-shadow: 0 6px 0 #e4bed5;
  pointer-events: none;
  animation: cheerIn 0.4s ease-out;
}
.korean-cheer small {
  font-family: "DM Sans";
  font-size: 13px;
  color: #a08096;
  margin-top: 4px;
}
.shop-item .treasure-art {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
#decoration img {
  width: 65px;
  height: 65px;
}
#miniDecoration img {
  width: 48px;
  height: 48px;
}
.avatar-stage > span#decoration {
  top: 32px;
  left: 55px;
}
.petal {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  color: #edaec4;
  animation: petalFall 11s linear infinite;
  font-size: 19px;
  top: -30px;
}
#world.zone-1 {
  background-image: url("assets/korean-zones.webp") !important;
  background-size: 300% 200%;
  background-position: 0 0;
}
#world.zone-2 {
  background-image: url("assets/korean-zones.webp") !important;
  background-size: 300% 200%;
  background-position: 50% 0;
}
#world.zone-3 {
  background-image: url("assets/korean-zones.webp") !important;
  background-size: 300% 200%;
  background-position: 100% 0;
}
#world.zone-4 {
  background-image: url("assets/korean-zones.webp") !important;
  background-size: 300% 200%;
  background-position: 0 100%;
}
#world.zone-5 {
  background-image: url("assets/korean-zones.webp") !important;
  background-size: 300% 200%;
  background-position: 50% 100%;
}
#world.zone-6 {
  background-image: url("assets/korean-zones.webp") !important;
  background-size: 300% 200%;
  background-position: 100% 100%;
}
@keyframes bob {
  50% {
    transform: translateY(-5px) rotate(2deg);
  }
}
@keyframes twinkle {
  50% {
    opacity: 0.5;
    transform: rotate(15deg);
  }
}
@keyframes partyHop {
  to {
    transform: translateY(-35px) rotate(-8deg);
  }
}
@keyframes cheerIn {
  from {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.7);
  }
}
@keyframes petalFall {
  to {
    transform: translate(60px, 580px) rotate(220deg);
  }
}
@media (max-width: 600px) {
  .avatar-stage {
    width: 150px;
    height: 150px;
    left: 5%;
  }
  .avatar-stage > span#decoration {
    left: 43px;
    top: 21px;
  }
  #world .speech {
    max-width: 160px;
    font-size: 12px;
  }
  .korean-cheer {
    font-size: 23px;
    padding: 12px 20px;
    white-space: nowrap;
  }
  #world {
    background-position: 47% center;
  }
  .language {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  #avatar,
  .spark,
  .petal,
  .korean-cheer,
  .avatar-stage.party #avatar {
    animation: none !important;
  }
}
.music-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 18px;
  font-size: 12px;
  color: #a18aaa;
}
.music-strip button {
  background: #f2e7f1;
  border: 1px solid #e3cde1;
  border-radius: 24px;
  padding: 10px 15px;
  min-height: 44px;
  font-size: 13px;
}
.music-bars {
  margin-left: auto;
  letter-spacing: 3px;
  color: #b397bb;
}
.zone-progress {
  position: absolute;
  z-index: 5;
  left: 20px;
  right: 20px;
  bottom: 8px;
  height: 5px;
  border-radius: 10px;
  background: #fff8;
  overflow: hidden;
  pointer-events: none;
}
.zone-progress div {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #dab4df, #f2cfa3, #c6e6ba);
  border-radius: 10px;
  transition: width 1s ease;
}
#world:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at 50% 25%, #fff9c8, transparent 75%);
  opacity: calc(var(--zone-progress, 0) * 0.25);
  transition: opacity 2s;
}
.petal {
  opacity: calc(0.16 + var(--zone-progress, 0) * 0.5);
}
#world.word-wave:after {
  animation: warmWave 1.5s ease-out;
}
.scene-top {
  z-index: 5;
}
.avatar-stage {
  z-index: 2;
}
.drop {
  z-index: 4;
}
.speech {
  z-index: 3;
}
@keyframes warmWave {
  0% {
    background: #fff7c9;
    opacity: 0.4;
  }
  100% {
    opacity: 0;
  }
}
.music-strip:has(button[aria-pressed="false"]) .music-bars {
  opacity: 0.3;
}
.avatar-stage > span#decoration.equipment-1 {
  top: 85px;
  left: 57px;
}
.avatar-stage > span#decoration.equipment-2 {
  top: 112px;
  left: 24px;
}
.avatar-stage > span#decoration.equipment-2 img {
  width: 140px;
  height: 85px;
}
.avatar-stage > span#decoration.equipment-3 {
  top: 97px;
  left: 110px;
  animation: bob 1.2s infinite;
}
.avatar-stage > span#decoration.equipment-3 img {
  width: 80px;
  height: 80px;
}
#miniDecoration.equipment-1 {
  top: 70px;
}
#miniDecoration.equipment-2 {
  top: 90px;
  left: 30px;
}
#miniDecoration.equipment-2 img {
  width: 100px;
  height: 65px;
}
#miniDecoration.equipment-3 {
  top: 70px;
  left: 110px;
}
.shop-item {
  min-height: 70px;
}
@media (max-width: 600px) {
  .avatar-stage > span#decoration.equipment-1 {
    top: 70px;
    left: 43px;
  }
  .avatar-stage > span#decoration.equipment-2 {
    top: 95px;
    left: 12px;
  }
  .avatar-stage > span#decoration.equipment-3 {
    top: 85px;
    left: 90px;
  }
  #miniDecoration.equipment-3 {
    left: 70%;
  }
}
.vocab-pop {
  position: absolute;
  z-index: 5;
  background: #fff5cb;
  color: #a88640;
  padding: 8px 12px;
  border-radius: 20px;
  font-family: Fredoka;
  font-size: 21px;
  pointer-events: none;
  animation: vocabFloat 1.4s ease-out forwards;
}
@keyframes vocabFloat {
  to {
    opacity: 0;
    transform: translateY(-65px) scale(1.2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .vocab-pop {
    animation: none;
  }
}
#world:before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 0% 100%, #ffcad9, transparent 55%),
    radial-gradient(ellipse at 100% 100%, #e2d1ff, transparent 55%);
  opacity: 0;
}
#world.music-bloom:before {
  animation: musicBloom 2s ease-out;
}
@keyframes musicBloom {
  0% {
    opacity: calc(0.05 + var(--music-layer, 0) * 0.035);
  }
  100% {
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  #world.music-bloom:before {
    animation: none;
  }
}

.drop.good small {
  position: absolute;
  left: -8px;
  right: -8px;
  bottom: -22px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  text-shadow:
    0 1px 0 #fff,
    0 0 6px #fff;
}
dialog .reading {
  font-family: Fredoka, sans-serif;
  font-size: 34px;
  line-height: 1.2;
  margin: 8px 0 0;
  color: var(--ink);
}

/* Grown-up check (practice without microphone) */
#gate {
  margin-top: 10px;
}
#helper {
  font-size: 14px;
  line-height: 1.5;
  padding: 10px;
  text-decoration: underline;
}
.gate-choices {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.gate-choices button {
  min-width: 56px;
  min-height: 56px;
  border-radius: 15px;
  background: #edf1df;
  font-size: 22px;
}

dialog .romanization {
  margin: 0;
  color: #8a7f98;
  font-size: 15px;
}
/* Blossom Buddy: stable space for the selected mark and touch controls. */
header {
  height: 116px;
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 160px;
  min-width: 0;
  letter-spacing: normal;
}
.brand img {
  display: block;
  width: 160px;
  height: 104px;
  object-fit: contain;
}
@media (max-width: 900px) {
  header {
    height: 104px;
  }
  .brand {
    flex-basis: 124px;
  }
  .brand img {
    width: 124px;
    height: 94px;
  }
  header button {
    margin-left: 0;
  }
  header #sound {
    margin-left: auto;
  }
}
@media (max-width: 600px) {
  header {
    height: 100px;
    gap: 8px;
  }
  .brand {
    flex-basis: 112px;
  }
  .brand img {
    width: 112px;
    height: 88px;
  }
  header button {
    padding: 8px 10px;
    font-size: 11px;
  }
}
@media (max-width: 359px) {
  header {
    padding-left: 10px;
    padding-right: 10px;
    gap: 5px;
  }
  .brand {
    flex-basis: 96px;
  }
  .brand img {
    width: 96px;
    height: 80px;
  }
  header button {
    padding: 7px 8px;
  }
}

/* Press-and-hold progress on the Grown-up guide button */
#help {
  position: relative;
  overflow: hidden;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}
#help::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  width: calc(var(--hold, 0) * 100%);
  background: var(--orange);
}

/* Grown-up settings dialog */
.settings {
  text-align: left;
}
.settings h2 {
  text-align: center;
}
.settings section {
  border-top: 1px solid #ecdde5;
  padding: 12px 0;
}
.settings h3 {
  font-family: Fredoka, sans-serif;
  font-size: 17px;
  font-weight: 500;
  margin: 4px 0 8px;
}
.settings p {
  margin: 6px 0;
  line-height: 1.5;
}
.settings .fine,
.settings small {
  font-size: 12px;
  color: #8a7f98;
}
.settings .ok {
  color: #3f7a52;
}
.settings .mode {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 4px;
  min-height: 44px;
}
.settings .mode input {
  margin-top: 4px;
  width: 20px;
  height: 20px;
  accent-color: #8a719a;
}
.settings .mode span {
  display: block;
}
.settings .mode b {
  display: block;
  font-size: 15px;
}
.settings textarea,
.settings input[type="text"],
.settings #logCode,
.settings select {
  width: 100%;
  font: inherit;
  padding: 10px;
  border: 1px solid #e1cfdb;
  border-radius: 12px;
  background: #fffdf9;
  color: var(--ink);
}
.settings .code-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: stretch;
}
.settings .code-row button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: #8a719a;
  color: #fff;
  white-space: nowrap;
}
.settings .code-row button.quiet,
.settings button.quiet {
  background: #f2e7f1;
  color: var(--ink);
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
}
.settings .status {
  min-height: 1.5em;
  margin-top: 12px;
  text-align: center;
  color: #725b7e;
}
.settings small {
  margin: 2px 0 0;
  display: block;
}

/* The picture in the practice dialog is a tap-to-replay button */
button.big-emoji {
  display: block;
  margin: 0 auto;
  background: none;
  border: 0;
  padding: 0;
  line-height: 1.1;
  min-width: 96px;
  min-height: 96px;
}

/* Buddy character: the rig's SVG fills the stage slot; the picture is shown until it loads */
#avatar {
  width: 100%;
  height: 100%;
}
#avatar > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Buddy inside the practice dialog (the dialog's backdrop hides the world behind it) */
.dialog-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.dialog-stage button.big-emoji {
  margin: 0;
  position: absolute;
  right: 0;
  bottom: 0;
  font-size: 48px;
  min-width: 64px;
  min-height: 64px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 4px 14px #64589c22;
}
.dialog-avatar {
  width: clamp(180px, 48vw, 240px);
  height: clamp(180px, 48vw, 240px);
}
.dialog-avatar > img,
.dialog-avatar > svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Microphone test */
.settings .testbtn {
  display: block;
  width: 100%;
  margin: 6px 0;
  text-align: left;
}
.settings .testbtn:disabled {
  opacity: 0.5;
}
.settings .micresults {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
}
.settings .micresults li {
  padding: 6px 0;
  border-top: 1px solid #ecdde5;
}

/* One clear speaking/listening turn, with a large familiar Shellfie buddy. */
.turn-cue { display: inline-block; margin: 4px 0 8px; padding: 10px 24px; border-radius: 24px;
  background: #ede6ff; color: #5a3e88; font-size: 1.4rem; font-weight: 800; }
.practice-turn[data-voice="listening"] .turn-cue { background: #d6f8e9; color: #166a55; }
.practice-turn[data-voice="listening"] .dialog-avatar { filter: drop-shadow(0 0 12px #67d5b166); }
.practice-turn[data-phase="retry"] .turn-cue { background: #fff0d1; color: #815812; }
@media (max-height: 520px) and (orientation: landscape) {
  .dialog-stage { min-height: 140px; }
  .dialog-avatar { width: 150px; height: 150px; }
  .turn-cue { margin: 0; padding: 6px 20px; }
}

/* Startup speaker check: an explicit media loop, stopped before gameplay. */
.sound-check-art { margin: 4px auto 14px; width: 112px; height: 100px; display: grid;
  place-items: center; border-radius: 36px; background: #e4f7ed; font-size: 58px; position: relative; }
.sound-check-art span { position: absolute; right: 8px; top: 4px; font-size: 24px; color: #7c5baa; }
.sound-check.is-playing .sound-check-art span { animation: check-note 1.5s ease-in-out infinite; }
.sound-check button { display: block; width: 100%; margin: 12px 0; min-height: 48px; }
.sound-check .sound-replay { background: #eee8ff; color: #5d4487; border: 0; border-radius: 18px; font-weight: 700; }
.sound-check .sound-skip { background: transparent; border: 0; color: #5d6572; text-decoration: underline; }
.sound-check #volumeStatus { min-height: 48px; font-size: 16px; }
.sound-check .sound-check-note { font-size: 14px; color: #68756d; }
@keyframes check-note { 50% { transform: translateY(-6px) rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .sound-check.is-playing .sound-check-art span { animation: none; } }

@media (max-width: 600px) { #volume { min-width: 44px; padding: 10px; } #volume span { display: none; } }

/* One generous replay target: picture, Korean spelling, pronunciation, then buddy. */
.practice-model { display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; margin: 0; padding: 6px 0 0; background: transparent; border: 0;
  border-radius: 22px; color: inherit; }
.practice-model:hover { transform: none; }
.practice-object { display: block; font-size: 72px; line-height: 1.15; }
.practice-model .reading { display: block; margin: 4px 0 0; }
.practice-model .romanization { display: block; margin: 0; font-size: 16px; }
.practice-model .dialog-avatar { display: block; margin: 2px auto 0; }
#practiceStatus:empty { display: none; }
@media (max-height: 520px) and (orientation: landscape) {
  .practice-object { font-size: 48px; }
  .practice-model { gap: 4px; }
}

/* A grown-up language check follows speaker calibration. Keyboard selection stays device-controlled. */
.korean-setup .setup-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #715b89; }
.korean-setup .setup-pack { padding: 12px; border-radius: 16px; background: #edf7ef; font-size: 15px; }
.korean-setup details { margin: 16px 0; padding: 12px; border-radius: 18px; background: #f2edfc; text-align: left; }
.korean-setup summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.korean-setup details p, .korean-setup label { font-size: 15px; }
.korean-setup input { display: block; box-sizing: border-box; width: 100%; margin: 10px 0; padding: 12px;
  font-size: 24px; border: 1px solid #bca9d3; border-radius: 12px; }
.korean-setup button { display: block; min-height: 48px; width: 100%; margin: 12px 0; }
.korean-setup button[hidden] { display: none; }
.korean-setup button:disabled { opacity: .55; cursor: default; }
.korean-setup #koreanTest { background: #eae1fc; border: 0; border-radius: 18px; color: #584079; font-weight: 800; }
.korean-setup #koreanTestStatus { font-size: 16px; }
.korean-setup .setup-test-prompt strong { font-size: 26px; }
.korean-setup .setup-skip { border: 0; background: transparent; text-decoration: underline; color: #666; }

.korean-setup span[lang="ko"] { white-space: nowrap; }
