    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    html,
    body {
      height: 100%;
    }

    body {
      font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
      background: #0a1f3d;
      color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      user-select: none;
      -webkit-user-select: none;
    }

    #app {
      width: 100%;
      max-width: 430px;
      height: 100%;
      max-height: 800px;
      background: linear-gradient(180deg, #0d2b52 0%, #0a1f3d 60%, #061229 100%);
      display: flex;
      flex-direction: column;
      padding: 20px;
      overflow: hidden;
      position: relative;
    }

    #s-prep {
      gap: 0;
    }

    .screen {
      flex: 1;
      display: none;
      flex-direction: column;
    }

    .screen.active {
      display: flex;
    }

    h1 {
      font-size: 22px;
      text-align: center;
      margin-bottom: 8px;
    }

    .lead {
      font-size: 14px;
      text-align: center;
      color: #bcd4f0;
      line-height: 1.7;
    }

    .spacer {
      flex: 1;
    }

    .btn {
      display: block;
      width: 100%;
      padding: 18px;
      border: 4px solid #b83a2e;
      border-radius: 12px;
      background: #fdf5e0;
      color: #3d2a1c;
      font-size: 20px;
      font-weight: bold;
      text-align: center;
      cursor: pointer;
    }

    .btn:active {
      transform: scale(0.97);
    }

    .btn.locked {
      border-color: #555;
      background: #26354a;
      color: #7a8aa0;
    }

    .timer {
      font-size: 40px;
      font-weight: bold;
      text-align: center;
      margin: 6px 0;
      font-variant-numeric: tabular-nums;
    }

    .timer.warn {
      color: #ff9d5c;
    }

    .step-card {
      width: 100%;
      padding: 16px;
      margin: 8px 0;
      border-radius: 12px;
      font-size: 18px;
      font-family: inherit;
      font-weight: bold;
      text-align: center;
      cursor: pointer;
      background: #16375f;
      color: #6c85a8;
      border: 3px solid #24507f;
      appearance: none;
      -webkit-appearance: none;
    }

    .step-card.current {
      background: #fdf5e0;
      color: #3d2a1c;
      border-color: #b83a2e;
      box-shadow: 0 0 16px rgba(255, 200, 120, 0.5);
    }

    .step-card.done {
      background: #1d4d35;
      color: #b8e6c8;
      border-color: #2f7a52;
    }

    .intro-character-stage {
      min-height: 172px;
      margin: 8px 0 12px;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      position: relative;
      pointer-events: none;
    }

    .intro-character-stage::before {
      content: "";
      position: absolute;
      bottom: 8px;
      left: 50%;
      width: 210px;
      height: 42px;
      transform: translateX(-50%);
      border-radius: 50%;
      background: rgba(82, 200, 231, 0.18);
      border: 2px solid rgba(82, 200, 231, 0.28);
    }

    .intro-character {
      width: 154px;
      max-width: 42vw;
      z-index: 1;
    }

    .intro-bubble {
      fill: none;
      stroke: #9feaff;
      stroke-width: 4;
      opacity: 0.68;
      animation: introBubble 2.4s ease-in-out infinite;
    }

    .intro-bubble.b2 {
      animation-delay: 0.7s;
    }

    .intro-bubble.b3 {
      animation-delay: 1.2s;
    }

    .mogu-stage {
      margin-top: 10px;
      min-height: 204px;
      display: grid;
      grid-template-rows: auto 1fr;
      gap: 6px;
      position: relative;
      flex: 1;
      min-height: 0;
    }

    .gear-row {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
    }

    .gear-tag {
      min-height: 34px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 4px;
      border: 2px solid #24507f;
      border-radius: 8px;
      background: rgba(10, 31, 61, 0.72);
      color: #7a97b8;
      font-size: 11px;
      font-weight: bold;
      line-height: 1.2;
      text-align: center;
    }

    .gear-tag.on {
      border-color: #b83a2e;
      background: #fdf5e0;
      color: #3d2a1c;
      box-shadow: 0 0 10px rgba(255, 200, 120, 0.42);
    }

    .mogu-character-wrap {
      position: relative;
      min-height: 158px;
      display: flex;
      align-items: flex-end;
      justify-content: center;
      overflow: hidden;
    }

    .prep-note {
      position: absolute;
      left: 4px;
      bottom: 18px;
      width: 96px;
      padding: 8px 6px;
      border: 3px solid #b83a2e;
      border-radius: 8px;
      background: #fdf5e0;
      color: #3d2a1c;
      font-size: 12px;
      font-weight: bold;
      line-height: 1.35;
      text-align: center;
      box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
    }

    .mogu-character {
      width: 188px;
      max-width: 66vw;
      height: auto;
      filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.32));
      pointer-events: none;
    }

    .prep-mash-mode .mogu-stage {
      flex: 0 0 auto;
      min-height: 168px;
      margin-top: 4px;
    }

    .prep-mash-mode .gear-row {
      display: none;
    }

    .prep-mash-mode .mogu-character-wrap {
      min-height: 168px;
    }

    .prep-mash-mode .mogu-character {
      width: 152px;
    }

    .prep-mash-mode .prep-note {
      display: none;
    }

    .prep-mash-mode .mogu-bob {
      animation: prepJump 0.58s ease-in-out infinite;
    }

    .prep-mash-mode .suit-arms {
      transform-origin: 160px 160px;
      animation: prepArms 0.58s ease-in-out infinite;
    }

    .prep-mash-mode .layer-balance {
      animation: prepGearShake 0.58s ease-in-out infinite;
    }

    .prep-mash-mode .layer-helmet {
      animation: prepHelmetNod 0.58s ease-in-out infinite;
    }

    .prep-mash-mode.is-pumping .mogu-character {
      animation: prepTapPop 0.18s ease-out;
    }

    .mogu-bob {
      transform-origin: 160px 250px;
      animation: prepBob 1.8s ease-in-out infinite;
    }

    .mogu-part {
      transition: opacity 0.2s ease, transform 0.2s ease;
      transform-origin: center;
    }

    .layer-suit,
    .layer-balance,
    .layer-helmet,
    .layer-traveler {
      opacity: 0;
      transform: translateY(-8px) scale(0.96);
    }

    .mogu-character[data-stage="0"] .layer-traveler,
    .mogu-character[data-stage="1"] .layer-suit,
    .mogu-character[data-stage="2"] .layer-suit,
    .mogu-character[data-stage="3"] .layer-suit,
    .mogu-character[data-stage="2"] .layer-balance,
    .mogu-character[data-stage="3"] .layer-balance,
    .mogu-character[data-stage="3"] .layer-helmet {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    .mogu-character[data-stage="0"] .layer-face,
    .mogu-character[data-stage="3"] .layer-face {
      opacity: 0;
    }

    @keyframes prepBob {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-4px); }
    }

    @keyframes prepJump {
      0%, 100% { transform: translateY(0) scaleY(1); }
      18% { transform: translateY(4px) scaleY(0.96); }
      52% { transform: translateY(-18px) scaleY(1.04); }
      76% { transform: translateY(-5px) scaleY(1); }
    }

    @keyframes prepArms {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      48% { transform: translateY(-20px) rotate(-5deg); }
    }

    @keyframes prepGearShake {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      50% { transform: translateY(-4px) rotate(2deg); }
    }

    @keyframes prepHelmetNod {
      0%, 100% { transform: translateY(0) rotate(0deg); }
      50% { transform: translateY(-7px) rotate(-3deg); }
    }

    @keyframes prepTapPop {
      0% { transform: scale(1); }
      55% { transform: scale(1.08); }
      100% { transform: scale(1); }
    }

    @keyframes introBubble {
      0%, 100% { transform: translateY(0); opacity: 0.48; }
      50% { transform: translateY(-10px); opacity: 0.92; }
    }

    .gauge-wrap {
      height: 34px;
      background: #16375f;
      border-radius: 17px;
      overflow: hidden;
      border: 2px solid #24507f;
      margin: 12px 0;
    }

    .gauge-bar {
      height: 100%;
      width: 0%;
      border-radius: 15px;
      background: linear-gradient(90deg, #43c59e, #ffd45c);
      transition: width 0.08s linear;
    }

    .gauge-label {
      text-align: center;
      font-size: 14px;
      color: #bcd4f0;
    }

    .tap-btn {
      width: 190px;
      height: 190px;
      border-radius: 50%;
      margin: 14px auto;
      border: 6px solid #b83a2e;
      background: #fdf5e0;
      color: #3d2a1c;
      font-size: 26px;
      font-family: inherit;
      font-weight: bold;
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      appearance: none;
      -webkit-appearance: none;
      position: relative;
      z-index: 2;
    }

    .tap-btn:active {
      transform: scale(0.94);
    }

    .rank-big {
      font-size: 64px;
      text-align: center;
      margin: 10px 0;
    }

    .scene-art {
      font-size: 64px;
      text-align: center;
      margin: 16px 0;
      line-height: 1.3;
    }

    .scene-text {
      font-size: 16px;
      text-align: center;
      line-height: 2;
      color: #f2e8cf;
      padding: 0 8px;
    }

    .return-video-wrap {
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .return-video-frame {
      flex: 1;
      min-height: 0;
      border: 4px solid #24507f;
      border-radius: 10px;
      overflow: hidden;
      background: #061229;
      box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.35);
      position: relative;
    }

    .return-video {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      background: #061229;
    }

    .return-video-caption {
      padding: 12px;
      border: 4px solid #b83a2e;
      border-radius: 10px;
      background: #fdf5e0;
      color: #3d2a1c;
      box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
      font-size: 16px;
      font-weight: bold;
      line-height: 1.6;
      text-align: center;
    }

    .rpg-hud {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 6px;
      margin: 6px 0 10px;
    }

    .hud-cell {
      min-height: 42px;
      padding: 6px;
      border: 2px solid #24507f;
      border-radius: 8px;
      background: rgba(6, 18, 41, 0.72);
      color: #fdf5e0;
      text-align: center;
      font-size: 12px;
      font-weight: bold;
      line-height: 1.25;
    }

    .hud-cell span {
      display: block;
      color: #7fd7ee;
      font-size: 10px;
      letter-spacing: 1px;
    }

    .dive-window {
      flex: 1;
      min-height: 360px;
      border: 4px solid #24507f;
      border-radius: 10px;
      overflow: hidden;
      position: relative;
      background:
        linear-gradient(180deg, rgba(83, 184, 221, 0.18), transparent 18%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 18px),
        linear-gradient(180deg, #0b3764 0%, #09264a 48%, #061229 100%);
      box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.35);
    }

    .dive-window::before,
    .dive-window::after {
      content: "";
      position: absolute;
      left: -12%;
      width: 124%;
      height: 42px;
      border-radius: 50%;
      background: rgba(126, 215, 238, 0.16);
      animation: seaCurrent 3.8s ease-in-out infinite;
    }

    .dive-window::before {
      top: 74px;
    }

    .dive-window::after {
      top: 184px;
      animation-delay: 1.4s;
      opacity: 0.72;
    }

    .dive-depth-line {
      position: absolute;
      top: 16px;
      bottom: 16px;
      left: 18px;
      width: 12px;
      border: 2px solid #24507f;
      border-radius: 8px;
      background: rgba(3, 14, 32, 0.7);
      overflow: hidden;
      z-index: 2;
    }

    .dive-depth-fill {
      position: absolute;
      left: 0;
      right: 0;
      bottom: 0;
      height: 34%;
      background: linear-gradient(180deg, #7fd7ee, #f0c85a);
      transition: height 0.35s ease;
    }

    .dive-route {
      position: absolute;
      inset: 0;
      z-index: 1;
    }

    .dive-route path {
      fill: none;
      stroke: rgba(253, 245, 224, 0.36);
      stroke-width: 4;
      stroke-dasharray: 10 10;
      animation: routeMarch 1.2s linear infinite;
    }

    .mini-diver {
      position: absolute;
      left: 50%;
      top: 50px;
      width: 94px;
      transform: translateX(-50%);
      z-index: 3;
      animation: diverDescend 2.15s ease-in-out forwards, diverSwim 0.7s ease-in-out infinite;
      filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.38));
    }

    .dive-bubble {
      position: absolute;
      width: 22px;
      height: 22px;
      border: 3px solid rgba(159, 234, 255, 0.85);
      border-radius: 50%;
      box-shadow: inset 5px 5px 8px rgba(255, 255, 255, 0.25);
      animation: bubbleRise 2.6s ease-in-out infinite;
      z-index: 2;
    }

    .dive-bubble.b1 { left: 62%; top: 78%; }
    .dive-bubble.b2 { left: 72%; top: 60%; width: 14px; height: 14px; animation-delay: 0.5s; }
    .dive-bubble.b3 { left: 30%; top: 66%; width: 18px; height: 18px; animation-delay: 1.1s; }
    .dive-bubble.b4 { left: 48%; top: 82%; width: 12px; height: 12px; animation-delay: 1.6s; }

    .sea-floor {
      position: absolute;
      left: -8%;
      right: -8%;
      bottom: -14px;
      height: 92px;
      border-radius: 50% 50% 0 0;
      background: linear-gradient(180deg, #15547e, #09203d);
      border-top: 5px solid #061123;
      z-index: 2;
    }

    .sea-coral {
      position: absolute;
      bottom: 42px;
      right: 38px;
      width: 92px;
      height: 92px;
      z-index: 3;
      animation: coralSway 1.8s ease-in-out infinite;
    }

    .quest-marker {
      position: absolute;
      bottom: 88px;
      left: 54%;
      padding: 6px 10px;
      border: 2px solid #f0c85a;
      border-radius: 8px;
      background: rgba(6, 18, 41, 0.82);
      color: #fdf5e0;
      font-size: 12px;
      font-weight: bold;
      z-index: 4;
      transform: translateX(-50%);
      animation: markerBlink 1s ease-in-out infinite;
    }

    .rpg-log {
      margin-top: 10px;
      padding: 12px;
      min-height: 86px;
      border: 4px solid #b83a2e;
      border-radius: 10px;
      background: #fdf5e0;
      color: #3d2a1c;
      box-shadow: 0 6px 0 rgba(0, 0, 0, 0.22);
    }

    .rpg-log-title {
      display: block;
      margin-bottom: 4px;
      color: #b83a2e;
      font-size: 13px;
      font-weight: bold;
    }

    .rpg-log p {
      margin: 0;
      font-size: 17px;
      font-weight: bold;
      line-height: 1.55;
    }

    .chest-rpg-frame {
      flex: 1;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      gap: 12px;
      min-height: 0;
      overflow-y: auto;
      padding-bottom: 12px;
      -webkit-overflow-scrolling: touch;
    }

    #s-chest {
      min-height: 0;
      overflow: hidden;
    }

    #s-chest.is-opened {
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }

    #s-chest.is-opened .chest-rpg-frame {
      flex: 0 0 auto;
      overflow: visible;
    }

    .event-tag {
      align-self: center;
      padding: 6px 14px;
      border: 2px solid #f0c85a;
      border-radius: 999px;
      background: rgba(6, 18, 41, 0.72);
      color: #fdf5e0;
      font-size: 13px;
      font-weight: bold;
    }

    .treasure-field {
      min-height: 286px;
      border: 4px solid #24507f;
      border-radius: 10px;
      position: relative;
      overflow: hidden;
      background:
        radial-gradient(circle at 50% 70%, rgba(82, 200, 231, 0.24), transparent 34%),
        linear-gradient(180deg, #0b315d 0%, #061229 100%);
    }

    .treasure-field::before {
      content: "";
      position: absolute;
      left: -20px;
      right: -20px;
      bottom: -28px;
      height: 104px;
      border-radius: 50% 50% 0 0;
      background: #10446d;
      border-top: 5px solid #061123;
    }

    .treasure-button {
      position: absolute;
      left: 50%;
      bottom: 62px;
      width: 150px;
      height: 120px;
      transform: translateX(-50%);
      border: 0;
      background: transparent;
      cursor: default;
      animation: chestIdle 1.25s ease-in-out infinite;
      z-index: 2;
      appearance: none;
      -webkit-appearance: none;
      pointer-events: none;
    }

    .treasure-button svg {
      width: 100%;
      height: 100%;
      filter: drop-shadow(0 14px 10px rgba(0, 0, 0, 0.36));
    }

    .treasure-button.is-opened {
      animation: chestOpenPop 0.45s ease-out forwards;
    }

    .treasure-button.is-inspecting {
      animation: chestInspect 0.42s ease-in-out infinite;
    }

    .command-panel {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      padding: 10px;
      border: 3px solid #24507f;
      border-radius: 10px;
      background: rgba(6, 18, 41, 0.78);
    }

    .command-panel button {
      min-height: 40px;
      display: grid;
      place-items: center;
      border: 2px solid #24507f;
      border-radius: 8px;
      color: #bcd4f0;
      font-size: 14px;
      font-family: inherit;
      font-weight: bold;
      background: transparent;
      cursor: pointer;
      appearance: none;
      -webkit-appearance: none;
    }

    .command-panel button:first-child {
      border-color: #b83a2e;
      background: #fdf5e0;
      color: #3d2a1c;
    }

    .command-panel button:active {
      transform: scale(0.97);
    }

    @keyframes seaCurrent {
      0%, 100% { transform: translateX(-8%); opacity: 0.42; }
      50% { transform: translateX(8%); opacity: 0.72; }
    }

    @keyframes routeMarch {
      to { stroke-dashoffset: -20; }
    }

    @keyframes diverDescend {
      0% { top: 34px; }
      100% { top: 186px; }
    }

    @keyframes diverSwim {
      0%, 100% { margin-left: -6px; }
      50% { margin-left: 6px; }
    }

    @keyframes bubbleRise {
      0% { transform: translateY(34px) scale(0.72); opacity: 0; }
      35% { opacity: 0.86; }
      100% { transform: translateY(-98px) scale(1.16); opacity: 0; }
    }

    @keyframes coralSway {
      0%, 100% { transform: rotate(-2deg); }
      50% { transform: rotate(3deg); }
    }

    @keyframes markerBlink {
      0%, 100% { opacity: 0.72; }
      50% { opacity: 1; }
    }

    @keyframes chestIdle {
      0%, 100% { transform: translateX(-50%) translateY(0); }
      50% { transform: translateX(-50%) translateY(-8px); }
    }

    @keyframes chestOpenPop {
      0% { transform: translateX(-50%) scale(1); }
      62% { transform: translateX(-50%) scale(1.12); }
      100% { transform: translateX(-50%) scale(1.04); }
    }

    @keyframes chestInspect {
      0%, 100% { transform: translateX(-50%) rotate(0deg); }
      25% { transform: translateX(-50%) rotate(-2deg); }
      75% { transform: translateX(-50%) rotate(2deg); }
    }

    .narration {
      font-size: 17px;
      text-align: center;
      line-height: 2.2;
      color: #ffd9a0;
      padding: 12px;
      border-top: 1px solid #3a5a85;
      border-bottom: 1px solid #3a5a85;
    }

    .result-row {
      display: flex;
      justify-content: space-between;
      padding: 10px 6px;
      border-bottom: 1px solid #24507f;
      font-size: 16px;
    }

    .hint {
      font-size: 12px;
      color: #7a97b8;
      text-align: center;
      margin-top: 8px;
    }

    .mame {
      display: inline-block;
      padding: 4px 14px;
      border-radius: 20px;
      background: #c62f2f;
      background-image: radial-gradient(#fff 15%, transparent 16%);
      background-size: 10px 10px;
      color: transparent;
      height: 18px;
    }

    /* ===== 特別アイテム（招待券）の高級感演出 ===== */
    @keyframes ticketPop {
      0% { transform: scale(0.3); opacity: 0; }
      70% { transform: scale(1.08); }
      100% { transform: scale(1); opacity: 1; }
    }

    @keyframes ticketGlow {
      0%, 100% { box-shadow: 0 0 18px rgba(255, 215, 120, 0.55); }
      50% { box-shadow: 0 0 44px rgba(255, 215, 120, 0.95); }
    }

    @keyframes shineSweep {
      0% { left: -70%; }
      60%, 100% { left: 130%; }
    }

    .ticket-card {
      margin: 14px auto;
      padding: 20px 16px;
      max-width: 320px;
      border-radius: 14px;
      border: 3px solid #f0c85a;
      background: linear-gradient(135deg, #3a2c0a 0%, #7a5f1a 45%, #3a2c0a 100%);
      color: #ffe9b0;
      text-align: center;
      animation: ticketPop 0.5s ease-out, ticketGlow 1.6s ease-in-out infinite;
      position: relative;
      overflow: hidden;
    }

    .ticket-card::after {
      content: "";
      position: absolute;
      top: -50%;
      left: -70%;
      width: 40%;
      height: 200%;
      transform: rotate(20deg);
      background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
      animation: shineSweep 2.4s ease-in-out infinite;
    }

    .ticket-title {
      font-size: 18px;
      font-weight: bold;
      letter-spacing: 1px;
      margin: 8px 0;
      line-height: 1.6;
    }

    .ticket-sub {
      font-size: 12px;
      color: #e8d290;
      letter-spacing: 2px;
    }

    .ticket-link {
      display: inline-block;
      margin-top: 14px;
      padding: 10px 22px;
      border-radius: 22px;
      background: linear-gradient(180deg, #ffd873, #e8b445);
      color: #3a2c0a;
      font-weight: bold;
      font-size: 14px;
      text-decoration: none;
      position: relative;
      z-index: 1;
    }
