:root {
  --bg: #ffffff;
  --text: #000000;
  --text-muted: #666666;
  --border: #000000;
  --border-light: #cccccc;
  --primary: #000000;
  --surface: #ffffff;
  --accent: #000000;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --radius: 4px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f0f0f0;
  color: var(--text);
  line-height: 1.4;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

.mobile-container {
  width: 100%;
  max-width: 414px;
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  border-left: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

header {
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

header h1 {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-btn {
  margin-right: var(--spacing-sm);
}

main {
  flex: 1;
  padding: var(--spacing-md);
  overflow-y: auto;
}

h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
}

section {
  margin-bottom: var(--spacing-xl);
}

.card {
  border: 2px solid var(--border);
  padding: var(--spacing-md);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: var(--spacing-md);
}

/* Progress Bar */
.progress-container {
  margin-top: var(--spacing-sm);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.progress-bar {
  height: 20px;
  border: 2px solid var(--border);
  position: relative;
  background: #eee;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
}

.progress-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Streak View */
.streak-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--spacing-xs);
  margin-top: var(--spacing-sm);
}

.streak-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--spacing-sm) 0;
  border: 1px solid var(--border);
  font-size: 12px;
}

.streak-day.active {
  background: #000;
  color: #fff;
}

/* Badges */
.badge-row {
  display: flex;
  gap: var(--spacing-md);
  overflow-x: auto;
  padding-bottom: var(--spacing-sm);
}

.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  text-align: center;
}

.badge-icon {
  width: 60px;
  height: 60px;
  border: 2px solid var(--border);
  border-radius: 50%;
  margin-bottom: var(--spacing-xs);
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-icon.locked {
  border-style: dashed;
  color: var(--text-muted);
}

.badge-name {
  font-size: 11px;
  font-weight: 600;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

/* Buttons */
.btn-group {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.btn {
  flex: 1;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 2px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
}

.btn:active {
  background: #000;
  color: #fff;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

/* Class List */
.class-list {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
}

.class-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid var(--border);
  padding: var(--spacing-sm) var(--spacing-md);
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: var(--spacing-md);
}

.tab {
  flex: 1;
  text-align: center;
  padding: var(--spacing-sm);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  border: none;
  background: none;
}

.tab.active {
  background: var(--primary);
  color: #fff;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
}

.leader-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border-light);
}

.leader-item.highlight {
  background: #f0f0f0;
  padding: var(--spacing-md);
  margin-left: calc(-1 * var(--spacing-md));
  margin-right: calc(-1 * var(--spacing-md));
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
}

.rank {
  font-weight: 800;
  width: 30px;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  margin-right: var(--spacing-sm);
}

.name {
  flex: 1;
  font-weight: 600;
}

.score {
  font-weight: 800;
}

/* Rewards */
.reward-card {
  border: 2px solid var(--border);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
}

.reward-body {
  padding: var(--spacing-md);
}

.reward-footer {
  border-top: 1px solid var(--border);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
}

/* Utility */
.placeholder-icon {
  width: 24px;
  height: 24px;
  background: #eee;
  display: inline-block;
  vertical-align: middle;
}

.status-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border: 1px solid var(--border);
  text-transform: uppercase;
}

.status-tag.warning {
  background: #fff;
  border-style: dashed;
}

.nav-bottom {
  position: sticky;
  bottom: 0;
  background: var(--bg);
  border-top: 2px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: var(--spacing-sm) 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  font-size: 10px;
  font-weight: 700;
}

.placeholder-avatar {
  width: 32px;
  height: 32px;
  background: #000;
  border-radius: 50%;
}

.placeholder-image {
  width: 100%;
  height: 120px;
  background: #eee;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.placeholder-image.square {
  aspect-ratio: 1/1;
  height: auto;
}

.placeholder-image.portrait {
  aspect-ratio: 3/4;
  height: auto;
}
