/* TOTI Feria Interactiva — Bento Box 2.0 + Rojo Institucional UNS + Fondo Blanco Sólido */
:root {
  --bg-canvas: #ffffff;
  --bg-card: #ffffff;
  --bg-card-rose: #fff6f7;
  --bg-card-slate: #f8fafc;

  --red-main: #d82f4b;
  --red-deep: #b51f38;
  --red-dark: #93162b;
  --red-soft: #ffe8ec;
  --red-border: #f2c6ce;

  --mint-main: #40dbad;
  --mint-light: #5ff2c2;

  --border-uniform: #e5e7eb;
  --text-main: #111827;
  --text-body: #374151;
  --text-muted: #6b7280;

  --green-ok: #15803d;
  --green-bg: #dcfce7;
  --amber-warn: #b45309;
  --amber-bg: #fef3c7;

  --radius-xl: 20px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --shadow-card: 0 2px 10px #f1f5f9;
  --shadow-hover: 0 10px 26px #f3e8ea;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-canvas);
  color: var(--text-main);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Patrones Bento 2.0 sobre fondo opaco */
.bento-pattern-grid {
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M28 0H0v28' fill='none' stroke='%23eef0f4' stroke-width='1'/%3E%3C/svg%3E");
}

.bento-pattern-dots {
  background-color: #ffffff;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Ccircle cx='2.5' cy='2.5' r='1.1' fill='%23f1ccd3'/%3E%3C/svg%3E"),
    linear-gradient(155deg, #ffffff 0%, #fff9fa 100%);
}

.bento-pattern-iso {
  background-color: #fff8f9;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cpath d='M18 0L36 18L18 36L0 18Z' fill='none' stroke='%23f5d7dd' stroke-width='0.9'/%3E%3C/svg%3E"),
    linear-gradient(145deg, #ffffff 0%, #fff4f6 100%);
}

.bento-pattern-rings {
  background-color: #ffffff;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M12 7v10M7 12h10' fill='none' stroke='%23e8ecf2' stroke-width='1'/%3E%3C/svg%3E"),
    linear-gradient(160deg, #ffffff 0%, #f9fafc 100%);
}

.bento-card {
  border: 1px solid var(--border-uniform);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  background-color: var(--bg-card);
}

.bento-card-hero {
  border: 1px solid var(--red-border);
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.25px;
}

.pill-badge-red {
  background: linear-gradient(135deg, var(--red-main) 0%, var(--red-deep) 100%);
  color: #ffffff;
}

.pill-badge-red-soft {
  background: var(--red-soft);
  color: var(--red-deep);
  border: 1px solid var(--red-border);
}

.pill-badge-neutral {
  background: var(--bg-card-slate);
  color: var(--text-body);
  border: 1px solid var(--border-uniform);
}

.avatar-ring {
  border-radius: 50%;
  background: linear-gradient(150deg, #ffffff 0%, #fff1f3 100%);
  border: 1px solid var(--red-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 4px;
}

.avatar-ring img,
.avatar-ring svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.avatar-ring-sm { width: 40px; height: 40px; padding: 3px; }
.avatar-ring-lg { width: 84px; height: 84px; padding: 6px; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-online { background: var(--green-ok); }
.status-checking { background: var(--amber-warn); }
.status-offline { background: var(--red-main); }

.btn-primary-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--red-main) 0%, var(--red-deep) 100%);
  color: #ffffff;
  border: 1px solid var(--red-dark);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 11px 18px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.btn-primary-red:hover:not(:disabled) {
  background: linear-gradient(135deg, #e03652 0%, #a81a32 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px #f3cdd4;
}

.btn-primary-red:disabled {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
}

.btn-outline-neutral {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  color: var(--text-body);
  border: 1px solid var(--border-uniform);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-outline-neutral:hover {
  border-color: var(--red-main);
  color: var(--red-deep);
  background: var(--bg-card-rose);
}

/* Shell & Topbar */
.feria-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.feria-topbar {
  background: #ffffff;
  border-bottom: 1px solid var(--border-uniform);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.feria-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feria-brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

.feria-brand-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.feria-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.feria-main {
  flex: 1;
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: center;
}

/* Vista Standby */
.standby-bento-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.standby-hero {
  padding: 34px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.standby-avatar-wrap {
  width: 170px;
  height: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.standby-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.standby-copy h1 {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.18;
}

.standby-lead {
  margin: 0 0 14px;
  font-size: 15px;
  color: var(--text-body);
}

.voice-prompt-chip {
  display: inline-block;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 2px dashed var(--red-main);
  color: var(--red-deep);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 18px;
}

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

.standby-side-stack,
.roulette-side-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-tile {
  padding: 18px 20px;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mini-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.mini-title {
  display: block;
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.mini-desc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.prizes-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* Vista Ruleta */
.roulette-bento-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 18px;
  align-items: start;
}

.wheel-card {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-card-head {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.wheel-title {
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.wheel-stage {
  position: relative;
  width: min(440px, 78vw);
  height: min(440px, 78vw);
  margin: 10px 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid var(--red-main);
  filter: drop-shadow(0 3px 4px rgba(17, 24, 39, 0.25));
  z-index: 5;
}

.wheel-rotator-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid #1e2430;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.12);
  overflow: hidden;
}

.wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
  transform-origin: 50% 50%;
  will-change: transform;
}

.wheel-center-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 5px solid #1e2430;
  background: linear-gradient(135deg, var(--red-main) 0%, var(--red-deep) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.7px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.28);
  z-index: 4;
  transition: transform 0.15s ease;
}

.wheel-center-hub:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.06);
}

.wheel-center-hub:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.wheel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-spin-lg {
  font-size: 16px;
  padding: 13px 28px;
}

.spin-status-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Tarjeta TOTI en vivo + animaciones del SVG normal */
.toti-live-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.toti-live-message {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
}

@keyframes toti-blink {
  0%, 92%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}
@keyframes toti-cap-bob {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-3deg); }
}
@keyframes toti-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes toti-thinking-eyes {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3px, -4px); }
  75% { transform: translate(3px, -4px); }
}
@keyframes toti-talk {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(2.2) translateY(-1.5px); }
}

.toti-inline-svg-box #toti-body-group {
  transform-origin: 100px 140px;
  animation: toti-float 3.5s ease-in-out infinite;
}
.toti-inline-svg-box .toti-eye-blink {
  transform-origin: center;
  animation: toti-blink 4s infinite;
}
.toti-inline-svg-box #toti-cap-group {
  transform-origin: 100px 50px;
  animation: toti-cap-bob 5s ease-in-out infinite;
}
.toti-inline-svg-box .toti-mouth-thinking,
.toti-inline-svg-box .toti-eye-wink {
  display: none;
}
.toti-inline-svg-box.state-talking #toti-mouth {
  transform-origin: 100px 128px;
  animation: toti-talk 0.25s ease-in-out infinite !important;
}
.toti-inline-svg-box.state-thinking .toti-pupil {
  animation: toti-thinking-eyes 1.5s ease-in-out infinite !important;
}
.toti-inline-svg-box.state-thinking .toti-mouth-smile { display: none; }
.toti-inline-svg-box.state-thinking .toti-mouth-thinking { display: block !important; }
.toti-inline-svg-box.state-wink #toti-right-eye-open { display: none; }
.toti-inline-svg-box.state-wink #toti-right-eye-wink { display: block !important; }

/* Leyenda de premios e historial */
.prizes-legend,
.recent-spins-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prize-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-slate);
  border: 1px solid var(--border-uniform);
  font-size: 13.5px;
  font-weight: 700;
}

.prize-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(17, 24, 39, 0.25);
  flex-shrink: 0;
}

.prize-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.spin-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
}

.spin-history-row:last-child {
  border-bottom: none;
}

/* Modal Resultado (100% opaco) */
.result-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.result-modal-card {
  width: 100%;
  max-width: 440px;
  padding: 28px;
  text-align: center;
  background-color: #ffffff;
}

.result-title {
  margin: 14px 0 8px;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
}

.result-desc {
  margin: 0 0 22px;
  font-size: 14.5px;
  color: var(--text-body);
  line-height: 1.5;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 960px) {
  .standby-bento-grid,
  .roulette-bento-grid {
    grid-template-columns: 1fr;
  }
  .standby-hero {
    flex-direction: column;
    text-align: center;
    padding: 24px;
  }
  .hero-badges,
  .standby-actions {
    justify-content: center;
  }
}

