:root {
        --ink: #223055;
        --muted: #71809d;
        --cream: #fff8ec;
        --paper: #fffdf8;
        --coral: #ff6f61;
        --coral-dark: #e8564d;
        --yellow: #ffc84d;
        --aqua: #4cc9c0;
        --aqua-dark: #229d9a;
        --lavender: #7b7de9;
        --green: #4bb98c;
        --pink: #ff8eb0;
        --shadow: 0 18px 50px rgba(49, 59, 99, 0.11);
      }

      * {
        box-sizing: border-box;
      }

      body {
        margin: 0;
        min-height: 100vh;
        color: var(--ink);
        font-family: "Nunito", sans-serif;
        background:
          radial-gradient(
            circle at 6% 8%,
            rgba(255, 200, 77, 0.22) 0 90px,
            transparent 91px
          ),
          radial-gradient(
            circle at 97% 32%,
            rgba(76, 201, 192, 0.17) 0 160px,
            transparent 161px
          ),
          linear-gradient(145deg, #fff9ee, #fff3e3 52%, #f6faf6);
        overflow-x: hidden;
      }

      button,
      select {
        font: inherit;
      }
      button {
        color: inherit;
      }

      .topbar {
        height: 72px;
        padding: 0 clamp(20px, 5vw, 72px);
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid rgba(34, 48, 85, 0.08);
        background: rgba(255, 253, 248, 0.78);
        backdrop-filter: blur(14px);
        position: relative;
        z-index: 5;
      }

      .brand {
        display: flex;
        align-items: center;
        gap: 11px;
      }
      .brand-mark {
        width: 41px;
        height: 41px;
        display: grid;
        place-items: center;
        border-radius: 14px;
        background: var(--coral);
        color: white;
        font-size: 22px;
        transform: rotate(-5deg);
        box-shadow: 0 7px 16px rgba(255, 111, 97, 0.25);
      }
      .brand-name {
        font-family: "Baloo 2", cursive;
        font-weight: 800;
        font-size: 22px;
        line-height: 1;
      }
      .brand-name small {
        display: block;
        font:
          800 9px/1.3 "Nunito",
          sans-serif;
        letter-spacing: 1.7px;
        color: var(--coral);
      }

      .top-actions {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .icon-btn {
        width: 41px;
        height: 41px;
        display: grid;
        place-items: center;
        border: 1px solid #e5e3dc;
        border-radius: 13px;
        background: white;
        cursor: pointer;
        transition: 0.18s ease;
        text-decoration: none;
      }
      .icon-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 15px rgba(34, 48, 85, 0.08);
      }
      .avatar {
        background: #ffdb69;
        border: 3px solid white;
        font-size: 21px;
        box-shadow: 0 0 0 1px #e5e3dc;
      }

      main {
        width: min(1180px, calc(100% - 32px));
        margin: 0 auto;
        padding: 38px 0 48px;
        position: relative;
      }

      .welcome {
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        gap: 20px;
        margin-bottom: 22px;
      }
      .eyebrow {
        margin: 0 0 2px;
        color: var(--coral);
        font-weight: 900;
        font-size: 12px;
        letter-spacing: 1.8px;
        text-transform: uppercase;
      }
      h1 {
        margin: 0;
        font:
          800 clamp(29px, 4vw, 40px)/1.13 "Baloo 2",
          cursive;
        letter-spacing: -0.4px;
      }
      .welcome p:last-child {
        margin: 5px 0 0;
        color: var(--muted);
        font-size: 14px;
      }

      .streak-pill {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 15px;
        background: white;
        border: 1px solid #ebe7df;
        border-radius: 15px;
        box-shadow: 0 8px 22px rgba(34, 48, 85, 0.05);
        font-size: 13px;
        font-weight: 900;
      }
      .streak-pill .fire {
        font-size: 22px;
      }

      .game-shell {
        display: grid;
        grid-template-columns: 285px 1fr;
        min-height: 660px;
        border: 1px solid rgba(34, 48, 85, 0.09);
        border-radius: 30px;
        background: rgba(255, 255, 255, 0.82);
        box-shadow: var(--shadow);
        overflow: hidden;
      }

      .host-panel {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 28px 22px 23px;
        background: linear-gradient(
          180deg,
          #5ed4ca 0%,
          #76dbd1 55%,
          #f5d78c 55.2%,
          #f7dda0 100%
        );
        overflow: hidden;
      }
      .sun {
        position: absolute;
        top: 22px;
        right: 20px;
        width: 57px;
        height: 57px;
        border-radius: 50%;
        background: #ffe174;
        box-shadow: 0 0 0 10px rgba(255, 225, 116, 0.15);
      }
      .cloud,
      .cloud::before,
      .cloud::after {
        position: absolute;
        border-radius: 50px;
        background: rgba(255, 255, 255, 0.72);
      }
      .cloud {
        width: 65px;
        height: 16px;
        top: 77px;
        left: 18px;
      }
      .cloud::before {
        content: "";
        width: 27px;
        height: 27px;
        left: 10px;
        bottom: 0;
      }
      .cloud::after {
        content: "";
        width: 20px;
        height: 20px;
        left: 33px;
        bottom: 0;
      }
      .palm {
        position: absolute;
        bottom: 102px;
        left: -14px;
        font-size: 74px;
        transform: rotate(-8deg);
        opacity: 0.7;
      }

      .host-badge {
        position: relative;
        z-index: 2;
        align-self: flex-start;
        padding: 7px 11px;
        border-radius: 50px;
        background: rgba(255, 255, 255, 0.9);
        color: #187d7c;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: 1.3px;
        text-transform: uppercase;
      }

      .speech {
        position: relative;
        z-index: 3;
        width: 100%;
        min-height: 85px;
        margin-top: 24px;
        padding: 15px 17px;
        border-radius: 20px 20px 20px 5px;
        background: white;
        box-shadow: 0 11px 26px rgba(27, 106, 108, 0.16);
        text-align: center;
        font:
          700 16px/1.35 "Baloo 2",
          cursive;
      }
      .speech strong {
        color: var(--coral);
      }

      .cat-wrap {
        position: relative;
        z-index: 2;
        width: 225px;
        height: 310px;
        margin: 9px 0 -8px;
      }
      .cat-wrap.celebrate {
        animation: catHop 0.55s ease;
      }
      .cat-wrap.oops {
        animation: catWobble 0.35s ease;
      }
      .cat-wrap.singing {
        animation: singBounce 0.34s ease-in-out infinite alternate;
      }
      .cat-wrap.singing::before,
      .cat-wrap.singing::after {
        position: absolute;
        z-index: 5;
        color: #7b4bc5;
        font:
          900 27px/1 "Baloo 2",
          cursive;
        text-shadow: 0 2px white;
        animation: noteFloat 0.8s ease-out infinite;
      }
      .cat-wrap.singing::before {
        content: "♪";
        left: 12px;
        top: 88px;
      }
      .cat-wrap.singing::after {
        content: "♫";
        right: 7px;
        top: 55px;
        animation-delay: 0.25s;
      }
      @keyframes catHop {
        0%,
        100% {
          transform: translateY(0) rotate(0);
        }
        45% {
          transform: translateY(-20px) rotate(3deg);
        }
      }
      @keyframes catWobble {
        25% {
          transform: rotate(-4deg);
        }
        70% {
          transform: rotate(4deg);
        }
      }
      @keyframes singBounce {
        from {
          transform: translateY(0) rotate(-1deg);
        }
        to {
          transform: translateY(-5px) rotate(1deg);
        }
      }
      @keyframes noteFloat {
        from {
          transform: translateY(8px) scale(0.8);
          opacity: 0;
        }
        35% {
          opacity: 1;
        }
        to {
          transform: translateY(-25px) scale(1.15);
          opacity: 0;
        }
      }
      .cat-svg {
        width: 100%;
        height: 100%;
        filter: drop-shadow(0 10px 8px rgba(124, 89, 44, 0.15));
      }

      .host-name {
        position: relative;
        z-index: 2;
        text-align: center;
      }
      .host-name h2 {
        margin: 0;
        font:
          800 24px/1 "Baloo 2",
          cursive;
      }
      .host-name p {
        margin: 5px 0 0;
        font-size: 11px;
        font-weight: 900;
        letter-spacing: 1.2px;
        color: #7c6947;
        text-transform: uppercase;
      }

      .session-progress {
        position: relative;
        z-index: 2;
        width: 100%;
        margin-top: auto;
        padding: 13px 14px;
        border-radius: 17px;
        background: rgba(255, 255, 255, 0.74);
      }
      .progress-top {
        display: flex;
        justify-content: space-between;
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.8px;
      }
      .progress-track {
        height: 7px;
        margin-top: 8px;
        overflow: hidden;
        border-radius: 20px;
        background: rgba(34, 48, 85, 0.12);
      }
      .progress-fill {
        height: 100%;
        width: 0;
        border-radius: inherit;
        background: var(--coral);
        transition: width 0.35s ease;
      }

      .play-panel {
        display: flex;
        flex-direction: column;
        padding: clamp(24px, 4vw, 42px);
        min-width: 0;
      }
      .lesson-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
      }
      .lesson-heading {
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .lesson-icon {
        width: 46px;
        height: 46px;
        display: grid;
        place-items: center;
        border-radius: 15px;
        background: #fff1cf;
        font-size: 22px;
      }
      .lesson-heading h2 {
        margin: 0;
        font:
          800 21px/1.1 "Baloo 2",
          cursive;
      }
      .lesson-heading p {
        margin: 4px 0 0;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.9px;
      }
      .lesson-select {
        border: 1px solid #e6e4de;
        border-radius: 13px;
        background: white;
        padding: 9px 35px 9px 12px;
        color: var(--ink);
        font-size: 12px;
        font-weight: 900;
        cursor: pointer;
      }

      .stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin: 25px 0 23px;
      }
      .stat {
        padding: 11px 13px;
        border-radius: 14px;
        background: #f7f6f2;
        text-align: center;
      }
      .stat-value {
        display: block;
        font:
          800 18px/1.1 "Baloo 2",
          cursive;
      }
      .stat-label {
        display: block;
        margin-top: 2px;
        color: var(--muted);
        font-size: 9px;
        font-weight: 900;
        letter-spacing: 1px;
        text-transform: uppercase;
      }

      .prompt-card {
        position: relative;
        min-height: 173px;
        padding: 30px 28px 22px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 2px solid #efede7;
        border-radius: 23px;
        background: var(--paper);
        cursor: text;
        transition:
          border-color 0.2s,
          transform 0.2s;
      }
      .prompt-card:focus-within {
        border-color: rgba(76, 201, 192, 0.6);
      }
      .prompt-card.error {
        border-color: #ff9f96;
        animation: cardShake 0.25s ease;
      }
      @keyframes cardShake {
        25% {
          transform: translateX(-4px);
        }
        75% {
          transform: translateX(4px);
        }
      }
      .prompt-label {
        position: absolute;
        top: 15px;
        left: 20px;
        color: var(--muted);
        font-size: 9px;
        font-weight: 900;
        letter-spacing: 1.3px;
        text-transform: uppercase;
      }
      .word-display {
        text-align: center;
        font:
          800 clamp(30px, 5vw, 46px)/1.3 "Baloo 2",
          cursive;
        letter-spacing: 2px;
        word-break: break-word;
      }
      .letter {
        color: #aeb5c3;
        transition: 0.1s;
      }
      .letter.done {
        color: var(--green);
      }
      .letter.current {
        color: var(--ink);
        border-bottom: 4px solid var(--coral);
      }
      .hidden-input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
        pointer-events: none;
      }
      .type-hint {
        margin-top: 7px;
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
      }

      .hands-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        margin: 17px 0 14px;
        color: var(--muted);
        font-size: 10px;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.8px;
      }
      .hands-hint span {
        color: var(--coral);
      }

      .keyboard {
        display: flex;
        flex-direction: column;
        gap: 7px;
        user-select: none;
      }
      .key-row {
        display: flex;
        gap: 6px;
        justify-content: center;
      }
      .key {
        width: clamp(29px, 4.3vw, 49px);
        height: 42px;
        display: grid;
        place-items: center;
        border: 1px solid #deddd8;
        border-bottom: 3px solid #d3d1ca;
        border-radius: 9px;
        background: white;
        font:
          900 12px/1 "Nunito",
          sans-serif;
        transition: 0.1s ease;
      }
      .key.home {
        background: #fff9e9;
      }
      .key.home::after {
        content: "";
        width: 4px;
        height: 4px;
        border-radius: 50%;
        background: #bbb19c;
        position: absolute;
        margin-top: 25px;
      }
      .key.space {
        width: min(255px, 47vw);
        color: var(--muted);
        font-size: 9px;
        letter-spacing: 1.2px;
      }
      .key.next {
        color: white;
        background: var(--coral);
        border-color: var(--coral-dark);
        border-bottom-color: var(--coral-dark);
        transform: translateY(-3px);
        box-shadow: 0 7px 13px rgba(255, 111, 97, 0.23);
      }
      .key.hit {
        transform: translateY(2px);
        border-bottom-width: 1px;
        background: var(--green);
        color: white;
      }
      .key.miss {
        background: #ff9890;
        color: white;
      }

      .game-footer {
        margin-top: auto;
        padding-top: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 14px;
      }
      .tip {
        color: var(--muted);
        font-size: 11px;
        font-weight: 800;
      }
      .tip b {
        color: var(--ink);
      }
      .new-btn {
        border: 0;
        border-radius: 14px;
        padding: 11px 16px;
        color: white;
        background: var(--ink);
        font-size: 11px;
        font-weight: 900;
        cursor: pointer;
        box-shadow: 0 7px 14px rgba(34, 48, 85, 0.16);
        transition: 0.18s;
      }
      .new-btn:hover {
        transform: translateY(-2px);
      }

      .confetti {
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 20;
        overflow: hidden;
      }
      .confetti i {
        position: absolute;
        top: -20px;
        width: 10px;
        height: 16px;
        border-radius: 3px;
        animation: fall 1.5s ease-in forwards;
      }
      @keyframes fall {
        to {
          transform: translate(var(--drift), 105vh) rotate(720deg);
        }
      }

      .modal-backdrop {
        position: fixed;
        inset: 0;
        z-index: 30;
        display: grid;
        place-items: center;
        padding: 20px;
        background: rgba(34, 48, 85, 0.32);
        backdrop-filter: blur(6px);
        opacity: 0;
        pointer-events: none;
        transition: 0.2s;
      }
      .modal-backdrop.show {
        opacity: 1;
        pointer-events: auto;
      }
      .modal {
        width: min(420px, 100%);
        padding: 32px;
        border-radius: 26px;
        background: white;
        box-shadow: 0 25px 70px rgba(25, 34, 65, 0.25);
        text-align: center;
        transform: translateY(10px);
        transition: 0.2s;
      }
      .show .modal {
        transform: translateY(0);
      }
      .modal .medal {
        font-size: 55px;
      }
      .modal h2 {
        margin: 8px 0 2px;
        font:
          800 29px/1.1 "Baloo 2",
          cursive;
      }
      .modal p {
        margin: 8px 0 22px;
        color: var(--muted);
        font-size: 14px;
      }
      .modal-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 22px;
      }
      .modal-stats div {
        padding: 11px 6px;
        border-radius: 13px;
        background: #f7f6f2;
      }
      .modal-stats strong {
        display: block;
        font:
          800 20px/1 "Baloo 2",
          cursive;
      }
      .modal-stats small {
        color: var(--muted);
        font-size: 9px;
        font-weight: 900;
        text-transform: uppercase;
      }
      .continue-btn {
        width: 100%;
        border: 0;
        padding: 13px;
        border-radius: 14px;
        background: var(--coral);
        color: white;
        font-weight: 900;
        cursor: pointer;
      }

      @media (max-width: 850px) {
        .game-shell {
          grid-template-columns: 1fr;
        }
        .host-panel {
          min-height: 220px;
          display: grid;
          grid-template-columns: 1fr 155px;
          grid-template-rows: auto 1fr;
          align-items: center;
          padding: 20px 24px;
          background: linear-gradient(110deg, #65d3ca 0 68%, #f4d58a 68.2%);
        }
        .host-badge {
          grid-column: 1;
        }
        .speech {
          grid-column: 1;
          margin: 12px 0 0;
          max-width: 330px;
        }
        .cat-wrap {
          grid-column: 2;
          grid-row: 1 / 3;
          width: 155px;
          height: 205px;
          margin: 0;
          align-self: end;
        }
        .host-name {
          position: absolute;
          right: 24px;
          bottom: 10px;
        }
        .host-name h2 {
          font-size: 17px;
        }
        .host-name p,
        .session-progress {
          display: none;
        }
        .palm {
          bottom: -5px;
          left: auto;
          right: 100px;
        }
      }

      @media (max-width: 560px) {
        .topbar {
          padding: 0 16px;
        }
        .brand-name {
          font-size: 18px;
        }
        main {
          width: min(100% - 18px, 1180px);
          padding-top: 24px;
        }
        .welcome {
          align-items: flex-start;
        }
        .streak-pill {
          padding: 8px 10px;
        }
        .streak-pill .streak-copy {
          display: none;
        }
        .game-shell {
          border-radius: 23px;
        }
        .host-panel {
          min-height: 180px;
          grid-template-columns: 1fr 120px;
          padding: 16px;
        }
        .cat-wrap {
          width: 125px;
          height: 170px;
        }
        .host-name {
          display: none;
        }
        .speech {
          min-height: 67px;
          padding: 11px 12px;
          font-size: 14px;
        }
        .play-panel {
          padding: 20px 14px 24px;
        }
        .lesson-select {
          width: 118px;
        }
        .lesson-heading p {
          display: none;
        }
        .stats {
          margin: 18px 0;
        }
        .prompt-card {
          min-height: 145px;
          padding-inline: 14px;
        }
        .key-row {
          gap: 3px;
        }
        .key {
          width: calc((100vw - 60px) / 10);
          height: 37px;
          border-radius: 7px;
          font-size: 10px;
        }
        .game-footer {
          flex-direction: column;
          text-align: center;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
          animation-duration: 0.01ms !important;
          animation-iteration-count: 1 !important;
          scroll-behavior: auto !important;
        }
      }
