:root {
  --espresso: #2a1f18;
  --roast: #5c3d2e;
  --foam: #f7f2ea;
  --steam: #e8dfd2;
  --sage: #6f8f7a;
  --sage-deep: #3f5c4a;
  --leaf: #a8c4b0;
  --copper: #c4784a;
  --ink: #1e1814;
  --muted: #6b5e54;
  --friday: #3f5c4a;
  --friday-soft: rgba(111, 143, 122, 0.18);
  --today-ring: #c4784a;
  --shadow: 0 24px 60px rgba(42, 31, 24, 0.14);
  --radius: 22px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 12% -10%, #d9e6dc 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%, #f0dcc8 0%, transparent 50%),
    linear-gradient(165deg, #f4efe6 0%, #e7eee8 45%, #f2ebe2 100%);
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: -20% auto auto 55%;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 120, 74, 0.18), transparent 70%);
  filter: blur(12px);
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
  z-index: 0;
}

.bg-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.brand {
  text-align: center;
  animation: riseIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand__logo {
  display: block;
  width: clamp(72px, 14vw, 96px);
  height: auto;
  margin: 0 auto 0.65rem;
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(42, 31, 24, 0.12);
  animation: logoFloat 4.5s ease-in-out infinite;
}

.brand__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-weight: 600;
}

.brand__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--espresso);
  line-height: 1;
}

.brand__sub {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--sage-deep), #54705d 60%, #6a8a74);
  color: var(--foam);
  box-shadow: var(--shadow);
  animation: riseIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.hero-card.is-weekend {
  background: linear-gradient(135deg, var(--roast), #7a5340);
}

.hero-card__label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.85;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.hero-card__date {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.9;
}

.hero-card__who {
  margin: 0.15rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  font-weight: 700;
}

.calendar-shell {
  background: rgba(247, 242, 234, 0.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(92, 61, 46, 0.08);
  border-radius: calc(var(--radius) + 2px);
  padding: 0.85rem 0.85rem 1rem;
  box-shadow: var(--shadow);
  animation: riseIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.calendar-nav__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  font-weight: 700;
  color: var(--espresso);
  text-align: center;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.calendar-nav__center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.today-btn {
  border: none;
  background: none;
  padding: 0.1rem 0.4rem;
  color: var(--sage-deep);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.today-btn:hover {
  color: var(--espresso);
}

/* Ocupa su espacio aunque esté oculto, para que el calendario no salte */
.today-btn[hidden] {
  display: block;
  visibility: hidden;
}

.calendar-nav__title.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}

.nav-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 11px;
  background: var(--steam);
  color: var(--espresso);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn:hover {
  background: var(--leaf);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(63, 92, 74, 0.2);
}

.nav-btn:active {
  transform: translateY(0);
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.28rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.weekday-row__friday {
  color: var(--sage-deep);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.28rem;
}

.day {
  position: relative;
  min-height: clamp(52px, 7.5vw, 72px);
  border-radius: 10px;
  padding: 0.3rem 0.28rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  animation: dayIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.day--muted {
  opacity: 0.35;
  background: transparent;
}

.day--muted .day__num {
  color: var(--muted);
}

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

.day--friday {
  background: linear-gradient(160deg, rgba(111, 143, 122, 0.22), rgba(168, 196, 176, 0.28));
  border-color: rgba(63, 92, 74, 0.2);
  cursor: pointer;
}

.day--friday:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 14px 28px rgba(63, 92, 74, 0.18);
}

.day--today {
  box-shadow: inset 0 0 0 2px var(--today-ring);
}

.day--today.day--friday {
  background: linear-gradient(160deg, #3f5c4a, #6f8f7a);
  color: var(--foam);
}

.day--today.day--friday .day__num,
.day--today.day--friday .day__name {
  color: var(--foam);
}

.day__name {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: clamp(0.68rem, 1.4vw, 0.82rem);
  font-weight: 700;
  color: var(--sage-deep);
  line-height: 1.1;
  animation: namePop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.day__chip {
  align-self: flex-start;
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--copper);
  background: rgba(196, 120, 74, 0.14);
  padding: 0.1rem 0.28rem;
  border-radius: 999px;
}

.day--today.day--friday .day__chip {
  color: var(--foam);
  background: rgba(247, 242, 234, 0.2);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.35rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.site-footer img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  opacity: 0.92;
}

.roster {
  background: rgba(247, 242, 234, 0.7);
  border: 1px solid rgba(92, 61, 46, 0.08);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem 1.3rem;
  animation: riseIn 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  animation: riseIn 1s cubic-bezier(0.22, 1, 0.36, 1) 0.18s both;
}

.chart-card {
  background: rgba(247, 242, 234, 0.78);
  border: 1px solid rgba(92, 61, 46, 0.08);
  border-radius: 16px;
  padding: 0.85rem 0.9rem 0.7rem;
  box-shadow: 0 12px 28px rgba(42, 31, 24, 0.08);
}

.chart-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--espresso);
}

.chart-card__sub {
  margin: 0.15rem 0 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.chart-frame {
  width: 100%;
  min-height: 150px;
}

.chart-frame svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-empty {
  margin: 0;
  min-height: 150px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.5rem;
}

.chart-bar {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: barGrow 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.chart-line {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: lineDraw 1s ease forwards;
}

.chart-dot {
  opacity: 0;
  animation: fadeIn 0.35s ease forwards;
}

@keyframes barGrow {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes lineDraw {
  to { stroke-dashoffset: 0; }
}

.roster__title {
  margin: 0 0 0.9rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--espresso);
}

.roster__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.roster__item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.roster__item.is-current {
  background: linear-gradient(135deg, rgba(111, 143, 122, 0.25), rgba(196, 120, 74, 0.16));
  border-color: rgba(63, 92, 74, 0.28);
  transform: translateY(-2px);
}

.roster__num {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--steam);
  color: var(--roast);
}

.roster__item.is-current .roster__num {
  background: var(--sage-deep);
  color: var(--foam);
}

.roster__name {
  font-weight: 600;
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%) translateY(20px);
  background: var(--espresso);
  color: var(--foam);
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.day__score {
  margin-top: 0.05rem;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--copper);
  letter-spacing: 0.02em;
}

.day--today.day--friday .day__score {
  color: rgba(247, 242, 234, 0.92);
}

.day--closed {
  opacity: 0.55;
  cursor: not-allowed;
}

.day--skipped {
  background: repeating-linear-gradient(135deg, rgba(92, 61, 46, 0.06) 0 6px, transparent 6px 12px);
  border-color: rgba(92, 61, 46, 0.18);
  cursor: default;
}

.day--skipped:hover {
  transform: none;
  box-shadow: none;
}

.day__name--off {
  color: var(--muted);
  font-style: italic;
}

.day__note {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.05rem;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--roast);
  opacity: 0.85;
}

/* Viernes con intercambio: marca discreta en la esquina */
.day--changed::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--copper);
}

.admin-link {
  display: inline-block;
  margin-top: 0.4rem;
  color: var(--sage-deep);
  font-size: 0.72rem;
  opacity: 0.55;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.admin-link:hover,
.admin-link:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

.admin-link[hidden] {
  display: none;
}

.day--closed:hover {
  transform: none;
  box-shadow: none;
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 24, 20, 0.45);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease both;
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  background: linear-gradient(180deg, #fbf7f1, #f3ebe1);
  border-radius: 24px;
  padding: 1.4rem 1.35rem 1.5rem;
  box-shadow: 0 30px 70px rgba(30, 24, 20, 0.28);
  animation: modalIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal__close {
  position: absolute;
  top: 0.7rem;
  right: 0.8rem;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: var(--steam);
  color: var(--espresso);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal__brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.15rem;
  padding-right: 2rem;
}

.modal__brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(42, 31, 24, 0.1);
}

.modal__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--sage-deep);
}

.modal__title {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--espresso);
}

.modal__host {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.modal__stats {
  margin: 0.9rem 0 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(111, 143, 122, 0.14);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sage-deep);
}

.review-form {
  display: grid;
  gap: 0.85rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--roast);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(92, 61, 46, 0.18);
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(111, 143, 122, 0.22);
}

.field--stars {
  border: none;
  margin: 0;
  padding: 0;
}

.field--stars legend {
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--roast);
}

/* Estrellas con relleno parcial: --fill es el porcentaje pintado */
.star-meter {
  --fill: 0%;
  display: inline-block;
  line-height: 1;
  background: linear-gradient(90deg, var(--copper) var(--fill), rgba(92, 61, 46, 0.25) var(--fill));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.star-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.star-meter--input {
  font-size: 2.1rem;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  border-radius: 6px;
}

.star-meter--input:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 3px;
}

.star-meter--input.is-disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.star-picker__value {
  min-width: 2.5rem;
  font-weight: 700;
  color: var(--roast);
}

.review-identity {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage-deep);
}

.review-identity:empty {
  display: none;
}

.field--check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 500;
  cursor: pointer;
}

.field--check input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--sage-deep);
  cursor: pointer;
}

.field--check span {
  color: var(--roast);
  font-size: 0.86rem;
}

.form-hint {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

.form-error {
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: rgba(160, 55, 40, 0.1);
  color: #8a2f22;
  font-size: 0.82rem;
  font-weight: 600;
}

.btn-submit {
  border: none;
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--sage-deep), #6a8a74);
  color: var(--foam);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(63, 92, 74, 0.25);
}

.btn-login {
  display: block;
  text-align: center;
  text-decoration: none;
}

.btn-login[hidden] {
  display: none;
}

.btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.comments {
  margin-top: 1.1rem;
  display: grid;
  gap: 0.55rem;
}

.comment {
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(92, 61, 46, 0.08);
  animation: riseIn 0.35s ease both;
}

.comment__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sage-deep);
  margin-bottom: 0.25rem;
}

.comment__name--anon {
  font-style: italic;
  color: var(--muted);
}

.comment__text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.4;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes dayIn {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes namePop {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes drift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(-8vw, 6vh);
  }
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 1rem, 960px);
    padding-top: 1rem;
  }

  .calendar-shell {
    padding: 0.7rem;
  }

  .day {
    min-height: 48px;
    padding: 0.22rem 0.18rem;
    border-radius: 8px;
  }

  .day__name {
    font-size: 0.58rem;
  }

  .day__chip {
    display: none;
  }

  .day__score {
    display: none;
  }

  .day__note {
    -webkit-line-clamp: 1;
    font-size: 0.52rem;
  }

  .weekday-row {
    font-size: 0.58rem;
  }

  .charts {
    grid-template-columns: 1fr;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }

  .hero-card__label {
    writing-mode: horizontal-tb;
    transform: none;
  }
}
