/* ============================================================
   ChillearApp — iPad PWA Styles
   Brand: Chill ON / Coors Light
   Palette: Sky blue #7EC8E3 · Red #CC0000 · Gray #555
   ============================================================ */

@font-face {
  font-family: 'BrandonGrotesque';
  src: url('/assets/BrandonGrotesque-Black.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ---- Reset & base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body {
  font-family: 'BrandonGrotesque', sans-serif;
  background-color: #7EC8E3;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Screens ---- */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.screen.active { display: flex; }

/* ---- Brand header ---- */
.brand-header {
  text-align: center;
  padding-top: clamp(40px, 8vh, 80px);
  margin-bottom: clamp(20px, 4vh, 50px);
}

.brand-title-img {
  width: 80%;
  max-width: 400px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ---- Form content area ---- */
.form-area {
  width: 100%;
  padding: 0 clamp(24px, 8vw, 70px);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 3vh, 28px);
}

/* ---- Field group (label + input) ---- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: 700;
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #555;
  text-align: center;
}

.field-input {
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: clamp(14px, 3vw, 20px) 20px;
  font-family: 'BrandonGrotesque', sans-serif;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: #333;
  width: 100%;
  outline: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  transition: box-shadow 0.2s;
  -webkit-appearance: none;
}

.field-input:focus {
  box-shadow: 0 4px 20px rgba(204, 0, 0, 0.25);
}

/* ---- Primary CTA button ---- */
.btn-primary {
  background: #CC0000;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: clamp(16px, 3.5vw, 22px) 40px;
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(204,0,0,0.35);
  transition: transform 0.12s, box-shadow 0.12s;
  -webkit-appearance: none;
  margin-top: clamp(4px, 1vh, 12px);
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(204,0,0,0.3);
}

/* ---- IDLE screen ---- */
.idle-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(24px, 8vw, 70px);
  gap: clamp(16px, 4vh, 32px);
  width: 100%;
}

.btn-nueva {
  background: #CC0000;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: clamp(20px, 4vw, 28px) 30px;
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(204,0,0,0.40);
  transition: transform 0.12s, box-shadow 0.12s;
}

.btn-nueva:active {
  transform: scale(0.97);
  box-shadow: 0 3px 12px rgba(204,0,0,0.30);
}

/* ---- Logout button (top-right power icon) ---- */
.btn-logout {
  position: absolute;
  top: clamp(16px, 3vh, 28px);
  right: clamp(16px, 4vw, 28px);
  width: clamp(44px, 7vw, 56px);
  height: clamp(44px, 7vw, 56px);
  background: #CC0000;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(204,0,0,0.4);
  transition: transform 0.12s;
  z-index: 10;
}
.btn-logout:active { transform: scale(0.92); }
.btn-logout svg { width: 55%; height: 55%; fill: #fff; }

/* ---- Participant count badge on idle ---- */
.idle-count {
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: clamp(0.85rem, 2vw, 1rem);
  color: #444;
  letter-spacing: 1px;
  text-align: center;
}

/* ---- Footer (logo + equalizer) ---- */
.screen-footer {
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 clamp(16px, 5vw, 40px) 0;
  height: clamp(90px, 18vh, 160px);
  flex-shrink: 0;
}

/* Chill ON Logo */
.chillon-img-logo {
  height: clamp(40px, 8vh, 70px);
  width: auto;
  object-fit: contain;
  padding-bottom: clamp(12px, 3vh, 28px);
}

/* ---- Equalizer bars ---- */
.equalizer {
  display: flex;
  align-items: flex-end;
  gap: clamp(2px, 0.5vw, 5px);
  height: clamp(70px, 15vh, 130px);
  padding-bottom: 0;
}

.eq-bar {
  border-radius: 3px 3px 0 0;
  animation: eq-bounce var(--speed, 0.8s) ease-in-out infinite alternate;
  will-change: height;
}

@keyframes eq-bounce {
  from { height: var(--min-h); opacity: 0.75; }
  to   { height: var(--max-h); opacity: 1; }
}

/* ---- Success overlay (prize reveal) ---- */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(7, 100, 145, 0.92);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  text-align: center;
}
.overlay.visible { display: flex; }

.overlay-icon {
  font-size: 4rem;
  animation: pop-in 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
}

.overlay-title {
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #fff;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.overlay-name {
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  color: #FFD700;
  letter-spacing: 1px;
}

.overlay-prize {
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  color: #fff;
}

.overlay-subtext {
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: rgba(255,255,255,0.8);
  letter-spacing: 1px;
}

.btn-overlay-close {
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
  border-radius: 50px;
  padding: 14px 40px;
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 12px;
  transition: background 0.2s;
}
.btn-overlay-close:active { background: rgba(255,255,255,0.25); }

@keyframes pop-in {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---- Toast notification ---- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #333;
  color: #fff;
  padding: 12px 28px;
  border-radius: 50px;
  font-family: 'BrandonGrotesque', sans-serif;
  font-weight: normal;
  font-size: 0.9rem;
  letter-spacing: 1px;
  z-index: 200;
  transition: transform 0.35s cubic-bezier(0.175,0.885,0.32,1.275);
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.error { background: #CC0000; }
.toast.success { background: #0a7a0a; }

/* ---- Spinner ---- */
.spinner {
  display: none;
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.active { display: inline-block; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Safe areas for notch devices ---- */
@supports (padding-top: env(safe-area-inset-top)) {
  .screen { padding-top: env(safe-area-inset-top); }
  .screen-footer { padding-bottom: env(safe-area-inset-bottom); }
}
