* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', Arial, sans-serif; background: #f5f0eb; color: #333; padding: 20px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
h1 { text-align: center; color: #8b0000; margin-bottom: 5px; font-size: 2em; line-height: 1.25; }
h1 .h1-fr { display: inline-block; margin-top: 4px; font-size: 0.7em; font-weight: normal; color: #555; letter-spacing: 0.02em; }
.subtitle { text-align: center; color: #666; margin-bottom: 30px; font-size: 0.95em; padding: 0 10px; }
.stats { display: flex; justify-content: center; gap: 30px; margin-bottom: 30px; flex-wrap: wrap; }
.stat-box { background: white; border-radius: 10px; padding: 15px 25px; text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,0.1); min-width: 140px; }
.stat-box .number { font-size: 2em; font-weight: bold; }
.stat-box .label { font-size: 0.85em; color: #666; }
.stat-total .number { color: #8b0000; }
.stat-ok .number { color: #2e7d32; }
.stat-miss .number { color: #c62828; }
.pct .number { color: #1565c0; }
.progress-bar { width: 80%; max-width: 500px; margin: 0 auto 30px; background: #e0e0e0; border-radius: 10px; height: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #4caf50, #2e7d32); border-radius: 10px; }
.level-section { background: white; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.level-header { padding: 15px 20px; color: white; font-size: 1.1em; font-weight: bold; display: flex; justify-content: space-between; align-items: center; gap: 8px; border-radius: 10px 10px 0 0; position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.level-header .count { font-size: 0.85em; opacity: 0.9; white-space: nowrap; }
.l1 { background: #4caf50; } .l2 { background: #ff9800; } .l3 { background: #2196f3; }
.l4 { background: #9c27b0; } .l5 { background: #8b0000; } .l6 { background: #455a64; }
table { width: 100%; border-collapse: collapse; }
th { background: #f5f5f5; padding: 10px 15px; text-align: left; font-size: 0.85em; color: #666; border-bottom: 2px solid #eee; }
td { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; font-size: 0.9em; vertical-align: top; word-wrap: break-word; overflow-wrap: break-word; }
tr:last-child td { border-bottom: none; }
tr:hover { background: #fafafa; }
.status-ok { color: #2e7d32; font-weight: bold; }
.status-miss { color: #c62828; font-weight: bold; }
.status-bunkai { color: #1565c0; font-size: 0.9em; }
.origin { color: #888; font-size: 0.82em; }
.video-links { display: flex; flex-wrap: wrap; gap: 6px; font-weight: normal; font-size: 0.8em; }
.status-bunkai { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.video-links a, .status-bunkai a { display: inline-block; padding: 5px 9px; border-radius: 5px; background: #f0f0f0; color: #444; text-decoration: none; white-space: nowrap; line-height: 1.4; }
.video-links a:hover, .status-bunkai a:hover { filter: brightness(0.95); text-decoration: underline; }
.src1 a { color: #1a237e; background: #e8eaf6; font-weight: 600; }
.src2 a { color: #2e7d32; background: #e8f5e9; }
.src3 a { color: #e65100; background: #fff3e0; }
.src4 a { color: #6a1b9a; background: #f3e5f5; }
.src5 a { color: #555; background: #eeeeee; }
.src6 a { color: #666; background: #f5f5f5; font-style: italic; }
.legend { text-align: center; margin-top: 20px; font-size: 0.85em; color: #888; padding: 15px; line-height: 1.8; }
.note { background: #fff3e0; border-left: 4px solid #ff9800; padding: 12px 16px; margin-bottom: 25px; border-radius: 0 6px 6px 0; font-size: 0.9em; line-height: 1.5; }
.source-legend { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; padding: 0 10px; }
.source-legend span { padding: 4px 12px; border-radius: 12px; font-size: 0.82em; }
.sl-1 { background: #e8eaf6; color: #1a237e; border: 1px solid #9fa8da; }
.sl-2 { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.sl-3 { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.sl-4 { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.sl-5 { background: #f5f5f5; color: #888; border: 1px solid #ccc; }

.player { inset: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; border: 0; padding: 0; margin: 0; background: rgba(0,0,0,0.94); display: none; align-items: center; justify-content: center; }
.player[open] { display: flex; }
.player::backdrop { background: rgba(0,0,0,0.94); }
.player video { display: block; max-width: 100%; max-height: 100vh; background: #000; }
.player-close { position: fixed; top: max(16px, env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(0,0,0,0.55); color: white; cursor: pointer; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 0; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.player-close:hover, .player-close:focus { background: rgba(0,0,0,0.75); outline: none; }
.player-close svg { width: 22px; height: 22px; }

@media (max-width: 720px) {
  body { padding: 10px; }
  h1 { font-size: 1.45em; }
  .subtitle { font-size: 0.82em; margin-bottom: 18px; }
  .level-header { padding: 12px 14px; font-size: 0.95em; flex-direction: column; align-items: flex-start; gap: 4px; }
  .source-legend { gap: 6px; margin-bottom: 16px; }
  .source-legend span { font-size: 0.74em; padding: 3px 9px; }
  .note { padding: 10px 14px; font-size: 0.85em; }

  table, tbody, tr, td { display: block; width: 100%; }
  tr:has(th) { display: none; }
  tr { padding: 14px 16px; border-bottom: 1px solid #eee; }
  tr:hover { background: transparent; }
  tr:last-child { border-bottom: none; }
  td { padding: 0; border: none; font-size: 0.9em; }
  td:first-child { font-size: 1.1em; margin-bottom: 2px; line-height: 1.3; }
  td.origin { margin-bottom: 10px; font-size: 0.78em; }

  td:nth-child(4):not(.status-bunkai) { display: none; }

  .status-ok, .status-miss, .status-bunkai {
    display: block;
    padding: 10px 0 0 0;
    margin-top: 10px;
    border-top: 1px solid #f0f0f0;
    color: inherit;
    font-weight: normal;
    font-size: 0.9em;
  }
  .status-ok::before,
  .status-miss::before,
  .status-bunkai::before {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
  }
  .status-ok::before, .status-miss::before { content: "Démonstrations"; }
  .status-bunkai::before { content: "Bunkai"; }
  .status-miss { color: #c62828; font-weight: bold; }

  .video-links { gap: 8px; font-size: 0.85em; }
  .video-links a, .status-bunkai a { padding: 8px 12px; font-size: 0.95em; min-height: 36px; display: inline-flex; align-items: center; }
}

@media (max-width: 380px) {
  h1 { font-size: 1.25em; }
  body { padding: 8px; }
  tr { padding: 12px 12px; }
  .video-links a { padding: 8px 10px; }
}
