:root {
  --primary: #e0252e;
  --accent: #ff7a00;
  --bg: #ffffff;
  --bg-2: #fff7f0;
  --panel: #ffffff;
  --panel-2: #fff9f4;
  --text: #1b1b1f;
  --muted: #6e6a74;
  --ok: #18a05a;
  --ko: #d98400;
  --border: #f1e3d6;
  --shadow: 0 10px 22px rgba(224, 37, 46, 0.15);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--text);
  background: radial-gradient(120% 80% at 0% 0%, var(--bg-2), transparent 60%),
    var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

#app-root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 16px 92px;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff, #fff6ef);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(140%) blur(6px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: radial-gradient(70% 70% at 30% 30%, var(--accent), transparent 60%),
    radial-gradient(70% 70% at 70% 60%, var(--primary), transparent 60%),
    #fff0ea;
  box-shadow: 0 0 0 2px #ffe6dd inset, 0 4px 12px rgba(224, 37, 46, 0.2);
}

.subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.pill {
  font-size: 0.75rem;
  color: #8b827d;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
}

/* Leaderboard */
.leaderboard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.lb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.lb-head h2 {
  font-size: 1rem;
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.crown {
  width: 18px;
  height: 18px;
  display: inline-block;
  color: var(--primary);
}

.players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.player {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.player.lead {
  outline: 2px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(224, 37, 46, 0.12);
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: white;
  font-size: 0.9rem;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.score {
  font-size: 1.25rem;
  font-weight: 900;
  color: #c81822;
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #ff8b3d;
  font-weight: 800;
}

.flame {
  width: 16px;
  height: 16px;
}

.tag {
  font-size: 0.7rem;
  color: var(--muted);
}

/* Sections */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0 4px;
}

.section-title h3 {
  margin: 0;
  font-size: 1rem;
}

.challenges {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card h4 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
}

.meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #8b827d;
  font-weight: 800;
}

.pts {
  color: #cf1e28;
  border-color: #ffd6c7;
  background: #fff2ef;
}

.due {
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-ok {
  background: linear-gradient(180deg, #fff, #fff1eb);
  border-color: #ffd6b0;
  color: #b91720;
}

.btn-ok .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  margin-right: 8px;
}

.btn-ko {
  background: linear-gradient(180deg, #fff, #fff6e6);
  border-color: #ffe2b9;
  color: #7a4b00;
}

.btn-ko .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ko);
  display: inline-block;
  margin-right: 8px;
}

.btn-ghost {
  background: transparent;
}

.state-done {
  opacity: 0.7;
  filter: saturate(0.95);
}

.state-unreal {
  opacity: 0.6;
  filter: grayscale(0.15);
}

/* FAB + Nav */
.fab {
  position: fixed;
  right: 18px;
  bottom: 86px;
  z-index: 15;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--accent), var(--primary));
  color: white;
  font-weight: 900;
  font-size: 1.5rem;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(255, 122, 0, 0.28);
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 10px 8px;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  background: transparent;
  border: 0;
  cursor: pointer;
}

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

.tab svg {
  width: 22px;
  height: 22px;
}

/* Focus */
button:focus-visible,
.tab:focus-visible,
.fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
  background: linear-gradient(180deg, var(--accent), var(--primary));
  color: white;
  border: none;
  box-shadow: 0 8px 18px rgba(224, 37, 46, 0.35);
}

.input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid #ddd;
  padding: 10px 14px;
  margin-top: 8px;
  font-size: 1rem;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}
