:root {
  --bg: #0b0e14;
  --surface: #121722;
  --surface-elevated: #1a2233;
  --border: #232c40;
  --text: #f0f4f8;
  --text-muted: #8e9bb0;

  /* Detroit Lions Color System */
  --honolulu-blue: #0076B6;
  --honolulu-blue-glow: rgba(0, 118, 182, 0.4);
  --honolulu-blue-light: #0090DF;
  --lions-silver: #B0B7BC;
  --lions-silver-light: #E2E8F0;
  --accent: var(--honolulu-blue);
  --accent-hover: var(--honolulu-blue-light);

  --danger: #ef4444;
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.15);
  --error-bg: rgba(239, 68, 68, 0.15);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(18, 23, 34, 0.75);
}

/* Reset & base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  padding: 0.75rem 1rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border-bottom: 2px solid var(--honolulu-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 639px) {
  .app-header {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    text-align: center;
  }

  .header-brand {
    justify-content: center;
    gap: 0.5rem;
  }

  .lion-logo-icon {
    font-size: 1.5rem;
  }

  .header-titles {
    align-items: center;
    text-align: center;
  }

  .app-header h1 {
    font-size: 1.05rem;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .app-subtitle {
    font-size: 0.72rem;
    text-align: center;
    margin-top: 0.15rem;
    line-height: 1.25;
  }

  .app-nav {
    width: 100%;
    justify-content: center;
    gap: 0.35rem;
  }

  .nav-btn {
    flex: 1;
    text-align: center;
    padding: 0.4rem 0.4rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.lion-logo-icon {
  font-size: 1.8rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px var(--honolulu-blue-glow));
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.app-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #ffffff 30%, var(--lions-silver) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.app-nav {
  display: flex;
  gap: 0.4rem;
}

.nav-btn {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn.active,
.nav-btn:hover,
.nav-btn:focus-visible {
  background: var(--honolulu-blue);
  border-color: var(--honolulu-blue-light);
  color: #fff;
  box-shadow: 0 0 12px var(--honolulu-blue-glow);
  outline: none;
}

/* Main */
.app-main {
  flex: 1;
  padding: 0.75rem;
}

/* View switching */
.view {
  display: none;
}

.view--active {
  display: block;
}

.view-intro {
  text-align: center;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.vote-hero-prompt {
  text-align: center;
  margin-bottom: 1rem;
}

.vote-hero-prompt .view-intro {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--lions-silver-light);
  margin: 0;
}

/* Matchup layout */
.matchup {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  align-items: stretch;
}

.vs-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  align-self: center;
}

/* VS badge */
.vs-badge {
  background: linear-gradient(135deg, var(--honolulu-blue) 0%, #004b78 100%);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  border: 2px solid var(--lions-silver);
  box-shadow: 0 0 14px var(--honolulu-blue-glow);
  flex-shrink: 0;
}

.new-matchup-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.new-matchup-btn:hover,
.new-matchup-btn:focus-visible {
  background: var(--honolulu-blue);
  border-color: var(--honolulu-blue-light);
  color: #fff;
  box-shadow: 0 0 10px var(--honolulu-blue-glow);
  outline: none;
}

/* Player card */
.player-card {
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  position: relative;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.player-card:hover {
  border-color: var(--honolulu-blue);
  transform: translateY(-2px);
}

.card-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.65rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--border);
}

.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-badge.badge-roster {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.status-badge.badge-bubble {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.card-rank {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--lions-silver);
}

.player-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--surface-elevated);
  display: block;
}

.player-info {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.player-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.player-meta {
  margin: 0;
  color: var(--lions-silver);
  font-size: 0.82rem;
  font-weight: 500;
}

.player-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0.35rem;
  font-size: 0.7rem;
}

.player-pills li {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
}

.pill-gold {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.5);
}

.pill-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.5);
}

.pill-blue {
  background: rgba(0, 144, 223, 0.2);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.5);
}

.pill-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.5);
}

.pill-gray {
  background: rgba(176, 183, 188, 0.15);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.4);
}

/* Vote button */
.vote-btn {
  width: 100%;
  padding: 0.75rem;
  border: none;
  background: linear-gradient(135deg, var(--honolulu-blue) 0%, #005a8d 100%);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all 0.15s ease;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vote-btn:hover,
.vote-btn:focus-visible {
  background: linear-gradient(135deg, var(--honolulu-blue-light) 0%, var(--honolulu-blue) 100%);
  box-shadow: 0 0 16px var(--honolulu-blue-glow);
  outline: none;
}

.vote-btn:active {
  transform: scale(0.99);
}

/* Feedback */
.feedback {
  margin-top: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  min-height: 2.5rem;
  display: none;
}

.feedback.visible {
  display: block;
}

.feedback.success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.feedback.error {
  background: var(--error-bg);
  color: var(--danger);
}

/* Ranks View Summary & Tabs */
.ranks-header-summary {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.85rem;
  border-radius: 14px;
}

.roster-cut-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.5rem 0;
}

.summary-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.summary-stat .summary-val {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.lock-stat .summary-val {
  color: #34d399;
}

.bubble-stat .summary-val {
  color: #fbbf24;
}

.summary-stat .summary-lbl {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.2rem;
}

.summary-divider {
  width: 1px;
  height: 2rem;
  background: var(--border);
}

.roster-filter-tabs {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
}

.filter-tab {
  flex: 1;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.filter-tab.active,
.filter-tab:hover {
  background: var(--honolulu-blue);
  border-color: var(--honolulu-blue-light);
  color: #fff;
  box-shadow: 0 0 10px var(--honolulu-blue-glow);
}

/* Ranks controls */
.ranks-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rank-search,
.rank-sort {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

.rank-search::placeholder {
  color: var(--text-muted);
}

.rank-search:focus,
.rank-sort:focus {
  border-color: var(--honolulu-blue);
  outline: none;
  box-shadow: 0 0 0 2px var(--honolulu-blue-glow);
}

/* 53-Man Cut Line Banner */
.cut-line-banner {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: linear-gradient(90deg, rgba(0, 118, 182, 0.25) 0%, rgba(245, 158, 11, 0.25) 100%);
  border-top: 2px dashed var(--honolulu-blue-light);
  border-bottom: 2px dashed var(--warning);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.cut-line-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cut-line-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Ranks list */
.ranks-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rank-empty {
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}

.rank-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.15s ease;
}

.rank-card.rank-lock {
  border-left: 4px solid var(--success);
}

.rank-card.rank-bubble {
  border-left: 4px solid var(--warning);
}

.rank-card:hover {
  border-color: var(--honolulu-blue);
  transform: translateX(2px);
}

.rank-number {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--honolulu-blue-light);
  min-width: 2.2rem;
  text-align: center;
}

.rank-thumb {
  width: 48px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-elevated);
  flex-shrink: 0;
}

.rank-details {
  flex: 1;
  min-width: 0;
}

.rank-name-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.rank-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.rank-badge-inline {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.rank-badge-inline.lock {
  background: var(--success-bg);
  color: var(--success);
}

.rank-badge-inline.bubble {
  background: var(--warning-bg);
  color: var(--warning);
}

.rank-meta {
  margin: 0;
  color: var(--lions-silver);
  font-size: 0.78rem;
}

.rank-rating {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--honolulu-blue-light);
  text-align: right;
  min-width: 3.8rem;
}

.rank-stats {
  display: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.15rem;
}

/* Footer */
.app-footer {
  background: var(--surface);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.app-footer p {
  margin: 0;
}

.text-btn {
  background: none;
  border: none;
  color: var(--honolulu-blue-light);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.text-btn:hover {
  color: var(--text);
}

/* Tablet and up */
@media (min-width: 640px) {
  .app-header {
    padding: 1rem 1.5rem;
  }

  .app-header h1 {
    font-size: 1.45rem;
  }

  .app-subtitle {
    font-size: 0.85rem;
  }

  .app-main {
    padding: 1.5rem;
  }

  .matchup {
    gap: 1.25rem;
  }

  .vs-badge {
    width: 52px;
    height: 52px;
    font-size: 0.95rem;
  }

  .player-info {
    padding: 1rem;
  }

  .player-name {
    font-size: 1.35rem;
  }

  .player-meta {
    font-size: 0.9rem;
  }

  .player-pills {
    font-size: 0.8rem;
  }

  .vote-btn {
    padding: 1rem;
    font-size: 1.1rem;
  }

  .ranks-controls {
    flex-direction: row;
  }

  .rank-search {
    flex: 1;
  }

  .rank-sort {
    width: auto;
    min-width: 11rem;
  }

  .rank-card {
    padding: 0.85rem 1.25rem;
  }

  .rank-thumb {
    width: 64px;
    height: 80px;
  }

  .rank-name {
    font-size: 1.2rem;
  }

  .rank-stats {
    display: block;
  }

  .ranks-header-summary {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
  }

  .roster-cut-summary {
    padding: 0;
  }

  .roster-filter-tabs {
    flex: 0 0 auto;
  }
}