/* ============================================================
   Arctic Dashboard — Premium Frosty Redesign
   Dark arctic theme | ice-blue #74c0fc | glassy cards
   ============================================================ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --bg:            #06090f;
  --bg-mid:        #0d1420;
  --panel:         rgba(17, 24, 38, 0.72);
  --panel-solid:   #111826;
  --panel2:        rgba(29, 36, 52, 0.72);
  --panel2-solid:  #1d2434;
  --glass-edge:    rgba(116, 192, 252, 0.12);
  --glass-hover:   rgba(116, 192, 252, 0.22);
  --ice:           #74c0fc;
  --ice-dim:       rgba(116, 192, 252, 0.18);
  --ice-glow:      rgba(116, 192, 252, 0.30);
  --frost:         #a8d8f0;
  --text:          #e8eef7;
  --dim:           #7a93b0;
  --ok:            #57f287;
  --ok-dim:        rgba(87, 242, 135, 0.15);
  --err:           #ed4245;
  --err-dim:       rgba(237, 66, 69, 0.15);
  --warn:          #fee75c;
  --radius:        16px;
  --radius-sm:     10px;
  --radius-xs:      6px;
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-glow:    0 0 24px var(--ice-glow);
  --transition:     0.22s ease-out;
  --font-body:      "Inter", "Segoe UI", "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display:   "Outfit", "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --aurora-2:       rgba(177, 151, 252, 0.07);
}
/* ── Keyframes ─────────────────────────────────────────── */
@keyframes aurora {
  0%   { opacity: 1; transform: scale(1) translate(0, 0); }
  33%  { opacity: 0.8; transform: scale(1.08) translate(-2%, 1%); }
  66%  { opacity: 0.9; transform: scale(0.96) translate(1%, -1%); }
  100% { opacity: 1; transform: scale(1) translate(0, 0); }
}
@keyframes snowfall {
  0%   { transform: translateY(-8px) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes eq1 { 0%, 100% { height:  6px; } 50% { height: 18px; } }
@keyframes eq2 { 0%, 100% { height: 10px; } 50% { height: 22px; } }
@keyframes eq3 { 0%, 100% { height:  8px; } 50% { height: 14px; } }
@keyframes toast-in  { from { opacity: 0; transform: translateX(120%); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); }     to { opacity: 0; transform: translateX(120%); } }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* ── Base Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 400px at 75% -5%,  rgba(116, 192, 252, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 700px 350px at 20% 105%, rgba(168, 216, 240, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 500px 600px at 50%  50%, rgba(13, 20, 32, 0.9)   0%, transparent 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, h4, .stat, .tab, button { font-family: var(--font-display); }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 1200px 500px at 70% -10%, rgba(22, 32, 47, 0.8) 0%, transparent 65%),
    radial-gradient(ellipse 800px 420px at 15% 110%, var(--aurora-2) 0%, transparent 70%);
  animation: aurora 18s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.7) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.4) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.6) 1px, transparent 1px),
    radial-gradient(circle, rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 180px 180px, 260px 260px, 200px 200px, 310px 310px;
  background-position: 0 0, 80px 120px, 40px 60px, 150px 90px;
  animation: snowfall 40s linear infinite;
  opacity: 0.35;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-edge); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ice-dim); }
::selection { background: var(--ice-dim); color: var(--frost); }
:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; border-radius: var(--radius-xs); }
/* ── Utilities ─────────────────────────────────────────── */
.hidden       { display: none !important; }
.dim          { color: var(--dim); }
.error        { color: var(--err); }
.ok           { color: var(--ok); }
.center       { display: grid; place-items: center; min-height: 70vh; }
.center-text  { text-align: center; margin-top: 3rem; }
code {
  background: var(--panel2-solid);
  padding: 0.15em 0.45em;
  border-radius: var(--radius-xs);
  font-size: 0.9em;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.5rem;
  background: rgba(6, 9, 15, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-edge);
}
.brand-mark { font-size: 1.3rem; filter: drop-shadow(0 0 8px var(--ice-glow)); }
.topbar-brand { display: flex; align-items: center; gap: 0.6rem; }
.topbar-brand h1 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, var(--ice) 0%, var(--frost) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-brand .dim { -webkit-text-fill-color: var(--dim); }
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  display: inline-block;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.status-dot.online {
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
/* ── Cards (glassy) ────────────────────────────────────── */
.card {
  background: var(--panel);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover {
  border-color: var(--glass-hover);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(-2px);
}
.card-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 0.35rem;
}

/* ── Buttons ───────────────────────────────────────────── */
button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  transition: all var(--transition);
}
button:not(.tab):not(.guilds button) {
  background: linear-gradient(135deg, var(--ice) 0%, #58a8f5 100%);
  color: #06121f;
  box-shadow: 0 2px 12px var(--ice-glow);
}
button:not(.tab):not(.guilds button):hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--ice-glow);
}
button:not(.tab):not(.guilds button):active {
  transform: translateY(0);
  filter: brightness(0.96);
}
button.ghost {
  background: transparent !important;
  color: var(--dim) !important;
  border: 1px solid var(--glass-edge) !important;
  box-shadow: none !important;
  filter: none !important;
}
button.ghost:hover {
  background: var(--ice-dim) !important;
  color: var(--frost) !important;
  border-color: var(--ice-dim) !important;
}
/* ── Login ─────────────────────────────────────────────── */
.login {
  width: min(420px, 92vw);
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.login::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: radial-gradient(ellipse 300px 200px at 50% 40%, rgba(116, 192, 252, 0.15) 0%, transparent 70%);
  pointer-events: none;
  animation: aurora 10s ease-in-out infinite;
}
.login h2 {
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ice) 0%, var(--frost) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.1rem;
}

/* ── Login hero & feedback ─────────────────────────────── */
.login-logo {
  font-size: 3.2rem;
  text-align: center;
  filter: drop-shadow(0 0 18px var(--ice-glow));
  animation: float 4s ease-in-out infinite;
}
.login button[type="submit"] {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 700;
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-5px); }
  40%, 60% { transform: translateX(5px); }
}
.shake { animation: shake 0.5s ease-in-out; }

/* ── Inputs & Forms ────────────────────────────────────── */
input, select {
  background: rgba(29, 36, 52, 0.85);
  color: var(--text);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input::placeholder { color: var(--dim); }
input:focus, select:focus {
  outline: none;
  border-color: var(--ice);
  box-shadow: 0 0 0 3px var(--ice-glow);
}
.form-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.form-row input { flex: 1; min-width: 120px; }
.form-row input#prefix-input { max-width: 120px; }

/* ── App Layout ────────────────────────────────────────── */
#app-view {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Guild Sidebar ─────────────────────────────────────── */
.guild-side {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-self: start;
  position: sticky;
  top: calc(60px + 1.5rem);
  max-height: calc(100vh - 60px - 3rem);
}
.guilds {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}
.guilds button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  text-align: left;
  width: 100%;
  transition: all var(--transition);
}
.guilds button:hover { background: var(--panel2-solid); border-color: var(--glass-hover); }
.guilds button.active { background: var(--ice-dim); border-color: var(--ice); color: var(--frost); }
.guilds img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel2-solid);
  flex-shrink: 0;
}
.guilds .g-text { display: flex; flex-direction: column; min-width: 0; }
.guilds .g-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guilds .g-count { font-size: 0.72rem; color: var(--dim); font-weight: 500; }

/* ── Guild Panel ───────────────────────────────────────── */
#guild-panel { display: flex; flex-direction: column; gap: 1rem; }
.guild-head {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
.guild-head:hover { transform: none; border-color: transparent; }
.guild-head img {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--panel2-solid);
  flex-shrink: 0;
}
.guild-head h2 { font-size: 1.25rem; font-weight: 700; }

/* ── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  background: var(--panel2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  padding: 4px;
  width: fit-content;
  position: relative;
}
.tab {
  background: transparent;
  color: var(--dim);
  border-radius: 99px;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  box-shadow: none !important;
  filter: none !important;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.tab:hover { background: var(--ice-dim); color: var(--frost); }
.tab.active {
  background: var(--ice) !important;
  color: #06121f !important;
  font-weight: 700;
  box-shadow: 0 2px 12px var(--ice-glow) !important;
}
.tabpage { animation: fade-up 0.25s ease-out; }
.tab { position: relative; z-index: 1; }
.tab-glider {
  position: absolute;
  top: 4px;
  left: 0;
  width: 0;
  height: calc(100% - 8px);
  border-radius: 99px;
  background: linear-gradient(135deg, var(--ice) 0%, #58a8f5 100%);
  box-shadow: 0 2px 12px var(--ice-glow);
  opacity: 0;
  transition: left 0.3s cubic-bezier(0.34, 1.3, 0.64, 1), width 0.3s cubic-bezier(0.34, 1.3, 0.64, 1), top 0.3s ease, opacity 0.2s ease;
  pointer-events: none;
  z-index: 0;
}
.tabs.glider-on .tab-glider { opacity: 1; }
.tabs.glider-on .tab.active { background: transparent !important; box-shadow: none !important; }

/* ── Stats Grid ────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.stat {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--ice) 0%, var(--frost) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

/* ── Key-Value List ────────────────────────────────────── */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--glass-edge);
  gap: 1rem;
  font-size: 0.9rem;
}
.kv:last-child { border-bottom: 0; }
.kv-label { color: var(--dim); flex-shrink: 0; }
.kv-value { text-align: right; word-break: break-all; }

/* ── Tables ────────────────────────────────────────────── */
table { width: 100%; border-collapse: separate; border-spacing: 0 5px; }
th {
  text-align: left;
  padding: 0.5rem 0.85rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: var(--panel);
}
th:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
th:last-child  { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
td { padding: 0.75rem 0.85rem; background: var(--panel2-solid); font-size: 0.9rem; vertical-align: middle; }
tr:hover td:first-child { border-radius: var(--radius-xs) 0 0 var(--radius-xs); }
tr:hover td:last-child  { border-radius: 0 var(--radius-xs) var(--radius-xs) 0; }
tr:nth-child(even) td { background: rgba(29, 36, 52, 0.55); }
tr:nth-child(even):hover td { background: var(--panel2-solid); }
.table-hover tr:hover td { background: var(--ice-dim) !important; }

/* ── Pills ─────────────────────────────────────────────── */
.pill {
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}
.pill.a-ban, .pill.a-massban, .pill.a-softban { background: var(--err-dim); border-color: rgba(237, 66, 69, 0.35); color: var(--err); }
.pill.a-kick, .pill.a-warn { background: rgba(254, 231, 92, 0.12); border-color: rgba(254, 231, 92, 0.3); color: var(--warn); }
.pill.a-timeout, .pill.a-mute { background: var(--ice-dim); border-color: var(--glass-hover); color: var(--ice); }
.pill.a-unban, .pill.a-untimeout { background: var(--ok-dim); border-color: rgba(87, 242, 135, 0.3); color: var(--ok); }

/* ── Now Playing (Music) ───────────────────────────────── */
.np { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.np img {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--panel2-solid);
  flex-shrink: 0;
}
.np-meta { flex: 1; min-width: 200px; }
.np-meta h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.eq { display: flex; align-items: flex-end; gap: 3px; height: 24px; }
.eq span {
  display: block;
  width: 4px;
  border-radius: 2px;
  background: var(--ice);
  box-shadow: 0 0 6px var(--ice-glow);
}
.eq span:nth-child(1) { animation: eq1 0.7s ease-in-out infinite; }
.eq span:nth-child(2) { animation: eq2 0.55s ease-in-out infinite 0.15s; }
.eq span:nth-child(3) { animation: eq3 0.65s ease-in-out infinite 0.3s; }

.np { position: relative; overflow: hidden; }
.np-art {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) saturate(140%);
  opacity: 0.25;
  pointer-events: none;
}
.np > *:not(.np-art) { position: relative; z-index: 1; }

/* ── Loading Skeletons ─────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--panel2-solid) 25%, rgba(40, 52, 70, 0.8) 50%, var(--panel2-solid) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--radius-xs);
}
.sk-stat  { height: 3.5rem; border-radius: var(--radius-sm); }
.sk-line  { height: 1rem; margin: 0.4rem 0; }
.sk-wid90 { width: 90%; }
.sk-wid60 { width: 60%; }
.sk-row   { height: 2.6rem; margin: 4px 0; border-radius: var(--radius-xs); }

/* ── Toast Notifications ──────────────────────────────── */
#toasts {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 240px;
  max-width: 360px;
  box-shadow: var(--shadow-card);
  pointer-events: auto;
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.ok  { border-left: 3px solid var(--ok); }
.toast.err { border-left: 3px solid var(--err); }
.toast.inf { border-left: 3px solid var(--ice); }
.toast.leaving { animation: toast-out 0.25s ease-in forwards; }

/* ── Empty / Error States ──────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 1rem;
  color: var(--dim);
  text-align: center;
  animation: float 3s ease-in-out infinite;
}
.empty-icon { font-size: 3rem; display: block; }
.error-state {
  background: var(--err-dim);
  border-color: rgba(237, 66, 69, 0.25);
  color: var(--err);
  text-align: center;
  padding: 2rem;
}
.error-state:hover { border-color: rgba(237, 66, 69, 0.4); }

/* ── Live Poll Timestamp ───────────────────────────────── */
.live-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.6rem;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 6px var(--ok);
  animation: pulse-dot 1.5s ease-in-out infinite;
  display: inline-block;
}
.live-label { font-size: 0.75rem; color: var(--dim); }

/* ── Toggle Switches ───────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--glass-edge);
}
.toggle-row:last-child { border-bottom: 0; }
.t-label { font-size: 0.9rem; }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.switch .track {
  position: absolute;
  inset: 0;
  background: var(--panel2-solid);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  transition: all var(--transition);
  pointer-events: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--dim);
  transition: all var(--transition);
}
.switch input:checked + .track { background: var(--ice-dim); border-color: var(--ice); box-shadow: 0 0 10px var(--ice-glow); }
.switch input:checked + .track::after { left: 22px; background: var(--ice); box-shadow: 0 0 8px var(--ice-glow); }
.switch input:focus-visible + .track { outline: 2px solid var(--ice); outline-offset: 2px; }
.switch.loading { opacity: 0.5; pointer-events: none; }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
  #app-view { grid-template-columns: 1fr; padding: 1rem; }
  .guild-side { position: static; max-height: none; }
  .guilds {
    position: static;
    max-height: none;
    overflow-y: visible;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .guilds button { width: auto; padding: 0.5rem 0.85rem; }
  .topbar { padding: 0.75rem 1rem; }
}
@media (max-width: 600px) {
  body { font-size: 14px; }
  .topbar h1 { font-size: 1rem; }
  .tabs { width: 100%; }
  .tab { padding: 0.45rem 0.85rem; font-size: 0.8rem; }
  .grid { grid-template-columns: 1fr 1fr; }
  .stat { font-size: 1.5rem; }
  .np img { width: 60px; height: 60px; }
  .card { padding: 1rem; }
}

/* ── Reduced Motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  body::after { display: none; }
}


/* ── v1.8: Discord OAuth login ── */
.login-divider { display: flex; align-items: center; gap: .75rem; color: var(--dim, #7a93b0); font-size: .8rem; margin: .25rem 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: rgba(116, 192, 252, .12); }
.discord-btn { display: block; text-align: center; background: #5865f2; color: #fff; font-weight: 700; border-radius: 10px; padding: .65rem 1rem; text-decoration: none; transition: filter .15s, transform .15s; }
.discord-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.topbar-user { display: flex; align-items: center; gap: .75rem; }
.user-chip { background: rgba(29, 36, 52, .72); border: 1px solid rgba(116, 192, 252, .12); border-radius: 99px; padding: .3rem .8rem; font-size: .85rem; color: var(--frost, #a8d8f0); }

/* ============================================================
   v2 "Aurora" polish — layered last so it wins ties
   ============================================================ */

/* Richer three-band aurora sky, slow drift */
body::before {
  background:
    radial-gradient(ellipse 1100px 480px at 75% -10%, rgba(116, 192, 252, 0.14) 0%, transparent 60%),
    radial-gradient(ellipse 900px 420px at 10% 110%, rgba(177, 151, 252, 0.10) 0%, transparent 65%),
    radial-gradient(ellipse 700px 380px at 45% 115%, rgba(87, 242, 199, 0.06) 0%, transparent 60%);
}

/* Login: rotating conic ice-ring around the card (graceful: static where unsupported) */
@property --ring { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes ring-spin { to { --ring: 360deg; } }
.login::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius) + 2px);
  padding: 2px;
  background: conic-gradient(from var(--ring), transparent 0%, rgba(116, 192, 252, 0.55) 12%, transparent 30%, transparent 60%, rgba(177, 151, 252, 0.35) 75%, transparent 90%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: ring-spin 6s linear infinite;
  pointer-events: none;
}

/* Cards: deeper float on hover */
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45), 0 0 26px rgba(116, 192, 252, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Guild rows: active gets a glowing ice edge */
.guilds button { border-left: 3px solid transparent; }
.guilds button.active {
  border-left-color: var(--ice);
  box-shadow: 0 0 18px rgba(116, 192, 252, 0.16);
}

/* Tab glider breathes */
@keyframes glider-pulse {
  0%, 100% { box-shadow: 0 2px 12px var(--ice-glow); }
  50% { box-shadow: 0 2px 22px rgba(116, 192, 252, 0.5); }
}
.tabs.glider-on .tab-glider { animation: glider-pulse 3s ease-in-out infinite; }

/* Buttons: sheen sweep on hover */
button:not(.tab):not(.guilds button), .discord-btn { position: relative; overflow: hidden; }
button:not(.tab):not(.guilds button)::after, .discord-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
  pointer-events: none;
}
button:not(.tab):not(.guilds button):hover::after, .discord-btn:hover::after { left: 130%; }

/* Topbar: aurora hairline instead of flat border */
.topbar { border-bottom: 0; }
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(116, 192, 252, 0.5), rgba(177, 151, 252, 0.35), transparent);
}

/* Stats: gradient text shimmers slowly */
@keyframes stat-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.stat { background-size: 200% 200%; animation: stat-shimmer 6s ease-in-out infinite; }

/* Table rows ease their hover */
td { transition: background var(--transition); }

/* ── Command Browser ─────────────────────────────────────── */
#commands-view { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 1rem; animation: fade-up 0.25s ease-out; }
.cmd-browser { position: sticky; top: calc(60px + 1rem); z-index: 5; }
.cmd-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
#cmd-chips .cmd-chip {
  background: var(--panel2-solid);
  color: var(--dim);
  border: 1px solid var(--glass-edge);
  border-radius: 99px;
  padding: 0.3rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: none;
}
#cmd-chips .cmd-chip:hover { color: var(--frost); border-color: var(--glass-hover); }
#cmd-chips .cmd-chip.active { background: var(--ice-dim); color: var(--ice); border-color: var(--ice); }
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.cmd-card { padding: 1rem 1.1rem; }
.cmd-name { font-family: var(--font-display); font-weight: 700; color: var(--frost); }
.cmd-cat {
  display: inline-block;
  margin-top: 0.3rem;
  background: var(--ice-dim);
  border: 1px solid var(--glass-edge);
  color: var(--ice);
  border-radius: 99px;
  padding: 0.1rem 0.6rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cmd-desc { color: var(--dim); font-size: 0.85rem; margin-top: 0.45rem; }
.cmd-opts { margin-top: 0.4rem; font-size: 0.74rem; color: var(--dim); }
#commands-btn.active { color: var(--frost) !important; background: var(--ice-dim) !important; border-color: var(--ice) !important; }
@media (max-width: 600px) { .cmd-grid { grid-template-columns: 1fr; } }

/* ── Command Browser toggles ──────────────────────────────── */
.cmd-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.cmd-card.cmd-disabled { opacity: 0.5; }
.cmd-card .switch { transform: scale(0.8); }
#cmd-chips .cmd-chip[style*="ok"] { border-color: rgba(87,242,135,.3); }
#cmd-chips .cmd-chip[style*="err"] { border-color: rgba(237,66,69,.3); }
