/* Lo-fi wireframe aesthetic from the MVP storyboard: orange primary, dark borders, cards. */
:root {
  --bg: #e7e5df;
  --ink: #2b2b2b;
  --muted: #6b6862;
  --faint: #9a978f;
  --line: #2b2b2b;
  --soft: #e0ddd6;
  --orange: #ff7a45;
  --orange-bg: #fff1ea;
  --card: #fff;
  --panel: #faf9f5;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: 'Patrick Hand', system-ui, sans-serif;
  display: flex; justify-content: center; min-height: 100vh; padding: 24px 12px;
}
h1, h2, h3, .head { font-family: 'Caveat', cursive; font-weight: 700; }

.phone {
  position: relative; width: 360px; max-width: 100%; background: var(--card);
  border: 2.5px solid var(--line); border-radius: 30px; min-height: 720px;
  display: flex; flex-direction: column; box-shadow: 0 6px 28px rgba(0,0,0,.15); overflow: hidden;
}
.grab { width: 44px; height: 5px; background: var(--soft); border-radius: 3px; margin: 12px auto 4px; flex: none; }
.view { flex: 1; padding: 8px 16px 16px; overflow-y: auto; }
.loading { text-align: center; color: var(--faint); margin-top: 60px; }

/* Tab bar */
.tabbar {
  display: flex; align-items: center; justify-content: space-between; gap: 4px;
  border-top: 2px solid #ece9e2; padding: 8px 18px 14px; background: var(--card);
}
.tab { background: none; border: none; font-family: 'Patrick Hand'; font-size: 13px; color: var(--faint); cursor: pointer; }
.tab.active { color: var(--ink); }
.fab {
  width: 46px; height: 46px; border-radius: 50%; background: var(--orange);
  border: 2px solid var(--line); color: var(--ink); font-size: 24px; cursor: pointer;
  margin-top: -28px; box-shadow: 2px 2px 0 var(--line);
}

/* Cards & bits */
.card { border: 2px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; background: var(--card); }
.card.soft { background: var(--panel); }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; }
.label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.head-lg { font-size: 26px; line-height: 1; }
.pill { border: 2px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.pill.dash { border-style: dashed; border-color: #b8b5ad; color: var(--faint); }

.avatar-art {
  width: 70px; height: 70px; flex: none; border: 2px dashed #c2bfb6; border-radius: 12px;
  background: repeating-linear-gradient(45deg,#efede8,#efede8 6px,#e4e1da 6px,#e4e1da 12px);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: #8a877f; text-align: center;
}
.xpbar { height: 11px; border: 2px solid var(--line); border-radius: 6px; overflow: hidden; }
.xpbar > div { height: 100%; background: var(--orange); }

.btn {
  display: block; width: 100%; background: var(--orange); border: 2px solid var(--line);
  border-radius: 10px; padding: 11px; text-align: center; font-size: 16px; color: var(--ink);
  box-shadow: 2px 2px 0 var(--line); cursor: pointer; font-family: 'Patrick Hand';
}
.btn.ghost { background: var(--card); box-shadow: none; }
.btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--line); }

.seg { display: flex; gap: 5px; }
.seg > button {
  flex: 1; border: 2px solid #cfccc4; border-radius: 8px; padding: 6px; text-align: center;
  font-size: 13px; color: var(--faint); background: var(--card); cursor: pointer; font-family: 'Patrick Hand';
}
.seg > button.on { border-color: var(--line); color: var(--ink); background: var(--orange-bg); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* Leaderboard rows */
.lb-row { border: 2px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 7px; display: flex; align-items: center; gap: 9px; }
.lb-row.me { border-color: var(--orange); background: var(--orange-bg); border-width: 2.5px; }
.lb-rank { font-family: 'Caveat'; font-weight: 700; font-size: 20px; width: 22px; text-align: center; }
.lb-av { width: 30px; height: 30px; border-radius: 50%; background: var(--soft); flex: none; }

/* Stepper / inputs */
.stepper { border: 2px solid var(--line); border-radius: 12px; padding: 10px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.stepper .val { text-align: center; }
.stepper .num { font-family: 'Caveat'; font-weight: 700; font-size: 36px; line-height: .9; }
.step-btn { width: 46px; height: 46px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); font-size: 24px; cursor: pointer; }
.step-btn.plus { background: var(--orange); box-shadow: 2px 2px 0 var(--line); }
.field { border: 2px solid var(--line); border-radius: 10px; padding: 9px; margin-bottom: 10px; }
.field input, .field select { width: 100%; border: none; outline: none; font-family: 'Patrick Hand'; font-size: 18px; background: transparent; }

/* Sheet */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; justify-content: center; z-index: 20; }
.sheet.hidden { display: none; }
.sheet-card { width: 360px; max-width: 100%; background: var(--card); border: 2.5px solid var(--line); border-radius: 24px 24px 0 0; padding: 8px 16px 20px; max-height: 90vh; overflow-y: auto; }

.toast { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 14px; z-index: 40; }
.pr-banner { background: var(--orange-bg); border: 2px solid var(--orange); border-radius: 12px; padding: 10px; text-align: center; margin-bottom: 12px; }
.hidden { display: none; }
