/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

button,
input:is([type="button"], [type="submit"], [type="reset"]),
[role="button"] {
  cursor: pointer;
}

button:disabled,
input:is([type="button"], [type="submit"], [type="reset"]):disabled,
[role="button"][aria-disabled="true"] {
  cursor: not-allowed;
}

:root {
  --site-header-height: 3.25rem;
}

.site-header {
  background: #3172D1;
}

.site-header__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.4rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--site-header-height);
  box-sizing: border-box;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.site-header__logo {
  height: 2.35rem;
  width: auto;
  display: block;
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-header__locale {
  display: inline-flex;
  align-items: center;
}

.site-header__locale-select {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(15, 23, 42, 0.25);
  color: #fff;
  border-radius: 0.375rem;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.2;
}

.site-header__locale-select option {
  color: #0f172a;
}

.site-header__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.55rem;
  background: #111827;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.site-header__profile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  background: #111827;
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
}

.site-header__profile:hover,
.site-header__profile:focus-visible {
  background: #0f172a;
  outline: none;
}

.site-header__auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.55rem;
  background: #f3f4f6;
  color: #3172D1;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

@media (min-width: 768px) {
  :root {
    --site-header-height: 3.5rem;
  }

  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 50;
  }

  body {
    padding-top: var(--site-header-height);
  }

  .site-header__inner {
    padding: 0.45rem 1.5rem;
  }

  .site-header__logo {
    height: 2.6rem;
  }
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: #f3f4f6;
}

.auth-card {
  width: 100%;
  max-width: 380px;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  padding: 32px;
}

.auth-card h1 {
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
  text-align: center;
}

.auth-form .field {
  margin-bottom: 18px;
}

.auth-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.auth-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
  color: #111827;
  background-color: #f9fafb;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
  background-color: #ffffff;
}

.auth-form .actions {
  margin-top: 24px;
}

.auth-submit {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  background-color: #4f46e5;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.auth-submit:hover {
  background-color: #4338ca;
}

.auth-secondary {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
  color: #4b5563;
}

.auth-secondary a {
  color: #4f46e5;
  font-weight: 500;
  text-decoration: none;
}

.auth-secondary a:hover {
  text-decoration: underline;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #4b5563;
}

.countdown-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.85);
  z-index: 1000;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.countdown-overlay.countdown-hidden {
  opacity: 0;
  visibility: hidden;
}

.countdown-card {
  text-align: center;
  padding: 2.5rem 3rem;
  border-radius: 1rem;
  background-color: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.45);
  pointer-events: none;
}

.countdown-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.9);
}

.countdown-number {
  display: block;
  font-size: 4.5rem;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
}

@media (max-width: 900px) {
  .countdown-card {
    padding: 2rem 2.25rem;
  }

  .countdown-label {
    font-size: 1.35rem;
  }

  .countdown-number {
    font-size: 5.5rem;
  }
}

.auth-hint {
  margin-top: 4px;
  font-size: 13px;
  color: #64748b;
}

.auth-intro {
  margin-bottom: 24px;
  color: #475569;
  line-height: 1.6;
}

.auth-submit--danger {
  background-color: #dc2626;
}

.auth-submit--danger:hover {
  background-color: #b91c1c;
}

.win-celebration {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.55);
  animation: win-celebration-fade-in 0.35s ease-out;
}

.win-celebration--hidden {
  display: none;
}

.win-celebration__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.win-celebration__card {
  position: relative;
  z-index: 2;
  max-width: 18rem;
  margin: 1rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  border-radius: 1rem;
  background: linear-gradient(180deg, #fff8e7 0%, #f6e2b3 100%);
  border: 1px solid #d4a017;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
  animation: win-celebration-pop 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: auto;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.win-celebration__title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: #7a4e00;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.win-celebration__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #8a5a12;
  line-height: 1.4;
}

.win-celebration__claim {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(212, 160, 23, 0.45);
  text-align: center;
}

.win-celebration__claim.hidden {
  display: none;
}

.win-celebration__claim-message {
  margin: 0;
  color: #7a4e00;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
}

.win-celebration__claim-link {
  color: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.win-celebration__claim-link:hover {
  color: #1d4ed8;
}

.win-celebration__claim-actions {
  margin-top: 0.65rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.win-celebration__claim-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.95rem;
  border: none;
  border-radius: 999px;
  background: #3172D1;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.win-celebration__claim-btn.hidden {
  display: none;
}

.win-celebration__actions {
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}

.win-celebration__new-game {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: #166534;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer !important;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.win-celebration__new-game:hover {
  background: #14532d;
  cursor: pointer !important;
}

.win-celebration__new-game.hidden {
  display: none;
}

.win-celebration__rematch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.win-celebration__rematch:hover:not(:disabled) {
  background: #1e40af;
}

.win-celebration__rematch:disabled {
  background: #64748b;
  cursor: default;
}

.win-celebration__rematch.hidden {
  display: none;
}

.win-celebration__dismiss {
  margin-top: 0;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: 999px;
  background: #1e3a5f;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.win-celebration__dismiss:hover {
  background: #16304f;
}

.win-celebration__series {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #7a4e00;
  line-height: 1.35;
}

.win-celebration__series.is-empty,
.win-celebration__series[hidden] {
  display: none;
}

.win-celebration__hint {
  margin: 0;
  font-size: 0.8rem;
  color: #a16207;
  opacity: 0.85;
}

.win-celebration {
  cursor: pointer;
}

.result-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.result-actions.hidden {
  display: none;
}

.result-actions__buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
}

.result-actions__rematch,
.result-actions__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.result-actions__rematch {
  border: none;
  background: #1d4ed8;
  color: #fff;
}

.result-actions__rematch:hover:not(:disabled) {
  background: #1e40af;
}

.result-actions__rematch:disabled {
  background: #64748b;
  cursor: default;
}

.result-actions__rematch.hidden {
  display: none;
}

.result-actions__back {
  background: #166534;
  color: #fff;
}

.result-actions__back:hover {
  background: #14532d;
}

.result-actions .win-celebration__claim {
  width: 100%;
  max-width: 24rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
}

.result-actions .win-celebration__claim-message {
  font-size: 0.8rem;
  font-weight: 600;
}

.result-actions .win-celebration__claim-actions {
  margin-top: 0.35rem;
  gap: 0.35rem;
}

.result-actions .win-celebration__claim-btn {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

#game-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.game-status__headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.75rem;
  width: 100%;
  line-height: 1.3;
}

#game-status-message {
  width: auto;
  line-height: 1.3;
}

.room-series-score {
  width: auto;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
  white-space: nowrap;
}

.room-series-score.is-empty,
.room-series-score[hidden] {
  display: none;
}

#game-status.game-status--win {
  border-style: solid;
  border-color: #d4a017;
  background: #fff8e7;
  color: #7a4e00;
  font-weight: 600;
}

#game-status.game-status--win .room-series-score {
  color: #8a5a12;
}

#game-status.game-status--loss {
  border-style: solid;
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

#game-status.game-status--check {
  border-style: solid;
  border-color: #b91c1c;
  background: #fef2f2;
  color: #991b1b;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#game-status.game-status--check-flash {
  animation: game-status-check-pulse 0.35s ease-in-out 3;
}

@keyframes game-status-check-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(185, 28, 28, 0);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.28);
    background: #fee2e2;
  }
}

.chess-panel {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.chess-panel--to-move {
  border-color: #1e3a5f;
  background: #f1f5f9;
  box-shadow: 0 0 0 1px rgba(30, 58, 95, 0.12);
}

.chess-clock {
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.chess-clock--ahead {
  border-color: #15803d;
  background: #ecfdf5;
  color: #14532d;
  font-weight: 600;
}

.chess-clock--behind {
  border-color: #c2410c;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 600;
}

.chess-play-layout {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chess-players-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#board-section,
#board-stage {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  line-height: 0;
}

#board-stage:has(.win-celebration:not(.win-celebration--hidden)) #chess-board,
#board-stage:has(.win-celebration:not(.win-celebration--hidden)) #draughts-board,
#board-stage:has(.win-celebration:not(.win-celebration--hidden)) .morpion-board {
  pointer-events: none;
}

[data-game-start-back],
[data-select-game] {
  cursor: pointer !important;
}

#chess-board {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

.chess-app {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  gap: 0.75rem;
  padding-top: 0.75rem;
  padding-bottom: 1.25rem;
  padding-left: 0;
  padding-right: 0;
}

.chess-app__header,
.chess-app__footer,
#game-meta,
#opponent-panel,
#player-panel {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.chess-panel__moves {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.chess-panel__moves-list {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  max-height: 10rem;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  line-height: 1.4;
}

.chess-panel__moves-list li + li {
  margin-top: 0.25rem;
}

@media (min-width: 900px) {
  .chess-app:not([data-mobile-board="true"]),
  .draughts-app:not([data-mobile-board="true"]) {
    --play-board-size: min(512px, calc(100vh - var(--site-header-height, 3.5rem) - 10.5rem));
    max-width: 64rem;
    gap: 0.65rem;
    padding: 0.65rem 1rem 0.4rem;
    box-sizing: border-box;
    max-height: calc(100vh - var(--site-header-height, 3.5rem));
    overflow: hidden;
  }

  .chess-app:not([data-mobile-board="true"]) .chess-play-layout,
  .draughts-app:not([data-mobile-board="true"]) .chess-play-layout {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(0, 1fr) var(--play-board-size) minmax(0, 1fr);
    grid-template-areas:
      "opponent board player"
      ". meta .";
    align-items: start;
  }

  .chess-app:not([data-mobile-board="true"]) .chess-players-row,
  .draughts-app:not([data-mobile-board="true"]) .chess-players-row {
    display: contents;
  }

  .chess-app:not([data-mobile-board="true"]) #opponent-panel,
  .chess-app:not([data-mobile-board="true"]) #player-panel,
  .draughts-app:not([data-mobile-board="true"]) #opponent-panel,
  .draughts-app:not([data-mobile-board="true"]) #player-panel {
    height: var(--play-board-size);
    max-height: var(--play-board-size);
    overflow: hidden;
  }

  .chess-app:not([data-mobile-board="true"]) #opponent-panel,
  .draughts-app:not([data-mobile-board="true"]) #opponent-panel {
    grid-area: opponent;
  }

  .chess-app:not([data-mobile-board="true"]) #board-section,
  .draughts-app:not([data-mobile-board="true"]) #board-section {
    grid-area: board;
  }

  .chess-app:not([data-mobile-board="true"]) #player-panel,
  .draughts-app:not([data-mobile-board="true"]) #player-panel {
    grid-area: player;
  }

  .chess-app:not([data-mobile-board="true"]) #game-meta,
  .draughts-app:not([data-mobile-board="true"]) #game-meta {
    grid-area: meta;
  }

  .chess-app:not([data-mobile-board="true"]) #chess-board,
  .draughts-app:not([data-mobile-board="true"]) #draughts-board {
    width: var(--play-board-size);
    max-width: var(--play-board-size);
    height: var(--play-board-size);
    aspect-ratio: auto;
    border-radius: 0.25rem;
  }

  .chess-app:not([data-mobile-board="true"]) .chess-panel__moves,
  .draughts-app:not([data-mobile-board="true"]) .chess-panel__moves {
    flex: 1 1 auto;
  }

  .chess-app:not([data-mobile-board="true"]) .chess-panel__moves-list,
  .draughts-app:not([data-mobile-board="true"]) .chess-panel__moves-list {
    flex: 1 1 auto;
    max-height: none;
    min-height: 0;
  }

  .chess-app:not([data-mobile-board="true"]) .play-app__header,
  .draughts-app:not([data-mobile-board="true"]) .play-app__header {
    gap: 0.5rem;
  }

  .chess-app:not([data-mobile-board="true"]) .play-app__header h1,
  .draughts-app:not([data-mobile-board="true"]) .play-app__header h1 {
    font-size: 1.25rem;
    line-height: 1.2;
  }

  .chess-app:not([data-mobile-board="true"]) .room-code-copy,
  .draughts-app:not([data-mobile-board="true"]) .room-code-copy {
    padding: 0.35rem 0.65rem;
  }

  .chess-app:not([data-mobile-board="true"]) .chess-app__footer,
  .draughts-app:not([data-mobile-board="true"]) .draughts-app__footer {
    margin: 0;
    line-height: 1.2;
  }

  .chess-app:not([data-mobile-board="true"]) #game-meta,
  .draughts-app:not([data-mobile-board="true"]) #game-meta {
    padding-top: 0;
    padding-bottom: 0;
  }
}

@keyframes win-celebration-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes win-celebration-pop {
  from {
    opacity: 0;
    transform: scale(0.86) translateY(12px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.game-params {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.game-param {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  font-weight: 700;
}

.game-param i,
.game-param__icon {
  line-height: 1;
}

.game-param__icon--circle-half {
  width: 0.95em;
  height: 0.95em;
  flex-shrink: 0;
}

.chess-capture-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.chess-capture-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}

.chess-capture-fallback {
  font-weight: 700;
}

.public-rooms-score-filter {
  margin-top: 1rem;
}

.public-rooms-score-filter__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.public-rooms-score-filter__label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #334155;
}

.public-rooms-score-filter__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.public-rooms-score-filter__slider {
  position: relative;
  height: 1.75rem;
}

.public-rooms-score-filter__slider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 0.35rem;
  margin-top: -0.175rem;
  border-radius: 999px;
  background: #cbd5e1;
}

.public-rooms-score-filter__track {
  position: absolute;
  top: 50%;
  height: 0.35rem;
  margin-top: -0.175rem;
  border-radius: 999px;
  background: #3172D1;
  pointer-events: none;
}

.public-rooms-score-filter__slider input[type="range"] {
  position: absolute;
  left: 0;
  width: 100%;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
  appearance: none;
  background: transparent;
  pointer-events: none;
  height: 1.75rem;
}

.public-rooms-score-filter__slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 2px solid #3172D1;
  background: #fff;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.public-rooms-score-filter__slider input[type="range"]::-moz-range-thumb {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 2px solid #3172D1;
  background: #fff;
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.public-rooms-score-filter__slider input[type="range"]::-moz-range-track {
  background: transparent;
}

.public-room-player {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.public-room-player .score-badge {
  margin-left: 0;
}

.public-room-players__sep {
  color: #94a3b8;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #94a3b8;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.82em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  vertical-align: middle;
}

.score-help-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  width: 1.35em;
  height: 1.35em;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  opacity: 0.85;
}

.score-help-trigger:hover,
.score-help-trigger:focus-visible {
  opacity: 1;
  outline: none;
}

.score-badge.score-help-trigger {
  width: auto;
  min-width: 1.75rem;
  height: auto;
  margin-left: 0.35rem;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #94a3b8;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 0.82em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  opacity: 1;
}

.score-badge.score-help-trigger:hover,
.score-badge.score-help-trigger:focus-visible {
  background: #cbd5e1;
  border-color: #64748b;
}

.score-help-dialog {
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(32rem, calc(100vw - 2rem));
}

.score-help-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
}

.score-help-dialog__panel {
  position: relative;
  background: #fff;
  color: #0f172a;
  border-radius: 14px;
  padding: 1.35rem 1.25rem 1.25rem;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}

.score-help-dialog__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 0.55rem;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 1.15rem;
  cursor: pointer;
}

.score-help-dialog__title {
  margin: 0 2.5rem 0.85rem 0;
  font-size: 1.25rem;
  font-weight: 800;
}

.score-help-dialog__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #334155;
}

.score-help-dialog__body p {
  margin: 0;
}

.score-help-ranking {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 0 0.25rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.score-help-ranking.is-empty {
  display: none;
}

.score-help-ranking__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
}

.score-help-ranking__label {
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 600;
}

.player-rating-line {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-weight: 700;
  white-space: nowrap;
}

.player-rating-line.is-empty {
  display: none;
}

.country-flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 1.05em;
}

.country-flag--hidden {
  display: none;
}

.country-flag--profile {
  font-size: 1.4rem;
}

.auth-form .field--checkbox {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.6rem;
  align-items: start;
}

.auth-form .field--checkbox input[type="checkbox"] {
  margin-top: 0.25rem;
}

.auth-form .field--checkbox .auth-hint {
  grid-column: 1 / -1;
}

.matchmaking-spinner {
  width: 3rem;
  height: 3rem;
  border: 0.28rem solid #cbd5e1;
  border-top-color: #3172D1;
  border-radius: 50%;
  animation: matchmaking-spin 0.8s linear infinite;
}

@keyframes matchmaking-spin {
  to {
    transform: rotate(360deg);
  }
}

.matchmaking-timer {
  font-variant-numeric: tabular-nums;
  min-width: 8ch;
}

.ready-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(15, 23, 42, 0.72);
}

.ready-overlay:not(.hidden) {
  display: flex;
}

.ready-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: min(90vw, 26rem);
  padding: 1.5rem 1.75rem;
  border-radius: 0.75rem;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.35);
  text-align: center;
}

.ready-overlay__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.2;
}

.ready-overlay__hint {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: #475569;
}

.ready-overlay__button {
  margin-top: 0.35rem;
  min-width: 10rem;
  padding: 0.7rem 1.25rem;
  border: 0;
  border-radius: 0.5rem;
  background: #3172D1;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.ready-overlay__button:disabled {
  background: #94a3b8;
  cursor: default;
}

