:root {
  --bg: #f6f6f4;
  --ink: #1f262b;
  --muted: #7b858c;
  --line: #e6e6e2;
  --card: #ffffff;
  --accent: #ed1c27;          /* DAVIarena red (from logo) */
  --face-ink: #1d1f24;
  --r5: #34c77b;
  --r4: #9ad25a;
  --r3: #f5c84c;
  --r2: #f6994a;
  --r1: #ee5a52;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* ---------- Top bar: logo + current event ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1.25rem, 3vh, 2.25rem) clamp(1.5rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}

.logo-slot {
  height: clamp(28px, 4.2vh, 44px);
  display: flex;
  align-items: center;
}
.logo-slot img { height: 100%; width: auto; display: block; }

/* ---------- Date + current event (top right), themed per event ---------- */
.event-info {
  --ev-date: var(--muted);
  --ev-name: var(--ink);
  --ev-sub: var(--ink);
  --ev-name-font: inherit;
  --ev-sub-font: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  max-width: 55%;
  gap: 0.2rem;
}
.today {
  font-family: var(--ev-name-font);
  font-size: clamp(0.72rem, 1.3vh, 0.85rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ev-date);
}
.event-name {
  font-family: var(--ev-name-font);
  font-size: clamp(1.3rem, 2.8vh, 1.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ev-name);
}
.event-sub {
  font-family: var(--ev-sub-font);
  font-size: clamp(0.9rem, 1.9vh, 1.2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ev-sub);
}
.event-info [hidden] { display: none; }

/* ---------- Stage ---------- */
.stage { flex: 1; position: relative; }

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem clamp(1.5rem, 4vw, 3.5rem);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .45s ease, transform .45s ease;
}
.screen.active { opacity: 1; transform: none; pointer-events: auto; }

.question {
  font-size: clamp(1.8rem, 4.6vw, 3.4rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
  text-align: center;
  max-width: 22ch;
  margin-bottom: clamp(2.5rem, 8vh, 5rem);
}

/* ---------- Faces ---------- */
.faces {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.75rem, 2.2vw, 2rem);
  width: min(100%, 1100px);
}

.face {
  appearance: none;
  border: 0;
  background: var(--card);
  border-radius: 28px;
  padding: clamp(1rem, 2.4vw, 1.75rem) 0.5rem clamp(0.9rem, 2vw, 1.4rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
  transition: transform .18s ease, box-shadow .18s ease, opacity .3s ease;
  font: inherit;
  color: inherit;
}
.face svg { width: 100%; max-width: 150px; height: auto; display: block; }
.face .label {
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  font-weight: 600;
  color: var(--muted);
  transition: color .18s ease;
}
.face:active, .face.pressed {
  transform: scale(0.94);
  box-shadow: 0 0 0 4px var(--c), 0 8px 24px rgba(0,0,0,.08);
}
.face.pressed .label { color: var(--ink); }
.faces.locked .face:not(.pressed) { opacity: 0.35; }

@media (hover: hover) {
  .face:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 14px 32px rgba(0,0,0,.08); }
}

/* ---------- Thank you ---------- */
.thanks-icon svg { width: clamp(120px, 20vh, 180px); height: auto; margin-bottom: 2rem; }
.thanks-title {
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  text-align: center;
}
.thanks-sub {
  margin-top: 0.75rem;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  color: var(--muted);
}

/* "Enviar otra calificación": the bar inside empties until the next review */
.again {
  --thanks-ms: 3000ms;
  position: relative;
  overflow: hidden;
  margin-top: clamp(2rem, 6vh, 3.5rem);
  min-width: min(100%, 360px);
  padding: 1.15rem 2.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  transition: transform .15s ease;
}
.again:active { transform: scale(0.97); }
.again-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(255,255,255,.6);
  transform-origin: left center;
}
.again-label { position: relative; }
.again.running .again-bar { animation: again-drain var(--thanks-ms) linear forwards; }
@keyframes again-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Portrait tablets: keep five across but tighten */
@media (orientation: portrait) {
  .faces { gap: 0.75rem; }
  .face { border-radius: 20px; }
}
