@media (prefers-reduced-motion: reduce) {
  #nicknameScreen {
    animation: none;
    transition: none;
  }

  .leaderboard li.gold,
  .leaderboard_supporter,
  .leaderboard_supporter li,
  .leaderboard_supporter li.gold,
  .pulse-button,
  .online-counter-card.is-live .online-counter-dot {
    animation: none;
    transition: none;
  }

  .welcome-back-toast-box,
  .welcome-back-toast-box.is-visible,
  .welcome-back-toast-box.is-hiding,
  .online-counter-value.bump {
    transition: none;
    animation: none;
    transform: none;
  }
}

@media (max-width: 1180px) {
  #nicknameSection #nicknameScreen,
  .game-seo {
    width: calc(100% - 28px);
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  #nicknameSection #nicknameScreen {
    display: flex;
    flex-direction: column;
    width: 95%;
    max-width: 100%;
    gap: 16px;
    margin-top: 20px;
  }

  .game-hero-card,
  .game-side-column,
  .player-profile-card,
  .leaderboard,
  .leaderboard_supporter,
  .online-counter-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .game-side-column {
    padding: 14px;
  }

  .online-counter-card {
    padding: 14px;
    border-radius: 18px;
  }

  .online-counter-value {
    font-size: 1.8rem;
  }

  .player-profile-card {
    padding: 16px 14px;
  }

  #gameSection #gameContainer {
    height: 100vh;
  }

  canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 100%;
    border-radius: 12px;
  }

  input,
  button {
    font-size: clamp(16px, 4vw, 18px);
    padding: clamp(10px, 2.5vw, 14px);
  }

  #lastScore {
    font-size: clamp(12px, 4vw, 14px);
  }

  .leaderboard h3,
  .leaderboard_supporter h3,
  .player-profile-card h3 {
    font-size: 18px;
  }

  .leaderboard li,
  .leaderboard_supporter li {
    font-size: 13px;
  }

  .leaderboard-row-inner {
    padding: 10px 12px;
    gap: 10px;
  }

  .leaderboard-name {
    font-size: 13px;
  }

  .leaderboard-score,
  .supporter-timer {
    font-size: 12px;
  }

  .welcome-back-toast-host {
    top: 78px;
    right: 14px;
  }
}

@media (max-width: 600px) and (orientation: portrait) {
  body {
    overflow-x: hidden;
    background-attachment: scroll !important;
  }

  #mainContent {
    width: 100%;
    padding: 6px;
    box-sizing: border-box;
  }

  #nicknameSection #nicknameScreen {
    margin-top: 4px;
    gap: 12px;
    width: 95%;
    max-width: 100%;
  }

  .game-hero-card {
    padding: 28px 14px 16px;
    overflow: hidden;
    box-shadow: none !important;
    backdrop-filter: none !important;
    box-sizing: border-box;
  }

  h1 {
    margin: 20px 0 12px;
    text-align: center;
    line-height: 1.08;
    font-size: clamp(1.9rem, 8vw, 2.2rem);
    text-shadow: none !important;
    animation: none !important;
  }

  #nicknameScreen h2,
  .game-hero-description {
    text-align: center;
  }

  input,
  button {
    border-radius: 10px;
    padding: clamp(10px, 3vw, 14px);
    font-size: clamp(14px, 4vw, 16px);
    box-sizing: border-box;
  }

  button {
    box-shadow: none !important;
    transition: none !important;
  }

  button:hover,
  button:active {
    transform: none !important;
    box-shadow: none !important;
  }

  #gameSection #gameContainer {
    height: 70vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 100%;
  }

  #lastScore {
    font-size: clamp(12px, 4vw, 16px);
    margin-top: 6px;
    text-shadow: none !important;
  }

  .leaderboard,
  .leaderboard_supporter,
  .player-profile-card,
  .online-counter-card {
    width: 100%;
    padding: 12px;
    margin: 0;
    font-size: 12px;
    box-shadow: none !important;
    backdrop-filter: none !important;
    box-sizing: border-box;
  }

  .online-counter-card {
    border-radius: 16px;
  }

  .online-counter-label {
    font-size: 11px;
  }

  .online-counter-value {
    font-size: 1.55rem;
  }

  .online-counter-sub {
    font-size: 11px;
  }

  .leaderboard_supporter li:hover,
  .leaderboard li:hover {
    transform: none;
    box-shadow: none;
  }

  .leaderboard-row-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 42px;
    padding: 9px 10px;
  }

  .leaderboard-left {
    min-width: 52px;
    gap: 5px;
    align-self: center;
    padding-top: 0;
  }

  .leaderboard-medal {
    font-size: 13px;
  }

  .leaderboard-place {
    font-size: 11px;
  }

  .leaderboard-center {
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    flex: 1 1 auto;
    overflow: hidden;
    white-space: nowrap;
  }

  .leaderboard-name,
  .leaderboard-rank-meta,
  .supporter-title,
  .supporter-badge,
  .supporter-tiktok {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  .leaderboard-name {
    font-size: 11px;
    line-height: 1;
    min-width: 0;
  }

  .leaderboard-rank-meta,
  .supporter-title {
    font-size: 9px;
    line-height: 1;
    flex-shrink: 1;
  }

  .supporter-badge {
    min-height: 16px;
    padding: 0 5px;
    font-size: 8px;
  }

  .supporter-crown {
    font-size: 9px;
  }

  .supporter-tiktok {
    font-size: 9px;
    line-height: 1;
  }

  .leaderboard-right {
    min-width: auto;
    flex: 0 0 auto;
    align-self: center;
    justify-self: end;
    white-space: nowrap;
    gap: 4px;
  }

  .leaderboard-score {
    font-size: 11px;
  }

  .supporter-timer-pill,
  .supporter-pending-pill {
    min-height: 22px;
    padding: 0 7px;
    font-size: 9px;
    white-space: nowrap;
  }

  .supporter-timer {
    font-size: 9px;
  }

  .player-reset-btn {
    font-size: 13px;
    padding: 10px 12px;
  }

  .game-seo {
    width: calc(100% - 12px);
    padding: 16px 12px;
    border-radius: 16px;
    box-shadow: none !important;
    background: #0f1726 !important;
    box-sizing: border-box;
  }

  .game-seo h2 {
    font-size: clamp(1.3rem, 5vw, 1.6rem);
    margin-bottom: 12px;
  }

  .game-seo p {
    font-size: 12px;
    margin-bottom: 1em;
  }

  .welcome-back-toast-host {
    top: 84px;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(92vw, 360px);
    transform: translateX(-50%);
  }

  .welcome-back-toast-box {
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    text-align: center;
    transform: translateY(-20px) scale(0.94);
    box-shadow: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
  }

  .welcome-back-toast-box.is-visible {
    transform: translateY(0) scale(1);
  }

  .welcome-back-toast-box.is-hiding {
    transform: translateY(-12px) scale(0.96);
  }

  .welcome-back-toast-title {
    font-size: 12px;
  }

  .welcome-back-toast-sub {
    font-size: 10px;
  }
}

@media (max-width: 430px) {
  .leaderboard-row-inner {
    gap: 6px;
    min-height: 40px;
    padding: 8px 8px;
  }

  .leaderboard-left {
    min-width: 46px;
    gap: 4px;
  }

  .leaderboard-medal {
    font-size: 12px;
  }

  .leaderboard-place {
    font-size: 10px;
  }

  .leaderboard-center {
    gap: 4px;
  }

  .leaderboard-name {
    font-size: 10px;
  }

  .leaderboard-rank-meta,
  .supporter-title,
  .supporter-tiktok {
    font-size: 8px;
  }

  .supporter-badge {
    min-height: 15px;
    padding: 0 4px;
    font-size: 7px;
  }

  .supporter-crown {
    font-size: 8px;
  }

  .leaderboard-score {
    font-size: 10px;
  }

  .supporter-timer-pill,
  .supporter-pending-pill {
    min-height: 20px;
    padding: 0 6px;
    font-size: 8px;
  }

  .supporter-timer {
    font-size: 8px;
  }

  .online-counter-value {
    font-size: 1.4rem;
  }

  .online-counter-sub {
    font-size: 10px;
  }

  .welcome-back-toast-host {
    top: 78px;
    width: min(94vw, 340px);
  }
}