* { margin: 0; box-sizing: border-box; }
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    body {
      font-family: system-ui, sans-serif;
      background: #0f1220;
      color: #e8e8f0;
      min-height: 100vh;
      padding: 1.5rem;
    }
    .container {
      max-width: 1400px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: 220px 1fr 220px;
      gap: 1.5rem;
    }
    @media (max-width: 1100px) {
      .container { grid-template-columns: 1fr; }
      .sidebar { display: none; }
    }
    .mobile-stats-fab {
      display: none;
      position: fixed;
      right: 1rem;
      bottom: 1rem;
      z-index: 999;
      width: 56px;
      height: 56px;
      border: none;
      border-radius: 50%;
      background: #7c5cff;
      color: #fff;
      font-size: 1.5rem;
      cursor: pointer;
      align-items: center;
      justify-content: center;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
      transition: background 0.2s, transform 0.15s;
    }
    .mobile-stats-fab:hover { background: #9a7dff; }
    .mobile-stats-fab:active { transform: scale(0.95); }
    .mobile-stats {
      display: none;
      margin-top: 1.5rem;
      background: #1a1e33;
      border: 1px solid #2c3155;
      border-radius: 12px;
      overflow: hidden;
    }
    @media (max-width: 1100px) {
      .mobile-stats-fab { display: flex; }
      .mobile-stats {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 998;
        margin: 0;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.45);
        max-height: 75vh;
        overflow-y: auto;
        transform: translateY(105%);
        transition: transform 0.3s ease;
      }
      .mobile-stats.open { transform: translateY(0); }
    }
    .mobile-stats-header {
      position: sticky;
      top: 0;
      padding: 1rem;
      font-size: 0.95rem;
      font-weight: 600;
      color: #7c5cff;
      display: flex;
      justify-content: space-between;
      align-items: center;
      user-select: none;
      background: #1a1e33;
    }
    .mobile-stats-close {
      border: none;
      background: none;
      color: #8a8aa0;
      font-size: 1.1rem;
      line-height: 1;
      cursor: pointer;
      padding: 0.25rem 0.5rem;
      border-radius: 8px;
    }
    .mobile-stats-close:hover { color: #e8e8f0; }
    .mobile-stats-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1rem;
      padding: 0 1rem 1rem;
    }
    @media (max-width: 600px) {
      .mobile-stats-grid { grid-template-columns: 1fr; }
    }
    .mobile-stats h3 {
      font-size: 0.85rem;
      font-weight: 600;
      color: #7c5cff;
      margin-bottom: 0.75rem;
    }
    h1 {
      text-align: center;
      font-size: 2.5rem;
      margin-bottom: 0.25rem;
      text-shadow: 0 0 20px #7c5cff;
      grid-column: 1 / -1;
    }
    p.tag {
      text-align: center;
      color: #8a8aa0;
      margin-bottom: 1rem;
      grid-column: 1 / -1;
    }
    @media (max-width: 600px) {
      .container { padding-top: 2.5rem; }
      h1 { font-size: 1.7rem; }
      .player-bar { font-size: 0.85rem; }
    }
    .player-bar {
      text-align: center;
      margin-bottom: 1rem;
      font-size: 0.95rem;
      color: #a8a8b8;
      grid-column: 1 / -1;
    }
    .player-bar .session-state,
    .player-bar .session-account,
    .player-bar .sync-status {
      margin: 0 0.5rem;
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
    }
    .auth-btn {
      padding: 0.45rem 1rem;
      border: none;
      border-radius: 999px;
      background: #7c5cff;
      color: #fff;
      font-size: 0.85rem;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
    }
    .auth-btn:hover { background: #9a7dff; }
    .auth-btn-outline {
      background: transparent;
      border: 1px solid #2c3155;
      color: #a8a8b8;
    }
    .auth-btn-outline:hover { border-color: #7c5cff; color: #e8e8f0; background: transparent; }
    .sync-status { color: #ffd93d; font-size: 0.85rem; }
    .guest-chip {
      display: inline-block;
      padding: 0.15rem 0.6rem;
      border-radius: 999px;
      background: #2c3155;
      color: #a8a8b8;
      font-size: 0.8rem;
      font-weight: 600;
    }
    .import-banner {
      grid-column: 1 / -1;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      background: rgba(124, 92, 255, 0.12);
      border: 1px solid #7c5cff;
      border-radius: 12px;
      padding: 0.75rem 1rem;
      font-size: 0.9rem;
      margin-bottom: 1rem;
    }
    .lb-sync-note {
      margin-top: 0.75rem;
      padding: 0.5rem 0.65rem;
      border-radius: 8px;
      background: rgba(255, 217, 61, 0.08);
      border: 1px solid rgba(255, 217, 61, 0.35);
      color: #ffd93d;
      font-size: 0.78rem;
      line-height: 1.35;
    }
    .player-name {
      color: #7c5cff;
      font-weight: 600;
      cursor: pointer;
      text-decoration: underline dotted;
    }
    .player-name:hover { color: #9a7dff; }
    .sidebar {
      background: #1a1e33;
      border: 1px solid #2c3155;
      border-radius: 12px;
      padding: 1rem;
      height: fit-content;
      position: sticky;
      top: 1rem;
    }
    .sidebar h3 {
      font-size: 0.95rem;
      font-weight: 600;
      margin-bottom: 1rem;
      color: #7c5cff;
    }
    .sidebar-content {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      font-size: 0.85rem;
    }
    .stat-item {
      display: flex;
      justify-content: space-between;
      padding: 0.5rem 0;
      border-bottom: 0.5px solid #2c3155;
    }
    .stat-item:last-child { border-bottom: none; }
    .stat-label { color: #8a8aa0; }
    .stat-value { color: #7c5cff; font-weight: 600; }
    .stat-item.you {
      background: rgba(124, 92, 255, 0.12);
      border-left: 3px solid #7c5cff;
      padding-left: 0.5rem;
      border-radius: 6px;
    }
    .you-badge {
      display: inline-block;
      margin-left: 0.4rem;
      padding: 0.1rem 0.45rem;
      font-size: 0.68rem;
      font-weight: 700;
      color: #fff;
      background: #7c5cff;
      border-radius: 999px;
      vertical-align: middle;
    }
    .stat-item.rank-1 { background: rgba(255, 217, 61, 0.08); border-radius: 6px; }
    .stat-item.rank-2 { background: rgba(192, 192, 192, 0.07); border-radius: 6px; }
    .stat-item.rank-3 { background: rgba(205, 127, 50, 0.07); border-radius: 6px; }
    .stat-item.rank-1 .stat-label { color: #ffd93d; font-weight: 700; }
    .stat-item.rank-2 .stat-label { color: #c8c8d4; font-weight: 700; }
    .stat-item.rank-3 .stat-label { color: #d99a5b; font-weight: 700; }
    .stat-item.rank-1 .stat-value { color: #ffd93d; }
    .stat-item.top-game {
      background: rgba(124, 92, 255, 0.08);
      border-left: 3px solid #7c5cff;
      padding-left: 0.5rem;
      border-radius: 6px;
    }
    .stat-box {
      background: #0f1220;
      padding: 0.75rem;
      border-radius: 6px;
      margin-bottom: 0.5rem;
    }
    .stat-box-label { font-size: 0.75rem; color: #8a8aa0; margin-bottom: 0.25rem; }
    .stat-box-value { font-size: 1.4rem; font-weight: 600; color: #7c5cff; }
    .game-select {
      width: 100%;
      margin-bottom: 0.75rem;
      padding: 0.5rem 0.65rem;
      background: #0f1220;
      color: #e8e8f0;
      border: 1px solid #2c3155;
      border-radius: 8px;
      font-size: 0.85rem;
    }
    .game-select:focus { outline: none; border-color: #7c5cff; }
    .center-column {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }
    .game-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 1rem;
      width: 100%;
    }
    @media (max-width: 1300px) {
      .game-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    @media (max-width: 900px) {
      .game-grid {
        grid-template-columns: 1fr;
      }
    }
    .card {
      display: block;
      background: #1a1e33;
      border: 1px solid #2c3155;
      border-radius: 12px;
      padding: 1.25rem;
      text-decoration: none;
      color: inherit;
      transition: transform 0.1s, border-color 0.1s;
      cursor: pointer;
    }
    .card:hover { transform: translateY(-3px); border-color: #7c5cff; }
    .card:focus-visible {
      outline: 2px solid #7c5cff;
      outline-offset: 3px;
      border-color: #7c5cff;
    }
    .card .emoji { display: block; font-size: 2rem; }
    .card h2 { font-size: 1.1rem; margin: 0.5rem 0 0.25rem; }
    .card .by { font-size: 0.8rem; color: #8a8aa0; }
    .card .tag {
      font-size: 0.8rem;
      color: #6f74a3;
      margin-top: 0.35rem;
      line-height: 1.4;
    }
    .modal {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.8);
      align-items: center;
      justify-content: center;
      z-index: 1000;
      display: flex;
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
      transition: opacity 0.2s ease, visibility 0.2s ease;
    }
    .modal.show {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    .modal-box {
      background: #1a1e33;
      border: 1px solid #2c3155;
      border-radius: 16px;
      padding: 2rem;
      max-width: 400px;
      text-align: center;
      gap: 1rem;
      display: flex;
      flex-direction: column;
      transform: scale(0.95);
      transition: transform 0.2s ease;
    }
    .modal.show .modal-box { transform: scale(1); }
    .modal-box h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
    .modal-box input {
      padding: 0.75rem;
      border: 1px solid #2c3155;
      border-radius: 8px;
      background: #0f1220;
      color: #e8e8f0;
      font-size: 1rem;
    }
    .modal-box input:focus { outline: none; border-color: #7c5cff; }
    .modal-box button {
      padding: 0.75rem 1.5rem;
      border: none;
      border-radius: 8px;
      background: #7c5cff;
      color: #fff;
      font-size: 1rem;
      cursor: pointer;
      transition: background 0.2s;
    }
    .modal-box button:hover { background: #9a7dff; }
    [hidden] { display: none !important; }
