      /* Base */

      :root {
        --zoom: max(
          0.45,
          min(
            1.35,
            calc((100svh - 360px) / var(--card-base-h)),
            calc((100vw - 36px) / var(--card-base-w))
          )
        );
        --card-base-w: 315px;
        --card-base-h: 440px;
        --card-w: calc(var(--card-base-w) * var(--zoom));
        --card-h: calc(var(--card-base-h) * var(--zoom));
        --shift-x: 0px;
        --shift-y: 0px;
        --photo-rotate: 0deg;
        --photo-tilt-x: 0deg;
        --photo-tilt-y: 0deg;
        --photo-scale: 1;
        --surface: rgba(255, 255, 255, 0.84);
        --surface-strong: rgba(255, 255, 255, 0.94);
        --surface-soft: rgba(255, 255, 255, 0.62);
        --stroke: rgba(60, 60, 67, 0.14);
        --stroke-strong: rgba(60, 60, 67, 0.22);
        --text: #1d1d1f;
        --text-muted: #6e6e73;
        --blue: #0a84ff;
        --green: #32d74b;
        --red: #ff453a;
      }

      * {
        box-sizing: border-box;
      }

      [hidden] {
        display: none !important;
      }

      body {
        margin: 0;
        width: 100%;
        min-height: 100vh;
        overflow-x: hidden;
        background:
          radial-gradient(circle at 20% 8%, rgba(100, 210, 255, 0.18), transparent 28rem),
          radial-gradient(circle at 84% 14%, rgba(191, 90, 242, 0.13), transparent 28rem),
          linear-gradient(180deg, #ffffff 0%, #f4f8ff 48%, #f8f5ff 100%);
        font-family:
          Inter,
          ui-sans-serif,
          system-ui,
          -apple-system,
          BlinkMacSystemFont,
          "Segoe UI",
          sans-serif;
        color: var(--text);
      }

      button,
      input {
        font: inherit;
      }
      button {
        border: 0;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
      }
      button:disabled {
        opacity: 0.5;
        cursor: default;
      }

      .app {
        height: 100svh;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 8px;
        padding: max(22px, env(safe-area-inset-top)) 12px
          max(12px, env(safe-area-inset-bottom));
        overflow: hidden;
      }

      /* Overlays */

      .overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: max(18px, env(safe-area-inset-top)) 24px
          max(54px, calc(env(safe-area-inset-bottom) + 54px));
        background: rgba(242, 242, 247, 0.72);
        -webkit-backdrop-filter: blur(28px) saturate(140%);
        backdrop-filter: blur(28px) saturate(140%);
      }

      .overlay.hidden {
        display: none;
      }

      .overlay-card {
        margin: auto 0;
        width: min(520px, 100%);
        border: 1px solid var(--stroke);
        border-radius: 26px;
        padding: 30px;
        background: rgba(255, 255, 255, 0.92);
        box-shadow:
          0 34px 90px rgba(74, 85, 120, 0.16),
          inset 0 1px 0 rgba(255, 255, 255, 0.86);
        text-align: center;
      }

      .overlay-card h2 {
        margin: 0 0 12px;
        font-size: clamp(28px, 5vw, 46px);
        font-weight: 760;
        letter-spacing: 0;
      }

      .overlay-card p {
        margin: 12px 0;
        color: var(--text-muted);
        line-height: 1.55;
      }

      .rule-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin: 20px 0;
      }

      .rule-card {
        border-radius: 16px;
        padding: 16px;
        background: rgba(255, 255, 255, 0.52);
        border: 1px solid var(--stroke);
      }

      .rule-card b {
        display: block;
        margin-bottom: 6px;
        font-size: 22px;
      }

      .rule-card.good b {
        color: var(--green);
      }
      .rule-card.bad b {
        color: var(--red);
      }

      .setup-panel {
        margin: 22px 0 0;
        border: 1px solid var(--stroke);
        border-radius: 14px;
        overflow: hidden;
        background: rgba(255, 255, 255, 0.46);
        text-align: left;
      }

      .setup-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 14px;
        align-items: center;
        min-height: 58px;
        padding: 12px 14px;
        color: var(--text);
      }

      .setup-row + .setup-row {
        border-top: 1px solid var(--stroke);
      }

      .setup-row span {
        display: grid;
        gap: 3px;
        min-width: 0;
      }

      .setup-row b {
        font-size: 14px;
        line-height: 1.2;
      }

      .setup-row small {
        color: var(--text-muted);
        font-size: 12px;
        line-height: 1.25;
      }

      .setup-row input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin: 0;
        accent-color: var(--blue);
      }

      .setup-row input[type="number"] {
        width: 78px;
        border: 1px solid var(--stroke-strong);
        border-radius: 10px;
        padding: 8px 10px;
        background: rgba(255, 255, 255, 0.72);
        color: var(--text);
        font-weight: 720;
        text-align: center;
      }

      .privacy-link {
        display: block;
        margin-top: 18px;
        margin-left: auto;
        margin-right: auto;
        padding: 4px 6px;
        background: transparent;
        color: rgba(110, 110, 115, 0.72);
        font-size: 12px;
        font-weight: 560;
        text-decoration: underline;
        text-underline-offset: 3px;
      }

      .privacy-copy {
        text-align: left;
      }

      .privacy-copy h3 {
        margin: 20px 0 8px;
        color: var(--text);
        font-size: 15px;
      }

      .privacy-copy ul {
        margin: 8px 0 0;
        padding-left: 20px;
        color: var(--text-muted);
        line-height: 1.5;
      }

      #startGameBtn,
      .new-game {
        background: var(--blue);
        color: white;
        font-weight: 760;
        box-shadow: 0 12px 26px rgba(10, 132, 255, 0.24);
      }

      #startGameBtn {
        display: block;
        margin-top: 12px;
        margin-left: auto;
        margin-right: auto;
        padding: 14px 18px;
        border-radius: 16px;
      }

      .final-score {
        margin: 18px auto 8px;
        width: 150px;
        height: 150px;
        border-radius: 999px;
        display: grid;
        place-items: center;
        background: linear-gradient(180deg, #ffffff, #eef5ff);
        box-shadow:
          0 22px 60px rgba(74, 85, 120, 0.16),
          inset 0 1px 0 rgba(255, 255, 255, 0.9);
        color: var(--text);
        font-size: 42px;
        font-weight: 950;
        letter-spacing: 0;
      }

      .final-score.bad {
        color: #c62f28;
      }

      .final-mode {
        margin: 0 0 10px;
        color: var(--text-muted);
        font-size: 13px;
        font-weight: 650;
      }

      /* Header */

      .top-bar {
        width: min(1100px, 100%);
        margin: 0 auto;
        position: relative;
        display: flex;
        justify-content: center;
        gap: 12px;
        align-items: center;
      }

      .brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        min-width: 0;
      }

      .pokeball {
        width: 36px;
        height: 36px;
        border-radius: 999px;
        flex: 0 0 auto;
        background:
          radial-gradient(
            circle at 50% 50%,
            #fff 0 18%,
            #111 19% 24%,
            transparent 25%
          ),
          linear-gradient(#d84f55 0 46%, #111 47% 53%, #fff 54% 100%);
        box-shadow: 0 8px 22px rgba(74, 85, 120, 0.16);
      }

      h1 {
        margin: 0;
        font-size: clamp(20px, 3vw, 30px);
        line-height: 1;
        letter-spacing: 0;
        white-space: nowrap;
      }

      .subtitle {
        display: none;
      }

      .pill-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: min(520px, calc(100vw - 24px), 100%);
        max-width: 100%;
        min-width: 0;
        margin: 0 auto;
      }

      .pill {
        padding: 9px 10px;
        border: 1px solid var(--stroke);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.78);
        color: var(--text);
        font-weight: 680;
        font-size: 13px;
        text-align: center;
        white-space: nowrap;
      }

      .new-game {
        padding: 10px 14px;
        border-radius: 999px;
      }

      /* Card stage */

      .game-stage {
        width: min(1100px, 100%);
        min-height: 0;
        min-width: 0;
        margin: 0 auto;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto auto;
        gap: 8px;
        align-items: stretch;
        justify-items: center;
      }

      .card-wrap {
        position: relative;
        display: grid;
        place-items: center;
        align-self: center;
        min-height: 0;
        min-width: 0;
        width: var(--card-w);
        height: var(--card-h);
        max-width: 100%;
        padding: 0;
      }

      .card {
        z-index: 1;
        width: var(--card-w);
        height: var(--card-h);
        position: relative;
        border-radius: calc(18px * var(--zoom));
        overflow: hidden;
        box-shadow: 0 18px 36px rgba(74, 85, 120, 0.16);
        background: #aaa;
        transform:
          perspective(900px)
          rotateX(var(--photo-tilt-x))
          rotateY(var(--photo-tilt-y))
          rotateZ(var(--photo-rotate))
          scale(var(--photo-scale));
        transform-origin: center;
        transition: transform 220ms ease-out;
      }

      .card img {
        position: absolute;
        width: var(--card-w);
        height: var(--card-h);
        object-fit: fill;
        display: block;
      }

      .card-glow {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        z-index: 0;
        width: calc(var(--card-w) * 1.14);
        height: calc(var(--card-h) * 1.08);
        border-radius: calc(32px * var(--zoom));
        background:
          radial-gradient(circle at 38% 28%, rgba(255, 255, 255, 0.92), transparent 42%),
          radial-gradient(circle at 62% 72%, rgba(10, 132, 255, 0.2), transparent 48%),
          rgba(255, 255, 255, 0.34);
        filter: blur(22px);
        opacity: 0.82;
      }

      .border-source {
        left: 0;
        top: 0;
        z-index: 1;
      }

      .printed-card {
        left: var(--shift-x);
        top: var(--shift-y);
        z-index: 2;
      }

      /* Controls */

      .continue-action {
        display: none;
        width: 100%;
        height: 60px;
        font-size: 14px;
        padding: 0 8px;
        border-radius: 10px;
        color: white;
        box-shadow:
          0 12px 24px rgba(74, 85, 120, 0.14),
          inset 0 1px 0 rgba(255, 255, 255, 0.16);
        grid-row: 1;
      }
      .continue-action.visible {
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .choice-row.hidden {
        display: none;
      }

      .panel {
        width: min(520px, calc(100vw - 24px), 100%);
        max-width: 100%;
        min-width: 0;
        margin: 0 auto;
        border: 1px solid var(--stroke);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.86);
        box-shadow:
          0 18px 50px rgba(74, 85, 120, 0.14),
          inset 0 1px 0 rgba(255, 255, 255, 0.88);
        -webkit-backdrop-filter: blur(24px) saturate(140%);
        backdrop-filter: blur(24px) saturate(140%);
        padding: 10px;
        display: grid;
        grid-template-rows: 60px 146px;
        gap: 8px;
        height: 236px;
      }

      #currentCard,
      .question-kicker,
      #resultText {
        display: none;
      }

      .choice-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin: 0;
        height: 60px;
        grid-row: 1;
        min-height: 0;
        min-width: 0;
      }

      .choice-row button {
        position: relative;
        height: 100%;
        border-radius: 18px;
        color: white;
        font-weight: 820;
        font-size: 19px;
        letter-spacing: 0;
        box-shadow:
          0 14px 24px rgba(74, 85, 120, 0.16),
          inset 0 1px 0 rgba(255, 255, 255, 0.28);
        transition:
          transform 120ms ease,
          filter 120ms ease,
          background 120ms ease;
      }

      .choice-row button:not(:disabled):hover {
        filter: brightness(1.02);
        transform: translateY(-1px);
      }

      .choice-row button:not(:disabled):active {
        box-shadow:
          0 5px 12px rgba(74, 85, 120, 0.14),
          inset 0 2px 5px rgba(0, 0, 0, 0.16);
        transform: translateY(1px);
      }

      #guess10 {
        background: linear-gradient(180deg, #34c759, #248a3d);
        border: 1px solid rgba(20, 107, 49, 0.24);
        box-shadow:
          0 14px 24px rgba(52, 199, 89, 0.24),
          inset 0 1px 0 rgba(255, 255, 255, 0.3);
      }
      #guess9 {
        background: linear-gradient(180deg, #ff453a, #c62f28);
        border: 1px solid rgba(159, 36, 31, 0.22);
        box-shadow:
          0 14px 24px rgba(255, 69, 58, 0.22),
          inset 0 1px 0 rgba(255, 255, 255, 0.3);
      }

      /* Status */

      .status-card {
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.62);
        border: 1px solid var(--stroke);
        padding: 10px;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 10px;
        align-content: space-between;
        align-items: start;
        grid-row: 2;
        height: 146px;
        min-height: 0;
        overflow: hidden;
      }

      .status-card.waiting {
        display: grid;
        place-items: center;
      }

      .status-card.waiting .status-column {
        max-width: 340px;
        text-align: center;
      }

      .status-card.waiting #status {
        color: var(--text-muted);
        line-height: 1.38;
      }

      .status-card.waiting .bars {
        display: none;
      }

      .status-card.good {
        border-color: rgba(48, 209, 88, 0.24);
        background: rgba(48, 209, 88, 0.1);
      }
      .status-card.bad {
        border-color: rgba(255, 69, 58, 0.24);
        background: rgba(255, 69, 58, 0.09);
      }

      .status-column {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
      }

      #status {
        margin: 0;
        font-size: 17px;
        color: var(--text);
        line-height: 1.28;
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 520;
      }

      .result-icon {
        width: 32px;
        height: 32px;
        border-radius: 999px;
        flex: 0 0 auto;
        display: grid;
        place-items: center;
        color: white;
        font-size: 22px;
        font-weight: 850;
        line-height: 1;
      }

      .result-icon.good {
        background: var(--green);
      }

      .result-icon.bad {
        background: var(--red);
      }

      .status-card.good #status {
        color: #146b31;
      }
      .status-card.bad #status {
        color: #9f241f;
      }

      #resultText {
        grid-column: 1 / -1;
        margin: 0;
      }

      .bars {
        display: grid;
        gap: 7px;
        min-width: 0;
        align-self: end;
      }

      .split-row {
        display: grid;
        gap: 3px;
      }

      .split-label {
        display: flex;
        justify-content: space-between;
        gap: 6px;
        color: var(--text-muted);
        font-size: 12px;
        font-weight: 700;
      }

      .split-bar {
        height: 9px;
        border-radius: 999px;
        overflow: hidden;
        display: flex;
        background: rgba(60, 60, 67, 0.12);
        border: 1px solid rgba(60, 60, 67, 0.08);
      }

      .split-a,
      .split-b {
        height: 100%;
      }
      .split-a.good,
      .split-b.good {
        background: var(--green);
      }
      .split-a.bad,
      .split-b.bad {
        background: var(--red);
      }
      .split-b.good,
      .split-b.bad {
        filter: brightness(0.62);
      }

      .loader {
        display: none;
        align-items: center;
        gap: 6px;
        color: var(--text-muted);
        font-size: 12px;
        grid-row: 1;
        height: 60px;
      }

      .loader.active {
        display: flex;
      }

      #startLoader {
        justify-content: center;
        height: auto;
        margin-top: 14px;
      }

      .spinner {
        width: 14px;
        height: 14px;
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-top-color: var(--blue);
        border-radius: 999px;
        animation: spin 800ms linear infinite;
      }

      .loader {
        display: none;
        align-items: center;
        gap: 10px;
        color: var(--text-muted);
        font-size: 14px;
      }

      .loader.active {
        display: flex;
      }

      .spinner {
        width: 18px;
        height: 18px;
        border: 3px solid rgba(255, 255, 255, 0.2);
        border-top-color: var(--blue);
        border-radius: 999px;
        animation: spin 800ms linear infinite;
      }

      @keyframes spin {
        to {
          transform: rotate(360deg);
        }
      }

      /* Responsive */

      @media (max-width: 900px) {
        .app {
          padding: max(18px, env(safe-area-inset-top)) 10px 10px;
          gap: 8px;
        }
        .top-bar {
          text-align: left;
        }
        .game-stage {
          gap: 8px;
        }
        :root {
          --zoom: max(
            0.45,
            min(
              1,
              calc((100svh - 330px) / var(--card-base-h)),
              calc((100vw - 36px) / var(--card-base-w))
            )
          );
        }
      }

      @media (max-width: 520px) {
        :root {
          --zoom: max(
            0.45,
            min(
              1.08,
              calc(
                (100svh - 330px - env(safe-area-inset-bottom)) /
                  var(--card-base-h)
              ),
              calc((100vw - 8px) / var(--card-base-w))
            )
          );
        }
        .app {
          padding: max(16px, env(safe-area-inset-top)) 4px
            max(8px, env(safe-area-inset-bottom));
          gap: 6px;
        }
        .top-bar {
          min-height: 34px;
        }
        .brand {
          gap: 8px;
        }
        .pokeball {
          width: 30px;
          height: 30px;
        }
        h1 {
          font-size: 20px;
        }
        .panel {
          width: min(100%, calc(100vw - 16px));
          padding: 8px;
          gap: 7px;
          border-radius: 16px;
          grid-template-rows: 58px 142px;
          height: 222px;
        }
        .pill {
          font-size: 12px;
          padding: 8px;
        }
        .choice-row {
          gap: 8px;
          height: 58px;
        }
        .choice-row button {
          height: 100%;
          font-size: 18px;
          border-radius: 16px;
        }
        .status-card {
          padding: 9px;
          height: 142px;
        }
        #status {
          font-size: 15px;
        }
        .overlay-card {
          padding: 20px;
          border-radius: 22px;
        }
        .overlay-card h2 {
          font-size: 34px;
        }
        .overlay-card p {
          margin: 10px 0;
          line-height: 1.45;
        }
        .rule-grid {
          grid-template-columns: 1fr;
          gap: 8px;
          margin: 16px 0;
        }
        .rule-card {
          padding: 13px;
        }
        .setup-panel {
          margin-top: 16px;
        }
        .setup-row {
          min-height: 54px;
          padding: 11px 12px;
        }
        .question-kicker,
        #currentCard {
          display: none;
        }
        .continue-action.visible {
          display: flex;
          width: 100%;
          font-size: 18px;
          height: 58px;
          padding: 0 16px;
          border-radius: 14px;
          color: white;
          box-shadow:
            0 16px 34px rgba(10, 132, 255, 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.16);
        }
      }
