/* PBTP Stock: the NFL Picks design (personal/nfl-picks/styles.css).
   Same tokens, header, tabs, cards, buttons, badges and toast; class names
   follow NFL Picks where the component is the same. */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --bg-dark: #0a0a0a;
  --bg-hover: #f0f1f3;
  --text-primary: #0a0a0a;
  --text-secondary: #4a4a4a;
  --text-light: #6b7280;

  --nfl-blue: #013369;
  --accent-green: #059669;
  --accent-red: #dc2626;
  --accent-teal: #0d9488;
  --accent-amber: #d97706;

  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.12);
}

/* Dark mode: set by the header toggle (or the phone's setting on first visit). */
[data-theme="dark"] {
  --bg-primary: #111111;
  --bg-secondary: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-dark: #000000;
  --bg-hover: #252525;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-light: #737373;

  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-teal: #14b8a6;
  --accent-amber: #f59e0b;

  --border-color: #2a2a2a;
  --border-light: #1f1f1f;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.6);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- Header ---------- */

header {
  background: var(--bg-dark);
  color: white;
  border-bottom: 3px solid var(--nfl-blue);
  padding-top: env(safe-area-inset-top);
}
[data-theme="dark"] header { background: #000000; }

.header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.app-logo { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.header-text { text-align: left; min-width: 0; }
header h1 {
  font-size: 1.35rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: white;
}
.subtitle {
  color: var(--accent-green);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

/* Round header buttons: settings gear + light/dark toggle. */
.header-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: all 0.2s ease;
}
.header-btn:hover { background: rgba(255, 255, 255, 0.2); transform: scale(1.1); }
.header-btn.first { margin-left: auto; }
.header-btn + .header-btn { margin-left: -8px; }
.dark-mode-toggle .icon-sun { display: none; color: #fbbf24; }
.dark-mode-toggle .icon-moon { display: block; }
[data-theme="dark"] .dark-mode-toggle .icon-sun { display: block; }
[data-theme="dark"] .dark-mode-toggle .icon-moon { display: none; }

/* ---------- Category tabs ---------- */

.category-tabs {
  display: flex;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
}
.category-tabs-inner { display: flex; width: 100%; max-width: 720px; margin: 0 auto; }
.tab {
  flex: 1;
  padding: 16px 4px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  transition: all 0.15s ease;
}
.tab:hover, .tab.active { color: var(--text-primary); }
.tab.active { border-bottom-color: var(--accent-green); }
.tab-primary { color: var(--accent-green); }

/* ---------- Page ---------- */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px calc(80px + env(safe-area-inset-bottom));
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.page-header { margin-bottom: 24px; }
.page-header h2 {
  font-size: 1.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.page-subtitle { color: var(--text-secondary); font-size: 0.9rem; margin-top: 8px; }

/* Label + control in a bordered row (NFL Picks' week / picker selectors). */
.selector {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 16px 20px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.selector label, .label {
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  white-space: nowrap;
}
.selector .value { margin-left: auto; font-weight: 700; }
.input, .dropdown {
  padding: 10px 16px;
  border-radius: 4px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 0;
}
.input { flex: 1; }
.input:hover, .dropdown:hover { border-color: var(--text-light); }
.input:focus, .dropdown:focus { outline: none; border-color: var(--accent-green); }
.input:disabled { opacity: 0.6; }

/* Cards (NFL Picks' game cards). */
.card {
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  transition: all 0.2s ease;
}
.card.accent { border-left: 4px solid var(--nfl-blue); }
.card.warn { border-left: 4px solid var(--accent-amber); }
.card.bad { border-left: 4px solid var(--accent-red); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}
.card-title { font-weight: 800; }
.card p + p, .card p + .btn-row { margin-top: 12px; }

/* Small uppercase section label inside cards (NFL Picks' .pick-label). */
.pick-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Status badge: black like FINAL; teal link-style for actions. */
.status-badge {
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--bg-dark);
  color: white;
  white-space: nowrap;
}
.status-badge.amber { background: var(--accent-amber); }
.link-btn {
  background: var(--bg-secondary);
  border: none;
  padding: 4px 10px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-teal);
  white-space: nowrap;
}
.link-btn:hover { background: var(--bg-hover); }

/* Choice / action buttons (NFL Picks' pick buttons). */
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pick-btn {
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.15s ease;
  min-width: 0;
}
.pick-btn:hover { border-color: var(--nfl-blue); background: var(--bg-hover); }
.pick-btn.selected, .pick-btn.primary { border-color: var(--nfl-blue); background: var(--nfl-blue); color: white; }
[data-theme="dark"] .pick-btn.selected, [data-theme="dark"] .pick-btn.primary { background: #1e4a8c; border-color: #1e4a8c; }
.pick-btn:disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg-secondary); }
.pick-btn:disabled:hover { border-color: var(--border-color); }
.pick-btn.big { padding: 20px 12px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; }
.pick-btn .hint {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-light);
}

/* Big number tiles. */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat-value { font-size: 1.6rem; font-weight: 900; line-height: 1.2; }
.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border-color);
}
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.muted { color: var(--text-secondary); }
.small { font-size: 0.85rem; }

.empty-state { text-align: center; color: var(--text-secondary); padding: 40px 20px; }
.empty-state .big-icon { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ---------- "Who's using this phone?" sheet ---------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet-backdrop[hidden] { display: none; }
.sheet {
  background: var(--bg-card);
  width: 100%; max-width: 720px;
  border-radius: 16px 16px 0 0;
  border-top: 3px solid var(--nfl-blue);
  padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
.sheet h2 { font-size: 1.2rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.02em; }
.sheet p { margin: 8px 0 20px; color: var(--text-secondary); font-size: 0.9rem; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: calc(30px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-dark);
  color: white;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
[data-theme="dark"] .toast { background: #f0f0f0; color: #1a1a1a; }
