* { margin: 0; padding: 0; box-sizing: border-box; }
  body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #090d16;
    background: radial-gradient(circle at 50% 40%, #1e293b 0%, #0f172a 55%, #090d16 100%);
    font-family: 'Google Sans', 'Outfit', sans-serif;
    position: relative;
  }
  canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; background: transparent; }

  :fullscreen, :-webkit-full-screen, :-moz-full-screen {
    background: #090d16 !important;
    background: radial-gradient(circle at 50% 40%, #1e293b 0%, #0f172a 55%, #090d16 100%) !important;
  }

  /* In-Game Glassmorphism Overlay Modal */
  .game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 1rem;
    animation: fadeIn 0.25s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
  }

  .modal-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.15rem 1.25rem;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    text-align: center;
    color: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    box-sizing: border-box;
  }

  .modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #000000;
    flex-shrink: 0;
  }

  .modal-stats {
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.4rem 0.75rem;
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-weight: 600;
    font-size: 0.85rem;
    border: none;
    flex-shrink: 0;
  }

  .modal-score { color: #2563eb; }
  .modal-bagels { color: #d97706; display: inline-flex; align-items: center; gap: 4px; }

  .submit-form {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
  }

  .name-input {
    flex: 1;
    height: 44px;
    padding: 0 1rem;
    border-radius: 9999px;
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    color: #0f172a;
  }

  .name-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  }

  .btn-submit {
    height: 44px;
    min-height: 44px;
    flex-shrink: 0;
    padding: 0 1.25rem;
    border-radius: 9999px;
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .btn-submit:hover {
    background: #ff7daf;
    color: #000000;
    border-color: #ff7daf;
    transform: none !important;
    box-shadow: none !important;
  }

.btn-retry {
  width: 100%;
  height: 44px;
  min-height: 44px;
  flex-shrink: 0;
  padding: 0 1.25rem;
  border-radius: 9999px;
  background: #000000;
  color: #ffffff;
  border: 2px solid #000000;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.2rem;
}

.btn-retry:hover {
  background: #ff7daf;
  color: #000000;
  border-color: #ff7daf;
  transform: none !important;
}

  .leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    text-align: left;
    max-height: 130px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 transparent;
  }

  .leaderboard-list::-webkit-scrollbar {
    width: 6px;
  }
  .leaderboard-list::-webkit-scrollbar-track {
    background: transparent;
  }
  .leaderboard-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }

  .lb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 0.85rem;
  }

  .lb-row.r1 { background: rgba(251, 188, 4, 0.2); font-weight: 700; border: 1px solid rgba(251, 188, 4, 0.4); }
  .lb-row.r2 { background: rgba(226, 232, 240, 0.9); font-weight: 700; }
  .lb-row.r3 { background: rgba(217, 119, 6, 0.15); font-weight: 700; }

  /* Unified Top HUD Container */
  .top-hud-bar {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 400; /* Higher than .game-overlay (z-index: 300) so HUD controls stay active on Game Over! */
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
  }

  .top-hud-bar > * {
    pointer-events: auto;
  }

  .hud-right-group {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Unified Base Pill Style for Music, Score/PTS, and Obwarzanki */
  .hud-pill {
    height: 36px;
    padding: 0 14px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    color: #ffffff;
    font-family: 'Google Sans', 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    user-select: none;
    white-space: nowrap;
    width: fit-content;
  }

  /* Music Toggle Pill Button Specifics */
  .music-toggle-btn {
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .music-toggle-btn:hover,
  .music-toggle-btn.active {
    background: #ff7daf;
    color: #000000;
    border-color: #ff7daf;
    box-shadow: none;
  }

  /* Obwarzanki Count Badge Accent */
  .hud-bagel-pill {
    color: #fbbf24;
  }

  .hud-bagel-icon {
    width: 22px;
    height: 20px;
    object-fit: contain;
    display: inline-block;
    vertical-align: middle;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3));
  }

  /* Fullscreen Pill Button (Bottom Right Corner) */
  .fullscreen-btn {
    position: fixed;
    bottom: 14px;
    right: 14px;
    z-index: 400; /* Higher than .game-overlay (z-index: 300) so Fullscreen stays active on Game Over! */
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 12px;
  }

  .fullscreen-btn:hover,
  .fullscreen-btn.active {
    background: #ff7daf;
    color: #000000;
    border-color: #ff7daf;
    box-shadow: none;
    transform: none;
  }

  /* Device Orientation Hint Overlay (Floating Banner for Mobile Portrait Mode) */
  .orientation-hint-overlay {
    position: fixed;
    top: 54px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    width: 90%;
    max-width: 380px;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translate(-50%, -15px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }

  .orientation-hint-card {
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 9999px;
    padding: 0.5rem 0.85rem 0.5rem 0.75rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
  }

  .phone-rotate-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .phone-svg {
    width: 20px;
    height: 20px;
    color: #ff7daf;
    animation: rotatePhone 2.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: center center;
  }

  @keyframes rotatePhone {
    0%, 15% {
      transform: rotate(0deg);
    }
    50%, 65% {
      transform: rotate(-90deg);
    }
    100% {
      transform: rotate(0deg);
    }
  }

  .orientation-hint-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
    line-height: 1.25;
  }

  .orientation-hint-text strong {
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffffff;
  }

  .orientation-hint-text span {
    font-size: 0.73rem;
    color: #94a3b8;
    font-weight: 500;
  }

  .orientation-close-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: all 0.2s ease;
  }

  .orientation-close-btn:hover {
    background: #ff7daf;
    color: #000000;
    border-color: #ff7daf;
  }
