/* L2 Pearl — Dashboard styles */

/* Every .input-wrap / .form-label / .form-hint on this page sits on a
   navy card (panel-card, package-card, or a modal) — register.css styles
   them for a light page (near-transparent fill, dark text), which goes
   invisible here. This page never has a light-background form, so
   override once for the whole dashboard instead of re-declaring the same
   on-dark treatment per section (that missed the Settings password form
   entirely, which is how it ended up unreadable too). */
.form-label,
.form-hint {
  color: var(--text-on-dark-2);
}
.input-wrap {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}
.input-wrap:focus-within {
  background: rgba(255, 255, 255, 0.1);
}
.input-wrap input,
.input-wrap select {
  color: var(--text-on-dark);
}
.input-wrap input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}
.input-wrap select option {
  background: #143055;
  color: var(--text-on-dark);
}
.form-error {
  color: #fca5a5;
}

.dashboard-sidebar {
  position: sticky;
  top: 100px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.sidebar-status {
  width: 100%;
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.95), rgba(12, 34, 66, 0.95));
  border: 1px solid rgba(184, 144, 46, 0.22);
  padding: 0.9rem 1rem;
}

.sidebar-status-title {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d9b968;
  margin: 0 0 0.75rem;
}

.sidebar-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
}

.dashboard-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.95), rgba(12, 34, 66, 0.95));
  border: 1px solid rgba(184, 144, 46, 0.22);
  padding: 0.75rem;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: #b6b0c9;
  padding: 0.75rem 1rem;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.tab-btn:hover {
  color: #d9b968;
  background: rgba(255, 255, 255, 0.08);
}
.tab-btn.active {
  color: #f2eef7;
  background: linear-gradient(90deg, rgba(156, 122, 36, 0.25), rgba(156, 122, 36, 0.05));
  border-color: rgba(184, 144, 46, 0.3);
}
.tab-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

@media (max-width: 1023px) {
  .dashboard-sidebar {
    position: static;
  }
  .dashboard-nav {
    flex-direction: row;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    /* Fade the right edge so a phone screen — which never fits all 5
       tabs — visibly hints "more to scroll" instead of hard-cutting
       the last button, which used to read as "this is the only tab". */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
  }
}

/* Labels were hidden below 640px, leaving a row of unlabeled icons on
   phones with no indication other tabs existed. Keep them everywhere;
   just tighten the button on narrow screens so more of the row shows
   at once. */
@media (max-width: 639px) {
  .tab-btn {
    padding: 0.65rem 0.75rem;
    font-size: 0.72rem;
    gap: 0.55rem;
  }
}

/* Tab panel */
.tab-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.tab-panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Panel card (generic) */
.panel-card {
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.92), rgba(12, 34, 66, 0.92));
  border: 1px solid rgba(184, 144, 46, 0.22);
  padding: 1.5rem;
  position: relative;
}
.panel-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #d9b968, transparent);
  opacity: 0.5;
}

/* Stat card */
.stat-card {
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.92), rgba(12, 34, 66, 0.92));
  border: 1px solid rgba(184, 144, 46, 0.2);
  padding: 1.5rem;
  position: relative;
}
.stat-card::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px;
  width: 12px; height: 12px;
  border-top: 1px solid #d9b968;
  border-right: 1px solid #d9b968;
  opacity: 0.5;
}
.stat-label {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b6b0c9;
  margin-bottom: 0.5rem;
}
.stat-value {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}
.stat-sub {
  font-size: 0.75rem;
  color: #b6b0c9;
  margin-top: 0.5rem;
}

/* Quick action button */
.quick-action {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.92), rgba(12, 34, 66, 0.92));
  border: 1px solid rgba(184, 144, 46, 0.26);
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.quick-action:hover {
  border-color: rgba(184, 144, 46, 0.45);
  transform: translateY(-2px);
}

/* Game-account card */
.account-card {
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.92), rgba(12, 34, 66, 0.92));
  border: 1px solid rgba(184, 144, 46, 0.22);
  padding: 1.25rem 1.5rem;
  position: relative;
}
.account-card .login {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: #f2eef7;
  letter-spacing: 0.05em;
  word-break: break-all;
}
.account-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: #b6b0c9;
}
.account-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}
.btn-link {
  background: transparent;
  border: 1px solid rgba(184, 144, 46, 0.3);
  color: #d9b968;
  padding: 0.5rem 0.875rem;
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #d9b968;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid;
}
.badge.ok      { color: #6ee7b7; border-color: rgba(34,197,94,0.5); background: rgba(34,197,94,0.1); }
.badge.warn    { color: #fbbf24; border-color: rgba(234,179,8,0.5); background: rgba(234,179,8,0.1); }
.badge.error   { color: #fca5a5; border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.1); }
.badge.server  { color: #d9b968; border-color: rgba(184,144,46,0.5); background: rgba(184,144,46,0.12); }

/* Donation packages */
.package-card {
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.95), rgba(12, 34, 66, 0.95));
  border: 1px solid rgba(184, 144, 46, 0.22);
  padding: 1.75rem 1.5rem;
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.package-card:hover {
  border-color: rgba(201, 162, 39, 0.6);
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -20px rgba(201, 162, 39, 0.4);
}
.package-card.featured {
  border-color: rgba(201, 162, 39, 0.6);
  box-shadow: 0 0 30px rgba(201, 162, 39, 0.25);
}
.package-card.featured::before {
  content: "Best Value";
  position: absolute;
  top: -10px;
  right: 1rem;
  background: linear-gradient(90deg, #9c7a24, #c9a227);
  color: white;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 10px;
}
.package-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #d9b968;
  margin-bottom: 0.5rem;
}
.package-price {
  font-family: 'Cinzel', serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #f2eef7;
  line-height: 1;
  margin-bottom: 0.25rem;
}
.package-price .currency {
  font-size: 1rem;
  color: #b6b0c9;
  margin-right: 0.25rem;
}
.package-coins {
  color: #c9a227;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.package-bonus {
  font-size: 0.75rem;
  color: #6ee7b7;
  margin-bottom: 1.25rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.package-card .register-submit {
  width: 100%;
  padding: 0.75rem 1rem;
}

/* Custom-amount card lives in the same grid as the fixed packages; its
   input/label/error colors come from the page-wide on-dark rules above. */
.custom-amount-hint {
  font-size: 0.8rem;
  color: #b6b0c9;
  margin-bottom: 1rem;
}
.custom-amount-card .input-wrap {
  margin-bottom: 0.5rem;
}
.custom-amount-card .form-error {
  min-height: 1.2em;
  margin-bottom: 0.5rem;
}

/* History table */
.history-table {
  width: 100%;
  text-align: left;
  font-size: 0.875rem;
}
.history-table th {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #b6b0c9;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid rgba(184, 144, 46, 0.22);
}
.history-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #d9b968;
}
.history-table tr:last-child td { border-bottom: 0; }

/* Modal
   Note: styles.css defines a homepage download .modal (display:none overlay).
   Dashboard modals use .modal-backdrop > .modal as the dialog panel — scope
   these rules so the homepage styles cannot hide the form. */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 12, 32, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.hidden { display: none; }

.modal-backdrop > .modal {
  display: block;
  position: relative;
  inset: auto;
  z-index: 1;
  align-items: initial;
  justify-content: initial;
  background: linear-gradient(180deg, rgba(28, 62, 104, 0.97), rgba(12, 34, 66, 0.97));
  border: 1px solid rgba(184, 144, 46, 0.3);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 30px 60px -20px rgba(156, 122, 36, 0.5);
}
.modal-backdrop > .modal::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #d9b968, transparent);
}
.modal-backdrop .modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: transparent;
  border: 0;
  color: #b6b0c9;
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}
.modal-backdrop .modal-close:hover { color: #d9b968; }

[data-message].success {
  display: block !important;
  color: #6ee7b7;
  padding: 0.75rem 1rem;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.4);
}
[data-message].error {
  display: block !important;
  color: #fca5a5;
  padding: 0.75rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.4);
}
[data-message].info {
  display: block !important;
  color: #d9b968;
  padding: 0.75rem 1rem;
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.4);
}

/* Welcome bundle banner — early-bird coin bonus above the package grid */
.early-bird {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(120deg, rgba(156, 122, 36, 0.45), rgba(12, 34, 66, 0.95) 60%);
  border: 1px solid rgba(201, 162, 39, 0.55);
  box-shadow: 0 0 30px rgba(201, 162, 39, 0.18);
}
.early-bird-badge {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 0.6rem 0.75rem;
  background: linear-gradient(90deg, #9c7a24, #c9a227);
  color: #fff;
  font-family: 'Cinzel', serif;
  line-height: 1.1;
}
.early-bird-badge span {
  font-size: 1.5rem;
  font-weight: 700;
}
.early-bird-badge small {
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.85;
}
.early-bird-body h3 {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d9b968;
  font-size: 0.95rem;
  margin-bottom: 0.35rem;
}
.early-bird-body p {
  color: #b6b0c9;
  font-size: 0.875rem;
}
.early-bird-note {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #c9a227;
}
@media (max-width: 640px) {
  .early-bird { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* text-pearllite / text-pearl / text-ash (from the Tailwind config in
   dashboard.html) default to dark, for headers and nav sitting on the
   light page. Everything inside a navy card needs the light versions
   instead — override by context rather than globally. */
.panel-card .text-pearllite,
.stat-card .text-pearllite,
.account-card .text-pearllite,
.quick-action .text-pearllite,
.package-card .text-pearllite,
.sidebar-status .text-pearllite,
.modal-backdrop .modal .text-pearllite {
  color: #f2eef7;
}
.panel-card .text-pearl,
.stat-card .text-pearl,
.account-card .text-pearl,
.quick-action .text-pearl,
.package-card .text-pearl,
.sidebar-status .text-pearl,
.modal-backdrop .modal .text-pearl {
  color: #d9b968;
}
.panel-card .text-ash,
.stat-card .text-ash,
.account-card .text-ash,
.quick-action .text-ash,
.package-card .text-ash,
.sidebar-status .text-ash,
.modal-backdrop .modal .text-ash {
  color: #b6b0c9;
}

/* Forge Account / Change Password modals reuse register.css's form
   styles; colors come from the page-wide on-dark rules at the top of this
   file. Only the icon tint is modal-specific. */
.modal-backdrop .modal .input-icon {
  color: var(--text-on-dark-muted);
}
