  :root {
      --cork: #EDE0C6;
      --cork-dark: #E2D2AE;
      --cream: #FFFAF0;
      --ink: #4A3222;
      --ink-soft: #7A6349;
      --coral: #FF6B5D;
      --coral-dark: #E4523F;
      --sun: #FFC93C;
      --leaf: #45B26B;
      --sky: #3FA9F5;
      --grape: #A66DD4;
  }

  * {
      box-sizing: border-box;
  }

  html,
  body {
      margin: 0;
      padding: 0;
      height: 100%;
      font-family: 'Nunito', sans-serif;
      color: var(--ink);
      background:
          radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.35) 0, transparent 45%),
          radial-gradient(circle at 85% 80%, rgba(255, 255, 255, 0.25) 0, transparent 40%),
          var(--cork);
      background-attachment: fixed;
      -webkit-tap-highlight-color: transparent;
  }

  .stage {
      min-height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 20px 14px 40px;
  }

  .card {
      width: 100%;
      max-width: 420px;
      background: var(--cream);
      border-radius: 28px;
      padding: 26px 22px 30px;
      box-shadow:
          0 2px 0 rgba(0, 0, 0, 0.03) inset,
          0 18px 40px -12px rgba(74, 50, 34, 0.35),
          0 0 0 6px rgba(255, 255, 255, 0.5);
      text-align: center;
      position: relative;
      overflow: hidden;
  }

  h1 {
      font-family: 'Baloo 2', cursive;
      font-weight: 800;
      font-size: 2.1rem;
      margin: 2px 0 2px;
      color: var(--coral-dark);
      letter-spacing: 0.5px;
  }

  .tagline {
      margin: 0 0 14px;
      font-weight: 700;
      color: var(--ink-soft);
      font-size: 0.92rem;
  }

  .round-tag {
      display: inline-block;
      font-family: 'Baloo 2', cursive;
      font-size: 0.78rem;
      font-weight: 700;
      color: #fff;
      background: var(--grape);
      padding: 3px 12px;
      border-radius: 999px;
      margin-bottom: 14px;
      letter-spacing: 0.5px;
  }

  /* Jar / mystery pile */
  .jar-wrap {
      position: relative;
      width: 220px;
      height: 220px;
      margin: 6px auto 12px;
  }

  .jar {
      position: absolute;
      inset: 0;
      border-radius: 20px 20px 20px 20px / 20px 20px 20px 20px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.15));
      border: 4px solid rgba(74, 50, 34, 0.18);
      overflow: hidden;
  }

  .jar::before {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 14px;
      background: rgba(74, 50, 34, 0.18);
      border-radius: 14px 14px 0 0;
  }

  .stick {
      position: absolute;
      height: 10px;
      border-radius: 6px;
      transform-origin: center center;
      box-shadow:
          inset 0 -2px 2px rgba(0, 0, 0, 0.28),
          inset 0 2px 2px rgba(255, 255, 255, 0.55),
          0 3px 4px -1px rgba(43, 28, 14, 0.4);
      overflow: hidden;
  }

  .knot {
      position: absolute;
      top: 50%;
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: radial-gradient(circle at 35% 35%, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.4) 70%);
      transform: translateY(-50%);
  }

  .wood-0 {
      background: linear-gradient(to bottom, #7d5c33 0%, #cbaa74 18%, #ecdcb3 50%, #cbaa74 82%, #7d5c33 100%);
  }

  .wood-1 {
      background: linear-gradient(to bottom, #46280f 0%, #7a4e28 18%, #a4744a 50%, #7a4e28 82%, #46280f 100%);
  }

  .wood-2 {
      background: linear-gradient(to bottom, #5e2c18 0%, #9c5636 18%, #cd8a5f 50%, #9c5636 82%, #5e2c18 100%);
  }

  .wood-3 {
      background: linear-gradient(to bottom, #5f5749 0%, #a89b82 18%, #d3c8ac 50%, #a89b82 82%, #5f5749 100%);
  }

  .wood-4 {
      background: linear-gradient(to bottom, #5c3a16 0%, #a3703c 18%, #d3a869 50%, #a3703c 82%, #5c3a16 100%);
  }

  .count-badge {
      position: relative;
      margin-top: -6px;
  }

  .count-number {
      font-family: 'Baloo 2', cursive;
      font-weight: 800;
      font-size: 3.6rem;
      color: var(--coral-dark);
      line-height: 1;
      display: block;
  }

  .count-label {
      font-weight: 700;
      color: var(--ink-soft);
      font-size: 0.95rem;
      display: block;
      margin-top: 2px;
  }

  button {
      font-family: 'Baloo 2', cursive;
      font-weight: 700;
      font-size: 1.05rem;
      border: none;
      border-radius: 18px;
      padding: 14px 22px;
      cursor: pointer;
      width: 100%;
      margin-top: 16px;
      color: #fff;
      box-shadow: 0 6px 0 rgba(0, 0, 0, 0.15), 0 8px 18px -6px rgba(0, 0, 0, 0.35);
      transition: transform 0.08s ease, box-shadow 0.08s ease;
  }

  button:active {
      transform: translateY(4px);
      box-shadow: 0 2px 0 rgba(0, 0, 0, 0.15), 0 4px 10px -6px rgba(0, 0, 0, 0.35);
  }

  #revealBtn {
      background: var(--coral);
      margin-top: auto;
  }

  #newBtn {
      background: var(--leaf);
      margin-top: auto;
  }

  .hidden {
      display: none !important;
  }

  #jarView {
      display: flex;
      flex-direction: column;
      min-height: 370px;
  }

  /* Shape reveal */
  .shape-reveal {
      display: flex;
      flex-direction: column;
      min-height: 370px;
  }

  .shape-box {
      width: 220px;
      height: 220px;
      margin: 6px auto 4px;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2));
      border-radius: 20px 20px 20px 20px / 20px 20px 20px 20px;
      border: 4px solid rgba(74, 50, 34, 0.12);
      display: flex;
      align-items: center;
      justify-content: center;
  }

  #shapeName {
      font-family: 'Baloo 2', cursive;
      font-size: 1.5rem;
      font-weight: 800;
      color: var(--leaf);
      margin: 10px 0 0;
  }

  .confetti {
      position: absolute;
      width: 8px;
      height: 8px;
      border-radius: 2px;
      top: -10px;
      pointer-events: none;
      animation: fall 1.1s ease-in forwards;
  }

  @keyframes fall {
      to {
          transform: translateY(260px) rotate(280deg);
          opacity: 0;
      }
  }

  footer {
      text-align: center;
      padding: 16px;
      font-size: 0.78rem;
      color: var(--ink-soft);
  }

  @media (max-width:380px) {

      .jar-wrap,
      .shape-box {
          width: 190px;
          height: 190px;
      }

      .count-number {
          font-size: 3rem;
      }

      #jarView,
      .shape-reveal {
          min-height: 310px;
      }
  }