/* ==============================================================
   Number Guess Battle — Home / Range Selection Page
   Same dark theme tokens as Photographic Memory for visual
   consistency across SagaxIQ games.
   ============================================================== */

:root {
  --ngh-bg: #111111;
  --ngh-card: #1f1f1f;
  --ngh-card-raised: #262626;
  --ngh-highlight: #58dbe8;
  --ngh-text: #f2f2f2;
  --ngh-text-muted: #9a9a9a;
  --ngh-border: #2c2c2c;
}

.ngh-root {
  position: relative;
  min-height: 100vh;
  background: var(--ngh-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  overflow: hidden;
  font-family: "Segoe UI", Roboto, sans-serif;
  color: var(--ngh-text);
}

/* ---------------- Ambient background digits ---------------- */

.ngh-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.ngh-floating-digit {
  position: absolute;
  font-weight: 800;
  font-size: 34px;
  color: rgba(88, 219, 232, 0.07);
  animation: ngh-float 9s ease-in-out infinite;
}

.d1 { top: 10%; left: 8%;  font-size: 48px; animation-delay: 0s; }
.d2 { top: 66%; left: 6%;  font-size: 26px; animation-delay: 1.4s; }
.d3 { top: 20%; left: 88%; font-size: 30px; animation-delay: 2.6s; }
.d4 { top: 76%; left: 90%; font-size: 40px; animation-delay: 0.8s; }
.d5 { top: 46%; left: 3%;  font-size: 20px; animation-delay: 3.4s; }
.d6 { top: 84%; left: 46%; font-size: 22px; animation-delay: 2s; }

@keyframes ngh-float {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.5; }
  50%      { transform: translateY(-18px) rotate(6deg); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .ngh-floating-digit { animation: none; }
}

/* ---------------- Card ---------------- */

.ngh-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  background: var(--ngh-card);
  border: 1px solid var(--ngh-border);
  border-radius: 22px;
  padding: 40px 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.ngh-header {
  text-align: center;
  margin-bottom: 30px;
}

.ngh-title {
  font-size: 27px;
  font-weight: 800;
  margin-bottom: 10px;
}

.ngh-title-icon {
  display: inline-block;
  filter: drop-shadow(0 0 10px rgba(88, 219, 232, 0.5));
}

.ngh-subtitle {
  color: var(--ngh-text-muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
}

/* ---------------- Range selector ---------------- */

.ngh-range-section {
  margin-bottom: 30px;
}

.ngh-section-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ngh-text-muted);
  margin-bottom: 12px;
  text-align: center;
}

.ngh-range-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ngh-range-btn:last-child {
  grid-column: 1 / -1;
}

.ngh-range-btn {
  background: #262626;
  border: 1.5px solid var(--ngh-border);
  border-radius: 14px;
  padding: 14px 8px;
  color: var(--ngh-text);
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.15s ease, background-color 0.18s ease;
}

.ngh-range-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(88, 219, 232, 0.4);
}

.ngh-range-btn.active {
  border-color: var(--ngh-highlight);
  background: rgba(88, 219, 232, 0.1);
  animation: ngh-range-pulse 0.5s ease;
}

@keyframes ngh-range-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(88, 219, 232, 0.5); }
  100% { box-shadow: 0 0 0 10px rgba(88, 219, 232, 0); }
}

.ngh-range-name {
  font-weight: 700;
  font-size: 14px;
}

.ngh-range-btn.active .ngh-range-name {
  color: var(--ngh-highlight);
}

/* ---------------- Mode buttons ---------------- */

.ngh-mode-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ngh-mode-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: var(--ngh-card-raised);
  border: 1.5px solid var(--ngh-border);
  border-radius: 16px;
  padding: 14px 18px;
  color: var(--ngh-text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.18s ease, box-shadow 0.2s ease;
}

.ngh-mode-btn:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.ngh-mode-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.ngh-mode-solo:hover  { border-color: rgba(88, 219, 232, 0.5); }

.ngh-mode-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #1c1c1c;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ngh-mode-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.ngh-mode-text strong {
  font-size: 15.5px;
}

.ngh-mode-text small {
  color: var(--ngh-text-muted);
  font-size: 12.5px;
}

.ngh-mode-arrow {
  color: var(--ngh-text-muted);
  font-size: 18px;
  transition: transform 0.15s ease;
}

.ngh-mode-btn:hover .ngh-mode-arrow {
  transform: translateX(4px);
  color: var(--ngh-highlight);
}

.ngh-mode-badge {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ngh-text-muted);
  background: #1c1c1c;
  border-radius: 20px;
  padding: 4px 10px;
  flex-shrink: 0;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 480px) {
  .ngh-card { padding: 30px 20px; border-radius: 18px; }
  .ngh-title { font-size: 22px; }
  .ngh-range-name { font-size: 12.5px; }
  .ngh-mode-icon { width: 36px; height: 36px; font-size: 20px; }
  .ngh-mode-text strong { font-size: 14px; }
}

/* ==============================================================
   APPEND THIS TO: static/iqgames/css/number_guess_home.css
   (Invite/Join modal styles — the buttons are no longer disabled
   now that the multiplayer backend exists, so the old
   .ngh-mode-btn:disabled / .ngh-mode-badge rules can stay in the
   file unused or be removed — they just won't match anything.)
   ============================================================== */

.ngh-hidden {
  display: none !important;
}

/* ---------------- Modals ---------------- */

.ngh-modal-content {
  background: var(--ngh-card);
  border: 1px solid var(--ngh-border);
  border-radius: 18px;
  color: var(--ngh-text);
}

.ngh-modal-header {
  border-bottom: 1px solid var(--ngh-border);
}

.ngh-modal-sub {
  color: var(--ngh-text-muted);
  font-size: 13px;
  margin-bottom: 18px;
}

.ngh-modal-range {
  color: var(--ngh-highlight);
  font-weight: 700;
}

.ngh-modal-text {
  font-size: 14px;
  color: var(--ngh-text-muted);
  margin-bottom: 20px;
}

.ngh-btn-round {
  border-radius: 30px;
  padding: 9px 28px;
  font-weight: 600;
}

/* Room code display */

.ngh-room-code {
  display: block;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ngh-highlight);
  background: #161616;
  border: 1px dashed rgba(88, 219, 232, 0.4);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

.ngh-copy-btn-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.ngh-waiting-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ngh-text-muted);
  font-size: 13.5px;
}

.ngh-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(88, 219, 232, 0.25);
  border-top-color: var(--ngh-highlight);
  border-radius: 50%;
  animation: ngh-spin 0.8s linear infinite;
}

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

/* Join code input */

.ngh-code-input {
  width: 100%;
  background: #161616;
  border: 1.5px solid var(--ngh-border);
  border-radius: 12px;
  padding: 14px;
  color: var(--ngh-text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  text-transform: uppercase;
  margin-bottom: 10px;
  outline: none;
  transition: border-color 0.15s ease;
}

.ngh-code-input:focus {
  border-color: var(--ngh-highlight);
}

.ngh-join-error {
  color: var(--ngh-hard, #ff5c5c);
  font-size: 12.5px;
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .ngh-room-code { font-size: 26px; }
}
