html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ===== Compact navbar ===== */
.navbar {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  min-height: auto;
}

.navbar .navbar-brand {
  font-size: 1rem;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

.navbar .navbar-brand .game-logo {
  height: 28px;
  width: auto;
}

.jr-nav-logo {
  height: 28px;
  width: auto;
}

.jr-page-logo {
  height: 56px;
  width: auto;
}

.navbar .nav-link {
  font-size: 0.875rem;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

/* ===== Badge / Achievement System ===== */
.badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 0;
}

.badge-wrapper {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: default;
}

/* The funnel shape: 4 center-aligned rectangles that get progressively smaller */
.funnel-shape {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.funnel-seg {
  border-radius: 3px;
  background: var(--badge-gradient);
  box-shadow: 2px 3px 3px var(--badge-shadow);
}

.funnel-seg:first-child { border-radius: 4px 4px 3px 3px; }
.funnel-seg:last-child  { border-radius: 3px 3px 4px 4px; }

.funnel-seg-1 { width: 100%; flex: 1; }
.funnel-seg-2 { width: 75%;  flex: 1; }
.funnel-seg-3 { width: 50%;  flex: 1; }
.funnel-seg-4 { width: 28%;  flex: 1; }

.badge-icon {
  position: relative;
  z-index: 2;
  color: white;
  font-size: 28px;
  text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.6);
  top: -5px;
}

/* Tier colours */
.badge-wrapper.gold {
  --badge-gradient: linear-gradient(135deg, #FBE18D 0%, #D4AF37 50%, #AA771C 100%);
  --badge-shadow: #AA771C;
}

.badge-wrapper.silver {
  --badge-gradient: linear-gradient(135deg, #E6E6E6 0%, #BDBDBD 50%, #8C8C8C 100%);
  --badge-shadow: #8C8C8C;
}

.badge-wrapper.bronze {
  --badge-gradient: linear-gradient(135deg, #F3A183 0%, #CD7F32 50%, #8A5A2B 100%);
  --badge-shadow: #8A5A2B;
}

.badge-wrapper.locked {
  --badge-gradient: #c0c0c0;
  --badge-shadow: #999;
}

.badge-wrapper.locked .funnel-shape {
  opacity: 0.35;
}

.badge-wrapper.locked .badge-icon {
  color: #aaa;
  text-shadow: none;
  opacity: 0.4;
}

/* Badge toast styling */
.badge-toast .toast-body .badge-wrapper {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.badge-toast .toast-body .badge-icon {
  font-size: 22px;
}

/* Profile badge grid */
.badge-grid-item {
  text-align: center;
  width: 100px;
}

.badge-grid-item .badge-name {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 4px;
  line-height: 1.2;
}

.badge-grid-item .badge-desc {
  font-size: 0.65rem;
  color: #6c757d;
  line-height: 1.2;
}

/* ===== Mode-switch button (navbar) ===== */
.btn-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.25rem 0.75rem;
  border: 2px solid #0d6efd;
  border-radius: 50rem;
  background: transparent;
  color: #0d6efd;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-mode-switch:hover,
.btn-mode-switch:focus {
  background: #0d6efd;
  color: #fff;
  text-decoration: none;
}

.btn-mode-switch-jr {
  border-color: #f59e0b;
  color: #92400e;
}

.btn-mode-switch-jr:hover,
.btn-mode-switch-jr:focus {
  background: #f59e0b;
  color: #fff;
}

.mode-switch-logo {
  height: 20px;
  width: auto;
}