@font-face {
  font-family: 'Clash Display';
  src: url('assets/fonts/clash-display-variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --blue: #087cf0;
  --cyan: #05b8ee;
  --purple: #18007d;
  --deep-purple: #13005f;
  --yellow: #ffb800;
  --orange: #ff3b18;
  --pink: #ef00c8;
  --green: #068a19;
  --ink: #15121d;
  --paper: #f6f2e9;
  --white: #fff;
  --line: rgba(21, 18, 29, .14);
  --muted: #6e6878;
  --shadow: 0 24px 70px rgba(13, 0, 74, .22);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Clash Display', Arial, sans-serif;
}
button, input, select { font: inherit; }
button { color: inherit; }
button, select { cursor: pointer; }

.topbar {
  position: fixed;
  z-index: 50;
  inset: 0 0 auto 0;
  min-height: 76px;
  padding: 10px clamp(16px, 3vw, 44px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.2);
  background: rgba(20, 0, 106, .88);
  backdrop-filter: blur(14px);
}

.brand-button {
  width: 94px;
  height: 54px;
  padding: 0;
  border: 0;
  background: transparent;
}
.brand-button img { display: block; width: auto; height: 54px; margin: 0 auto; }

.mode-switch {
  display: flex;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 99px;
  background: rgba(0,0,0,.13);
}
.mode-switch__button {
  padding: 8px 15px;
  border: 0;
  border-radius: 99px;
  color: rgba(255,255,255,.66);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}
.mode-switch__button.is-active { color: var(--purple); background: var(--yellow); }

.session-chip {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.session-chip span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.session-chip button { padding: 7px 11px; border: 1px solid rgba(255,255,255,.28); border-radius: 99px; color: #fff; background: transparent; font-size: 11px; }

#app { min-height: 100vh; }

.participant-screen {
  min-height: 100vh;
  padding: 112px clamp(18px, 4vw, 60px) 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--purple) center / cover no-repeat;
}
.participant-screen--register { background-image: linear-gradient(rgba(5, 65, 189, .04), rgba(8, 0, 89, .1)), url('assets/backgrounds/textura-azul.webp'); }
.participant-screen--waiting { background-image: linear-gradient(rgba(210, 0, 170, .18), rgba(104, 0, 126, .18)), url('assets/backgrounds/textura-rosada.webp'); }
.participant-screen--self { color: var(--purple); background-image: url('assets/backgrounds/textura-amarilla.webp'); }
.participant-screen--closed { background-image: url('assets/backgrounds/textura-verde.webp'); }
.participant-screen--vote { color: var(--ink); background-image: linear-gradient(rgba(23,0,112,.84), rgba(23,0,112,.84)), url('assets/backgrounds/textura-azul.webp'); }

.register-layout {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: clamp(34px, 7vw, 100px);
}

.event-lockup { max-width: 650px; }
.event-lockup .event-logo { display: block; width: min(230px, 58%); margin: 0 0 24px; filter: brightness(0) saturate(100%) invert(76%) sepia(99%) saturate(1468%) hue-rotate(358deg) brightness(101%); }
.event-sticker {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0 0 26px;
  font-size: clamp(50px, 7vw, 92px);
  font-weight: 300;
  line-height: .77;
  letter-spacing: -.055em;
}
.event-sticker span { padding: .04em .14em .09em; color: var(--purple); background: var(--yellow); transform: rotate(-1deg); }
.event-sticker strong { align-self: flex-end; padding: .05em .16em .08em; color: #fff; background: var(--orange); font-size: .52em; font-weight: 650; letter-spacing: -.02em; transform: translate(8px, 2px) rotate(.7deg); }
.event-formula { margin: 0 0 7px; font-size: clamp(16px, 2vw, 24px); font-weight: 600; letter-spacing: .02em; }
.event-details { margin: 0; color: rgba(255,255,255,.7); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

.glass-card {
  width: 100%;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.micro-label {
  margin: 0 0 14px;
  color: var(--orange);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.glass-card h1, .state-card h1, .vote-heading h1, .admin-hero h1 {
  margin: 0;
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 400;
  line-height: .92;
  letter-spacing: -.055em;
}
.glass-card > p:not(.micro-label) { margin: 20px 0 34px; color: var(--muted); line-height: 1.5; }
.field-label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
.text-input {
  width: 100%;
  padding: 14px 3px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: clamp(25px, 4vw, 38px);
  font-weight: 500;
}
.text-input:focus { border-color: var(--orange); }
.text-input::placeholder { color: #b9b1be; }

.button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 3px;
  font-weight: 650;
  transition: transform .16s ease, background .16s ease, opacity .16s ease;
}
.button:not(:disabled):hover { transform: translateY(-2px); }
.button:disabled { cursor: not-allowed; opacity: .36; }
.button--primary { color: var(--purple); background: var(--yellow); }
.button--dark { color: #fff; background: var(--purple); }
.button--secondary { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.button--danger { color: #fff; background: #c8202f; }
.button--full { width: 100%; margin-top: 28px; }
.button--icon { min-width: 40px; min-height: 38px; padding: 0 10px; border: 1px solid var(--line); background: #fff; }

.state-card {
  width: min(700px, 100%);
  padding: clamp(34px, 6vw, 72px);
  text-align: center;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.state-card--transparent { color: var(--purple); border-color: rgba(24,0,125,.22); background: rgba(255, 186, 0, .9); }
.state-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--purple);
  background: var(--yellow);
  font-size: 28px;
  font-weight: 700;
}
.state-card--transparent .state-icon { color: #fff; background: var(--purple); }
.state-card h1 { font-size: clamp(42px, 7vw, 70px); }
.state-card > p:not(.micro-label) { max-width: 510px; margin: 24px auto 0; color: var(--muted); font-size: 18px; line-height: 1.5; }
.state-card--transparent > p:not(.micro-label) { color: rgba(24,0,125,.72); }
.assignment-pill { display: inline-block; margin-top: 28px; padding: 10px 16px; border: 1px solid currentColor; border-radius: 99px; font-size: 13px; font-weight: 600; }
.pulse { display: inline-flex; gap: 5px; margin-top: 28px; }
.pulse i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: blink 1.25s infinite ease-in-out; }
.pulse i:nth-child(2) { animation-delay: .15s; }
.pulse i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: scale(.7); } 40% { opacity: 1; transform: scale(1); } }

.vote-shell { width: min(1120px, 100%); }
.vote-heading { display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: end; margin-bottom: 28px; color: #fff; }
.vote-heading h1 { font-size: clamp(45px, 7vw, 76px); }
.challenge-pair { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.challenge-pair span { padding: 7px 11px; color: var(--purple); background: var(--yellow); font-size: 13px; font-weight: 600; }
.challenge-pair span:last-child { color: #fff; background: var(--orange); }
.presentation-position { color: rgba(255,255,255,.65); font-size: 13px; text-align: right; }
.presentation-position strong { display: block; color: #fff; font-size: 30px; }

.vote-card { padding: clamp(20px, 4vw, 38px); border-radius: 8px; background: var(--paper); box-shadow: var(--shadow); }
.criteria-grid { display: grid; gap: 13px; }
.criterion { padding: 18px 20px; border: 1px solid var(--line); background: #fff; }
.criterion__heading { display: flex; justify-content: space-between; gap: 18px; align-items: baseline; margin-bottom: 14px; }
.criterion__heading h2 { margin: 0; font-size: 17px; font-weight: 600; }
.criterion__value { color: var(--muted); font-size: 13px; }
.criterion__value strong { color: var(--orange); font-size: 22px; }
.score-scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.score-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  font-weight: 600;
  transition: .14s ease;
}
.score-button:hover { border-color: var(--purple); transform: translateY(-2px); }
.score-button[aria-checked="true"] { color: #fff; border-color: var(--purple); background: var(--purple); }
.vote-footer { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; margin-top: 22px; }
.total-score { display: flex; align-items: baseline; gap: 8px; }
.total-score span { color: var(--muted); font-size: 13px; }
.total-score strong { font-size: 44px; line-height: 1; }
.total-score small { color: var(--muted); }
.total-score .converted-score { margin-left: 10px; padding: 6px 9px; color: var(--purple); background: var(--yellow); font-size: 12px; font-weight: 650; }

.admin-page { min-height: 100vh; padding-top: 76px; background: #f3efe7; }
.admin-hero {
  padding: 54px max(24px, calc((100vw - 1220px) / 2));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 40px;
  color: #fff;
  background: var(--purple) center / cover url('assets/backgrounds/textura-azul.webp');
}
.admin-hero h1 { font-size: clamp(46px, 6vw, 76px); }
.admin-hero .micro-label { color: var(--yellow); }
.admin-hero p:last-child { margin: 16px 0 0; color: rgba(255,255,255,.68); }
.admin-status { display: flex; gap: 12px; }
.stat-box { min-width: 112px; padding: 16px; border: 1px solid rgba(255,255,255,.24); background: rgba(12,0,72,.34); }
.stat-box span { display: block; color: rgba(255,255,255,.62); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.stat-box strong { font-size: 28px; font-weight: 500; }

.admin-content { width: min(1220px, calc(100% - 48px)); margin: 34px auto 80px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); gap: 24px; align-items: start; }
.admin-card { border: 1px solid var(--line); background: #fff; }
.admin-card__header { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.admin-card__header h2 { margin: 0; font-size: 22px; font-weight: 600; }
.admin-card__header p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.admin-card__body { padding: 18px; }

.presentation-list { display: grid; gap: 10px; }
.presentation-row {
  display: grid;
  grid-template-columns: 40px minmax(150px, .9fr) minmax(180px, 1.15fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  background: #faf8f3;
}
.presentation-row.is-active { border-color: var(--orange); box-shadow: inset 4px 0 var(--orange); }
.order-number { width: 36px; height: 36px; display: grid; place-items: center; color: #fff; background: var(--purple); font-size: 12px; font-weight: 600; }
.row-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.small-input, .participant-select {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: 0;
  background: #fff;
  font-size: 12px;
}
.small-input:focus, .participant-select:focus { border-color: var(--purple); }
.participant-cell { min-width: 0; }
.participant-cell small { display: block; margin-top: 5px; overflow: hidden; color: var(--orange); font-size: 10px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 5px; }
.row-actions .button--icon { font-size: 12px; }
.activate-button { color: var(--purple); border-color: var(--yellow) !important; background: var(--yellow) !important; }
.active-button { color: #fff; border-color: var(--orange) !important; background: var(--orange) !important; }

.add-presentation { width: 100%; margin-top: 12px; border: 1px dashed rgba(24,0,125,.35); background: rgba(24,0,125,.04); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.participant-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 14px; }
.participant-list { display: grid; gap: 8px; }
.participant-item { padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); }
.participant-item strong { display: block; font-size: 14px; }
.participant-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.participant-item__actions { display: flex; gap: 5px; }
.participant-item.is-unassigned { border-left: 4px solid var(--yellow); }
.empty-state { padding: 30px 16px; color: var(--muted); text-align: center; font-size: 13px; }

.live-control { margin-bottom: 24px; padding: 22px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; color: #fff; background: var(--deep-purple); }
.live-control h2 { margin: 0 0 6px; font-size: 22px; }
.live-control p { margin: 0; color: rgba(255,255,255,.62); font-size: 12px; }
.live-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #8e899c; }
.live-dot.is-live { background: #49dc74; box-shadow: 0 0 0 5px rgba(73,220,116,.12); }

.results-section { margin-top: 24px; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th, .results-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 12px; text-align: left; }
.results-table th { color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.results-table td:last-child, .results-table th:last-child { text-align: right; }

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 25px;
  padding: 11px 18px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-radius: 99px;
  color: #fff;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast__icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 50%; color: var(--purple); background: var(--yellow); font-weight: 700; }

.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 5px; box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(12,0,60,.68); backdrop-filter: blur(5px); }
.confirm-dialog form { padding: 30px; }
.confirm-dialog h2 { margin: 0; font-size: 28px; font-weight: 500; }
.confirm-dialog p:not(.micro-label) { color: var(--muted); line-height: 1.5; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 25px; }

@media (max-width: 950px) {
  .register-layout { grid-template-columns: 1fr; max-width: 680px; }
  .event-lockup { text-align: center; }
  .event-lockup .event-logo { margin-left: auto; margin-right: auto; }
  .event-sticker { align-items: center; }
  .event-sticker strong { align-self: center; }
  .admin-grid { grid-template-columns: 1fr; }
  .presentation-row { grid-template-columns: 40px 1fr auto; }
  .row-inputs { grid-column: 2 / -1; }
}

@media (max-width: 680px) {
  .topbar { grid-template-columns: 1fr auto; min-height: 64px; }
  .brand-button { width: 78px; height: 46px; }
  .brand-button img { height: 46px; }
  .mode-switch { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .mode-switch__button { flex: 1; }
  .session-chip { grid-column: 2; grid-row: 1; }
  .participant-screen { padding: 142px 14px 34px; }
  .event-sticker { font-size: 52px; }
  .glass-card { padding: 30px 22px; }
  .vote-heading { grid-template-columns: 1fr; }
  .presentation-position { text-align: left; }
  .score-scale { grid-template-columns: repeat(5, 1fr); gap: 7px; }
  .score-button { min-height: 43px; }
  .vote-footer { grid-template-columns: 1fr; }
  .vote-footer .button { width: 100%; }
  .admin-page { padding-top: 112px; }
  .admin-hero { grid-template-columns: 1fr; padding: 38px 18px; }
  .admin-status { width: 100%; }
  .stat-box { flex: 1; min-width: 0; }
  .admin-content { width: calc(100% - 24px); margin-top: 18px; }
  .admin-card__header { align-items: flex-start; flex-direction: column; }
  .presentation-row { grid-template-columns: 35px 1fr; }
  .participant-select, .row-actions { grid-column: 2; }
  .row-inputs { grid-column: 2; }
  .row-actions { flex-wrap: wrap; }
  .live-control { grid-template-columns: 1fr; }
  .live-control .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
