/* UI-kit-local styles. Inherits design tokens from ../../colors_and_type.css */

:root {
  --kit-bg: var(--canvas-paper);
  --kit-card: #FFFFFF;
  --kit-border: var(--border-subtle-light);
  --kit-shadow: var(--shadow-card);
  --kit-accent: #3B82F6; /* app-primary accent (deck shows blue progress rings) */
  --kit-ink: var(--fg-ink);
  --kit-ink-2: var(--fg-ink-2);
  --kit-ink-3: var(--fg-ink-3);
}

html, body, #root { margin: 0; height: 100%; }
body {
  background: #E9EEF4;
  font-family: var(--font-body);
  color: var(--kit-ink);
  -webkit-font-smoothing: antialiased;
}

.app-stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background: radial-gradient(ellipse 1000px 600px at 50% 0%, #F4F7FB 0%, #E9EEF4 80%);
}

/* iPhone-ish frame for the mobile demo */
.phone {
  width: 390px;
  height: 780px;
  background: var(--kit-bg);
  border-radius: 42px;
  box-shadow:
    0 0 0 10px #0B1120,
    0 0 0 11px #1E293B,
    0 24px 80px rgba(15, 23, 42, 0.25),
    0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.phone .notch {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 28px;
  background: #0B1120;
  border-radius: 999px;
  z-index: 10;
}
.phone .status {
  height: 44px;
  padding: 14px 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--kit-ink);
}

.screen {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 90px;
  background: var(--kit-bg);
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px 14px;
  gap: 12px;
}
.app-header .brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-header .mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: #EFF1FD;
  display: grid;
  place-items: center;
}
.app-header .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--kit-ink);
}
.app-header .icons { display: flex; align-items: center; gap: 10px; }
.app-header .icons button {
  background: transparent;
  border: 0;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--kit-ink-2);
}
.app-header .icons button:hover { background: #F1F3F7; }
.app-header .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: #DDE6F7;
  color: var(--kit-accent);
  font-weight: 700;
  font-size: 14px;
  display: grid; place-items: center;
  position: relative;
}
.app-header .avatar .badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--kit-accent);
  color: #fff;
  font-size: 11px;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--kit-bg);
}

/* Cards */
.card {
  background: var(--kit-card);
  border: 1px solid var(--kit-border);
  border-radius: 14px;
  box-shadow: var(--kit-shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Level banner */
.level-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--kit-card);
  border: 1px solid var(--kit-border);
  border-radius: 14px;
  box-shadow: var(--kit-shadow);
  margin-bottom: 14px;
}
.level-banner .ring {
  width: 68px; height: 68px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--kit-accent) 0 60%, #E4EBF5 60% 100%);
  padding: 3px;
  flex-shrink: 0;
}
.level-banner .ring-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: var(--kit-card);
  display: grid; place-items: center;
  overflow: hidden;
}
.level-banner .ring-inner img { width: 100%; height: 100%; object-fit: cover; }
.level-banner .meta { flex: 1; min-width: 0; }
.level-banner .name-row {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.level-banner .lvl-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  color: var(--kit-accent);
  background: #EAF1FD;
  padding: 3px 8px;
  border-radius: 999px;
}
.level-banner .xp-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 6px;
  font-size: 11px; color: var(--kit-ink-3);
  font-family: var(--font-mono);
}
.level-banner .bar {
  margin-top: 6px;
  height: 6px; border-radius: 999px;
  background: #EEF2F7;
  overflow: hidden;
}
.level-banner .bar > i {
  display: block; height: 100%;
  background: var(--kit-accent);
  border-radius: 999px;
}
.rookie-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  background: #EAF1FD;
  color: var(--kit-accent);
}

/* Domain list */
.dom-list { width: 100%; border-collapse: collapse; }
.dom-list thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--kit-ink-3);
  padding: 6px 0 10px;
  border-bottom: 1px solid var(--kit-border);
  letter-spacing: 0.04em;
}
.dom-list tbody td {
  padding: 12px 0;
  border-bottom: 1px solid var(--kit-border);
  font-size: 14px;
  vertical-align: middle;
}
.dom-list tbody tr:last-child td { border-bottom: 0; }
.dom-list .d-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dom-list .d-prog {
  width: 100%;
  min-width: 70px;
  display: flex; align-items: center; gap: 8px;
}
.dom-list .d-prog .bar {
  flex: 1;
  height: 6px; border-radius: 999px;
  background: #EEF2F7;
  overflow: hidden;
}
.dom-list .d-prog .bar > i { display: block; height: 100%; border-radius: 999px; }
.dom-list .d-prog .pct { font-family: var(--font-mono); font-size: 11px; color: var(--kit-ink-3); width: 36px; text-align: right; }

/* Quests */
.quest {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px;
  background: var(--kit-card);
  border: 1px solid var(--kit-border);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 160ms var(--ease-out-soft), box-shadow 160ms var(--ease-out-soft);
}
.quest:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.quest.done { opacity: 0.55; }
.quest .q-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1.5px solid #CBD5E1;
  flex-shrink: 0;
  margin-top: 2px;
  display: grid; place-items: center;
}
.quest.done .q-check { background: var(--kit-accent); border-color: var(--kit-accent); color: #fff; }
.quest .q-body { flex: 1; min-width: 0; }
.quest .q-title { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.quest .q-meta { font-size: 12px; color: var(--kit-ink-3); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.quest .q-meta .chip {
  display: inline-flex; gap: 5px; align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #F1F3F7;
  font-weight: 600;
  font-size: 11px;
  color: var(--kit-ink-2);
}
.quest .q-meta .chip .dot { width: 6px; height: 6px; border-radius: 50%; }
.quest .q-reward {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6B10B0;
  font-weight: 700;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(163,46,237,0.12), rgba(249,145,78,0.14));
}

/* Bottom nav */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px) saturate(1.1);
  border-top: 1px solid var(--kit-border);
  padding: 10px 8px 18px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  z-index: 20;
}
.bottom-nav button {
  background: transparent;
  border: 0;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  color: var(--kit-ink-3);
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.bottom-nav button.active {
  color: var(--kit-accent);
}
.bottom-nav button svg { width: 22px; height: 22px; }

/* Radar chart container */
.radar-wrap {
  display: grid;
  place-items: center;
  padding: 12px 0 0;
  position: relative;
}

/* Domain chip (for filters/header) */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip-btn {
  border: 1px solid var(--kit-border);
  background: var(--kit-card);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--kit-ink-2);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip-btn.active {
  background: var(--kit-ink);
  color: #fff;
  border-color: var(--kit-ink);
}
.chip-btn .dot { width: 7px; height: 7px; border-radius: 50%; }

/* Eyebrow */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kit-ink-3);
  margin: 18px 4px 8px;
}
