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

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #FFFFFF;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

#app { width: 600px; height: 600px; position: relative; }

/* ── Screens ── */
.screen { position: absolute; inset: 0; padding: 8px; display: none; flex-direction: column; }
.screen.active { display: flex; }

/* ── Header ── */
.screen-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  flex-shrink: 0;
}
.header-title { font-size: 16px; font-weight: 700; letter-spacing: 3px; color: #6b7280; flex: 1; text-align: center; text-transform: uppercase; }

/* Home header — taller to fit logo + tagline */
.home-header { height: 80px; }

.home-brand {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.home-logo {
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.5px;
}

.home-tagline {
  font-size: 16px;
  font-weight: 400;
  color: #6b7280;
  letter-spacing: 0.3px;
  text-align: center;
}

.icon-btn {
  width: 44px; height: 44px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 50%;
  color: #FFFFFF; font-size: 17px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 300ms cubic-bezier(0.4,0.04,0.5,1), border-color 300ms cubic-bezier(0.4,0.04,0.5,1);
}
.icon-btn:focus { outline: none; background: #1a1a1a; border-color: rgba(255,255,255,0.3); }
.icon-btn:active { transform: scale(0.92); transition: transform 100ms cubic-bezier(0.68,0,0.29,1); }

/* ── Home ── */
.home-toggle-bar {
  display: flex;
  justify-content: center;
  padding: 4px 8px 12px;
  flex-shrink: 0;
}

.sport-toggle {
  background: #111111;
  border-radius: 50px;
  padding: 4px;
  display: flex;
  width: 320px;
}

.toggle-opt {
  flex: 1;
  height: 56px;
  border-radius: 46px;
  border: 2px solid transparent;
  background: transparent;
  color: #6b7280;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 300ms cubic-bezier(0.4,0.04,0.5,1), color 300ms cubic-bezier(0.4,0.04,0.5,1), border-color 300ms cubic-bezier(0.4,0.04,0.5,1);
}
.toggle-opt.active {
  background: #ffffff;
  color: #000000;
}
.toggle-opt:focus { outline: none; border-color: rgba(255,255,255,0.4); }
.toggle-opt:active { transform: scale(0.96); transition: transform 100ms cubic-bezier(0.68,0,0.29,1); }

/* ── Screen content ── */
.screen-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

/* ── MATCH CARD (shared component) ── */
.match-card {
  background: #141414;
  border: 2px solid transparent;
  border-radius: 18px;
  padding: 14px 18px 16px;
  cursor: pointer;
  transition: transform 475ms cubic-bezier(0.6,0,0.4,1), border-color 300ms cubic-bezier(0.4,0.04,0.5,1);
}
.match-card .inner { opacity: 0.85; transition: opacity 300ms cubic-bezier(0.4,0.04,0.5,1); }
.match-card:focus { outline: none; border-color: rgba(255,255,255,0.6); transform: scale(0.97); }
.match-card:focus .inner { opacity: 1; }
.match-card:active { transform: scale(0.95); transition: transform 100ms cubic-bezier(0.68,0,0.29,1); }

/* ● LIVE bar */
.live-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 12px;
}
.live-dot {
  width: 8px; height: 8px;
  background: #ff3b30;
  border-radius: 50%;
  flex-shrink: 0;
}
.live-text {
  font-size: 16px;
  font-weight: 600;
  color: #E4E6EB;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* Team row */
.card-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.crest-md { width: 48px; height: 48px; object-fit: contain; }
.crest-lg { width: 64px; height: 64px; object-fit: contain; }
.crest-sm { width: 36px; height: 36px; object-fit: contain; }

.card-team-name {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #E4E6EB;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.card-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  min-width: 110px;
}

/* Score sizes */
.score-list  { font-size: 44px; font-weight: 700; letter-spacing: 3px; color: #FFFFFF; line-height: 1; }
.score-full  { font-size: 64px; font-weight: 700; letter-spacing: 4px; color: #FFFFFF; line-height: 1; }
.score-detail{ font-size: 56px; font-weight: 700; letter-spacing: 4px; color: #FFFFFF; line-height: 1; }

.card-time { font-size: 16px; color: #6b7280; letter-spacing: 1px; margin-top: 2px; }

/* ── MULTIPLE GAMES — scrollable list ── */
.match-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 8px 72px;
  position: relative;
  scrollbar-width: none;
}
.match-list::-webkit-scrollbar { display: none; }
.match-list::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 72px;
  background: linear-gradient(to top, #000000 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* ── DETAIL — card + goalscorers ── */
.detail-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 8px 70px;
  gap: 12px;
  overflow: hidden;
}

.scorer-col { display: flex; flex-direction: column; gap: 5px; }
.scorer-col.right { align-items: flex-end; }

.scorer-name {
  font-size: 16px;
  font-weight: 500;
  color: #E4E6EB;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scorer-name .minute { color: #6b7280; font-size: 16px; }

/* ── Detail unified card (score + scorers in one card) ── */
.detail-unified-card {
  background: #141414;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  overflow: hidden;
  padding: 14px 18px 18px;
}

.detail-divider {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 14px 0 12px;
}

.detail-scorers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}

/* ── Cricket detail screen ── */
.cd-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 70px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: none;
}
.cd-wrap::-webkit-scrollbar { display: none; }

.cd-stats-divider-h {
  height: 1px;
  background: rgba(255,255,255,0.08);
  margin: 10px 0;
}
.cd-stats-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.cd-stats-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cd-stats-divider {
  width: 1px;
  background: rgba(255,255,255,0.08);
  align-self: stretch;
  margin: 0 12px;
}

.cd-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.cd-pname {
  font-size: 16px; font-weight: 500; color: #E4E6EB;
  flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cd-pstat { font-size: 16px; font-weight: 700; color: #fff; flex-shrink: 0; }
.cd-pball { font-size: 16px; color: #6b7280; font-weight: 400; }

/* ── Cricket card redesign ── */
.cc-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cc-match-type { font-size: 16px; font-weight: 700; color: #9ca3af; letter-spacing: 1.5px; text-transform: uppercase; }
.cc-live { display: flex; align-items: center; gap: 6px; }

.cc-main {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.cc-left-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cc-right-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.cc-team-left  { display: flex; align-items: center; gap: 10px; }
.cc-team-right { display: flex; align-items: center; gap: 10px; }
.cc-score-left  { display: flex; flex-direction: column; }
.cc-score-right { display: flex; flex-direction: column; align-items: flex-end; }

.cc-logo {
  width: 44px; height: 30px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.cc-badge { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; font-family: inherit; width: 44px; height: 30px; border-radius: 4px; }
.cc-flag  { object-fit: cover; object-position: center; }

.cc-abbr     { font-size: 20px; font-weight: 800; color: #9ca3af; letter-spacing: 0.5px; line-height: 1; }

.cc-vs-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: #6b7280; letter-spacing: 1px;
  flex-shrink: 0;
}

.cc-runs  { font-size: 28px; font-weight: 700; color: #ffffff; letter-spacing: -1px; line-height: 1; }
.cc-dashes{ font-size: 16px; color: #374151; letter-spacing: 5px; line-height: 1; padding-top: 5px; }
.cc-label { font-size: 16px; color: #6b7280; letter-spacing: 1px; margin-top: 3px; text-transform: uppercase; }

.cricket-large .cc-runs  { font-size: 36px; }
.cricket-large .cc-abbr  { font-size: 24px; }

.cc-target-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
  font-size: 16px;
  font-weight: 600;
  color: #E4E6EB;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ── No matches ── */
.no-matches {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; text-align: center; padding: 24px;
}
.no-matches-icon { font-size: 44px; opacity: 0.4; }
.no-matches-title { font-size: 20px; font-weight: 700; }
.no-matches-sub { font-size: 16px; color: #6b7280; line-height: 1.6; }

.next-match-pill {
  margin-top: 8px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 16px;
  color: #E4E6EB;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ── Loading ── */
.loading { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 16px; color: #6b7280; letter-spacing: 2px; text-transform: uppercase; }

.scorer-loading { font-size: 16px; color: #6b7280; text-align: center; padding: 8px 0; letter-spacing: 0.5px; }

/* ── Voice bar ── */
.voice-bar {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  height: 50px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 25px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 12px;
  z-index: 20;
  cursor: pointer;
  transition: background 300ms, border-color 300ms;
}

.voice-bar:active { background: rgba(255,255,255,0.09); }

.voice-bar.active-listen {
  border-color: rgba(255,59,48,0.4);
}

.voice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4b5563;
  transition: color 300ms;
}

.voice-icon.listening { color: #ff3b30; }

.voice-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.voice-wave span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
}

.voice-wave span:nth-child(1) { height: 8px; }
.voice-wave span:nth-child(2) { height: 13px; }
.voice-wave span:nth-child(3) { height: 20px; }
.voice-wave span:nth-child(4) { height: 13px; }
.voice-wave span:nth-child(5) { height: 8px; }

.voice-icon.listening .voice-wave span {
  animation: vwave 0.7s ease-in-out infinite;
}
.voice-icon.listening .voice-wave span:nth-child(1) { animation-delay: 0.00s; }
.voice-icon.listening .voice-wave span:nth-child(2) { animation-delay: 0.10s; }
.voice-icon.listening .voice-wave span:nth-child(3) { animation-delay: 0.20s; }
.voice-icon.listening .voice-wave span:nth-child(4) { animation-delay: 0.30s; }
.voice-icon.listening .voice-wave span:nth-child(5) { animation-delay: 0.40s; }

@keyframes vwave {
  0%, 100% { transform: scaleY(0.35); }
  50%       { transform: scaleY(1); }
}

.voice-hint {
  font-size: 16px;
  color: #4b5563;
  letter-spacing: 0.3px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-hint.voice-command { color: #ffffff; }
