  @font-face {
    font-family: 'Bebas Neue'; font-weight: 400; font-display: swap;
    src: url('assets/fonts/BebasNeue-Regular.ttf') format('truetype');
  }
  @font-face {
    font-family: 'Oswald'; font-weight: 200 700; font-display: swap;
    src: url('assets/fonts/Oswald-Medium.ttf') format('truetype');
  }
  * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
  html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0612; font-family: 'Oswald', 'Segoe UI', system-ui, sans-serif; color: #fff; touch-action: none; overscroll-behavior: none; }
  .movelist-dialog, #qa-panel { touch-action: pan-y; }
  #canvas-container { position: fixed; inset: 0; z-index: 1; }
  canvas { display: block; width: 100%; height: 100%; }

  /* HUD OVERLAY */
  #hud {
    position: fixed; inset: 0; z-index: 10; pointer-events: none;
    display: flex; flex-direction: column; justify-content: space-between;
    padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }
  body.menu-open #hud { display: none; }
  body.menu-open .kb-hint { display: none; }
  body.menu-open .controls-bar { display: none; }
  .top-bar {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 6px;
    width: 100%; max-width: 1120px; margin: 0 auto;
  }
  .fighter-hud { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
  .fighter-hud.p2 { align-items: flex-end; }
  .name-row { display: flex; align-items: center; gap: 4px; width: 100%; justify-content: space-between; }
  .p2 .name-row { flex-direction: row-reverse; }
  .char-name {
    font-weight: 900; font-size: clamp(11px, 2.9vw, 22px); letter-spacing: 0.8px;
    text-transform: uppercase; color: #ffd98e; text-shadow: 0 2px 6px #000, 0 0 12px rgba(255,140,0,0.6);
    white-space: nowrap; flex-shrink: 0;
  }
  .pips { display: flex; gap: 4px; flex-shrink: 0; }
  .pip {
    width: clamp(9px, 1.8vw, 15px); height: clamp(9px, 1.8vw, 15px); border-radius: 50%;
    border: 2px solid #ffd98e; background: rgba(0,0,0,0.6); box-shadow: 0 0 6px #000;
  }
  .pip.won { background: radial-gradient(circle, #fff 10%, #ff9900 60%, #b32400 100%); box-shadow: 0 0 10px #ff8800; }

  .hp-outer {
    width: 100%; height: clamp(15px, 3vw, 25px); background: rgba(15, 8, 24, 0.85);
    border: 2px solid #d49b35; border-radius: 4px; overflow: hidden; position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.7), inset 0 2px 6px rgba(0,0,0,0.8);
    transform: skewX(-12deg);
  }
  .p2 .hp-outer { transform: skewX(12deg); }
  .hp-trail {
    position: absolute; top: 0; bottom: 0; left: 0; width: 100%;
    background: #d92626; transition: width 0.35s ease-out;
  }
  .p2 .hp-trail { left: auto; right: 0; }
  .hp-fill {
    position: absolute; top: 0; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(180deg, #ffe066 0%, #ff8800 55%, #b82e00 100%);
    transition: width 0.06s linear;
  }
  .p2 .hp-fill { left: auto; right: 0; background: linear-gradient(180deg, #70ff94 0%, #17b857 55%, #06632c 100%); }

  .meter-outer {
    width: 72%; height: clamp(6px, 1.3vw, 10px); background: rgba(0,0,0,0.75);
    border: 1px solid #8a6d3b; border-radius: 3px; overflow: hidden;
  }
  .meter-fill {
    height: 100%; width: 50%;
    background: linear-gradient(90deg, #38b6ff, #b56bff, #fff);
    box-shadow: 0 0 8px #5ce1e6; transition: width 0.1s;
  }
  .p2 .meter-fill {
    background: linear-gradient(90deg, #ff9900, #ffd866, #fff);
    box-shadow: 0 0 8px #ffb732;
  }

  .center-hud {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0 2px; min-width: clamp(44px, 10vw, 84px); flex-shrink: 0;
  }
  .wordmark-mini {
    font-size: clamp(6.5px, 1.3vw, 11px); font-weight: 900; letter-spacing: 1.5px;
    color: #e6b86a; text-shadow: 0 1px 4px #000; margin-bottom: 2px; white-space: nowrap;
  }
  .timer-box {
    font-size: clamp(19px, 4.5vw, 38px); font-weight: 900; color: #fff;
    background: linear-gradient(180deg, #3b1d5e, #160926);
    border: 2px solid #e6b86a; border-radius: 6px; padding: 2px 8px;
    line-height: 1; text-shadow: 0 2px 8px #ff6a00; box-shadow: 0 4px 14px rgba(0,0,0,0.8);
  }

  /* CALLOUTS & COMBOS */
  .mid-layer { position: relative; flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; }
  .combo-badge {
    position: absolute; top: 14%; font-weight: 900; font-style: italic;
    font-size: clamp(16px, 3.8vw, 32px); color: #ffea79;
    text-shadow: 0 3px 0 #a82000, 0 0 16px #ff8800;
    opacity: 0; transform: scale(0.6); transition: opacity 0.12s, transform 0.12s;
  }
  #combo-p1 { left: 2%; }
  #combo-p2 { right: 2%; text-align: right; }
  .combo-badge.active { opacity: 1; transform: scale(1); }
  .combo-badge.counter-tag { top: 27%; color: #ffe1e1; text-shadow: 0 3px 0 #7a0010, 0 0 16px #ff2f45; }
  #counter-p1 { left: 2%; }
  #counter-p2 { right: 2%; text-align: right; }
  .callout-sub {
    display: block; font-size: clamp(10px, 2vw, 16px); color: #fff;
    letter-spacing: 1px; text-shadow: 0 2px 4px #000;
  }

  #banner {
    position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) scale(0.5);
    font-size: clamp(28px, 7.5vw, 76px); font-weight: 900; letter-spacing: 4px;
    color: #fff3b0; text-align: center; white-space: nowrap;
    text-shadow: 0 4px 0 #7a1c00, 0 0 30px #ff7b00, 0 0 60px #ff0055;
    opacity: 0; pointer-events: none; transition: transform 0.22s cubic-bezier(0.18, 1.4, 0.4, 1), opacity 0.18s;
  }
  #banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  #banner-sub {
    display: block; font-size: clamp(12px, 2.8vw, 24px); color: #ffd166;
    letter-spacing: 3px; margin-top: 4px; text-shadow: 0 2px 8px #000;
  }

  /* TOUCH CONTROLS */
  .controls-bar {
    display: flex; justify-content: space-between; align-items: flex-end;
    width: 100%; max-width: 1120px; margin: 0 auto; pointer-events: auto;
    padding-bottom: 2px;
  }
  #joy-zone {
    width: clamp(96px, 22vw, 134px); height: clamp(96px, 22vw, 134px);
    background: radial-gradient(circle, rgba(255,210,120,0.16) 0%, rgba(20,10,35,0.55) 75%);
    border: 2px solid rgba(230, 184, 106, 0.55); border-radius: 50%;
    position: relative; touch-action: none;
  }
  #joy-knob {
    width: 44%; height: 44%; border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #ffe6a3, #c97a16 70%, #5e2c04);
    border: 2px solid #fff; position: absolute; top: 28%; left: 28%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.7); pointer-events: none;
  }
  .btn-cluster {
    display: grid; grid-template-columns: repeat(4, clamp(44px, 10.5vw, 60px));
    grid-template-rows: repeat(2, clamp(44px, 10.5vw, 60px)); gap: clamp(5px, 1.2vw, 9px);
    touch-action: none;
  }
  .act-btn {
    border-radius: 50%; border: 2px solid #ffd885; color: #fff; font-weight: 900;
    font-size: clamp(12px, 2.8vw, 17px); display: flex; flex-direction: column;
    align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.75), inset 0 2px 4px rgba(255,255,255,0.35);
    text-shadow: 0 1px 3px #000;
  }
  .act-btn span { font-size: clamp(8px, 1.6vw, 11px); opacity: 0.85; font-weight: 700; letter-spacing: 0.5px; }
  .act-btn:active, .act-btn.pressed { transform: scale(0.9); filter: brightness(1.3); }
  #btn-l { background: linear-gradient(145deg, #d97706, #7c2d12); }
  #btn-h { background: linear-gradient(145deg, #dc2626, #7f1d1d); }
  #btn-s { background: linear-gradient(145deg, #7c3aed, #3b0764); border-color: #c4b5fd; }
  #btn-b { background: linear-gradient(145deg, #2563eb, #1e3a8a); }
  #btn-u { background: linear-gradient(145deg, #0d9488, #115e59); border-color: #99f6e4; }
  #btn-i { background: linear-gradient(145deg, #db2777, #831843); border-color: #fbcfe8; }
  #btn-o { background: linear-gradient(145deg, #9255d5, #352052); border-color: #ffe1a1; }
  .act-btn.low-meter { opacity: 0.55; filter: saturate(0.5); }
  .act-btn.unavailable { opacity: 0.34; filter: grayscale(0.85); cursor: not-allowed; }

  .hud-utility-row {
    display: flex; gap: 6px; margin-top: 4px; pointer-events: auto;
  }
  .hud-mini-btn {
    min-height: 44px; padding: 6px 12px; border-radius: 5px;
    border: 1px solid #e6b86a; background: rgba(24, 10, 40, 0.88);
    color: #ffe299; font-weight: 800; font-size: clamp(9px, 1.7vw, 12px);
    letter-spacing: 0.7px; cursor: pointer; text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,0.65);
  }
  .hud-mini-btn:active { transform: scale(0.95); }

  #finish-btn {
    position: absolute; top: 58%; left: 50%; transform: translate(-50%, -50%) scale(0.85);
    min-width: 148px; min-height: 48px; padding: 10px 22px; border-radius: 999px;
    border: 2px solid #fff3b0; background: linear-gradient(180deg, #ff3b00 0%, #7f0000 100%);
    color: #fff; font-weight: 900; font-size: clamp(14px, 3.2vw, 22px); letter-spacing: 2px;
    box-shadow: 0 0 24px rgba(255, 60, 0, 0.95), 0 4px 12px rgba(0,0,0,0.85);
    cursor: pointer; pointer-events: none; opacity: 0;
    transition: opacity 0.14s, transform 0.14s;
  }
  #finish-btn.visible {
    opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1);
  }

  #movelist-modal {
    position: fixed; inset: 0; z-index: 36;
    background: rgba(8, 4, 15, 0.90); backdrop-filter: blur(5px);
    display: flex; align-items: center; justify-content: center; padding: 12px;
    pointer-events: auto;
  }
  #movelist-modal.hidden { display: none; }
  .movelist-dialog {
    width: min(760px, 96vw); max-height: min(86dvh, 620px);
    background: linear-gradient(165deg, rgba(42, 18, 66, 0.96), rgba(14, 7, 24, 0.98));
    border: 2px solid #e6b86a; border-radius: 10px; padding: 12px 14px;
    display: flex; flex-direction: column; gap: 10px; overflow: hidden;
    box-shadow: 0 12px 36px rgba(0,0,0,0.85);
  }
  .movelist-header {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    border-bottom: 1px solid rgba(230, 184, 106, 0.35); padding-bottom: 6px;
  }
  .movelist-title { font-size: clamp(15px, 3vw, 22px); font-weight: 900; color: #ffd166; letter-spacing: 1.5px; }
  .movelist-close {
    min-width: 44px; min-height: 44px; border-radius: 6px; border: 1px solid #ffd166;
    background: #3b175e; color: #fff; font-weight: 900; font-size: 13px; cursor: pointer; padding: 0 12px;
  }
  .movelist-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px; overflow-y: auto; padding-right: 4px;
  }
  .movelist-card {
    background: rgba(0, 0, 0, 0.38); border: 1px solid rgba(212, 155, 53, 0.45);
    border-radius: 8px; padding: 9px 11px; text-align: left;
  }
  .movelist-card h4 { color: #ffd98e; font-size: 14px; letter-spacing: 0.8px; margin-bottom: 2px; }
  .movelist-archetype { color: #c4b5fd; font-size: 11px; margin-bottom: 7px; font-weight: 700; }
  .move-item {
    border-top: 1px solid rgba(255,255,255,0.1); padding: 5px 0; font-size: 11px; line-height: 1.32;
  }
  .move-item-top { display: flex; justify-content: space-between; gap: 6px; font-weight: 800; color: #fff; }
  .move-cost { color: #fbbf24; font-size: 10px; white-space: nowrap; }
  .move-input { color: #67e8f9; font-family: ui-monospace, monospace; font-size: 10.5px; }
  .move-desc { color: #d8c8e8; font-size: 10.5px; margin-top: 1px; }

  .kb-hint {
    position: fixed; bottom: 8px; left: 14px;
    font-size: 10px; color: rgba(240,214,168,0.7); letter-spacing: 0.6px;
    text-align: left; pointer-events: none; z-index: 11; white-space: nowrap;
    font-family: 'Oswald', ui-sans-serif, sans-serif;
  }
  .kb-hint kbd {
    display: inline-block; font-family: 'Oswald', ui-sans-serif, sans-serif; font-weight: 600;
    font-size: 9.5px; color: #f6d492; border: 1px solid rgba(255,217,142,0.5);
    border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; margin: 0 1px;
    background: rgba(28,14,8,0.6); line-height: 1.5;
  }
  @media (max-width: 740px), (max-height: 500px) { .kb-hint { display: none; } }

  /* SCREENS (TITLE / REMATCH) — Akofena language: painted art, frosted glass, condensed display type */
  .overlay-screen {
    position: fixed; inset: 0; z-index: 30;
    background: linear-gradient(180deg, rgba(8,4,12,0.35) 0%, rgba(8,4,12,0.15) 45%, rgba(8,4,12,0.72) 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 18px; text-align: center;
  }
  .overlay-screen.hidden { display: none; }
  .screen-art {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: url('assets/keyart.webp') center 32%/cover no-repeat;
  }
  .menu-panel {
    display: flex; flex-direction: column; align-items: center;
    background: linear-gradient(180deg, rgba(34,17,10,0.66), rgba(16,7,4,0.78));
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border: 1px solid rgba(216,168,78,0.5);
    border-radius: 14px; padding: clamp(16px, 3.4vh, 30px) clamp(20px, 4vw, 40px);
    box-shadow: 0 24px 60px rgba(0,0,0,0.62), inset 0 1px 0 rgba(255,225,160,0.14);
    max-width: min(94vw, 900px); max-height: 92dvh; overflow-y: auto;
  }
  .crest {
    font-family: 'Oswald', ui-sans-serif, sans-serif;
    font-size: clamp(10px, 2vw, 14px); letter-spacing: 6px; color: #f0b64c;
    font-weight: 500; margin-bottom: 4px; text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  }
  .main-title {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif; font-weight: 400;
    font-size: clamp(38px, 9.5vw, 96px); letter-spacing: 8px;
    background: linear-gradient(180deg, #fff7d6 0%, #ffbb33 48%, #c83e00 95%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 5px 0 #3d0e00) drop-shadow(0 0 28px rgba(255,120,0,0.6));
    line-height: 0.95; margin-bottom: 8px;
  }
  .sub-lore {
    max-width: 560px; font-size: clamp(12px, 2.3vw, 16px); color: #ecdcbc;
    line-height: 1.45; margin-bottom: 18px; text-shadow: 0 2px 6px #000;
    font-weight: 300; letter-spacing: 0.4px;
  }
  .vs-cards {
    display: flex; gap: clamp(10px, 3vw, 26px); align-items: center; margin-bottom: 20px;
    flex-wrap: wrap; justify-content: center;
  }
  .card {
    background: linear-gradient(165deg, rgba(46,24,14,0.72), rgba(16,8,6,0.82));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(216,168,78,0.55); border-radius: 12px; padding: 12px 18px; min-width: 150px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,225,160,0.1);
    color: inherit; font-family: inherit;
    cursor: pointer; pointer-events: auto; transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  }
  .card.selected {
    border-color: #ffe9ad;
    box-shadow: 0 0 26px rgba(255,178,44,0.6), 0 10px 30px rgba(0,0,0,0.65);
    transform: translateY(-3px);
  }
  .card:focus-visible { outline: 2px solid #f6d492; outline-offset: 2px; }
  .card h3 { font-family: 'Bebas Neue', 'Arial Narrow', sans-serif; font-weight: 400; color: #ffd98e; font-size: clamp(16px, 3vw, 24px); letter-spacing: 3px; }
  .card p { color: #dcc9a6; font-size: 11px; margin-top: 2px; font-weight: 300; letter-spacing: 0.5px; }
  .vs-badge {
    font-family: 'Bebas Neue', sans-serif; font-size: 30px; color: #ff9d2e; font-style: italic;
    text-shadow: 0 3px 0 #2b0d00, 0 0 22px rgba(255,140,0,0.5);
  }

  .cta-btn {
    pointer-events: auto; cursor: pointer;
    font-family: 'Oswald', ui-sans-serif, sans-serif; font-weight: 600;
    background: linear-gradient(180deg, #f6b93b 0%, #d98a12 100%);
    border: 1px solid rgba(255,235,180,0.7); border-radius: 10px; padding: 12px 32px;
    font-size: clamp(14px, 3vw, 20px); color: #241002;
    letter-spacing: 2.5px; text-transform: uppercase;
    box-shadow: 0 0 22px rgba(255, 150, 30, 0.55), 0 5px 0 #7a3a00;
    transition: transform 0.12s, box-shadow 0.12s;
  }
  .cta-btn:active { transform: translateY(3px); box-shadow: 0 0 14px rgba(255,150,30,0.5), 0 2px 0 #7a3a00; }
  .cta-btn.menu-btn {
    background: linear-gradient(180deg, rgba(52,30,18,0.75), rgba(24,12,8,0.85));
    color: #f0d9a8; border-color: rgba(216,168,78,0.55);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 14px rgba(216,168,78,0.28), 0 5px 0 rgba(58,28,6,0.9);
  }
  .cta-btn.menu-btn:active { box-shadow: 0 0 8px rgba(216,168,78,0.22), 0 2px 0 rgba(58,28,6,0.9); }
  .cta-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

  /* MODE SELECT */
  .mode-row { display: flex; gap: clamp(8px, 2.4vw, 20px); flex-wrap: wrap; justify-content: center; margin-bottom: 14px; }
  .mode-card {
    background: linear-gradient(165deg, rgba(46,24,14,0.72), rgba(16,8,6,0.82));
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(216,168,78,0.5); border-radius: 12px; padding: 14px 20px; min-width: 155px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,225,160,0.1);
    color: inherit; font-family: inherit; cursor: pointer; pointer-events: auto;
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
  }
  .mode-card.selected { border-color: #ffe9ad; box-shadow: 0 0 24px rgba(255,178,44,0.55), 0 10px 30px rgba(0,0,0,0.6); transform: translateY(-3px); }
  .mode-card:focus-visible { outline: 2px solid #f6d492; outline-offset: 2px; }
  .mode-card h3 { font-family: 'Bebas Neue', sans-serif; font-weight: 400; color: #ffd98e; font-size: clamp(16px, 2.9vw, 23px); letter-spacing: 3px; }
  .mode-card p { color: #dcc9a6; font-size: 11px; margin-top: 3px; font-weight: 300; }
  .beta-tag { font-size: 9px; font-family: 'Oswald', sans-serif; font-weight: 600; background: #b45309; color: #fff; border-radius: 3px; padding: 1px 5px; vertical-align: middle; letter-spacing: 1px; }
  #difficulty-row { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 14px; }
  #difficulty-row.hidden { display: none; }
  .diff-label { color: #dcc9a6; font-size: 12px; letter-spacing: 2px; font-weight: 500; }
  .diff-chip {
    pointer-events: auto; cursor: pointer; font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 12px;
    letter-spacing: 2px; color: #ecdcbc; background: rgba(30,16,10,0.6); border: 1px solid rgba(216,168,78,0.45);
    border-radius: 20px; padding: 10px 18px; min-height: 44px;
  }
  .diff-chip.selected { border-color: #ffd166; color: #ffd166; background: rgba(120,60,14,0.55); }
  #net-row { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
  #net-row.hidden { display: none; }
  #net-room-input {
    pointer-events: auto; font-family: 'Bebas Neue', monospace; font-weight: 400; font-size: 20px; letter-spacing: 6px;
    text-transform: uppercase; text-align: center; width: 160px; padding: 8px 8px;
    background: rgba(20,10,6,0.7); color: #ffd166; border: 1px solid rgba(216,168,78,0.6); border-radius: 8px;
  }
  #net-name-input {
    pointer-events: auto; font-family: 'Bebas Neue', monospace; font-weight: 400; font-size: 16px; letter-spacing: 2px;
    text-transform: uppercase; text-align: center; width: 130px; padding: 9px 8px;
    background: rgba(20,10,6,0.7); color: #ecdcbc; border: 1px solid rgba(216,168,78,0.45); border-radius: 8px;
  }
  .net-btn { font-size: 13px; padding: 9px 16px; }
  .net-status { width: 100%; margin: 4px 0 0; font-size: 11px; color: #dcc9a6; font-weight: 300; }
  .end-board { margin: 10px 0 14px; width: 100%; max-width: 340px; }
  .end-board.hidden { display: none; }
  .end-board-title {
    font-family: 'Bebas Neue', monospace; font-size: 15px; letter-spacing: 3px;
    color: #d8a84e; text-align: center; margin-bottom: 6px;
  }
  .end-board-list {
    list-style: none; margin: 0; padding: 0; max-height: 150px; overflow-y: auto;
    font-family: 'Bebas Neue', monospace; font-size: 14px; letter-spacing: 1px;
  }
  .end-board-list li {
    display: flex; justify-content: space-between; gap: 12px; padding: 3px 10px;
    color: #ecdcbc; border-bottom: 1px solid rgba(216,168,78,0.18);
  }
  .end-board-list li.me { color: #ffd166; background: rgba(120,60,14,0.35); }
  .end-board-list .board-empty { justify-content: center; color: #dcc9a6; font-size: 12px; }
  #net-indicator {
    position: fixed; top: 14%; left: 50%; transform: translateX(-50%); z-index: 28;
    background: rgba(20,10,6,0.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(216,168,78,0.6); border-radius: 8px;
    padding: 8px 18px; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 13px; letter-spacing: 2px;
    color: #ffd166; pointer-events: none;
  }
  #net-indicator.hidden { display: none; }

  /* SELECT SCREEN */
  .card { position: relative; }
  .portrait {
    width: clamp(96px, 20vw, 150px); height: clamp(96px, 20vw, 150px); margin: 0 auto 6px;
    border-radius: 6px; overflow: hidden; border: 1px solid rgba(255,217,142,0.4);
    background: radial-gradient(circle at 50% 30%, rgba(120,60,180,0.5), rgba(10,5,20,0.9));
  }
  .portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .portrait-missing img { display: none; }
  .pick-badge {
    position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 900; letter-spacing: 1px;
    color: #fff; background: #b45309; border-radius: 3px; padding: 2px 6px; display: none;
  }
  .card.picked-p1 .pick-badge { display: block; content: 'P1'; }
  .card.picked-p1 .pick-badge::before { content: 'P1'; }
  .card.picked-p2 .pick-badge { display: block; background: #0e7490; }
  .card.picked-p2 .pick-badge::before { content: 'P2'; }
  .card.locked { opacity: 0.4; pointer-events: none; filter: grayscale(0.5); }
  .select-hint { color: #e2d4f0; font-size: 13px; margin: 0 0 12px; letter-spacing: 0.5px; }
  .load-note { color: #ffae42; font-size: 11px; letter-spacing: 2px; margin-bottom: 12px; animation: loadPulse 1.1s ease-in-out infinite; }
  .load-note.done { animation: none; color: #7dd3a8; }
  @keyframes loadPulse { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }
  @media (prefers-reduced-motion: reduce) { .load-note { animation: none; } }

  /* EMBED (Ọmọ Eko boss fights, ?embed=omo): portrait allowed, no online board, one way out */
  html.kc-embed #rotate-overlay, html.kc-embed #end-board, html.kc-embed #end-moves-btn,
  html.kc-embed #title-moves-btn { display: none !important; }
  @media (orientation: portrait) {
    html.kc-embed #joy-zone { width: 100px; height: 100px; }
    html.kc-embed .btn-cluster { grid-template-columns: repeat(4, min(54px, 14.5vw)); grid-template-rows: repeat(2, min(54px, 14.5vw)); gap: 8px; }
    html.kc-embed .char-name { font-size: 9.5px; letter-spacing: 0.6px; white-space: nowrap; }
  }
  /* PORTRAIT GATE — this fighter is built for landscape phones */
  #rotate-overlay {
    display: none; position: fixed; inset: 0; z-index: 55;
    background: rgba(8, 4, 15, 0.97); flex-direction: column;
    align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px;
  }
  .rotate-phone { font-size: 64px; color: #ffae42; }
  @media (orientation: portrait) and (pointer: coarse) and (max-width: 640px) {
    #rotate-overlay { display: flex; }
  }

  /* VS SPLASH */
  #vs-splash {
    position: fixed; inset: 0; z-index: 26; pointer-events: none;
    display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 40px);
    background: linear-gradient(90deg, rgba(10,5,20,0.88), rgba(45,18,70,0.55) 50%, rgba(10,5,20,0.88));
    animation: vsSplash 1.5s ease forwards;
  }
  #vs-splash.hidden { display: none; }
  .vs-name {
    font-family: 'Bebas Neue', 'Arial Narrow', sans-serif; font-weight: 400;
    font-size: clamp(26px, 6.5vw, 64px); letter-spacing: 6px; color: #ffd166;
    text-shadow: 0 4px 0 #3d0e00, 0 0 30px rgba(255,120,0,0.6); white-space: nowrap;
  }
  .vs-mark { font-family: 'Bebas Neue', sans-serif; font-size: clamp(20px, 4.4vw, 44px); font-style: italic; color: #ff9d2e; }
  @keyframes vsSplash {
    0% { opacity: 0; transform: scale(1.06); }
    15% { opacity: 1; transform: scale(1); }
    78% { opacity: 1; }
    100% { opacity: 0; }
  }
  @media (prefers-reduced-motion: reduce) { #vs-splash { animation: vsSplash 0.8s linear forwards; } }
  #qa-panel {
    position: fixed; left: 10px; top: 68px; z-index: 40; width: min(335px, calc(100vw - 20px)); max-height: calc(100dvh - 78px); overflow: auto;
    background: rgba(14, 8, 24, 0.92); border: 1px solid #d49b35; border-radius: 8px;
    padding: 8px 10px; color: #f6e8ff; font-size: 11px; line-height: 1.35;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.72); pointer-events: auto;
  }
  #qa-panel.hidden { display: none; }
  #qa-panel.collapsed .qa-body { display: none; }
  .qa-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; font-weight: 800; color: #ffd166; }
  .qa-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 6px; margin-bottom: 5px; }
  .qa-panel-btns { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
  .qa-btn, .qa-select, .qa-range {
    background: #231238; color: #fff; border: 1px solid #8a6d3b; border-radius: 4px;
    padding: 3px 6px; font-size: 11px;
  }
  .qa-btn { cursor: pointer; font-weight: 700; }
  .qa-btn.active { border-color: #ffd166; background: #5a2a0c; }
  .qa-readout {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 10px; white-space: pre-wrap; background: rgba(0, 0, 0, 0.45);
    border-radius: 4px; padding: 6px; border: 1px solid rgba(255, 217, 142, 0.22);
  }

  /* LOCALIZED / TRANSLUCENT IMPACT BURST OVERLAY (<100ms, never washes out the hit) */
  #flash-overlay {
    position: fixed; inset: 0;
    background: radial-gradient(circle at 50% 45%, rgba(255, 245, 255, 0.85) 0%, rgba(192, 132, 252, 0.35) 38%, rgba(255, 255, 255, 0) 70%);
    mix-blend-mode: screen;
    opacity: 0; pointer-events: none; z-index: 25;
    transition: opacity 0.055s ease-out;
  }
