﻿: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 240px;
}

/* 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: 16px;
}

.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;
  gap: 12px;
}

.leaderboard-caption {
  margin: 0;
  font-size: 0.85rem;
  color: #8f8aa0;
  font-weight: 700;
}

.player {
  background: #fffaf8;
  border: 1px solid #ead9cf;
  border-radius: 18px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  min-width: 0;
}

.player.lead {
  border: 2px solid #ff4a43;
  box-shadow: 0 0 0 4px rgba(224, 37, 46, 0.08);
}

.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;
}

.player-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  flex-shrink: 0;
}

.player-icon svg {
  width: 22px;
  height: 22px;
}

.player-icon.lead {
  color: #c81822;
  background: #fff2ec;
}

.player-icon.other {
  color: #cf7a00;
  background: #fff7e8;
}

.player-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.player-main > div {
  min-width: 0;
}

.player-name {
  font-weight: 900;
  font-size: 1.45rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag {
  font-size: 0.78rem;
  color: #7f7a96;
}

.encouragement-message {
  margin-top: 16px;
  padding: 14px 16px;
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: #b07925;
}

.streak-progress-card {
  background: linear-gradient(135deg, #fff9f3, #ffffff);
  border-color: #f4d8bf;
  gap: 12px;
}

.streak-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.streak-progress-kicker {
  margin: 0 0 2px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8d7669;
}

.streak-progress-title {
  margin: 0;
  font-size: 1.3rem;
}

.streak-bonus-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff1e7;
  border: 1px solid #ffd5b9;
  color: #a04d11;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.streak-progress-track {
  height: 12px;
  background: #f8e8dc;
  border-radius: 999px;
  overflow: hidden;
}

.streak-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb44d, #ff8b3d 40%, #e0252e 100%);
}

.streak-progress-track-compact {
  margin-top: 2px;
}

.streak-progress-milestones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.streak-milestone {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #f0ddd0;
  background: rgba(255, 255, 255, 0.84);
  color: #7b6d68;
}

.streak-milestone strong {
  font-size: 0.95rem;
}

.streak-milestone span {
  font-size: 0.74rem;
  font-weight: 700;
}

.streak-milestone.is-done {
  border-color: #ffc18b;
  background: linear-gradient(135deg, #fff4dd, #fff7ed);
  color: #a34a14;
}

.streak-progress-copy {
  margin: 0;
  font-size: 0.84rem;
  color: #7d6d67;
  line-height: 1.45;
}

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

.score {
  font-size: 2rem;
  font-weight: 900;
  color: #c81822;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

.score-unit {
  font-size: 0.72rem;
  font-weight: 700;
  color: currentColor;
}

.catchup-hero-card {
  background: linear-gradient(135deg, #fff8f0 0%, #fff 100%);
  border: 1px solid #f0d9c4;
}

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

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

/* ─── Streak inline (inside leaderboard card) ─── */
.streak-inline {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.streak-inline-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.streak-inline-fire {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.streak-inline-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text);
}

.streak-steps {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0 4px;
}

.streak-steps-track {
  position: absolute;
  top: 14px; /* half of 28px dot height */
  left: 18px;
  right: 18px;
  height: 4px;
  border-radius: 999px;
  background: #ede8e4;
  overflow: hidden;
}

.streak-steps-track-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.streak-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.streak-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ddd7d3;
  background: #f6f4f2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.67rem;
  font-weight: 800;
  color: #b0a8a2;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}

.streak-step.is-done .streak-step-dot {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: transparent;
  color: #fff;
}

.streak-step.is-milestone:not(.is-done) .streak-step-dot {
  border-color: #f5c89a;
  background: #fff8f2;
  color: #c07540;
}

.streak-step.is-milestone.is-done .streak-step-dot {
  box-shadow: 0 0 0 3px rgba(255, 139, 61, 0.25);
}

.streak-step-reward {
  font-size: 0.6rem;
  font-weight: 800;
  color: #cbc3bb;
  white-space: nowrap;
}

.streak-step.is-done .streak-step-reward {
  color: var(--accent);
}

.streak-inline-copy {
  margin: 10px 0 0;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
}

.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;
  align-items: center;
}

.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;
}

.badge-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.bonus-badge {
  color: #7b3f00;
  border-color: #ffd49e;
  background: #fff5e8;
}

.card.bonus-card {
  background:
    linear-gradient(135deg, rgba(255, 202, 64, 0.2), rgba(255, 244, 214, 0.95)),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 184, 44, 0.1) 0,
      rgba(255, 184, 44, 0.1) 10px,
      rgba(255, 255, 255, 0.22) 10px,
      rgba(255, 255, 255, 0.22) 20px
    );
  border: 2px solid #ffb32c;
  box-shadow: 0 12px 28px rgba(247, 154, 24, 0.28);
}

.card.bonus-card h4 {
  color: #8f3d00;
}

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

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

.bonus-warning {
  margin: 0;
  font-size: 0.8rem;
  color: #a34600;
  font-weight: 700;
}

/* Carte f�licitation gagnant bonus */
.bonus-winner-card {
  background: linear-gradient(135deg, #fff5e8 0%, #ffffff 100%);
  border: 2px solid #ffd700;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.bonus-winner-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.bonus-winner-header h3 {
  margin: 0;
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.bonus-trophy {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #c81822;
}

.bonus-trophy svg {
  width: 36px;
  height: 36px;
}

.bonus-winner-message {
  text-align: center;
  font-size: 1rem;
  color: #7b3f00;
  margin-bottom: 20px;
  font-weight: 600;
}

/* Liste des d�fis bonus avec recherche */
.bonus-defis-list {
  max-height: min(56vh, 520px);
  min-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e0e0e0;

  background: #ffffff;
  margin-top: 12px;
  margin-bottom: 16px;
  padding: 8px;
}

.bonus-defi-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f9f9f9;
  border: 2px solid transparent;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bonus-defi-item:hover {
  background: #fff5e8;
  border-color: #ffd700;
  transform: translateX(4px);
}

.bonus-defi-item.selected {
  background: linear-gradient(135deg, #fff2ef 0%, #ffffff 100%);
  border: 2px solid var(--primary);
  box-shadow: 0 2px 8px rgba(224, 37, 46, 0.2);
}

.bonus-defi-item span:first-child {
  flex: 1;
  font-weight: 600;
  color: #333;
}

.bonus-defi-item.selected span:first-child {
  color: var(--primary);
}

.bonus-defi-points {
  font-weight: 700;
  color: #cf1e28;
  background: linear-gradient(135deg, #fff2ef 0%, #ffd6c7 100%);
  border: 1px solid #ffb4a0;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.85rem;
  white-space: nowrap;
  margin-left: 12px;
  box-shadow: 0 1px 4px rgba(207, 30, 40, 0.15);
}

.bonus-assign-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bonus-assign-controls .input {
  flex: 1 1 220px;
  min-height: 42px;
}

button {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 10px 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;
}

/* Boutons ic�nes dans les badges */
.btn-icon {
  border: 2px solid;
  font-size: 1.4rem;
  padding: 6px 18px;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s ease;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

/* Premier bouton pouss� � droite */
.btn-icon.btn-ko {
  margin-left: auto;
  background: linear-gradient(135deg, #fff9f0, #ffecd0);
  border-color: #ffb84d;
  color: #8b5a00;
}

.btn-icon.btn-ko:hover {
  background: linear-gradient(135deg, #fff4e0, #ffd89a);
  border-color: #ff9500;
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(255, 149, 0, 0.3);
}

.btn-icon.btn-ok {
  background: linear-gradient(135deg, #f0fff4, #d0ffe0);
  border-color: #4ade80;
  color: #166534;
}

.btn-icon.btn-ok:hover {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border-color: #22c55e;
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-ghost {
  background: transparent;
}

.spark-menu-btn {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff, #fff4ed);
  color: var(--text);
  padding: 14px 12px;
  text-align: left;
  font-size: 0.96rem;
  font-weight: 800;
}

.spark-menu-btn + .spark-menu-btn {
  margin-top: 10px;
}

.spark-menu-btn.is-disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.intimate-question-card {
  background: linear-gradient(145deg, #fff4ed 0%, #fff 100%);
  border-color: #ffd9bf;
}

.intimate-question-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9c5b23;
}

.intimate-question-text {
  margin: 6px 0 2px;
  font-size: 1.1rem;
  line-height: 1.45;
  font-weight: 800;
  color: #2e1c12;
}

.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;
}

.fab-mail {
  bottom: 152px;
  font-size: 0;
}

.fab-mail svg {
  width: 24px;
  height: 24px;
}

.partner-message-panel {
  position: fixed;
  right: 18px;
  bottom: 220px;
  z-index: 16;
  width: min(340px, calc(100vw - 32px));
  background: linear-gradient(180deg, #fffaf4, #ffffff);
  border: 1px solid #ffd8b2;
  border-radius: 18px;
  box-shadow: 0 20px 36px rgba(255, 122, 0, 0.2);
  padding: 14px;
}

.partner-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.partner-message-head h3 {
  margin: 0;
  font-size: 1rem;
}

.partner-message-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.partner-message-close svg {
  width: 18px;
  height: 18px;
}

.partner-message-input {
  width: 100%;
  min-height: 100px;
  margin-top: 8px;
  border: 1px solid #f2d6bc;
  border-radius: 14px;
  padding: 12px 14px;
  resize: vertical;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.partner-message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.partner-message-counter {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.partner-message-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 520px) {
  .partner-message-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }
}

.bottom-nav {
  position: fixed;
  left: max(0px, env(safe-area-inset-left));
  right: max(0px, env(safe-area-inset-right));
  bottom: 0;
  z-index: 10;
  background: #fff;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

@supports (bottom: env(safe-area-inset-bottom)) {
  .fab {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .fab-mail {
    bottom: calc(152px + env(safe-area-inset-bottom));
  }

  .partner-message-panel {
    bottom: calc(220px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 520px) {
  .bonus-defis-list {
    max-height: 52vh;
    min-height: 340px;
  }
}

.settings-submenu-card {
  gap: 14px;
}

.settings-submenu {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.settings-submenu-btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 10px 8px;
}

.settings-submenu-btn.active {
  background: #fff3ef;
  border-color: #ffc6b9;
  color: var(--primary);
}

.settings-panel h3 {
  margin: 0;
}

.settings-build-stamp {
  margin: 14px 0 0;
  font-size: 0.7rem;
  color: rgba(110, 106, 116, 0.82);
  text-align: center;
}

.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.is-disabled {
  opacity: 0.35;
  color: #9c9aa1;
  pointer-events: none;
  cursor: not-allowed;
  filter: grayscale(1);
}

.tab.is-disabled svg {
  opacity: 0.7;
}

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

/* Focus */
button:focus-visible,
.tab:focus-visible,
.fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.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);
}

/* ========== LOGIN PAGE STYLES ========== */
.login-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 24px 16px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  gap: 12px;
  align-items: center;
}

.login-brand .logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: radial-gradient(70% 70% at 28% 28%, var(--accent), transparent 62%),
    radial-gradient(75% 75% at 72% 68%, var(--primary), transparent 58%),
    #fff1ea;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75), 0 8px 18px rgba(224, 37, 46, 0.18);
  flex: none;
}

.brand-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 1.06rem;
}

.brand-title span {
  color: var(--primary);
}

.login-hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  margin-bottom: 8px;
}

.login-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 2.5rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-lead {
  display: none;
}

.login-hero-card {
  display: none;
}

.energy-chip {
  display: none;
}

.energy-box {
  display: none;
}

.login-form-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.form-title {
  margin: 0 0 14px;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 900;
  color: #4e4652;
  letter-spacing: 0.01em;
}

.form-input {
  width: 100%;
  min-height: 54px;
  border-radius: 15px;
  border: 1px solid rgba(26, 26, 36, 0.1);
  background: #fff;
  padding: 0 16px;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.form-input:focus {
  border-color: rgba(224, 37, 46, 0.35);
  box-shadow: 0 0 0 4px rgba(224, 37, 46, 0.1);
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 8px;
}

.login-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  min-height: 56px;
  padding: 15px 18px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  color: #fff;
  width: 100%;
}

.login-btn:hover {
  transform: translateY(-1px);
}

.login-btn:focus-visible {
  outline: 2px solid rgba(224, 37, 46, 0.24);
  outline-offset: 3px;
}

.form-status {
  min-height: 20px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.form-divider::before,
.form-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(26, 26, 36, 0.08);
}

@media (max-width: 420px) {
  .players {
    gap: 10px;
  }

  .player {
    padding: 10px;
  }

  .player-main {
    gap: 8px;
  }

  .player-icon {
    width: 30px;
    height: 30px;
  }

  .player-icon svg {
    width: 19px;
    height: 19px;
  }

  .player-name {
    font-size: 0.98rem;
  }

  .score {
    font-size: 1.08rem;
    gap: 4px;
  }

  .score-unit {
    font-size: 0.64rem;
  }

  .login-app {
    padding-inline: 14px;
  }
  
  .login-hero h1 {
    font-size: 1.75rem;
  }
}

/* ========== STATS PAGE ========== */

.stats-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 16px 88px;
}

.stats-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 12px 0 6px;
}

.stats-section-title-hero {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.stats-hero-card {
  background:
    radial-gradient(100% 140% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 40%),
    linear-gradient(135deg, #d62d36 0%, #ee5e2f 54%, #ffb24a 100%);
  border: 0;
  color: #fff;
  padding: 18px;
  gap: 10px;
  box-shadow: 0 20px 40px rgba(224, 37, 46, 0.22);
}

.stats-hero-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stats-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stats-hero-name {
  font-size: clamp(2rem, 8vw, 2.65rem);
  font-weight: 900;
  margin: 0;
  line-height: 1.1;
  color: #fff;
}

.stats-hero-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  line-height: 1.45;
}

.stats-hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stats-hero-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
}

.stats-hero-pill strong {
  font-size: 1.4rem;
  line-height: 1;
}

.stats-hero-pill span {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.82);
}

.stats-hero-pill-soft {
  background: rgba(84, 29, 0, 0.18);
}

.stats-section-card {
  margin-bottom: 4px;
  padding: 16px;
  gap: 14px;
}

.stats-section-card-warm {
  background: linear-gradient(180deg, #fffdfb, #fff7f2);
}

.stats-section-card-chart {
  background:
    linear-gradient(180deg, rgba(255, 250, 246, 0.98), rgba(255, 255, 255, 0.98)),
    radial-gradient(120% 120% at 0% 0%, rgba(255, 139, 61, 0.08), transparent 50%);
}

.stats-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stats-card-title {
  margin: 0;
  font-size: 1rem;
}

.stats-card-copy {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.stats-inline-value {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 900;
}

.stats-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 132px;
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto -10px -22px auto;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(224, 37, 46, 0.06);
}

.kpi-card-streak::after {
  background: rgba(255, 122, 0, 0.1);
}

.kpi-card-check::after {
  background: rgba(24, 160, 90, 0.1);
}

.kpi-card-progress::after {
  background: rgba(34, 197, 94, 0.08);
}

.kpi-icon {
  position: relative;
  z-index: 1;
  font-size: 1.05rem;
}

.kpi-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  position: relative;
  z-index: 1;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.rate-bar-wrap {
  grid-column: 1 / -1;
  min-height: auto;
}

.streak-journey-card {
  gap: 10px;
}

.rate-bar-track {
  height: 12px;
  background: #f6ebe1;
  border-radius: 999px;
  overflow: hidden;
  margin: 4px 0;
}

.rate-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffb34e, #ff7a00 48%, #e0252e 100%);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* Weekly scores chart */
.stats-chart-wrap {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: stretch;
}

.stats-chart-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  color: #998e89;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 0 18px;
}

.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 128px;
  overflow-x: auto;
  padding: 10px 6px 8px;
  border-radius: 16px;
  background:
    linear-gradient(to top, rgba(240, 227, 214, 0.55) 1px, transparent 1px),
    linear-gradient(180deg, #fffdfa, #fff8f1);
  background-size: 100% 33.33%;
  border: 1px solid #f3e4d8;
}

.stats-chart-week {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 40px;
}

.stats-chart-values {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  font-size: 0.68rem;
  font-weight: 800;
  color: #6c6060;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stats-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 92px;
}

.stats-bar {
  width: 14px;
  border-radius: 8px 8px 2px 2px;
  transition: height 0.4s ease, transform 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.stats-bar:hover {
  transform: translateY(-2px);
}

.stats-bar-me {
  background: linear-gradient(180deg, #ff8c72, var(--primary));
}

.stats-bar-partner {
  background: linear-gradient(180deg, #ffd06f, var(--accent));
}

.stats-chart-week-label {
  font-size: 0.66rem;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.stats-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 2px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

/* All-time grid */
.stats-alltime-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.weeks-won-box {
  text-align: center;
  justify-content: center;
}

.weeks-won-box-highlight {
  background: linear-gradient(135deg, #fff4ea, #fffaf6);
  border-color: #ffd8bb;
}

.weeks-won-number {
  display: block;
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.weeks-won-total {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

/* Categories */
.stat-cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.stat-cat-rank {
  flex-shrink: 0;
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.stat-cat-name {
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-cat-bar-track {
  flex: 1;
  height: 8px;
  background: #f0e4d6;
  border-radius: 999px;
  overflow: hidden;
}

.stat-cat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  border-radius: 999px;
}

.stat-cat-count {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
  width: 24px;
  text-align: right;
}

.stats-empty-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  justify-content: center;
  min-height: 88px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff9f4, #fff);
  border: 1px dashed #f0d7c3;
}

.stats-empty-state strong {
  font-size: 0.95rem;
}

.stats-empty-state span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.stats-empty-state-soft {
  min-height: 128px;
}

@media (max-width: 420px) {
  .streak-progress-head {
    flex-direction: column;
  }

  .stats-page {
    padding-inline: 12px;
  }

  .stats-hero-meta,
  .stats-kpis,
  .stats-alltime-grid {
    grid-template-columns: 1fr;
  }

  .stats-chart-wrap {
    grid-template-columns: 1fr;
  }

  .stats-chart-axis {
    display: none;
  }

  .stats-chart {
    gap: 6px;
  }
}

