/* Cafe 247 — shared styles for the kitchen (hub) and every game page */

:root {
  --cream: #fbf3e4;
  --paper: #fffaf1;
  --ink: #2b1d14;
  --ink-soft: #6e5a4a;
  --line: #ecdcc2;
  --chili: #d9481c;
  --chili-2: #b93a12;
  --turmeric: #f2b33d;
  --mint: #2f8f6b;
  --shadow: 0 1px 2px rgba(60, 35, 15, .06), 0 14px 34px -14px rgba(60, 35, 15, .28);

  --font: "Baloo 2", "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", "Baloo 2", Georgia, serif;
  --r: 20px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font: 400 16px/1.5 var(--font); color: var(--ink); background: var(--cream);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--chili); }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 0; font-weight: 700; font-size: 17px; line-height: 1.2;
  text-decoration: none; transition: transform .12s ease, filter .15s, background .15s;
}
.btn:active { transform: translateY(2px) scale(.98); }
.btn-primary { background: var(--chili); color: #fff; box-shadow: 0 5px 0 var(--chili-2); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { box-shadow: 0 2px 0 var(--chili-2); }
.btn-soft { background: #fff; color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 1.5px solid var(--line); }
.btn-small { padding: 7px 14px; font-size: 14px; }
.btn-block { width: 100%; }

/* Language toggle */
.lang { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .7); border: 1.5px solid var(--line); }
.lang button { border: 0; background: none; padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-soft); min-width: 38px; }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: .2s ease;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 15px;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Modal */
.modal-wrap {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(30, 18, 10, .45); opacity: 0; transition: opacity .2s ease;
}
.modal-wrap.open { opacity: 1; }
.modal {
  width: min(100%, 380px); background: var(--paper); color: var(--ink); border-radius: 26px; padding: 26px 22px 22px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); transform: translateY(18px) scale(.97); transition: transform .25s cubic-bezier(.2, 1.3, .4, 1);
  display: grid; gap: 14px; text-align: center; max-height: calc(100dvh - 32px); overflow: auto;
}
.modal-wrap.open .modal { transform: none; }
.modal h2 { font: 700 28px/1.1 var(--display); }
.modal p { color: var(--ink-soft); }
.settings { text-align: left; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-weight: 600; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--ink-soft); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }

/* In-app browser banner */
.inapp {
  position: relative; z-index: 70; display: flex; align-items: center; gap: 10px;
  padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
  background: var(--turmeric); color: var(--ink); font-weight: 600; font-size: 14px;
}
.inapp span { flex: 1; min-width: 0; }
.inapp .btn { background: var(--ink); color: #fff; }
.inapp .x { border: 0; background: none; font-size: 22px; line-height: 1; padding: 0 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Cafe lives: header chip, continue offer, shop */
.lives-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 42px; padding: 0 12px 0 9px; border: 0; border-radius: 14px;
  background: var(--hud-chip, rgba(255, 255, 255, .12)); color: inherit; font-weight: 800; font-size: 17px;
}
.lives-chip svg { width: 22px; height: 22px; }
.lives-chip.bump svg { animation: lv-bump .5s ease; }
@keyframes lv-bump { 40% { transform: scale(1.35); } }
.lv-ring { position: relative; width: 84px; height: 84px; margin: 0 auto 6px; }
.lv-ring svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(226, 70, 47, .35)); }
.lv-ring .lv-count { position: absolute; inset: 0; display: grid; place-items: center; padding-bottom: 6px; color: #fff; font: 800 28px/1 var(--font); }
.lv-offer, .lv-shop, .lv-soon { text-align: center; }
.lv-timer { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 4px 0; }
.lv-timer i { display: block; height: 100%; background: var(--chili); transform-origin: left; transition: transform .1s linear; }
.lv-have { font-size: 14px; font-weight: 700; }
.lv-packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lv-pack {
  position: relative; display: grid; gap: 2px; padding: 16px 6px 12px; border-radius: 16px; border: 2px solid var(--line);
  background: #fff; color: var(--ink);
}
.lv-pack b { font-size: 16px; }
.lv-pack .price { font: 700 20px/1.1 var(--display); color: var(--chili); }
.lv-pack.best { border-color: var(--chili); background: #fff4ea; }
.lv-pack .lv-tag {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 1px 8px; border-radius: 999px;
  background: var(--chili); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
html[lang="hi"] .lv-pack .lv-tag { letter-spacing: 0; }
.lv-h { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); text-align: left; margin-top: 4px; }
.lv-frees { display: grid; gap: 6px; }
.lv-free {
  display: grid; grid-template-columns: 1fr auto; text-align: left; padding: 10px 14px; border-radius: 14px; border: 0;
  background: #f6ead6; color: var(--ink); align-items: center;
}
.lv-free b { font-size: 15px; }
.lv-free span { grid-column: 1; font-size: 13.5px; color: var(--ink-soft); font-weight: 600; }
.lv-free i { grid-column: 2; grid-row: 1 / 3; font-style: normal; font-weight: 800; color: var(--chili); }
.lv-shop { max-height: 88dvh; overflow-y: auto; }
