/* --------------------------------------------------
   POPSICLE HUB — iPad Kiosk Stylesheet
-------------------------------------------------- */

:root {
  --bg: #F9F6CB;
  --accent: #FA374A;
  --muted: #6C6C6C;
  --card: #ffffffee;
  --radius: 18px;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  user-select: none;
}

/* Confetti canvas */
#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  display:none;
}

/* -------- APP LAYOUT -------- */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px calc(40px + env(safe-area-inset-bottom));
  gap: 16px;
}

/* -------- TOP HEADER AREA -------- */
.hub-top {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: env(safe-area-inset-top);
}

.hub-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hub-logo {
  height: 60px;
  object-fit: contain;
}

.help-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.help-btn-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  cursor: pointer;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 13px;
}

.help-btn-inline svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
}

.help-text {
  opacity: 0;
  margin: 0;
  font-family: "Fira Sans", system-ui, sans-serif;
  font-size: 12px;
  color: #C02A39;
  transform: translateY(-6px);
  transition: opacity .25s ease, transform .25s ease;
}

.help-text.visible {
  opacity: 1;
  transform: translateY(0);
}

/* -------- ROLLER TEXT -------- */
.hub-roller {
  height: 34px;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  border-radius: 999px;
  background: rgba(250,55,74,0.08);
  border: 1px solid rgba(250,55,74,0.12);
  font-size: 15px;
  color: #382a2b;
  position: relative;
  display: flex;
  align-items: center;
}

.hub-roller span {
  position: absolute;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  animation: roll 9s linear infinite;
}

.hub-roller span:nth-child(1) { animation-delay: 0s; }
.hub-roller span:nth-child(2) { animation-delay: 3s; }
.hub-roller span:nth-child(3) { animation-delay: 6s; }

@keyframes roll {
  0% { opacity: 0; transform: translateY(12px); }
  5% { opacity: 1; transform: translateY(0); }
  28% { opacity: 1; transform: translateY(0); }
  33% { opacity: 0; transform: translateY(-12px); }
  100% { opacity: 0; }
}

/* -------- MAIN GRID -------- */
main {
  width: 100%;
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 950px) {
  main { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 110px;
  display: flex;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.02);
  box-shadow: 0 10px 24px rgba(0,0,0,0.04);
}

/* -------- BUTTONS -------- */
.button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border: none;
  background: transparent;
  cursor: pointer;
}

.button:active {
  transform: scale(0.985);
}

.btn-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--accent);
}

.btn-content h3 {
  margin: 0;
  font-size: 17px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  color: #1e1e1e;
}

.btn-content p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  font-family: "Fira Sans", system-ui, sans-serif;
}

/* -------- INFO STRIP -------- */
.info-strip {
  width: 100%;
  max-width: 920px;
  background: rgba(255,255,255,0.55);
  border-radius: 18px;
  padding: 10px 14px;
  border: 1px solid rgba(0,0,0,0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.time-label {
  font-size: 11.5px;
  color: #7a6a6b;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: "Fira Sans", system-ui, sans-serif;
}

.time-value {
  font-size: 16px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
}

.weather-block {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(250,55,74,0.12);
  border-radius: 16px;
  padding: 6px 12px;
}

.weather-icon {
  width: 30px;
  height: 30px;
  border-radius: 14px;
  background: rgba(255,255,255,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.weather-temp {
  font-size: 14px;
  font-weight: 600;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
}

.weather-meta {
  font-size: 11.5px;
  color: var(--muted);
  font-family: "Fira Sans", system-ui, sans-serif;
}

/* -------- FOOTER -------- */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 16px calc(8px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(249,246,203,0) 0%, rgba(249,246,203,1) 40%);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

/* -------- FULLSCREEN VIEWER -------- */
.viewer {
  position: fixed;
  inset: 0;
  background: #fff;
  display: none;
  flex-direction: column;
  z-index: 50;
}

.viewer.active {
  display: flex;
}

.viewer-topbar {
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(249,246,203,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(250,55,74,0.2);
}

.viewer-back {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  cursor: pointer;
}

.viewer-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
  background: #fffbe8;
}

.viewer-body iframe {
  width: 100%;
  height: calc(100vh - 90px);
  border: none;
  border-radius: 14px;
}

#viewerTitle {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  font-size: 1.1rem;      /* adjust as needed */
  font-weight: 200;       /* adjust as needed */
}


/* -------- CAMERA UI -------- */
#cameraView {
  width: 100%;
  height: 38vh;
  min-height: 300px;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#cameraView video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.capture-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px,1fr));
  gap: 10px;
  background: rgba(249,246,203,0.7);
  border-radius: 14px;
  padding: 12px;
  border: 1px solid rgba(250,55,74,0.05);
}

.capture-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-family: "Fira Sans", system-ui, sans-serif;
}

.capture-form input {
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.05);
  background: #fff;
}

.controls {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.pill {
  padding: 10px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
}

.pill.secondary {
  background: #eee;
  color: #222;
}

.capture-preview {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.capture-preview img {
  width: 150px;
  border-radius: 14px;
  border: 2px solid rgba(250,55,74,0.25);
  background: #eee;
}

/* Hide scrollbar iOS */
::-webkit-scrollbar {
  width: 0;
}
