*, *::before, *::after {
      box-sizing: border-box;
      user-select: none;
      -webkit-user-select: none;
      -webkit-touch-callout: none;
      -webkit-tap-highlight-color: transparent;
      -webkit-user-drag: none;
      touch-action: none;
    }

    ::selection {
      background: transparent;
      color: inherit;
    }

    html, body {
      margin: 0;
      padding: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      position: fixed;
      overscroll-behavior: none;
      background-color: #1a0b05;
      font-family: 'Hiragino Kaku Gothic ProN', 'メイリオ', sans-serif;
      color: #fff;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    #game-container {
      position: relative;
      width: 100%;
      max-width: 800px;
      height: 100vh;
      height: 100dvh;
      max-height: 600px;
      background: linear-gradient(to bottom, #0f051d 0%, #2c1205 100%);
      box-shadow: 0 0 30px rgba(255, 100, 0, 0.3);
      overflow: hidden;
      border-radius: 8px;
      cursor: none;
    }

    #game-container.selecting {
      cursor: default;
    }

    .game-btn {
      min-height: 56px;
      min-width: 48px;
      cursor: pointer;
      transition: transform 0.08s ease, opacity 0.08s ease, filter 0.08s ease, border-color 0.08s ease, box-shadow 0.08s ease;
      will-change: transform;
      touch-action: manipulation;
      -webkit-tap-highlight-color: transparent;
      -webkit-user-select: none;
      user-select: none;
    }

    .game-btn:active,
    .game-btn.is-pressed {
      transform: scale(0.92);
      opacity: 0.88;
      filter: brightness(1.08);
    }

    .game-btn:disabled {
      opacity: 0.4;
      pointer-events: none;
      filter: none;
    }

    .char-card.game-btn.is-pressed {
      transform: scale(0.94);
    }

    .char-card.selected.is-pressed {
      transform: scale(0.94);
    }

    /* 提灯と装飾 */
    .festival-decor {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 60px;
      background: #8b0000;
      border-bottom: 4px solid #ffd700;
      display: flex;
      justify-content: space-around;
      align-items: center;
      z-index: 5;
      box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }

    .lantern {
      width: 36px;
      height: 46px;
      background: #e60000;
      border-radius: 12px;
      border: 2px solid #ffd700;
      color: #ffd700;
      font-weight: bold;
      font-size: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 15px #ff4500;
      animation: swing 2s ease-in-out infinite alternate;
    }

    .lantern:nth-child(even) {
      animation-delay: 0.5s;
      background: #ff8c00;
    }

    @keyframes swing {
      0% { transform: rotate(-5deg); }
      100% { transform: rotate(5deg); }
    }

    /* 挑戦者選択（提灯の直下） */
    .char-select {
      position: absolute;
      top: 68px;
      left: 10px;
      right: 10px;
      z-index: 25;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      padding: 12px 10px 14px;
      background: linear-gradient(180deg, rgba(80, 10, 10, 0.92), rgba(30, 8, 4, 0.88));
      border: 2px solid #ffd700;
      border-radius: 12px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 0 20px rgba(255, 80, 0, 0.12);
      pointer-events: auto;
    }

    .char-select[hidden] {
      display: none;
    }

    .char-select-title {
      margin: 0;
      font-size: 16px;
      font-weight: bold;
      letter-spacing: 0.06em;
      color: #ffeb3b;
      text-shadow: 1px 1px 3px #000;
    }

    .char-select-title::before {
      content: "親父「";
      font-size: 11px;
      font-weight: bold;
      color: #ffcc80;
      letter-spacing: 0.04em;
      margin-right: 2px;
    }

    .char-select-title::after {
      content: "」";
      font-size: 11px;
      font-weight: bold;
      color: #ffcc80;
    }

    .char-cards {
      display: flex;
      gap: 8px;
      width: 100%;
      justify-content: center;
    }

    .char-card {
      flex: 1;
      max-width: 140px;
      min-height: 168px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 4px;
      padding: 8px 6px 10px;
      background: rgba(0, 0, 0, 0.55);
      border: 2px solid #8b4513;
      border-radius: 10px;
      color: #fff;
      font-family: inherit;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    }

    .char-card .char-portrait {
      width: 64px;
      height: 96px;
      object-fit: contain;
      object-position: center bottom;
      pointer-events: none;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.65));
      image-rendering: auto;
    }

    .char-card .char-name {
      font-size: 12px;
      font-weight: bold;
      text-align: center;
      line-height: 1.2;
    }

    .char-card .char-diff {
      font-size: 10px;
      font-weight: bold;
      padding: 1px 8px;
      border-radius: 999px;
      letter-spacing: 0.04em;
    }

    .char-card .char-diff.easy {
      background: #1b5e20;
      color: #c8e6c9;
    }

    .char-card .char-diff.normal {
      background: #e65100;
      color: #ffe0b2;
    }

    .char-card .char-diff.hard {
      background: #b71c1c;
      color: #ffcdd2;
    }

    .char-card .char-desc {
      font-size: 9px;
      color: rgba(255, 255, 255, 0.72);
      text-align: center;
      line-height: 1.25;
      min-height: 22px;
    }

    .char-card.selected {
      border-color: #ffd700;
      box-shadow: 0 0 0 2px #ff9800, 0 0 16px rgba(255, 152, 0, 0.55);
      background: rgba(80, 30, 0, 0.75);
    }

    .stage-select {
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }

    .stage-select-label {
      margin: 0;
      font-size: 12px;
      font-weight: bold;
      color: #ffcc80;
      letter-spacing: 0.04em;
    }

    .stage-cards {
      display: flex;
      gap: 8px;
      width: 100%;
      justify-content: center;
    }

    .stage-card {
      flex: 1;
      max-width: 120px;
      min-height: 58px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 1px;
      padding: 6px 4px;
      background: rgba(0, 0, 0, 0.5);
      border: 2px solid #8b4513;
      border-radius: 10px;
      color: #fff;
      font-family: inherit;
    }

    .stage-card .stage-num {
      font-size: 16px;
      font-weight: bold;
      color: #ffd700;
      line-height: 1;
    }

    .stage-card .stage-name {
      font-size: 11px;
      font-weight: bold;
    }

    .stage-card .stage-desc {
      font-size: 9px;
      color: rgba(255, 255, 255, 0.7);
      text-align: center;
      line-height: 1.2;
    }

    .stage-card.selected {
      border-color: #ffd700;
      box-shadow: 0 0 0 2px #ff9800, 0 0 14px rgba(255, 152, 0, 0.45);
      background: rgba(80, 30, 0, 0.75);
    }

    .start-btn {
      margin-top: 2px;
      min-width: 160px;
      min-height: 56px;
      padding: 12px 28px;
      border-radius: 24px;
      border: 2px solid #fff;
      background: linear-gradient(to bottom, #ff9800, #e65100);
      color: #fff;
      font-size: 16px;
      font-weight: bold;
      font-family: inherit;
      letter-spacing: 0.08em;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    }

    .start-btn:disabled {
      background: linear-gradient(to bottom, #6d4c41, #4e342e);
      border-color: #9e9e9e;
      color: #bdbdbd;
    }

    @media (max-width: 380px) {
      .char-card .char-name { font-size: 11px; }
      .char-card .char-desc { font-size: 8px; }
      .char-card { min-height: 150px; padding: 6px 4px 8px; }
      .char-card .char-portrait { width: 58px; height: 88px; }
    }

    /* 暗殺者警告バナー */
    #assassin-banner {
      position: absolute;
      top: 108px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 22;
      min-width: 220px;
      padding: 10px 18px 12px;
      text-align: center;
      background: linear-gradient(180deg, rgba(90, 0, 0, 0.92), rgba(20, 0, 0, 0.9));
      border: 2px solid #ff1744;
      border-radius: 12px;
      box-shadow: 0 0 24px rgba(255, 23, 68, 0.55);
      pointer-events: none;
      animation: assassinPulse 0.35s ease-in-out infinite alternate;
    }

    #assassin-banner[hidden] {
      display: none;
    }

    @keyframes assassinPulse {
      0% { box-shadow: 0 0 12px rgba(255, 23, 68, 0.35); }
      100% { box-shadow: 0 0 28px rgba(255, 23, 68, 0.75); }
    }

    .assassin-banner-title {
      font-size: 18px;
      font-weight: bold;
      color: #ff5252;
      letter-spacing: 0.08em;
      text-shadow: 1px 1px 2px #000;
    }

    .assassin-banner-sub {
      margin-top: 4px;
      font-size: 12px;
      color: #ffeb3b;
      text-shadow: 1px 1px 2px #000;
    }

    .assassin-timer {
      margin-top: 6px;
      font-size: 28px;
      font-weight: bold;
      color: #fff;
      font-variant-numeric: tabular-nums;
      text-shadow: 0 0 10px #ff1744;
    }

    /* ゲームUI（スコア・弾数） */
    .ui-panel {
      position: absolute;
      top: 70px;
      left: 20px;
      right: 20px;
      display: flex;
      justify-content: space-between;
      z-index: 10;
      font-size: 18px;
      font-weight: bold;
      text-shadow: 2px 2px 4px #000;
      pointer-events: none;
    }

    .ui-panel[hidden] {
      display: none;
    }

    .score-board {
      background: rgba(0, 0, 0, 0.6);
      padding: 6px 16px;
      border-radius: 20px;
      border: 2px solid #ffd700;
      color: #fff;
    }

    .ammo-board {
      background: rgba(0, 0, 0, 0.6);
      padding: 6px 16px;
      border-radius: 20px;
      border: 2px solid #ff4500;
      color: #ffeb3b;
    }

    /* ゲームキャンバス */
    canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
    }

    /* リスタート・操作ボタン */
    .btn {
      position: absolute;
      bottom: calc(20px + env(safe-area-inset-bottom, 0px));
      right: calc(20px + env(safe-area-inset-right, 0px));
      z-index: 20;
      background: linear-gradient(to bottom, #ff9800, #e65100);
      color: white;
      border: 2px solid #fff;
      padding: 10px 20px;
      border-radius: 25px;
      font-size: 16px;
      font-weight: bold;
      cursor: pointer;
      box-shadow: 0 4px 8px rgba(0,0,0,0.4);
      display: none;
    }

    .mute-btn {
      position: absolute;
      bottom: calc(20px + env(safe-area-inset-bottom, 0px));
      left: calc(20px + env(safe-area-inset-left, 0px));
      z-index: 20;
      width: 56px;
      height: 56px;
      min-width: 56px;
      min-height: 56px;
      padding: 0;
      border-radius: 50%;
      border: 2px solid #ffd700;
      background: rgba(0, 0, 0, 0.65);
      color: #fff;
      font-size: 20px;
      cursor: pointer;
      box-shadow: 0 2px 8px rgba(0,0,0,0.4);
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .mute-btn:active,
    .mute-btn.is-pressed {
      transform: scale(0.92);
      opacity: 0.85;
    }

    /* モバイル用タップ発射エリア案内 */
    .mobile-hint {
      position: absolute;
      bottom: calc(80px + env(safe-area-inset-bottom, 0px));
      width: 100%;
      text-align: center;
      color: rgba(255, 255, 255, 0.8);
      font-size: 14px;
      z-index: 10;
      pointer-events: none;
    }

    .mobile-hint[hidden] {
      display: none;
    }

    /* 親父ライフゲージ */
    #uncle-hp-panel {
      position: absolute;
      top: 70px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 15;
      display: none;
      pointer-events: none;
      text-align: center;
      min-width: 180px;
    }

    #uncle-hp-panel.visible {
      display: block;
      animation: hpPop 0.35s ease-out;
    }

    @keyframes hpPop {
      0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
      100% { transform: translateX(-50%) scale(1); opacity: 1; }
    }

    .uncle-hp-label {
      font-size: 12px;
      font-weight: bold;
      color: #ffeb3b;
      text-shadow: 1px 1px 3px #000;
      margin-bottom: 4px;
    }

    .uncle-hp-bar-bg {
      width: 160px;
      height: 14px;
      background: rgba(0, 0, 0, 0.75);
      border: 2px solid #ffd700;
      border-radius: 8px;
      overflow: hidden;
      margin: 0 auto;
    }

    .uncle-hp-bar-fill {
      height: 100%;
      width: 100%;
      background: linear-gradient(to right, #c62828, #ef5350);
      border-radius: 6px;
      transition: width 0.25s ease-out;
    }

    .uncle-hp-bar-fill.critical {
      background: linear-gradient(to right, #b71c1c, #ff1744);
      animation: hpPulse 0.4s ease-in-out infinite alternate;
    }

    @keyframes hpPulse {
      0% { opacity: 0.7; }
      100% { opacity: 1; }
    }

    /* 補導演出オーバーレイ */
    #arrest-overlay {
      position: absolute;
      inset: 0;
      z-index: 30;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(0, 0, 40, 0.85);
      pointer-events: none;
    }

    #arrest-overlay.active {
      display: flex;
      animation: arrestFlash 0.15s steps(2) infinite;
    }

    @keyframes arrestFlash {
      0% { background: rgba(180, 0, 0, 0.55); }
      50% { background: rgba(0, 40, 180, 0.55); }
      100% { background: rgba(180, 0, 0, 0.55); }
    }

    #arrest-overlay .arrest-badge {
      font-size: 64px;
      margin-bottom: 12px;
      filter: drop-shadow(0 0 12px #fff);
    }

    #arrest-overlay .arrest-title {
      font-size: 28px;
      font-weight: bold;
      color: #fff;
      text-shadow: 0 0 8px #00e5ff, 2px 2px 0 #000;
      letter-spacing: 0.08em;
    }

    #arrest-overlay .arrest-sub {
      margin-top: 10px;
      font-size: 15px;
      color: #ffeb3b;
      text-shadow: 1px 1px 2px #000;
    }

    /* 暗殺失敗オーバーレイ */
    #assassinate-overlay {
      position: absolute;
      inset: 0;
      z-index: 30;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(20, 0, 0, 0.88);
      pointer-events: none;
    }

    #assassinate-overlay.active {
      display: flex;
      animation: assassinateFade 0.4s ease-out;
    }

    @keyframes assassinateFade {
      0% { opacity: 0; }
      100% { opacity: 1; }
    }

    #assassinate-overlay .assassinate-badge {
      font-size: 64px;
      margin-bottom: 12px;
      filter: drop-shadow(0 0 12px #ff1744);
    }

    #assassinate-overlay .assassinate-title {
      font-size: 26px;
      font-weight: bold;
      color: #ff5252;
      text-shadow: 2px 2px 0 #000;
      letter-spacing: 0.06em;
    }

    #assassinate-overlay .assassinate-sub {
      margin-top: 10px;
      font-size: 15px;
      color: #ffeb3b;
      text-shadow: 1px 1px 2px #000;
    }

    /* 逃走成功 */
    #escape-overlay {
      position: absolute;
      inset: 0;
      z-index: 30;
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(0, 30, 20, 0.88);
      pointer-events: none;
    }

    #escape-overlay.active {
      display: flex;
      animation: escapeWinPop 0.45s ease-out;
    }

    @keyframes escapeWinPop {
      0% { opacity: 0; transform: scale(0.92); }
      100% { opacity: 1; transform: scale(1); }
    }

    #escape-overlay .escape-badge {
      font-size: 64px;
      margin-bottom: 12px;
      filter: drop-shadow(0 0 12px #69f0ae);
    }

    #escape-overlay .escape-title {
      font-size: 28px;
      font-weight: bold;
      color: #69f0ae;
      text-shadow: 2px 2px 0 #000;
      letter-spacing: 0.06em;
    }

    #escape-overlay .escape-sub {
      margin-top: 10px;
      font-size: 15px;
      color: #ffeb3b;
      text-shadow: 1px 1px 2px #000;
    }

    #escape-hud {
      position: absolute;
      top: 70px;
      left: 50%;
      transform: translateX(-50%);
      z-index: 18;
      min-width: 200px;
      padding: 8px 14px 10px;
      background: rgba(0, 0, 0, 0.72);
      border: 2px solid #ffd700;
      border-radius: 12px;
      text-align: center;
      pointer-events: none;
    }

    #escape-hud[hidden] {
      display: none;
    }

    .escape-hud-row {
      font-size: 14px;
      font-weight: bold;
      color: #fff;
      text-shadow: 1px 1px 2px #000;
    }

    .escape-gap-label {
      margin-top: 6px;
      font-size: 11px;
      color: #ffcc80;
    }

    .escape-gap-bg {
      margin-top: 4px;
      height: 12px;
      border-radius: 6px;
      background: rgba(80, 0, 0, 0.85);
      border: 1px solid #ff8a80;
      overflow: hidden;
    }

    .escape-gap-fill {
      height: 100%;
      width: 100%;
      background: linear-gradient(to right, #ff1744, #ffd54f, #69f0ae);
      transition: width 0.1s linear;
    }

    #escape-controls {
      position: absolute;
      left: 0;
      right: 0;
      bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      z-index: 22;
      display: flex;
      justify-content: space-between;
      padding: 0 calc(16px + env(safe-area-inset-left, 0px)) 0 calc(16px + env(safe-area-inset-right, 0px));
      pointer-events: none;
    }

    #escape-controls[hidden] {
      display: none;
    }

    .escape-btn {
      pointer-events: auto;
      width: 72px;
      height: 72px;
      min-width: 72px;
      min-height: 72px;
      border-radius: 50%;
      border: 2px solid #ffd700;
      background: rgba(0, 0, 0, 0.65);
      color: #fff;
      font-size: 28px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    }
