/* KidsEatFree UI v2 (with unblurred tangerine background) */

/* ---- design tokens ---- */
:root{
  --bg:        #EEF2F7;
  --surface:   #FFFFFF;
  --text:      #1F2328;
  --muted:     #6B7280;
  --accent:    #22C55E;
  --accent-600:#16A34A;
  --stroke:    #E5E7EB;

  --radius: 16px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06);
  --shadow-md: 0 10px 25px rgba(16,24,40,.08);

  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --h1: clamp(20px, 3vw, 28px);
  --h2: clamp(18px, 2.6vw, 22px);
  --h3: clamp(16px, 2.2vw, 18px);
  --body: clamp(14px, 2vw, 16px);
  --small: 13px;

  --stack-gap: var(--space-4);
}

/* ---- base ---- */
*{ box-sizing: border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height:1.5;
  color:var(--text);
  background:var(--bg);
}
img{ display:block; max-width:100%; }

/* ---- layout ---- */
.container{
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}
main.container{ padding-bottom: 88px; }

.topbar{
  padding: var(--space-4) 0 0;
  margin-bottom: var(--stack-gap);
}

/* ---- HERO ---- */
.hero-card{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--stroke);
  overflow: hidden;
  background: linear-gradient(135deg, #E8F9EE, #D9F99D);
}
@supports not (aspect-ratio: 1 / 1) {
  .hero-card::before { content:""; display:block; padding-top:100%; }
}
.hero-slides, .hero-overlay, .hero-dots{ position:absolute; inset:0; }
.hero-slides img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  opacity:0; transform: scale(1.02);
  transition: opacity .6s ease, transform .6s ease;
  background:#eef2f7;
}
.hero-slides img.is-active{ opacity:1; transform:scale(1); }
.hero-overlay{
  inset:auto auto 0 0; padding: var(--space-4);
  display:grid; gap:4px; color:#fff;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 60%, rgba(0,0,0,.55) 100%);
}
.module-title{ margin:0; font-size: var(--h1); }
.module-sub{ margin:0; font-size: var(--body); opacity:.95; }
.hero-dots{ inset:auto 0 10px 0; display:flex; justify-content:center; gap:8px; pointer-events:none; }
.hero-dots .dot{ width:8px; height:8px; border-radius:50%; background:rgba(255,255,255,.55); border:none; pointer-events:auto; cursor:pointer; }
.hero-dots .dot.is-active{ background:#fff; }

/* ---- headings ---- */
.section-title{
  margin: 0 0 var(--stack-gap);
  font-size: var(--h2);
  font-weight: 700;
  text-align: center;
}

/* ---- search panel ---- */
.is-hidden{ display:none; }
.search-panel{ margin-bottom: var(--space-3); }

.searchbar{
  background: var(--surface);
  border-radius: 999px;
  display:flex; align-items:center; gap: var(--space-3);
  padding: 10px 12px 10px 14px;
  border:1px solid var(--stroke);
  box-shadow: var(--shadow-sm);
}
.searchbar .icon{ opacity:.6; }
.searchbar input{
  flex:1; border:none; outline:none; background:transparent;
  font-size: var(--body); padding: 6px 0;
}
.btn-accent{
  background: var(--accent); color:white;
  border:none; border-radius: 999px;
  padding: 10px 16px; font-weight:600; cursor:pointer;
}
.btn-accent:hover{ background: var(--accent-600); }

.segmented{
  display:flex; align-items:center; gap: var(--space-3);
  margin: var(--space-3) 0 0;
}
.seg-btn{
  background: var(--surface);
  border:1px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 14px; cursor:pointer; font-weight:600;
}
.seg-btn.is-active{ background:#E8F9EE; border-color:transparent; color:var(--accent-600); }
.segmented .date{
  margin-left:auto; background: var(--surface);
  border:1px solid var(--stroke); border-radius: 12px;
  padding: 8px 10px; font-size: var(--body);
}

/* ---- cards ---- */
.cards{ display:grid; gap: var(--stack-gap); }
.card{
  position:relative; background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border:1px solid var(--stroke);
  padding: var(--space-4);
}
.card h3{ margin:0 0 4px; font-size: var(--h2); }
.card .deal{ margin:0 0 6px; color: var(--text); font-size: var(--body); }
.card .address{ margin:0; color: var(--muted); font-size: var(--small); }
.fav-btn{
  position:absolute; top: 10px; right: 10px;
  inline-size:40px; block-size:40px;
  display:grid; place-items:center;
  border-radius: 999px; background:white;
  border:1px solid var(--stroke); cursor:pointer;
}
.fav-btn[aria-pressed="true"]{ background:#FFF6F6; border-color:#FECACA; }

/* ---- bottom tab bar ---- */
.tabbar{
  position: fixed; inset-inline:0; bottom:0; z-index:50;
  background: var(--surface);
  border-top:1px solid var(--stroke);
  display:flex; justify-content: space-around; align-items:center;
  height:64px;
}
.tab{
  display:flex; flex-direction:column; align-items:center;
  gap:4px; padding:6px 10px;
  background:none; border:none; cursor:pointer;
  color: var(--muted); font-size:12px;
}
.tab .ticon{ font-size:18px; line-height:1; }
.tab.is-active{ color: var(--accent-600); font-weight:700; }

@media (min-width: 600px){
  .cards{ grid-template-columns: 1fr 1fr; }
}
@media (min-width: 920px){
  .cards{ grid-template-columns: 1fr 1fr 1fr; }
}

/* ------------------ Tangerine LIQUID BACKGROUND (UNBLURRED) ------------------ */
.css-liquid{
  position: fixed;
  inset: -10vmax;
  z-index: 0;
  pointer-events: none;
  /* unblurred */
  filter: none;
  opacity: 0.9;
}
.css-liquid span{
  position: absolute;
  width: 55vmax; height: 55vmax;
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255,140,66,0.35), rgba(255,140,66,0) 70%);
  animation: kef-float 22s ease-in-out infinite alternate;
  will-change: transform;
}
.css-liquid span:nth-child(1){ left: 10%; top: 15%; animation-duration: 20s; }
.css-liquid span:nth-child(2){ left: 70%; top: 20%; animation-duration: 24s; }
.css-liquid span:nth-child(3){ left: 55%; top: 70%; animation-duration: 26s; }
.css-liquid span:nth-child(4){ left: 20%; top: 65%; animation-duration: 23s; }
.css-liquid span:nth-child(5){ left: 45%; top: 45%; animation-duration: 25s; }

@keyframes kef-float{
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(8vw, -6vh) scale(1.05); }
  100% { transform: translate(-10vw, 7vh) scale(0.98); }
}

/* Keep all content above the background */
body > *:not(.css-liquid){ position: relative; z-index: 1; }

/* Motion accessibility */
@media (prefers-reduced-motion: reduce){
  .css-liquid{ opacity: 0.7; }
  .css-liquid span{ animation: none; }
}

/* ---- anti-truncation safeguards for deal text ---- */
.card h3, .card .deal, .card .address{ padding-right: 56px; }
.card .deal{
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  word-break: break-word;
  overflow-wrap: anywhere;
  display: block;
  -webkit-line-clamp: unset;
  -webkit-box-orient: unset;
}
.card{ height:auto !important; max-height:none !important; overflow:visible; }
