@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@300;400;600&family=Share+Tech+Mono&family=Crimson+Pro:ital,wght@0,300;0,400;1,300;1,400&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #020b18; --surface: #040f1f; --surface2: #071628; --surface3: #0a1e36;
  --blue-bright: #2979ff; --blue-dim: #0d47a1; --blue-faint: #0a1e36;
  --steel: #4a7ab5; --steel-dim: #2a4a6a;
  --text: #c8d8e8; --text-dim: #5a7a9a;
  --red: #c62828; --red-bright: #ef5350;
  --green-bright: #43a047; --amber: #f57f17;
  --border: #0d2a45;
  --mono: 'Share Tech Mono', monospace;
  --serif: 'Crimson Pro', serif;
  --sans: 'Rajdhani', sans-serif;
}

body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; min-height: 100vh; }
.app { max-width: 700px; margin: 0 auto; padding: 12px; padding-bottom: 40px; }

/* HEADER */
.header { padding: 20px 0 14px; margin-bottom: 4px; position: relative; text-align: center; }
.header::after { content: ''; position: absolute; bottom: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, var(--blue-dim), var(--blue-bright), var(--blue-dim), transparent); }
.sys-label { font-family: var(--mono); font-size: 9px; letter-spacing: 5px; color: var(--steel-dim); margin-bottom: 6px; }
.hunter-name { font-family: var(--mono); font-size: 32px; letter-spacing: 8px; color: var(--blue-bright); margin-bottom: 4px; text-shadow: 0 0 30px rgba(41,121,255,0.3); }
.rank-pill { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: 4px; padding: 3px 14px; border: 1px solid var(--blue-dim); color: var(--steel); background: var(--surface2); margin-bottom: 6px; }
.chronicle-phrase { font-family: var(--serif); font-size: 12px; color: var(--text-dim); font-style: italic; padding: 0 20px 6px; }

/* NAV */
.nav { display: flex; border-bottom: 1px solid var(--border); margin: 14px 0 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-tab { font-family: var(--mono); font-size: 9px; letter-spacing: 2px; padding: 10px 14px; cursor: pointer; color: var(--text-dim); border-bottom: 2px solid transparent; transition: all 0.2s; background: none; border-left: none; border-right: none; border-top: none; white-space: nowrap; flex-shrink: 0; }
.nav-tab:hover { color: var(--steel); }
.nav-tab.active { color: var(--blue-bright); border-bottom-color: var(--blue-bright); }
.sec { display: none; }
.sec.active { display: block; }

/* PANELS */
.panel { background: var(--surface); border: 1px solid var(--border); margin-bottom: 10px; position: relative; overflow: hidden; }
.panel::before { content: ''; position: absolute; top: 0; left: 0; width: 2px; height: 100%; background: var(--blue-dim); }
.panel.alert::before { background: var(--red); }
.panel.accent::before { background: var(--blue-bright); }
.ptitle { font-family: var(--mono); font-size: 8px; letter-spacing: 3px; color: var(--text-dim); padding: 10px 14px 6px; border-bottom: 1px solid var(--border); }
.pbody { padding: 12px 14px; }
.date-stamp { font-family: var(--mono); font-size: 8px; color: var(--text-dim); text-align: right; padding: 4px 14px; border-top: 1px solid var(--border); }

/* BOSS GATE URGENT */
.boss-urgent { background: rgba(198,40,40,0.08); border: 1px solid var(--red); margin-bottom: 10px; padding: 14px; text-align: center; animation: pulse-border 2s infinite; }
@keyframes pulse-border { 0%,100% { border-color: var(--red); } 50% { border-color: var(--red-bright); box-shadow: 0 0 12px rgba(239,83,80,0.3); } }
.boss-urgent-title { font-family: var(--mono); font-size: 12px; letter-spacing: 3px; color: var(--red-bright); margin-bottom: 6px; }
.boss-urgent-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.btn-boss { font-family: var(--mono); font-size: 9px; letter-spacing: 2px; padding: 8px 20px; background: transparent; border: 1px solid var(--red); color: var(--red-bright); cursor: pointer; transition: all 0.2s; }
.btn-boss:hover { background: rgba(198,40,40,0.15); }

/* WEIGHT CARDS */
.weight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.wcard { background: var(--surface2); border: 1px solid var(--border); padding: 12px; text-align: center; }
.wcard-label { font-family: var(--mono); font-size: 8px; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 4px; }
.wcard-val { font-family: var(--mono); font-size: 24px; color: var(--blue-bright); }
.wcard-unit { font-family: var(--mono); font-size: 10px; color: var(--text-dim); }
.wcard-sub { font-family: var(--mono); font-size: 9px; color: var(--steel-dim); margin-top: 3px; }

/* RANK SPECTRUM */
.rank-spectrum-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--text-dim); margin-bottom: 6px; padding: 0 2px; }
.rank-spectrum-track { height: 8px; background: var(--surface2); border: 1px solid var(--border); position: relative; overflow: visible; border-radius: 2px; margin-bottom: 4px; }
.rank-spectrum-fill { height: 100%; background: linear-gradient(90deg, #0d47a1, #1565c0, #1976d2, #2979ff); transition: width 0.8s ease; border-radius: 2px; }
.rank-spectrum-glow { position: absolute; top: 50%; right: 0; transform: translate(50%, -50%); width: 16px; height: 16px; border-radius: 50%; background: var(--blue-bright); box-shadow: 0 0 12px var(--blue-bright), 0 0 24px rgba(41,121,255,0.5); transition: right 0.8s ease; }
.rank-spectrum-thresholds { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 8px; color: var(--steel-dim); padding: 0 2px; }

/* WHOOP */
.whoop-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wmetric { text-align: center; padding: 8px 4px; }
.wm-label { font-family: var(--mono); font-size: 8px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 4px; }
.wm-val { font-family: var(--mono); font-size: 22px; }
.wm-val.green { color: var(--green-bright); }
.wm-val.amber { color: var(--amber); }
.wm-val.red { color: var(--red-bright); }
.wm-val.dim { color: var(--text-dim); }
.wm-unit { font-family: var(--mono); font-size: 8px; color: var(--text-dim); }

/* STATS GRID */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.scard { background: var(--surface2); border: 1px solid var(--border); padding: 10px 6px; text-align: center; transition: border-color 0.3s, box-shadow 0.3s; }
.scard.buffed { border-color: var(--blue-bright); box-shadow: 0 0 8px rgba(41,121,255,0.2); }
.scard.debuffed { border-color: var(--red-bright); box-shadow: 0 0 8px rgba(239,83,80,0.2); }
.sname { font-family: var(--mono); font-size: 8px; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 5px; }
.sval { font-family: var(--mono); font-size: 16px; color: var(--blue-bright); }
.sval.buffed { color: var(--green-bright); }
.sval.debuffed { color: var(--red-bright); }
.sbar { height: 2px; background: var(--border); margin-top: 6px; }
.sbar-fill { height: 100%; background: linear-gradient(90deg, var(--blue-dim), var(--blue-bright)); transition: width 0.5s; }
.sbar-fill.buffed { background: linear-gradient(90deg, #1b5e20, var(--green-bright)); }
.sbar-fill.debuffed { background: linear-gradient(90deg, var(--red), var(--red-bright)); }

/* QUEST SUMMARY */
.quest-summary-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.quest-summary-item:last-child { border-bottom: none; }
.qcheck { width: 16px; height: 16px; border: 1px solid var(--steel-dim); flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: var(--blue-bright); }
.qcheck.done { background: var(--blue-dim); border-color: var(--blue-bright); }
.qtext { flex: 1; font-size: 12px; line-height: 1.4; }
.qtext.done { color: var(--text-dim); text-decoration: line-through; }

/* HABITS */
.habit-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.habit-item:last-child { border-bottom: none; }
.hcheck { width: 16px; height: 16px; border: 1px solid var(--steel-dim); flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; color: var(--blue-bright); transition: all 0.2s; }
.hcheck.done { background: var(--blue-dim); border-color: var(--blue-bright); }
.htext { flex: 1; font-size: 13px; line-height: 1.5; }
.htext.done { color: var(--text-dim); text-decoration: line-through; }
.htags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.htag { font-family: var(--mono); font-size: 8px; padding: 2px 6px; background: var(--surface3); border: 1px solid var(--blue-dim); color: var(--blue-bright); }

/* BUTTONS */
.btn { font-family: var(--mono); font-size: 9px; letter-spacing: 2px; padding: 11px 16px; background: transparent; border: 1px solid var(--steel-dim); color: var(--steel); cursor: pointer; transition: all 0.2s; width: 100%; text-align: center; display: block; margin-top: 6px; }
.btn:hover { border-color: var(--blue-bright); color: var(--blue-bright); }
.btn.primary { border-color: var(--blue-dim); color: var(--blue-bright); }
.btn-row { display: flex; gap: 8px; margin-top: 10px; }
.btn-row .btn { margin-top: 0; }
.btn-inline { font-family: var(--mono); font-size: 9px; letter-spacing: 1px; padding: 8px 14px; background: transparent; border: 1px solid var(--steel-dim); color: var(--steel); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.btn-inline.primary { border-color: var(--blue-dim); color: var(--blue-bright); }
.btn-inline:hover { border-color: var(--blue-bright); color: var(--blue-bright); }

/* WEIGHT INPUT ROW */
.weight-input-row { display: flex; gap: 8px; align-items: flex-end; }

/* CHAT */
.claude-panel { margin-top: 10px; }
.claude-response { font-family: var(--sans); font-size: 13px; line-height: 1.7; white-space: pre-wrap; min-height: 40px; }
.chat-input-row { display: flex; gap: 8px; margin-top: 8px; }
.chat-input-row input { flex: 1; background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-family: var(--mono); font-size: 12px; padding: 10px 12px; outline: none; transition: border-color 0.2s; }
.chat-input-row input:focus { border-color: var(--blue-dim); }

/* CHRONICLE */
.chronicle-entry { font-family: var(--serif); font-size: 15px; line-height: 1.9; color: var(--text); border-left: 2px solid var(--blue-dim); padding: 0 0 0 16px; margin-bottom: 16px; }
.ch-meta { font-family: var(--mono); font-size: 8px; color: var(--text-dim); letter-spacing: 2px; margin-bottom: 10px; }
.ch-title { font-family: var(--mono); font-size: 11px; color: var(--blue-bright); letter-spacing: 3px; margin-bottom: 14px; }
.ch-nav { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.ch-btn { font-family: var(--mono); font-size: 8px; padding: 5px 10px; background: var(--surface2); border: 1px solid var(--border); color: var(--text-dim); cursor: pointer; transition: all 0.2s; }
.ch-btn.active { border-color: var(--blue-dim); color: var(--blue-bright); }

/* FORMS */
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.ifield label { font-family: var(--mono); font-size: 8px; letter-spacing: 2px; color: var(--text-dim); display: block; margin-bottom: 4px; }
.ifield input, .ifield select, .ifield textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text); font-family: var(--mono); font-size: 12px; padding: 8px 10px; outline: none; transition: border-color 0.2s; }
.ifield input:focus, .ifield select:focus, .ifield textarea:focus { border-color: var(--blue-dim); }
.ifield select option { background: var(--surface2); }

/* MISC */
.boss-locked { text-align: center; padding: 14px; font-family: var(--mono); font-size: 9px; color: var(--text-dim); letter-spacing: 3px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface2); border: 1px solid var(--blue-dim); color: var(--blue-bright); font-family: var(--mono); font-size: 10px; padding: 10px 20px; letter-spacing: 2px; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 999; white-space: nowrap; }
.toast.show { opacity: 1; }
.loading { text-align: center; padding: 20px; font-family: var(--mono); font-size: 9px; color: var(--text-dim); letter-spacing: 3px; }
.blink { animation: blink 2s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }
.scan-line { height: 1px; background: linear-gradient(90deg, transparent, var(--blue-dim), transparent); animation: sc 3s infinite; margin: 6px 0; }
@keyframes sc { 0% { opacity: 0.3; } 50% { opacity: 1; } 100% { opacity: 0.3; } }
