/* ==========================================================================
   Nostalgia Forever — base styles
   Every colour is a custom property. Nothing is hardcoded, so the four
   theme combinations (horde/alliance × light/dark) all work from one sheet.
   ========================================================================== */

/* --- Theme palettes ------------------------------------------------------ */

[data-theme="horde-dark"] {
  --bg:            #12100f;
  --bg-raised:     #1b1817;
  --bg-inset:      #0c0a0a;
  --bg-hover:      #241f1e;
  --border:        #332c2a;
  --border-strong: #4a3f3c;
  --text:          #ece7e4;
  --text-dim:      #9b8f8a;
  --text-faint:    #6b615d;
  --accent:        #b32d2d;
  --accent-hover:  #cf3a3a;
  --accent-soft:   #3a1717;
  --on-accent:     #fff6f4;
  --shadow:        0 2px 12px rgba(0,0,0,.5);
}

[data-theme="horde-light"] {
  --bg:            #faf6f3;
  --bg-raised:     #ffffff;
  --bg-inset:      #f0e9e4;
  --bg-hover:      #f3ebe6;
  --border:        #e0d4cd;
  --border-strong: #c9b8af;
  --text:          #241b18;
  --text-dim:      #6d5c55;
  --text-faint:    #96837b;
  --accent:        #96201f;
  --accent-hover:  #7d1a19;
  --accent-soft:   #f7e6e4;
  --on-accent:     #fff6f4;
  --shadow:        0 2px 10px rgba(80,50,40,.12);
}

[data-theme="alliance-dark"] {
  --bg:            #0e1116;
  --bg-raised:     #171b23;
  --bg-inset:      #0a0d11;
  --bg-hover:      #1f242e;
  --border:        #2a3039;
  --border-strong: #3c4553;
  --text:          #e6eaf0;
  --text-dim:      #8e97a6;
  --text-faint:    #5e6675;
  --accent:        #2f6fc4;
  --accent-hover:  #3d84e0;
  --accent-soft:   #16263c;
  --on-accent:     #f2f7ff;
  --shadow:        0 2px 12px rgba(0,0,0,.5);
}

[data-theme="alliance-light"] {
  --bg:            #f5f8fc;
  --bg-raised:     #ffffff;
  --bg-inset:      #e9eff6;
  --bg-hover:      #eaf1f8;
  --border:        #d3dde8;
  --border-strong: #b2c1d2;
  --text:          #16202c;
  --text-dim:      #56657a;
  --text-faint:    #7d8b9e;
  --accent:        #1d5aa8;
  --accent-hover:  #174a8c;
  --accent-soft:   #e2ecf8;
  --on-accent:     #f2f7ff;
  --shadow:        0 2px 10px rgba(30,60,100,.12);
}

/* --- Constants across every theme ---------------------------------------- */

:root {
  --ok:      #3f9b54;
  --warn:    #c98a1e;
  --danger:  #c0392b;

  /* Class colours are game data, never decoration. Identical in all themes. */
  --class-warrior: #C79C6E;
  --class-paladin: #F58CBA;
  --class-hunter:  #ABD473;
  --class-rogue:   #FFF569;
  --class-priest:  #FFFFFF;
  --class-shaman:  #0070DE;
  --class-mage:    #69CCF0;
  --class-warlock: #9482C9;
  --class-druid:   #FF7D0A;

  --radius:    10px;
  --radius-sm: 6px;
  --tap:       44px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset --------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color .18s ease, color .18s ease;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Boot ---------------------------------------------------------------- */

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.boot-spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Layout -------------------------------------------------------------- */

.app { min-height: 100dvh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; flex-direction: column; line-height: 1.15; margin-right: auto; }
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--text-faint);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.main { flex: 1; width: 100%; max-width: 940px; margin: 0 auto; padding: 22px 16px 64px; }

.page-head { margin-bottom: 22px; }
.page-title { margin: 0 0 4px; font-size: 21px; font-weight: 640; letter-spacing: -.02em; }
.page-sub { margin: 0; color: var(--text-dim); font-size: 13.5px; }

/* --- Cards --------------------------------------------------------------- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card-title {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -.01em;
}
.card-sub { margin: 0 0 16px; font-size: 12.5px; color: var(--text-dim); }

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

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }

.label {
  display: block;
  margin-bottom: 5px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-dim);
}

.input, .select {
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-faint); }

.hint { margin-top: 5px; font-size: 12px; color: var(--text-faint); }

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 0 16px;
  background: var(--bg-inset);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 540;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-sm { min-height: 34px; padding: 0 11px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border); }

/* --- Segmented control --------------------------------------------------- */

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  gap: 3px;
}
.segmented button {
  min-height: 32px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 540;
  color: var(--text-dim);
  transition: background-color .15s ease, color .15s ease;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

/* --- Avatar -------------------------------------------------------------- */

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
  background: var(--bg-inset);
}
.avatar-lg { width: 60px; height: 60px; }

/* --- Sign-in ------------------------------------------------------------- */

.signin-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.signin {
  width: 100%;
  max-width: 400px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 34px 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.signin-mark {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.signin h1 {
  margin: 0 0 8px;
  font-size: 25px;
  font-weight: 660;
  letter-spacing: -.03em;
}
.signin p { margin: 0 0 26px; color: var(--text-dim); font-size: 14px; }

.btn-google {
  width: 100%;
  background: var(--bg-inset);
  border: 1px solid var(--border-strong);
}
.btn-google svg { width: 17px; height: 17px; flex: none; }

.signin-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-faint);
}

/* --- Clocks -------------------------------------------------------------- */

.clock-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.clock {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 14px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.clock strong { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.clock-zone {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
}
.clock-sub { font-size: 11.5px; color: var(--text-faint); }

@media (max-width: 480px) {
  .clock-pair { grid-template-columns: 1fr; }
}

/* --- Dual time, inline (raid rows etc.) ---------------------------------- */

.time-dual { display: inline-flex; align-items: baseline; gap: 7px; }
.time-dual .t-local { font-variant-numeric: tabular-nums; font-weight: 560; }
.time-dual .t-server {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-dim);
}

/* --- Misc ---------------------------------------------------------------- */

.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 4px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-dim); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banner {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
  border: 1px solid;
}
.banner-error  { background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: var(--danger); }
.banner-ok     { background: color-mix(in srgb, var(--ok) 12%, transparent);     border-color: var(--ok); }
.banner-info   { background: var(--accent-soft); border-color: var(--border-strong); }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  z-index: 60;
  animation: toast-in .2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Desktop-only gate --------------------------------------------------- */

.desktop-only-notice { display: none; }
@media (max-width: 1023px) {
  .desktop-only .desktop-only-body { display: none; }
  .desktop-only .desktop-only-notice { display: block; }
}

/* --- Mobile -------------------------------------------------------------- */

@media (max-width: 560px) {
  .main { padding: 16px 12px 56px; }
  .card { padding: 15px; }
  .brand-sub { display: none; }
  .signin { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
