*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-en);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
  background:
    radial-gradient(circle, rgba(217, 164, 65, 0.16) 1.4px, transparent 1.6px) 0 0 / 26px 26px,
    radial-gradient(120% 70% at 50% 0%, #fffaf0 0%, var(--cream) 45%, var(--mint) 100%) fixed;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid var(--peacock); outline-offset: 3px; }
[hidden] { display: none !important; }
.ic { display: block; width: 1em; height: 1em; flex: none; }

.te { font-family: var(--font-te); }
.bi { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.15; text-align: center; }
.bi .te { font-size: 0.82em; color: var(--ink-soft); font-weight: 600; }
/* one language setting (html[data-lang]) decides what is shown, same as what is spoken */
html[data-lang='en'] .bi .te { display: none; }
html[data-lang='te'] .bi .en { display: none; }
html[data-lang='te'] .bi .te { font-size: 1em; color: inherit; font-weight: inherit; }
.btn .bi .te, .tile .bi .te { color: inherit; opacity: 0.88; }

.screen { position: relative; max-width: 1100px; margin: 0 auto; padding: 14px 16px 28px; min-height: 100dvh; display: flex; flex-direction: column; gap: 14px; }
h1, h2 { color: var(--ink); letter-spacing: 0.01em; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }
.topbar .spacer { flex: 1; }

/* ---- buttons: every tap target is at least 64px ---- */
.btn {
  position: relative;
  min-height: var(--tap); min-width: var(--tap);
  padding: 8px 22px;
  border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #fffefb, var(--cream-2));
  color: var(--ink);
  font-weight: 800; font-size: 1.2rem;
  box-shadow: inset 0 -4px 0 rgba(61, 42, 63, 0.08), var(--lift-sm);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.14s var(--ease), box-shadow 0.14s, filter 0.2s;
  touch-action: manipulation;
}
.btn::after { content: ''; position: absolute; inset: 3px 10px auto; height: 40%; border-radius: 999px; background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0)); pointer-events: none; }
.btn:active { transform: translateY(3px) scale(0.98); box-shadow: inset 0 -2px 0 rgba(61, 42, 63, 0.08), 0 1px 0 rgba(61, 42, 63, 0.12); }
.btn .ic { width: 1.5em; height: 1.5em; }
.btn.primary { background: linear-gradient(180deg, #ffd166, var(--mango) 55%, #f59a1d); color: #4a2a12; box-shadow: inset 0 -5px 0 rgba(160, 80, 0, 0.25), var(--lift); }
.btn.teal { background: linear-gradient(180deg, #2fa8a3, var(--peacock)); color: #fff; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18), var(--lift); }
.btn.lotus { background: linear-gradient(180deg, #f27ba3, var(--lotus)); color: #fff; box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.16), var(--lift); }
.btn.ghost { background: var(--paper); box-shadow: inset 0 0 0 2.5px var(--line), var(--lift-sm); }
.btn.round { width: var(--tap); padding: 0; color: var(--ink); }
.btn.round .ic { width: 28px; height: 28px; }
.btn.big { min-height: 80px; font-size: 1.5rem; padding: 12px 34px; }
.btn.small { font-size: 1rem; }
.btn[disabled] { filter: saturate(0.4); opacity: 0.55; box-shadow: none; cursor: default; }

.chip {
  min-height: 52px; padding: 4px 16px 4px 8px; border-radius: 999px;
  background: var(--paper); box-shadow: inset 0 0 0 2.5px var(--line), var(--lift-sm);
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.2rem;
}
.chip .ic { width: 38px; height: 38px; }
.chip.bump { animation: bump 0.5s var(--spring); }

.card { background: linear-gradient(180deg, var(--paper), var(--cream)); border-radius: 28px; padding: 18px; box-shadow: inset 0 0 0 2px var(--line), var(--lift); }

/* language switch */
.lang { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 2.5px var(--line), var(--lift-sm); }
.lang button { min-height: 56px; min-width: var(--tap); border: 0; border-radius: 999px; background: transparent; padding: 0 14px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; }
.lang button[aria-pressed='true'] { background: linear-gradient(180deg, #2fa8a3, var(--peacock)); color: #fff; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15); }

/* press-and-hold (grown-up entry, session override) */
.hold { position: relative; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hold .hold-fill { position: absolute; inset: 0; background: rgba(229, 89, 138, 0.3); transform: scaleX(0); transform-origin: left; transition: transform 0.2s; pointer-events: none; }
.hold.holding .hold-fill { transform: scaleX(1); transition: transform linear; }
.hold > *:not(.hold-fill) { position: relative; }
.corner-hold { width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 2.5px var(--line); opacity: 0.75; display: grid; place-items: center; }
.corner-hold .ic { width: 30px; height: 30px; }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(61, 42, 63, 0.42); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; z-index: 50; overflow: hidden; }
.modal { position: relative; overflow: hidden; background: linear-gradient(180deg, var(--paper), var(--cream)); border-radius: 32px; padding: 64px 24px 24px; max-width: 460px; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; box-shadow: 0 10px 0 rgba(61, 42, 63, 0.14), 0 24px 48px rgba(61, 42, 63, 0.2); animation: pop 0.45s var(--spring); }
.modal h2 { margin: 0; font-size: 2rem; }
.modal .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.toran.in-modal { position: absolute; top: 0; left: 0; right: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 999px; z-index: 60; text-align: center; box-shadow: var(--lift); animation: rise 0.3s var(--ease); }
.toast .te { color: #fff; }

.toran { height: 70px; overflow: hidden; pointer-events: none; }
.toran svg { display: block; }
.petals { position: absolute; inset: 0; pointer-events: none; }
.petals span { position: absolute; top: -20px; width: 12px; height: 16px; border-radius: 60% 0 60% 0; opacity: 0.9; animation: fall linear infinite; }

@keyframes pop { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-6px); } }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-14px) scale(1.06, 0.96); } 60% { transform: translateY(0) scale(0.96, 1.04); } }
@keyframes tilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-9deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes fall { 0% { transform: translateY(0) rotate(0); } 100% { transform: translateY(110vh) rotate(540deg); } }
@keyframes twinkle { 0%, 100% { opacity: 0.4; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .petals { display: none; }
  .hold.holding .hold-fill { transition-duration: 0.001ms !important; transform: scaleX(1); }
}

.sandbox-flag { position: fixed; left: 50%; top: 4px; transform: translateX(-50%); z-index: 70; padding: 2px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; background: var(--ink); color: #fff; opacity: 0.75; pointer-events: none; }
