@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
  --bg: #121212;
  --card: #1E1E1E;
  --border: #2E2E2E;
  --red: #EF4444;
  --red-dim: rgba(239, 68, 68, 0.1);
  --text: #E5E7EB;
  --text-dim: #6B7280;
  --green: #10B981;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.text-red { color: var(--red); }
.text-dim { color: var(--text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }

/* Loading */
.loading-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.loader { text-align: center; }
.loader .crosshair { width: 48px; height: 48px; animation: pulse 1.5s ease-in-out infinite; }
.loader-text { margin-top: 16px; color: var(--text-dim); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.9); } }

/* App layout */
#app { height: 100%; }
#main-app { display: flex; flex-direction: column; height: 100%; }

/* Header */
header {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--border);
  background: var(--card); flex-shrink: 0; z-index: 10;
}
header h1 { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: -0.5px; color: #fff; }
header h1 span { color: var(--red); }
.header-coins {
  display: flex; align-items: center; gap: 6px;
  background: var(--red-dim); border: 1px solid rgba(239,68,68,0.2);
  padding: 6px 12px; border-radius: 20px;
}
.header-coins svg { width: 14px; height: 14px; color: var(--red); }
.header-coins span { font-size: 13px; font-weight: 800; color: var(--red); }

/* Content */
#content { flex: 1; overflow-y: auto; overflow-x: hidden; }
.page { display: none; min-height: 100%; }
.page.active { display: block; }
.page-inner { padding: 20px 16px 24px; }
.page-header { margin-bottom: 20px; }
.page-header h2 { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.page-center { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; text-align: center; gap: 12px; }

/* Home */
.home-hero { text-align: center; margin-bottom: 28px; }
.home-icon svg { width: 56px; height: 56px; margin-bottom: 16px; opacity: 0.8; }
.home-hero h2 { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.home-subtitle { color: var(--text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 12px; text-align: center; display: flex; flex-direction: column; gap: 6px;
}
.stat-value { font-size: 24px; font-weight: 800; color: var(--red); }
.stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-dim); }

/* Coming soon */
.coming-icon svg { width: 56px; height: 56px; opacity: 0.3; }
.coming-soon-badge {
  padding: 8px 20px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 11px; color: var(--red); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
}

/* Trends */
.trends-filters { display: flex; gap: 10px; margin-bottom: 16px; }
.input-search, .input-select {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 10px 14px; font-size: 13px; font-weight: 600;
  outline: none; transition: border-color 0.2s;
}
.input-search { flex: 1; }
.input-search:focus, .input-select:focus { border-color: var(--red); }
.input-select { appearance: none; cursor: pointer; min-width: 140px; }

.trends-container { min-height: 300px; }
.loading-spinner { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 0; gap: 12px; }
.loading-spinner p { color: var(--text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; }
.spinner { width: 32px; height: 32px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.trend-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 8px; cursor: pointer; transition: border-color 0.2s;
}
.trend-card:hover { border-color: var(--red); }
.trend-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.trend-match { font-size: 13px; font-weight: 700; color: #fff; }
.trend-live { background: var(--red-dim); color: var(--red); padding: 2px 8px; border-radius: 6px; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.trend-card-meta { display: flex; gap: 12px; align-items: center; }
.trend-league, .trend-country { font-size: 11px; color: var(--text-dim); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.trend-card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.trend-time { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.trend-icons { display: flex; gap: 6px; }
.trend-icon {
  width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
}
.trend-icon.yellow { background: rgba(234, 179, 8, 0.15); color: #EAB308; }
.trend-icon.green { background: rgba(16, 185, 129, 0.15); color: #10B981; }

.no-trends { text-align: center; padding: 60px 0; color: var(--text-dim); }
.no-trends p { font-size: 14px; font-weight: 600; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
.page-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: none; color: var(--text-dim); font-size: 12px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center;
}
.page-btn.active { background: var(--red); color: #fff; border-color: var(--red); }
.page-btn:hover:not(.active) { border-color: var(--red); color: var(--text); }

/* Claim */
.claim-container { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 20px; }
.claim-icon svg { width: 56px; height: 56px; opacity: 0.6; margin-bottom: 16px; }
.claim-container h2 { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.claim-balance {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px 32px; margin: 24px 0;
}
.claim-balance-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.15em; color: var(--text-dim); }
.claim-balance-value { font-size: 36px; font-weight: 800; color: var(--red); }

.claim-countdown {
  position: relative; width: 140px; height: 140px; margin: 24px 0;
}
.countdown-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown-bg { fill: none; stroke: var(--border); stroke-width: 6; }
.countdown-progress {
  fill: none; stroke: var(--red); stroke-width: 6; stroke-linecap: round;
  stroke-dasharray: 339.292; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear;
}
.countdown-text {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.countdown-time { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.countdown-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }

.claim-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 320px; padding: 16px; border-radius: 14px;
  background: var(--red); color: #fff; border: none;
  font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  cursor: pointer; transition: all 0.2s; margin-top: 8px;
}
.claim-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.claim-btn svg { width: 20px; height: 20px; }

.claim-message {
  margin-top: 16px; padding: 12px 20px; border-radius: 10px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.claim-message.success { background: rgba(16, 185, 129, 0.1); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.2); }
.claim-message.error { background: rgba(239, 68, 68, 0.1); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Profile */
.profile-container { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 20px; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%; background: var(--red-dim);
  border: 2px solid rgba(239, 68, 68, 0.3); display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.profile-avatar svg { width: 32px; height: 32px; }
.profile-name { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.profile-role {
  display: inline-block; padding: 4px 12px; border-radius: 6px;
  background: var(--red-dim); color: var(--red); font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 24px;
}
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; margin-bottom: 32px; }
.profile-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 8px; text-align: center; display: flex; flex-direction: column; gap: 4px;
}
.profile-stat-value { font-size: 16px; font-weight: 800; color: var(--text); }
.profile-stat-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); }

.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 320px; padding: 14px; border-radius: 12px;
  background: var(--card); color: var(--text-dim); border: 1px solid var(--border);
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  cursor: pointer; transition: all 0.2s;
}
.btn-secondary svg { width: 16px; height: 16px; }
.btn-secondary:hover { border-color: var(--red); color: var(--text); }

/* Bottom Nav */
#bottom-nav {
  display: flex; height: 64px; border-top: 1px solid var(--border);
  background: var(--card); flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: none; border: none; color: var(--text-dim);
  cursor: pointer; transition: color 0.2s;
}
.nav-btn svg { width: 22px; height: 22px; }
.nav-btn span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.nav-btn.active { color: var(--red); }

/* Scrollbar */
#content::-webkit-scrollbar { width: 4px; }
#content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Flag image */
.flag-img { width: 16px; height: 12px; border-radius: 2px; object-fit: cover; }
