/* Styles used only by the player profile page. */

.difficulty-stars {
  color: #f5b301;
  white-space: nowrap;
}

.score-value {
  display: block;
  font-weight: 700;
}

.score-adjustment {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
  white-space: nowrap;
}

.profile-tabs {
  margin: 16px auto 12px;
}

.badge-dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 24px;
}

.badge-level-title {
  margin: 20px 0 10px;
  color: #334155;
  font-size: 15px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.badge-card {
  padding: 13px 14px;
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.badge-card.complete {
  border-color: #86d6a6;
  background: #f0fdf4;
}

.badge-card.disabled {
  opacity: 0.65;
  background: #f8fafc;
}

.badge-card-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.badge-card-name {
  font-weight: 700;
}

.badge-card-count {
  color: #475569;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.badge-card-description {
  min-height: 32px;
  margin: 6px 0 9px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
}

.badge-progress {
  display: block;
  width: 100%;
  height: 8px;
}

.badge-progress-text {
  display: block;
  margin-top: 5px;
  color: #64748b;
  font-size: 11px;
  text-align: right;
}

.game-title-autocomplete {
  position: relative;
}

.hltb-suggestions {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: 290px;
  overflow-y: auto;
  padding: 5px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.hltb-suggestions[hidden] {
  display: none;
}

.request-form .hltb-suggestion {
  display: block;
  width: 100%;
  padding: 8px 9px;
  color: #1f2937;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.request-form .hltb-suggestion:hover,
.request-form .hltb-suggestion.active {
  background: #eff6ff;
}

.hltb-suggestion strong {
  display: block;
}

.hltb-suggestion strong {
  font-size: 13px;
  font-weight: 600;
}

.random-game-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0 14px;
  padding: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 9px;
}

.random-game-entry button,
.random-game-primary {
  padding: 8px 12px;
  color: #fff;
  background: var(--cm-accent);
  border: 1px solid var(--cm-accent);
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.random-game-entry small {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.random-game-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.random-game-modal {
  position: fixed;
  z-index: 1201;
  top: 50%;
  left: 50%;
  width: min(620px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  padding: 20px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.28);
  transform: translate(-50%, -50%);
}

.random-game-overlay[hidden],
.random-game-modal[hidden],
.random-game-offer[hidden],
.random-game-error[hidden],
.random-game-actions button[hidden] {
  display: none;
}

.random-game-modal-open {
  overflow: hidden;
}

.random-game-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.random-game-modal-header h3 {
  margin: 3px 0 0;
  color: #172033;
  font-size: 21px;
}

.random-game-eyebrow {
  margin: 0;
  color: var(--cm-accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.random-game-close {
  width: 34px;
  height: 34px;
  padding: 0;
  color: #475569;
  background: #f1f5f9;
  border: 0;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
}

.random-game-help {
  margin: 15px 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.random-game-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.random-game-filter-grid label {
  display: grid;
  gap: 5px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.random-game-filter-grid select {
  width: 100%;
  padding: 8px 9px;
  color: #1f2937;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
}

.random-game-primary:disabled,
.random-game-secondary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.random-game-offer {
  margin-top: 18px;
  padding: 18px;
  text-align: center;
  background: #f8fafc;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
}

.random-game-attempt {
  display: inline-block;
  padding: 4px 8px;
  color: #475569;
  background: #e2e8f0;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.random-game-offer h4 {
  margin: 13px 0 8px;
  color: #172033;
  font-size: 22px;
}

.random-game-conditions,
.random-game-rule {
  color: #64748b;
  font-size: 12px;
  line-height: 1.45;
}

.random-game-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.random-game-secondary {
  padding: 8px 12px;
  color: #334155;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.random-game-error {
  margin-top: 12px;
  padding: 9px 11px;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 12px;
}

.request-form.random-game-accepted #req_game_title,
.request-form.random-game-accepted #req_game_len_url,
.request-form.random-game-accepted #req_console_id,
.request-form.random-game-accepted #game_len_category {
  color: #334155;
  background: #f1f5f9;
}

@media (max-width: 540px) {
  .random-game-entry,
  .random-game-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .random-game-filter-grid {
    grid-template-columns: 1fr;
  }
}
