/*
 * Play Checkers – UI Styles (Account / Profile / Leaderboards)
 *
 * Design goals:
 * - Scoped: only affects elements under .checkers-* wrappers
 * - Theme-friendly: avoids global element resets
 * - Modern: card layout, readable forms, responsive grids
 */

.checkers-account,
.checkers-profile,
.checkers-leaderboard {
  --pc-ui-bg: rgba(17, 24, 39, 0.02);
  --pc-ui-card: #ffffff;
  --pc-ui-border: rgba(17, 24, 39, 0.14);
  --pc-ui-border-2: rgba(17, 24, 39, 0.10);
  --pc-ui-text: rgba(17, 24, 39, 0.92);
  --pc-ui-muted: rgba(17, 24, 39, 0.70);
  --pc-ui-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
  --pc-ui-radius: 16px;
  --pc-ui-radius-sm: 12px;
  --pc-ui-pad: 18px;
  color: var(--pc-ui-text);
}

.checkers-account *,
.checkers-profile *,
.checkers-leaderboard * {
  box-sizing: border-box;
}

/* ---- Messages ---- */

.checkers-messages {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--pc-ui-border);
  border-radius: var(--pc-ui-radius-sm);
  background: var(--pc-ui-bg);
}

.checkers-messages p {
  margin: 0;
  line-height: 1.45;
  color: var(--pc-ui-text);
}

.checkers-messages p + p {
  margin-top: 8px;
}

/* ---- Account layout ---- */

.checkers-account__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

@media (min-width: 860px) {
  .checkers-account__grid {
    grid-template-columns: 1fr 1fr;
    gap: 22px;
  }
}

.checkers-account__col {
  background: var(--pc-ui-card);
  border: 1px solid var(--pc-ui-border);
  border-radius: var(--pc-ui-radius);
  box-shadow: var(--pc-ui-shadow);
  padding: calc(var(--pc-ui-pad) + 2px);
}

.checkers-account__col h2 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.2;
}

.checkers-account__hint {
  margin: 0 0 14px;
  color: var(--pc-ui-muted);
  font-size: 14px;
  line-height: 1.45;
}

/* ---- Forms ---- */

.checkers-form {
  display: grid;
  gap: 12px;
}

.checkers-form p {
  margin: 0;
}

.checkers-form label {
  display: grid;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  color: var(--pc-ui-text);
}

.checkers-form input[type="text"],
.checkers-form input[type="email"],
.checkers-form input[type="password"] {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--pc-ui-border);
  border-radius: 12px;
  background: #fff;
  color: var(--pc-ui-text);
  outline: none;
}

.checkers-form input:focus {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.checkers-form button {
  appearance: none;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 700;
  cursor: pointer;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
}

.checkers-form button:hover {
  filter: brightness(1.03);
}

.checkers-form button:active {
  transform: translateY(1px);
}

.checkers-form .checkers-form__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.checkers-form .checkers-form__row .checkers-link {
  font-size: 13px;
  color: rgba(37, 99, 235, 0.95);
  text-decoration: none;
}

.checkers-form .checkers-form__row .checkers-link:hover {
  text-decoration: underline;
}

/* ---- Profile ---- */

.checkers-profile {
  background: var(--pc-ui-card);
  border: 1px solid var(--pc-ui-border);
  border-radius: var(--pc-ui-radius);
  box-shadow: var(--pc-ui-shadow);
  padding: calc(var(--pc-ui-pad) + 2px);
}

.checkers-profile__header {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.checkers-profile__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.checkers-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--pc-ui-border);
  background: var(--pc-ui-bg);
  font-weight: 700;
  font-size: 13px;
}

.checkers-badge__dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.85);
}

.checkers-profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 18px;
}

@media (min-width: 900px) {
  .checkers-profile-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.checkers-stat {
  border: 1px solid var(--pc-ui-border-2);
  border-radius: 14px;
  padding: 12px 12px;
  background: rgba(17, 24, 39, 0.015);
}

.checkers-stat__label {
  font-size: 12px;
  color: var(--pc-ui-muted);
  margin: 0 0 6px;
  line-height: 1.2;
}

.checkers-stat__value {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.checkers-profile__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.checkers-button {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  text-decoration: none;
  font-weight: 700;
}

.checkers-button.is-secondary {
  background: #fff;
  color: var(--pc-ui-text);
}

.checkers-button.is-primary {
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
}

/* ---- Leaderboard ---- */

.checkers-leaderboard {
  background: var(--pc-ui-card);
  border: 1px solid var(--pc-ui-border);
  border-radius: var(--pc-ui-radius);
  box-shadow: var(--pc-ui-shadow);
  padding: calc(var(--pc-ui-pad) + 2px);
}

.checkers-leaderboard__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.checkers-leaderboard__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.checkers-leaderboard__range {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.checkers-leaderboard__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid var(--pc-ui-border);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  color: var(--pc-ui-text);
  background: rgba(17, 24, 39, 0.02);
}

.checkers-leaderboard__tab:hover {
  background: rgba(17, 24, 39, 0.05);
}

.checkers-leaderboard__tab.is-active {
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  border-color: rgba(17, 24, 39, 0.92);
}

.checkers-leaderboard table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}

.checkers-leaderboard th,
.checkers-leaderboard td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--pc-ui-border-2);
  vertical-align: middle;
}

.checkers-leaderboard th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pc-ui-muted);
}

.checkers-leaderboard tbody tr:hover {
  background: rgba(17, 24, 39, 0.02);
}

.checkers-lb-rank {
  font-weight: 800;
  width: 60px;
}

.checkers-lb-name {
  font-weight: 700;
}

.checkers-lb-meta {
  color: var(--pc-ui-muted);
  font-size: 12px;
}

/* Responsive table: allow horizontal scroll on very narrow screens */
@media (max-width: 520px) {
  .checkers-leaderboard {
    padding: 14px;
  }
  .checkers-leaderboard__header {
    align-items: flex-start;
  }
  .checkers-leaderboard table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
