:root {
  --bg:        #0a0e1a;
  --surface:   #131a2c;
  --surface-2: #1a2138;
  --surface-3: #232c47;
  --border:    #2b3550;
  --text:      #e6ebf7;
  --muted:     #8a9ab8;
  --accent:    #4f8cff;
  --accent-2:  #6aa3ff;
  --accent-glow: rgba(79, 140, 255, 0.35);
  --success:   #5cdb95;
  --warning:   #ffb454;
  --danger:    #ff6b6b;

  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 10px 40px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1000px 600px at 20% -10%, rgba(79, 140, 255, 0.18), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(79, 140, 255, 0.10), transparent 60%),
    linear-gradient(180deg, #0a0e1a 0%, #060912 100%);
}

main {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Header */
.page-header {
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #0a0e1a;
  font-weight: 800;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px var(--accent-glow);
}

.brand-name {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
}

.bot-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #06101e;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 6px 20px var(--accent-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.bot-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--accent-glow);
}
.bot-link-emoji {
  font-size: 16px;
}

/* Cards */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.5s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

/* Today */
.today-card {
  border-color: var(--accent);
  background:
    radial-gradient(700px 200px at 100% 0%, rgba(79, 140, 255, 0.18), transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  position: relative;
  overflow: hidden;
}
.today-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent-glow);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(79, 140, 255, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(79, 140, 255, 0); }
}
.today-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.today-date {
  color: var(--muted);
  font-weight: 500;
  font-size: 16px;
  margin-left: 10px;
}
.today-counter {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 14px;
}
.big-num {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
}
.bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  margin-top: 16px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
  box-shadow: 0 0 12px var(--accent-glow);
}

.recent {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  animation: slideIn 0.3s ease both;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}
.recent-name { font-weight: 500; }
.recent-time { color: var(--muted); font-size: 12px; }

/* Hero (course progress) */
.big-stat {
  text-align: right;
  white-space: nowrap;
}
.big-percent {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
}
.big-stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.lec-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.lec-cell {
  position: relative;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 130px;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.lec-cell:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.lec-cell.is-today {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--surface-3) 0%, rgba(79, 140, 255, 0.18) 100%);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px var(--accent-glow);
}
.lec-cell.is-future {
  opacity: 0.55;
}
.lec-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, var(--accent-2) 0%, var(--accent) 100%);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  height: 0%;
}
.lec-num {
  position: relative;
  z-index: 1;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.lec-count {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.lec-cell.has-data .lec-count { color: var(--text); }
.lec-date {
  position: relative;
  z-index: 1;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: auto;
}

/* Leaderboard */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lb-row {
  display: grid;
  grid-template-columns: 32px 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: border-color 0.15s ease;
}
.lb-row:hover { border-color: var(--accent); }
.lb-rank {
  font-weight: 800;
  font-size: 16px;
  color: var(--muted);
  text-align: center;
}
.lb-row.top-1 .lb-rank { color: var(--warning); font-size: 18px; }
.lb-row.top-2 .lb-rank { color: #d0d6e0; font-size: 17px; }
.lb-row.top-3 .lb-rank { color: #cd7f32; font-size: 17px; }
.lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  overflow: hidden;
  border: 1px solid var(--border);
}
.lb-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.lb-info {
  min-width: 0;
}
.lb-name {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}
.lb-attended {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.lb-attended-total {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

/* Mood */
.mood-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.mood-cell {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.mood-cell-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--muted);
}
.mood-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}
.mood-emoji { font-size: 16px; width: 20px; }
.mood-count { font-weight: 700; }

.empty {
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
  padding: 18px 0;
  text-align: center;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 24px 4px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 640px) {
  .lec-grid { grid-template-columns: repeat(9, 1fr); gap: 4px; }
  .lec-cell { height: 110px; padding: 8px 4px; }
  .lec-num { font-size: 15px; }
  .lec-count { font-size: 11px; }
  .lec-date { display: none; }
  .big-num { font-size: 44px; }
  .big-percent { font-size: 32px; }
  .today-title { font-size: 22px; }
  .lb-row { grid-template-columns: 28px 36px 1fr auto; gap: 10px; padding: 10px; }
  .lb-avatar { width: 36px; height: 36px; }
  .brand-name { font-size: 16px; }
  .bot-link-text { display: none; }
  .bot-link { padding: 10px 12px; }
  .card { padding: 18px; }
}
