/* === CSS Variables === */
:root {
  --bg: #0f0f1a;
  --bg-surface: #1a1a2e;
  --bg-elevated: #25253e;
  --text: #e8e8f0;
  --text-muted: #8888a8;
  --text-dim: #7777a0;
  --accent: #4fc3f7;
  --accent-dark: #0288d1;
  --green: #66bb6a;
  --green-dark: #2e7d32;
  --red: #ef5350;
  --red-dark: #c62828;
  --yellow: #ffd54f;
  --yellow-dark: #f9a825;
  --orange: #ffa726;
  --blue: #42a5f5;
  --purple: #ab47bc;
  --border: #333355;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3);
  --transition: 150ms ease;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --home-color: #4fc3f7;
  --away-color: #ffa726;
  --home-gradient: #4fc3f7;
  --away-gradient: #ffa726;
  --home-text: #000;
  --away-text: #000;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  -webkit-user-select: none;
  user-select: none;
}

input, textarea {
  -webkit-user-select: auto;
  user-select: auto;
}

/* === Screen System === */
.screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

.screen-content {
  flex: 1;
  padding: 20px 16px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* === Home Screen === */
.home-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.home-screen h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent);
}

.home-screen .subtitle {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* === Resume Banner === */
.resume-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-dark);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.resume-banner p {
  width: 100%;
  text-align: center;
  font-weight: 600;
  margin-bottom: 4px;
}

/* === Home Activity Panel === */
.home-activity {
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}

.home-activity:not(:has(.resume-banner:not(.hidden),
  .live-now:not(.hidden),
  .watch-history:not(.hidden),
  .draft-matches:not(.hidden))) {
  display: none;
}

.home-activity > div:not(.hidden) + div:not(.hidden) {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* === Typography === */
h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* === Form Elements === */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.input:focus {
  border-color: var(--accent);
}

/* Hide Safari search clear button and autofill contact button */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}
input::-webkit-contacts-auto-fill-button,
input::-webkit-credentials-auto-fill-button {
  visibility: hidden;
  display: none !important;
  pointer-events: none;
  height: 0;
  width: 0;
  margin: 0;
}

.input-sm {
  width: 64px;
  flex-shrink: 0;
  text-align: center;
}

/* === Screen Actions (bottom buttons) === */
.screen-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-bottom: 20px;
}

.screen-actions .btn {
  flex: 1;
}

/* === Utility === */
.hidden {
  display: none !important;
}

/* === Toast === */
.toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: transform 300ms ease;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* === Scrollbar (subtle) === */
::-webkit-scrollbar {
  width: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
