/* ============================================================
   Palpi10 — Design system (from the design handoff)
   Archivo (UI/display) · Space Mono (placares/pontos/códigos)
   ============================================================ */
:root {
  --accent: #00A868;        /* verde gramado · ação */
  --accent-dark: #00794B;   /* verde escuro · pressed */
  --gold: #FFC42E;          /* amarelo · cravou / pódio */
  --gold-ink: #C98A00;
  --coral: #E5384F;         /* errou */
  --coral-ink: #C42B3F;
  --coral-bg: #FDE7EA;
  --warn-bg: #FFF1D6;
  --warn-ink: #9A6B00;

  --ink: #0E1A14;
  --ink-2: #3A4A40;
  --muted: #5E6E64;
  --muted-2: #9AA89E;

  --surface: #EEF2EA;       /* fundo das telas */
  --page: #E6EAE2;          /* fundo fora do app */
  --card: #ffffff;
  --line: #E3E8E1;
  --line-2: #D8DFD3;
  --line-3: #C9D2C5;

  --sans: 'Archivo', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --app-max: 480px;
  --nav-h: 80px;
  --r-lg: 26px;
  --r-md: 20px;
  --shadow-card: 0 1px 2px rgba(14,26,20,.05), 0 10px 24px rgba(14,26,20,.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--page);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; }
a { color: inherit; }

.msr {
  font-family: 'Material Symbols Rounded';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  display: inline-block;
  white-space: nowrap;
  font-variation-settings: 'FILL' 0;
  -webkit-font-feature-settings: 'liga';
  user-select: none;
}

/* Team flags — local 4:3 SVG, hairline ring so light flags read on white. */
.flag {
  display: inline-block;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  vertical-align: middle;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(14, 26, 20, .12);
  flex: none;
}
.flag--blank {
  background: repeating-linear-gradient(135deg, #E4EAE0, #E4EAE0 5px, #DBE2D6 5px, #DBE2D6 10px);
}
.mono { font-family: var(--mono); }

/* ---------- App shell (centered phone column on desktop) ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: var(--app-max);
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
@media (min-width: 540px) {
  body { background: var(--page); }
  .app {
    height: min(940px, 100dvh);
    margin-top: max(0px, calc((100dvh - 940px) / 2));
    border-radius: 28px;
    box-shadow: 0 30px 80px rgba(14,26,20,.18);
  }
}

/* A screen fills the app column: scrollable content + optional fixed bottom nav */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.screen-body { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.screen--scroll { overflow: hidden; }
.scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.scroll::-webkit-scrollbar { width: 0; height: 0; }
.scroll { scrollbar-width: none; }
/* scroll containers are flex columns; keep children at their natural height */
.scroll > * { flex-shrink: 0; }
.pt-safe { padding-top: env(safe-area-inset-top, 0px); }
.pb-safe { padding-bottom: env(safe-area-inset-bottom, 0px); }

/* ---------- Boot splash ---------- */
.boot {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(120% 80% at 80% 0%, #00C078 0%, #00A868 34%, #00794B 72%, #02583A 100%);
  color: #fff;
}
.boot__logo {
  width: 74px; height: 74px; border-radius: 22px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
}
.boot__name { font-size: 34px; font-weight: 900; letter-spacing: -.03em; }

/* ---------- Reusable components ---------- */
.btn {
  border: none; cursor: pointer; width: 100%;
  height: 56px; border-radius: 100px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 800; font-size: 17px;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: scale(.985); filter: brightness(.95); }
.btn[disabled] { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn--tonal { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); box-shadow: none; }
.btn--outline { background: #fff; color: var(--ink); border: 1.5px solid var(--line-3); box-shadow: none; }
.btn--gold { background: var(--gold); color: var(--ink); box-shadow: 0 8px 20px rgba(255,196,46,.4); }

.chip {
  border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 100px;
  background: #fff; border: 1px solid var(--line-3); color: var(--ink-2);
  font-weight: 600; font-size: 13px; font-family: var(--sans);
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }

.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--ink);
}

.card { background: var(--card); border-radius: var(--r-md); box-shadow: 0 1px 2px rgba(14,26,20,.04); }

/* tap feedback for clickable rows/cards */
.tap { cursor: pointer; transition: transform .08s ease; -webkit-tap-highlight-color: transparent; }
.tap:active { transform: scale(.98); }

/* ---------- Bottom navigation ---------- */
.bnav {
  display: flex; align-items: flex-start; justify-content: space-around;
  background: #fff; border-top: 1px solid var(--line);
  padding: 10px 6px calc(12px + env(safe-area-inset-bottom, 0px));
  flex: none;
}
.bnav__item {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0;
}
.bnav__pill {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 32px; border-radius: 16px; background: transparent;
  transition: background .15s;
}
.bnav__pill .msr { font-size: 24px; color: var(--muted); }
.bnav__label { font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: .01em; color: var(--muted); }
.bnav__item.is-active .bnav__pill { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.bnav__item.is-active .bnav__pill .msr { color: var(--accent); font-variation-settings: 'FILL' 1; }
.bnav__item.is-active .bnav__label { color: var(--accent); font-weight: 700; }

/* ---------- Headings / labels reused across screens ---------- */
.page-title { font-size: 26px; font-weight: 900; letter-spacing: -.02em; }
.label-up { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

/* number input (passcode) - keep monospace caret-style boxes */
.code-box {
  flex: 1; height: 52px; border-radius: 13px;
  background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 22px; color: #fff;
  text-transform: uppercase;
}
.code-box.is-filled { border-color: var(--gold); }

/* hidden field used to capture passcode / text via the keyboard */
.ghost-input {
  position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 16px); transform: translateX(-50%);
  background: var(--ink); color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 18px; border-radius: 100px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  z-index: 60; max-width: 88%; text-align: center;
  animation: toast-in .2s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* bottom sheet / dialog */
.sheet-backdrop {
  position: absolute; inset: 0; background: rgba(14,26,20,.45); z-index: 50;
  display: flex; align-items: flex-end; animation: fade .15s ease;
}
.sheet {
  width: 100%; background: #fff; border-radius: 28px 28px 0 0;
  padding: 22px 22px calc(24px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0,0,0,.18); animation: sheet-up .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }

.field {
  display: flex; align-items: center; gap: 10px; height: 58px;
  border: 1.5px solid var(--line-3); border-radius: 16px; padding: 0 16px; background: #fff;
}
.field:focus-within { border-color: var(--accent); }
.field input {
  border: none; outline: none; background: none; flex: 1; min-width: 0;
  font-family: var(--sans); font-weight: 700; font-size: 18px; color: var(--ink);
}
.field input::placeholder { color: var(--muted-2); font-weight: 600; }
