:root {
  --bg: #0a0c12;
  --bg-glow: radial-gradient(ellipse 900px 500px at 50% -10%, rgba(45, 141, 191, 0.16), transparent 60%),
    radial-gradient(ellipse 700px 400px at 100% 100%, rgba(255, 122, 89, 0.07), transparent 60%),
    linear-gradient(180deg, #0a0c12 0%, #10131c 60%, #0a0c12 100%);
  --panel: linear-gradient(160deg, #161b26 0%, #12151e 100%);
  --panel-raised: linear-gradient(160deg, #1e2531 0%, #171c27 100%);
  --panel-solid: #161b26;
  --line: #2c3444;
  --ink: #f2f5f8;
  --ink-dim: #8b96a8;
  --teal: #2dd4bf;
  --teal-dim: #1a8f81;
  --teal-glow: rgba(45, 212, 191, 0.25);
  --coral: #ff7a59;
  --coral-dim: #c85a3d;
  --amber: #f2b84b;
  --red: #ef5a5a;
  --green: #3fb56f;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body, #app { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; min-height: 100%; }

button { font-family: var(--font-body); cursor: pointer; }

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.6rem;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 12, 18, 0.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 30;
  max-width: 100vw;
  box-sizing: border-box;
  gap: 0.6rem;
}
.hamburger-btn {
  display: block;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .topnav {
    padding: 0.7rem 0.9rem;
  }
  .hamburger-btn {
    display: block;
  }
  .topnav-train-btn {
    display: none; /* en móvil el CTA grande vive debajo del nav */
  }
  .topnav-user-rating,
  .topnav-user span:last-child {
    display: none;
  }
}

.hamburger-panel {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}
.hamburger-panel.open {
  display: block;
}
.hamburger-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 7, 0.6);
}
.hamburger-sheet {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(280px, 82vw);
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  animation: hamburger-slide-in 0.2s ease-out;
}
@keyframes hamburger-slide-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}
.hamburger-sheet h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 0.8rem;
}
.hamburger-link {
  background: none;
  border: none;
  color: var(--ink);
  text-align: left;
  padding: 0.8rem 0.6rem;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}
.hamburger-link:hover {
  background: var(--panel-raised);
}

.topnav-pro-btn {
  border: 1px solid #f2b84b;
  color: #1a1200 !important;
  background: linear-gradient(135deg, #f2b84b, #e0982a) !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  letter-spacing: 0.02em;
  box-shadow: 0 0 18px rgba(242, 184, 75, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.topnav-pro-btn:hover {
  box-shadow: 0 0 26px rgba(242, 184, 75, 0.65), 0 2px 10px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}
@media (max-width: 640px) {
  .topnav-pro-btn {
    display: none;
  }
}
.hamburger-link-pro {
  color: var(--amber);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
}

.practice-pro-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(242, 184, 75, 0.12), rgba(255, 122, 89, 0.08));
  border: 1px solid var(--amber);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.4rem;
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  .practice-pro-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

.quota-blocked {
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
}
.quota-blocked-icon {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.8rem;
}
.quota-blocked h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.8rem;
}
.quota-blocked p {
  font-size: 0.9rem;
  color: var(--ink-dim);
  margin: 0 0 1.4rem;
}
.quota-blocked .btn {
  width: 100%;
  margin-bottom: 0.6rem;
  display: block;
  text-align: center;
}
.quota-streak-note {
  background: rgba(255, 122, 89, 0.08);
  border: 1px solid rgba(255, 122, 89, 0.3);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem !important;
  margin-bottom: 1rem !important;
}

.pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f2b84b, #e0982a);
  color: #1a1200;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(242, 184, 75, 0.5);
}
.pro-badge-small {
  font-size: 0.78rem;
  filter: drop-shadow(0 0 4px rgba(242, 184, 75, 0.7));
}
.streak-badge-small {
  font-size: 0.78rem;
  filter: drop-shadow(0 0 4px rgba(255, 122, 89, 0.6));
}
.share-card-pro {
  border-color: #f2b84b !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(242, 184, 75, 0.18) !important;
}

.dash-stat-clickable {
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.dash-stat-clickable:hover {
  border-color: var(--teal-dim);
  transform: translateY(-1px);
}

.streak-summary {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.streak-summary-item {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem;
  text-align: center;
}
.streak-summary-value {
  display: block;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.5rem;
}
.streak-summary-label {
  font-size: 0.75rem;
  color: var(--ink-dim);
}

.streak-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.6rem;
}
.streak-cell {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  border: 1px solid var(--line);
  background: var(--panel);
}
.streak-cell-icon {
  font-size: 1.1rem;
}
.streak-cell-num {
  font-size: 0.65rem;
  color: var(--ink-dim);
}
.streak-cell-completed {
  border-color: rgba(255, 122, 89, 0.4);
  background: rgba(255, 122, 89, 0.08);
}
.streak-cell-frozen {
  border-color: rgba(122, 200, 255, 0.5);
  background: rgba(122, 200, 255, 0.1);
}
.streak-cell-missed {
  opacity: 0.5;
}
.streak-cell-freezing {
  animation: streak-freeze-pop 0.55s ease-out;
}
@keyframes streak-freeze-pop {
  0% { transform: scale(1); background: var(--panel); }
  35% { transform: scale(1.25); background: rgba(122, 200, 255, 0.35); box-shadow: 0 0 20px rgba(122, 200, 255, 0.7); }
  100% { transform: scale(1); background: rgba(122, 200, 255, 0.1); }
}

.streak-freeze-section {
  text-align: center;
}
.streak-pro-label {
  color: #f2b84b;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}
.streak-freeze-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  width: 100%;
}
#freeze-btn.btn-primary {
  width: 100%;
}
.account-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.account-toggle-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.account-toggle-disabled .account-toggle-label {
  color: var(--ink-dim);
  cursor: not-allowed;
}
.account-toggle-pro-tag {
  font-size: 0.68rem;
  font-weight: 700;
  color: #f2b84b;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.account-row-label {
  color: var(--ink-dim);
}
.account-note {
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-align: center;
  margin-top: 0.6rem;
}
.account-error {
  color: var(--red);
  font-size: 0.82rem;
  text-align: center;
  min-height: 1.2rem;
}
.account-terms-link {
  display: block;
  text-align: center;
  margin-top: 1.6rem;
  font-size: 0.82rem;
  color: var(--ink-dim);
  text-decoration: underline;
}
.terms-body p {
  font-size: 0.88rem;
  color: var(--ink-dim);
  line-height: 1.6;
  margin-bottom: 1rem;
}
.terms-body h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 1.2rem 0 0.6rem;
}
.pro-view {
  max-width: 560px;
  margin: 2rem auto;
  padding: 0 1rem;
}
.pro-hero {
  text-align: center;
  margin-bottom: 1.8rem;
}
.pro-hero h1 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 0 0 0.6rem;
}
.pro-hero p {
  color: var(--ink-dim);
  font-size: 0.95rem;
}
.pro-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.pro-plan-btn {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  color: var(--ink);
}
.pro-plan-btn:hover {
  border-color: var(--teal-dim);
}
.pro-plan-cta {
  margin-top: 0.6rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: var(--panel-raised);
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 600;
}
.pro-plan-cta-featured {
  background: var(--teal);
  color: #04211d;
  border-color: var(--teal);
}
.pro-plan-featured {
  border-color: var(--amber);
  background: rgba(242, 184, 75, 0.08);
}
.pro-plan-badge {
  position: absolute;
  top: -0.6rem;
  background: var(--amber);
  color: #1a1200;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 20px;
}
.pro-plan-name {
  font-size: 0.85rem;
  color: var(--ink-dim);
}
.pro-plan-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
}
.pro-plan-price span {
  font-size: 0.75rem;
  color: var(--ink-dim);
  font-weight: 500;
}
.pro-plan-sub {
  font-size: 0.72rem;
  color: var(--ink-dim);
}
.pro-error {
  color: var(--red);
  font-size: 0.82rem;
  text-align: center;
  min-height: 1.2rem;
}
.pro-compare {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.85rem;
}
.pro-compare th, .pro-compare td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.pro-compare td:first-child {
  text-align: left;
  color: var(--ink-dim);
}
.pro-compare th:nth-child(3) {
  color: var(--amber);
}

.install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--panel);
  border-top: 1px solid var(--teal-dim);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}
.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.install-banner-never {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}
.install-banner-dismiss {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
}
@media (max-width: 640px) {
  .install-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}
.mobile-train-cta {
  display: none;
}
.stats-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.5rem;
  max-width: 1360px;
  margin: 1.6rem auto;
  padding: 0 1.5rem;
  align-items: start;
}
.stats-ranking-fixed {
  position: sticky !important;
  top: 90px !important;
  right: auto !important;
  width: auto !important;
}
.stats-main-col h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 1rem;
}
@media (max-width: 900px) {
  .stats-page-layout {
    grid-template-columns: 1fr;
  }
  .stats-ranking-fixed {
    position: static !important;
    display: block !important;
    width: auto !important;
    margin-top: 1.5rem;
  }
}
.sparkline-card-big {
  padding: 1.4rem;
}
.pro-stats-grid-wide {
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 700px) {
  .pro-stats-grid-wide {
    grid-template-columns: repeat(2, 1fr);
  }
}
.stats-row-wide {
  grid-template-columns: 1.4fr 0.8fr 1fr auto;
}
.stats-row-rating {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--teal);
  font-size: 0.85rem;
}
.standalone-view {
  max-width: 480px;
  margin: 1.6rem auto;
  padding: 0 1rem;
}
.standalone-view h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 1rem;
}
.sparkline-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}
.sparkline-svg {
  width: 100%;
  height: 90px;
}
.sparkline-svg-big {
  height: 340px !important;
}
.sparkline-caption {
  font-size: 0.72rem;
  color: var(--ink-dim);
  margin: 0.4rem 0 0;
}
.pro-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
  margin-top: 1rem;
}
.pro-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.pro-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
}
.pro-stat-label {
  font-size: 0.74rem;
  color: var(--ink-dim);
}

.stats-preview-wrap {
  position: relative;
}
.stats-locked-icon {
  font-size: 1.6rem;
  display: block;
}
.stats-preview-blur {
  filter: blur(5px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}
.stats-preview-cta {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.6rem;
  padding: 1.5rem;
}
.stats-preview-cta p {
  font-size: 0.85rem;
  color: var(--ink);
  max-width: 320px;
  background: rgba(10, 12, 18, 0.6);
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
}
.stats-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 1.6rem 0 0.8rem;
}
.stats-table {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.stats-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
}
.stats-row-label {
  font-size: 0.82rem;
}
.stats-row-acc {
  font-size: 0.72rem;
  color: var(--ink-dim);
  font-family: var(--font-mono);
}
.stats-row-stars {
  color: var(--amber);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
}
@media (max-width: 640px) {
  .mobile-train-cta {
    display: block;
    width: calc(100% - 1.8rem);
    margin: 0.9rem auto 0;
    padding: 1rem;
    font-size: 1rem;
  }
}
.topnav-brand {
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0;
}
.topnav-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.topnav-back {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.3rem 0;
}
.topnav-back:hover { color: var(--teal); }

.topnav-right {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.topnav-train-btn {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
}
.topnav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 0.3rem 0.9rem 0.3rem 0.3rem;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.topnav-user:hover { border-color: var(--teal-dim); }
.topnav-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  color: #04211d;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topnav-user-rating {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.82rem;
}

.topnav-logout {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
}
.topnav-logout:hover { border-color: var(--red); color: var(--red); }

.auth-screen {
  max-width: 360px;
  margin: 3.5rem auto;
  text-align: center;
  padding: 0 1.2rem;
}
.auth-screen h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.auth-logo {
  height: 90px;
  width: auto;
  margin: 0 auto 0.6rem;
  display: block;
}
.topnav-logo {
  height: 34px;
  width: auto;
  display: block;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.6rem;
}
.auth-checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-align: left;
  cursor: pointer;
}
.auth-checkbox-row input {
  margin-top: 0.15rem;
  width: auto !important;
  flex-shrink: 0;
}
.auth-checkbox-row a {
  color: var(--teal);
}
.auth-form input {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  color: var(--ink);
  font-size: 0.92rem;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--teal-dim);
}
.auth-error {
  color: var(--red);
  font-size: 0.85rem;
  min-height: 1.2rem;
  margin: 0.8rem 0 0;
}
.auth-switch {
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  margin-top: 0.4rem;
}

.topnav-link {
  font-size: 0.85rem;
  color: var(--ink-dim);
  font-weight: 500;
}
.topnav-link.active {
  color: var(--teal);
}

.btn {
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--ink);
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}
.btn:hover { border-color: var(--teal-dim); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, #22b8a5 100%);
  border-color: var(--teal);
  color: #04211d;
  font-weight: 600;
}
.btn-primary:hover {
  box-shadow: 0 0 24px var(--teal-glow);
}

.back-btn { margin: 1.4rem; }

.menu {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
  text-align: center;
}

.menu h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
}

.accent { color: var(--teal); }

.menu-sub {
  color: var(--ink-dim);
  font-size: 1.05rem;
  margin: 0 0 3rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.mode-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.8rem;
  text-align: left;
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.mode-card:hover {
  border-color: var(--teal-dim);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.mode-card h3 {
  font-family: var(--font-display);
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}
.mode-card p { color: var(--ink-dim); font-size: 0.9rem; margin: 0; line-height: 1.5; }

.drill-header {
  max-width: 560px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0.8rem;
  text-align: center;
}
.drill-header h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0 0 0.7rem;
  letter-spacing: -0.01em;
}
.drill-hint { color: var(--ink-dim); font-size: 0.95rem; line-height: 1.6; }

.drill-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.timer {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--teal);
  min-width: 2.4ch;
  display: inline-block;
  text-align: center;
  text-shadow: 0 0 20px var(--teal-glow);
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
}

@keyframes board-fade-in {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.board-mount {
  width: min(560px, 66vh);
  aspect-ratio: 1;
  margin: 1.6rem auto;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  animation: board-fade-in 0.35s ease-out;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(45, 212, 191, 0.28),
    0 0 46px rgba(45, 212, 191, 0.13);
}

.board-mount-preview {
  opacity: 0.55;
  filter: grayscale(0.3);
}

.drill-controls {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.4rem 0;
}

.feedback {
  max-width: 520px;
  margin: 0 auto 2.5rem;
  padding: 0 1.5rem;
  text-align: center;
  font-size: 0.96rem;
  color: var(--ink-dim);
  line-height: 1.6;
}
.feedback strong { color: var(--ink); }

.summary {
  max-width: 560px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
}
.summary h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 2rem;
}
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.summary-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.3rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.summary-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--teal);
  text-shadow: 0 0 20px var(--teal-glow);
}
.summary-label {
  font-size: 0.76rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.session-topbar {
  display: flex;
  justify-content: center;
  gap: 0.9rem;
  padding: 1rem 0 0;
}

.intro {
  max-width: 640px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
}

.intro-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  border: 1px solid var(--teal-dim);
  border-radius: 20px;
  padding: 0.3rem 0.9rem;
  margin-bottom: 1.2rem;
}

.intro-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 700;
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}

.intro-subtitle {
  color: var(--ink-dim);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto 2.4rem;
  line-height: 1.6;
}

.intro-steps {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 2.4rem;
  text-align: left;
}

.intro-step {
  display: grid;
  grid-template-columns: 1.8rem 2.2rem 1fr;
  align-items: center;
  gap: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
}

.intro-step-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--teal);
  border: 1px solid var(--teal-dim);
  border-radius: 50%;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.intro-step-icon { font-size: 1.4rem; text-align: center; }

.intro-step-text {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.45;
}
.intro-step-text strong { color: var(--teal); }

.btn-lg {
  padding: 0.9rem 2.2rem;
  font-size: 1rem;
}

.turn-badge {
  display: block;
  width: fit-content;
  margin: 1.4rem auto 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.4rem 1.1rem;
  border-radius: 20px;
  border: 1px solid var(--line);
}
.turn-badge.white {
  background: rgba(242, 245, 248, 0.92);
  color: #08090c;
  border-color: rgba(242, 245, 248, 0.92);
}
.turn-badge.black {
  background: #1a1e26;
  color: var(--ink);
  border-color: var(--line);
}

.exercise-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1rem 0 0;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

.session-time-chip,
.exercise-time-chip {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
}
.exercise-time-chip {
  color: var(--teal);
  border-color: var(--teal-dim);
}

.bm-hint-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: none;
  border: none;
  color: var(--teal);
  padding: 0.4rem 0.3rem;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.bm-hint-btn:hover:not(:disabled) {
  opacity: 0.8;
}
.bm-hint-btn:active:not(:disabled) {
  transform: scale(0.97);
}
.bm-hint-btn:disabled {
  opacity: 0.4;
  cursor: default;
  color: var(--ink-dim);
}
.bm-hint-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.6));
}
.bm-hint-btn:disabled .bm-hint-icon {
  filter: none;
}

.exercise-header .turn-badge {
  margin: 0 !important;
}

.board-mount.hide-pieces piece {
  opacity: 0 !important;
}

.board-mount.board-mount-tight {
  margin: 0.2rem auto 1.4rem;
  position: relative;
  width: min(560px, 66vh);
}

.exercise-layout {
  position: relative;
  max-width: 1000px;
  margin: 1.6rem auto;
  padding: 0 1rem;
}

.exercise-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-left: 2px solid var(--teal-dim);
  padding-left: 1rem;
}
@media (min-width: 900px) {
  .exercise-sidebar {
    position: fixed;
    left: 2rem;
    top: 130px;
    width: 160px;
  }
}
@media (max-width: 899px) {
  .exercise-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    column-gap: 2rem;
    row-gap: 1rem;
    margin-bottom: 1.2rem;
    border-left: none;
    border-bottom: 2px solid var(--teal-dim);
    padding-left: 0;
    padding-bottom: 1rem;
  }
}

.sidebar-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sidebar-stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
}
.sidebar-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--ink);
}
.sidebar-stat-value.good { color: var(--green); }
.sidebar-stat-value.bad { color: var(--coral); }
.sidebar-stat-value.accent { color: var(--teal); }
.sidebar-divider {
  display: none;
}
.sidebar-turn-badge {
  align-self: flex-start;
}

.board-instruction {
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.85rem;
  margin: 0.6rem 0 0;
}
.board-instruction.solution-callout {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.98rem;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid var(--teal-dim);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  margin-top: 0.8rem;
}

.exercise-content {
  margin: 0 auto;
  max-width: 560px;
  text-align: center;
  position: relative;
}

.blind-banner {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  background: rgba(4, 5, 7, 0.72);
  border-radius: 10px;
  animation: board-fade-in 0.3s ease-out;
}
.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 7, 0.72);
  border-radius: 10px;
  animation: overlay-fade 1.3s ease-out forwards;
}
.result-ring {
  width: 52%;
  max-width: 220px;
  filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.6));
}
.result-ring-track {
  fill: rgba(4, 5, 7, 0.85);
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 5;
}
.result-ring-progress {
  fill: none;
  stroke-width: 7;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  animation: ring-fill 0.45s ease-out forwards;
}
.result-mark {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 90;
  stroke-dashoffset: 90;
  animation: mark-draw 0.35s ease-out 0.35s forwards;
}
.result-overlay.ok .result-ring-progress { stroke: var(--green); }
.result-overlay.ok .result-mark { stroke: var(--green); }
.result-overlay.wrong .result-ring-progress { stroke: var(--red); }
.result-overlay.wrong .result-mark { stroke: var(--red); }
.result-overlay.timeout .result-ring-progress { stroke: var(--amber); }
.result-overlay.timeout .result-mark { stroke: var(--amber); }
.result-mark-clockface { fill: none; stroke: var(--amber); stroke-width: 3; opacity: 0.5; }

@keyframes ring-fill { to { stroke-dashoffset: 0; } }
@keyframes mark-draw { to { stroke-dashoffset: 0; } }
@keyframes overlay-fade {
  0% { opacity: 0; }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.admin-view {
  max-width: 1100px;
  margin: 1.6rem auto;
  padding: 0 1.5rem;
}
.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 1.6rem;
}
.admin-summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.admin-summary-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.4rem;
}
.admin-summary-label {
  font-size: 0.72rem;
  color: var(--ink-dim);
}
.admin-search-input {
  width: 100%;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.7rem 1rem;
  color: var(--ink);
  margin: 0.6rem 0 1rem;
}
.admin-chart-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.admin-chart-tab {
  background: var(--panel-raised);
  border: 1px solid var(--line);
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
}
.admin-chart-tab.active {
  background: var(--teal);
  color: #04211d;
  border-color: var(--teal);
  font-weight: 600;
}
.admin-users-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.admin-user-row {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 1rem;
  align-items: center;
  font-size: 0.82rem;
}
.admin-user-main {
  display: flex;
  flex-direction: column;
}
.admin-user-email {
  color: var(--ink-dim);
  font-size: 0.75rem;
}
.admin-user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  color: var(--ink-dim);
  font-size: 0.72rem;
}
.admin-user-actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
}
.admin-delete-btn {
  margin-top: 0.4rem;
  background: none;
  border: 1px solid rgba(239, 90, 90, 0.4);
  color: #ef5a5a;
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.admin-delete-btn:hover:not(:disabled) {
  background: rgba(239, 90, 90, 0.1);
}
.admin-delete-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
@media (max-width: 700px) {
  .admin-user-row {
    grid-template-columns: 1fr;
  }
}
.pro-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 7, 0.75);
  animation: board-fade-in 0.25s ease-out;
  padding: 1rem;
}
.pro-success-card {
  background: linear-gradient(160deg, var(--panel-raised), var(--panel));
  border: 1px solid rgba(242, 184, 75, 0.4);
  border-radius: 20px;
  padding: 2.4rem 1.8rem;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 60px rgba(242, 184, 75, 0.15);
  animation: pro-success-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pro-success-pop {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.pro-success-badge {
  font-size: 3.4rem;
  filter: drop-shadow(0 0 16px rgba(242, 184, 75, 0.7));
  margin-bottom: 0.6rem;
  animation: pro-success-badge-spin 0.7s ease-out;
}
@keyframes pro-success-badge-spin {
  0% { transform: scale(0) rotate(-30deg); }
  60% { transform: scale(1.2) rotate(10deg); }
  100% { transform: scale(1) rotate(0deg); }
}
.pro-success-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 0 0 0.8rem;
  background: linear-gradient(90deg, #f2b84b, #ffd98a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pro-success-text {
  font-size: 0.88rem;
  color: var(--ink-dim);
  line-height: 1.5;
  margin: 0 0 1.6rem;
}
.pro-success-btn {
  width: 100%;
}
.piece-slider-wrap {
  max-width: 380px;
  margin: 1.6rem auto 0;
  text-align: center;
}
.piece-slider-wrap label {
  font-size: 0.9rem;
  color: var(--ink-dim);
  display: block;
  margin-bottom: 0.8rem;
}
.piece-slider-wrap label strong {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 1.2rem;
}
#piece-slider {
  width: 100%;
  accent-color: #2dd4bf;
  height: 6px;
  cursor: pointer;
}
.piece-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--ink-dim);
  margin: 0.3rem 0 1.2rem;
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}
.level-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.level-card:hover {
  border-color: var(--teal-dim);
  transform: translateY(-2px);
}
.level-icon { font-size: 1.8rem; }
.level-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
}
.level-desc {
  font-size: 0.8rem;
  color: var(--ink-dim);
  text-align: center;
}

.eval-simple {
  text-align: center;
  max-width: 1300px;
  margin: 1.6rem auto;
}
.eval-layout {
  display: flex;
  gap: 2rem;
  align-items: center;
  text-align: left;
}
.eval-board-col {
  flex: 0 0 auto;
  text-align: center;
}
.eval-board-col .board-mount {
  width: min(520px, 50vh);
  margin: 0.7rem 0 0;
}
.eval-side-col {
  flex: 1;
  min-width: 220px;
}
.eval-side-col .board-instruction {
  text-align: left;
  margin: 0 0 1rem;
}
@media (max-width: 680px) {
  .eval-layout {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .eval-board-col .board-mount {
    width: min(420px, 88vw);
    margin: 0.7rem auto 0;
  }
  .eval-side-col .board-instruction {
    text-align: center;
  }
}
.eval-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.eval-btn {
  border: 1px solid var(--line);
  background: var(--panel-raised);
  color: var(--ink);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.eval-btn:hover:not(:disabled) { border-color: var(--teal-dim); }
.eval-btn:disabled { opacity: 0.75; }
.eval-btn-correct {
  background: rgba(63, 181, 111, 0.22) !important;
  border-color: var(--green) !important;
  opacity: 1 !important;
}
.eval-btn-wrong {
  background: rgba(239, 90, 90, 0.22) !important;
  border-color: var(--red) !important;
  opacity: 1 !important;
}

.dash-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}
.dash-badge {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-dim);
  border: 1px dashed var(--line);
  border-radius: 20px;
  padding: 0.3rem 0.8rem;
  margin: 0 auto 1.8rem;
  width: fit-content;
}

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 860px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-side {
    order: -1;
  }
}

.dash-top {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (max-width: 640px) {
  .dash-top { grid-template-columns: 1fr; }
}
.dash-stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.dash-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
}
.dash-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--ink);
}
.dash-stat-value-max {
  font-size: 1rem;
  color: var(--ink-dim);
  font-weight: 500;
}
.dash-stat-sub {
  font-size: 0.76rem;
  color: var(--ink-dim);
}
.dash-stat-sub.good { color: var(--green); }

.dash-section {
  margin-bottom: 2rem;
}
.dash-section h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.8rem;
}

.star-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.7rem;
}
.dash-stats-link {
  width: 100%;
  margin-top: 0.9rem;
}
@media (max-width: 640px) {
  .star-grid { grid-template-columns: 1fr; }
}
.star-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 1rem;
}
.star-row-label {
  font-size: 0.85rem;
  color: var(--ink);
}
.star-row-stars {
  font-size: 1.05rem;
  color: var(--ink-dim);
  letter-spacing: 0.12em;
}
.star-row-stars.full { color: var(--amber); }

.dash-practice-header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.8rem;
}
.dash-practice-sub {
  font-size: 0.82rem;
  color: var(--ink-dim);
}

/* Columna lateral: tarjeta + clasificación, siempre visibles */
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (min-width: 861px) {
  .dash-side {
    position: sticky;
    top: 90px;
  }
}

.share-card {
  background:
    radial-gradient(ellipse 200px 140px at 20% 0%, rgba(45, 212, 191, 0.16), transparent 60%),
    radial-gradient(ellipse 180px 140px at 100% 100%, rgba(255, 122, 89, 0.14), transparent 60%),
    linear-gradient(160deg, #171d29, #0d1017);
  border: 1px solid var(--teal-dim);
  border-radius: 20px;
  padding: 1.4rem 1.4rem 1.2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(45, 212, 191, 0.08);
}
.share-card-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}
.share-card-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--coral));
  color: #04211d;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.share-card-rating-block {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.share-card-rating {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--teal);
  line-height: 1;
}
.info-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
  cursor: pointer;
  margin-left: 0.4rem;
  vertical-align: super;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  opacity: 0.8;
}
.info-btn:hover {
  border-color: var(--teal-dim);
  color: var(--teal);
  opacity: 1;
}
.info-popover {
  font-size: 0.76rem;
  color: var(--ink-dim);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  margin: 0.5rem 0 0;
  text-align: left;
}
.share-card-rating-label {
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.share-card-weekly {
  font-size: 0.72rem;
  color: var(--ink-dim);
  margin: -0.6rem 0 0.9rem;
}
.share-card-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.share-card-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  color: var(--ink);
}
.share-card-identity {
  display: flex;
  flex-direction: column;
}
.share-card-username {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.share-card-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.dash-share-btn {
  width: 100%;
}

.dash-ranking-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.1rem 0.6rem;
}
.dash-ranking-card h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.7rem;
}
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ranking-row {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  align-items: center;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  font-size: 0.85rem;
}
.ranking-pos {
  color: var(--ink-dim);
  font-family: var(--font-mono);
}
.ranking-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ranking-points {
  font-family: var(--font-mono);
  font-weight: 600;
}
.ranking-provisional-mark {
  width: 15px;
  height: 15px;
  font-size: 0.6rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.ranking-row.ranking-you {
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid var(--teal-dim);
}

.mode-reminder {
  max-width: 420px;
  margin: 2rem auto;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--teal-dim);
  border-radius: 16px;
  padding: 1.6rem 1.4rem;
  animation: board-fade-in 0.3s ease-out;
}
.mode-reminder-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.5rem;
}
.mode-reminder h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.6rem;
}
.mode-reminder p {
  font-size: 0.9rem;
  color: var(--ink-dim);
  margin: 0 0 1.2rem;
}
.mode-reminder-hide-note {
  font-size: 0.72rem !important;
  color: var(--ink-dim);
  margin: 0.8rem 0 0 !important;
}
.mode-reminder-hide-note a {
  color: var(--teal);
}
.daily-header {
  max-width: 460px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.2rem 0;
}
.daily-mode-badge {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.daily-mode-icon {
  font-size: 1.5rem;
}
.daily-mode-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--teal);
}
.daily-meta {
  display: flex;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
}

.wod-screen {
  max-width: 480px;
  margin: 2.5rem auto;
  text-align: center;
}
.wod-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.8rem 0 0.6rem;
}
.wod-personalized-note {
  font-size: 0.8rem;
  color: var(--teal);
  text-align: center;
  max-width: 420px;
  margin: 0 auto 1.2rem;
  line-height: 1.4;
}
.wod-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.6rem;
  text-align: left;
}
.wod-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  position: relative;
}
.wod-item-count {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--teal);
  min-width: 2.2rem;
}
.wod-item-label {
  flex: 1;
  font-size: 0.92rem;
}
.wod-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-dim);
  font-size: 0.78rem;
  cursor: pointer;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
}
.wod-info-btn:hover { border-color: var(--teal-dim); color: var(--teal); }
.wod-item-info {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--ink-dim);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.6rem 0.8rem;
  z-index: 5;
}
.wod-start-btn {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
}

.done-stat-row {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin: 1.6rem 0 2rem;
  flex-wrap: wrap;
}
.done-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  animation: board-fade-in 0.4s ease-out;
}
.done-stat-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--ink);
}
.done-stat-label {
  font-size: 0.78rem;
  color: var(--ink-dim);
}
.done-stat-label .good { color: var(--green); }
.done-stat-label .bad { color: var(--coral); }

.countdown-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  background: var(--bg);
}
.countdown-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.countdown-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.25) 0%, rgba(45, 212, 191, 0) 70%);
  border-radius: 50%;
  animation: countdown-glow-kf 0.55s ease-out infinite;
}
@keyframes countdown-glow-kf {
  0% { opacity: 0.4; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.05); }
  100% { opacity: 0.4; transform: scale(0.85); }
}
.countdown-ring {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.countdown-ring-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 5;
}
.countdown-ring-progress {
  fill: none;
  stroke: var(--teal);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  filter: drop-shadow(0 0 6px rgba(45, 212, 191, 0.7));
}
.countdown-ring-progress.countdown-ring-animate {
  animation: countdown-ring-drain 0.55s linear forwards;
}
@keyframes countdown-ring-drain {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: 327; }
}
.countdown-num {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4rem;
  color: var(--ink);
  text-shadow: 0 0 18px rgba(45, 212, 191, 0.5);
}
@keyframes countdown-pulse-kf {
  0% { transform: scale(0.6); opacity: 0; }
  40% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.countdown-pulse {
  animation: countdown-pulse-kf 0.4s ease-out;
}
@media (max-width: 640px) {
  .countdown-ring-wrap {
    width: 140px;
    height: 140px;
  }
  .countdown-num {
    font-size: 3.2rem;
  }
}
.promo-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 45;
  background: rgba(4, 5, 7, 0.7);
  animation: board-fade-in 0.2s ease-out;
}
.promo-picker {
  background: var(--panel);
  border: 1px solid var(--teal-dim);
  border-radius: 14px;
  padding: 1.2rem;
  text-align: center;
}
.promo-picker-title {
  font-size: 0.9rem;
  margin: 0 0 0.8rem;
  color: var(--ink-dim);
}
.promo-picker-options {
  display: flex;
  gap: 0.6rem;
}
.promo-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  color: var(--ink);
}
.promo-picker-btn:hover {
  border-color: var(--teal-dim);
  transform: translateY(-1px);
}
.promo-picker-icon {
  font-size: 1.8rem;
}
.promo-picker-label {
  font-size: 0.68rem;
  color: var(--ink-dim);
}

.board-dimmed {
  filter: brightness(0.35) blur(1px);
  transition: filter 0.25s ease;
  pointer-events: none;
}
.continue-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  z-index: 40;
  animation: board-fade-in 0.25s ease-out;
  transition: all 0.25s ease;
}
.continue-overlay-below {
  position: static;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  animation: board-fade-in 0.25s ease-out;
}
.continue-btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
}
.continue-solution-btn {
  padding: 0.9rem 1.4rem;
}
.continue-btn {
  padding: 0.9rem 1.8rem;
  font-size: 1rem;
}
.continue-countdown {
  font-size: 0.75rem;
  color: var(--ink-dim);
  font-family: var(--font-mono);
}
.reveal-screen {
  max-width: 420px;
  margin: 2.5rem auto;
  text-align: center;
}
@media (min-width: 700px) {
  .reveal-screen {
    max-width: 480px;
  }
}
.reveal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 1.8rem;
  opacity: 0;
  animation: reveal-title-in 0.5s ease-out forwards;
}
@keyframes reveal-title-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.reveal-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 1.4rem;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.45s ease-out, transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.reveal-step.reveal-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.reveal-label {
  font-size: 0.78rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.reveal-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--ink);
}
.reveal-value small {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-dim);
}
.reveal-streak-value {
  animation: reveal-fire-pulse 1.4s ease-in-out infinite;
}
@keyframes reveal-fire-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 122, 89, 0)); }
  50% { filter: drop-shadow(0 0 10px rgba(255, 122, 89, 0.6)); }
}
.reveal-delta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.15rem;
}
.reveal-delta.good { color: var(--green); }
.reveal-delta.bad { color: var(--coral); }

.reveal-performance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 1.3rem 1rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(242, 184, 75, 0.16), rgba(45, 212, 191, 0.06));
  border: 1px solid var(--gold-dim, rgba(242, 184, 75, 0.4));
  box-shadow: 0 0 30px rgba(242, 184, 75, 0.08);
  margin-bottom: 1.6rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal-performance::before {
  content: '🏆';
  font-size: 1.4rem;
  margin-bottom: 0.1rem;
}
.reveal-performance.reveal-in {
  opacity: 1;
  transform: translateY(0);
}
.reveal-performance-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.2rem;
  color: #f2b84b;
}
.reveal-performance-note {
  font-size: 0.72rem;
  color: var(--ink-dim);
  margin-top: 0.2rem;
}
.reveal-merge-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  margin-bottom: 1.6rem;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.reveal-merge-row.reveal-in {
  opacity: 1;
  transform: scale(1);
}
.reveal-merge-item {
  opacity: 1 !important;
  transform: none !important;
  margin-bottom: 0 !important;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 1rem 0.8rem;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.reveal-plus {
  font-size: 1.4rem;
  color: var(--ink-dim);
  font-weight: 300;
}

.reveal-position-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.6rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(242, 184, 75, 0.06));
  border: 1px solid var(--teal-dim);
  margin-bottom: 1.6rem;
  opacity: 0;
  transform: translateY(16px) scale(0.94);
  transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.reveal-position-final.reveal-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.reveal-tournament {
  text-align: left;
  margin-bottom: 1.6rem;
  max-height: 380px;
  overflow-y: auto;
}
.reveal-tournament-title {
  font-family: var(--font-display);
  font-size: 1rem;
  margin: 0 0 0.8rem;
  text-align: center;
  color: var(--ink-dim);
}
.reveal-tournament-group {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 0.9rem;
  overflow: hidden;
}
.reveal-tournament-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.7rem 1rem;
  background: var(--panel-raised);
  border-bottom: 1px solid var(--line);
}
.reveal-tournament-group-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.reveal-tournament-group-delta {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}
.reveal-tournament-table {
  width: 100%;
  border-collapse: collapse;
}
.reveal-tournament-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}
.reveal-tournament-table tr:not(:last-child) td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.reveal-tournament-table td {
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: var(--ink-dim);
  vertical-align: middle;
}
.rt-result {
  width: 42px;
}
.rt-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}
.rt-badge-ok {
  background: rgba(45, 212, 191, 0.18);
  color: var(--teal);
}
.rt-badge-wrong {
  background: rgba(255, 122, 89, 0.16);
  color: #ff7a59;
}
.rt-rival {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-dim);
  background: var(--panel-raised);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  display: inline-block;
}
.rt-delta {
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--ink);
  width: 60px;
}
.rt-delta.good,
.reveal-tournament-group-delta.good {
  color: var(--teal);
}
.rt-delta.bad,
.reveal-tournament-group-delta.bad {
  color: #ff7a59;
}
.reveal-position-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--ink);
}
.reveal-position-value.reveal-position-up {
  color: var(--teal);
  text-shadow: 0 0 20px rgba(45, 212, 191, 0.5);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 80;
}
.confetti-piece {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 14px;
  opacity: 0.9;
  animation-name: confetti-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
  border-radius: 2px;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(540deg); opacity: 0; }
}

.reveal-cta {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
  width: 100%;
}
.reveal-cta.reveal-in {
  opacity: 1;
  transform: translateY(0);
}
.mini-ranking-panel {
  display: none;
}
.mini-ranking-panel h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.7rem;
}
.mini-ranking-loading {
  font-size: 0.82rem;
  color: var(--ink-dim);
}
.mini-ranking-your-pos {
  margin: 0.6rem 0 0;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--line);
  font-size: 0.78rem;
  color: var(--teal);
  text-align: center;
  font-weight: 600;
}
@media (min-width: 1150px) {
  .mini-ranking-panel {
    display: block;
    position: fixed;
    right: 2rem;
    top: 130px;
    width: 220px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.1rem 1.1rem 0.6rem;
  }
}
