/* Ulis Market — mobile-first styles. Max width 640px, app column centered. */
:root {
  --navy: #0b1e3a;
  --navy-2: #13294d;
  --green: #1faa59;
  --green-dark: #178a47;
  --amber: #f5a623;
  --red: #d33;
  --bg: #f2f5f8;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #667085;
  --border: #dfe5ec;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; }

/* --- Splash: logo bounce + slogan forming from both sides --- */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: var(--navy);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px; text-align: center;
  transition: opacity .45s ease;
}
#splash.fade { opacity: 0; pointer-events: none; }
#splash-logo { width: min(62vw, 260px); border-radius: 28px; animation: logoFloat 2.6s ease-in-out infinite; }
#splash-slogan { color: #fff; font-size: 1.35rem; font-weight: 700; }
#splash-slogan .w1 { display: inline-block; animation: fromLeft .8s ease both; color: #7ddfa8; }
#splash-slogan .w2 { display: inline-block; animation: fromCenter .8s ease .15s both; color: #fff; }
#splash-slogan .w3 { display: inline-block; animation: fromRight .8s ease .3s both; color: var(--amber); }
@keyframes logoFloat { 0%,100% { transform: translateY(0) rotate(-1.2deg); } 50% { transform: translateY(-12px) rotate(1.2deg); } }
@keyframes fromLeft { from { transform: translateX(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fromRight { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fromCenter { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #splash-logo, #splash-slogan span { animation: none !important; }
}

/* --- App frame --- */
#app { max-width: 640px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
#topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; padding: 10px 14px;
}
.logo-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; font-size: 1.1rem; font-weight: 700; padding: 0; }
.logo-btn img { width: 38px; height: 38px; border-radius: 10px; animation: logoFloat 2.6s ease-in-out infinite; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; background: var(--navy-2); color: #fff; border: 0; border-radius: 50%; width: 38px; height: 38px; font-size: 1.1rem; }
#bell-count, .nav-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px;
  background: var(--red); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
#lang-select { background: var(--navy-2); color: #fff; border: 1px solid #2a456e; border-radius: 8px; padding: 6px; font-size: .9rem; }

#view { flex: 1; padding: 14px 14px 150px; }
#view h1 { font-size: 1.35rem; margin: 4px 0 12px; }
#view h2 { font-size: 1.1rem; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* --- Navigation --- */
#hist-nav {
  position: fixed; bottom: 62px; left: 50%; transform: translateX(-50%);
  width: min(640px, 100%); display: flex; gap: 8px; padding: 8px 14px;
  background: rgba(255,255,255,.96); border-top: 1px solid var(--border); z-index: 40;
}
#hist-nav button {
  flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; font-size: 1rem; font-weight: 600; color: var(--navy);
}
#hist-nav button.dimmed { opacity: .35; }
#bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(640px, 100%); height: 62px; z-index: 40;
  display: flex; background: var(--navy); border-top: 1px solid #1c335c;
}
#bottom-nav button {
  flex: 1; background: none; border: 0; color: #b9c6da; font-size: .72rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative;
}
#bottom-nav button .nav-badge { top: 4px; right: calc(50% - 22px); }
#bottom-nav button.active { color: #fff; }
#bottom-nav button.active::before { content: ""; position: absolute; top: 0; left: 20%; right: 20%; height: 3px; background: var(--green); border-radius: 0 0 4px 4px; }

/* --- Components --- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.btn {
  display: inline-block; width: 100%; padding: 13px; border-radius: 12px; border: 0;
  background: var(--green); color: #fff; font-size: 1.05rem; font-weight: 700; text-align: center; margin: 6px 0;
}
.btn:active { background: var(--green-dark); }
.btn.secondary { background: var(--navy); }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--border); }
.btn.danger { background: var(--red); }
.btn.amber { background: var(--amber); color: #231303; }
.btn.small { width: auto; padding: 8px 14px; font-size: .9rem; margin: 2px; }
.btn:disabled { opacity: .5; }
.input, .select, textarea.input {
  width: 100%; padding: 12px; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 1rem; margin: 6px 0; background: #fff; color: var(--text);
}
textarea.input { min-height: 90px; resize: vertical; }
label.field { display: block; font-weight: 600; margin-top: 10px; font-size: .95rem; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip {
  display: inline-block; padding: 6px 12px; border-radius: 999px; background: #e8f5ee;
  color: var(--green-dark); font-size: .85rem; font-weight: 600; margin: 2px;
}
.chip.amber { background: #fdf3dd; color: #7a5200; }
.chip.navy { background: #e6ebf5; color: var(--navy); }
.badge-live { background: var(--red); color: #fff; font-weight: 700; padding: 3px 9px; border-radius: 999px; font-size: .8rem; }
.avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: #dde3ec; }
.avatar.big { width: 96px; height: 96px; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.price { font-weight: 800; font-size: 1.15rem; color: var(--green-dark); }
.progress { height: 10px; background: #e5e9ef; border-radius: 6px; overflow: hidden; margin: 8px 0; }
.progress > div { height: 100%; background: var(--green); }

/* Home hub */
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hub-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 12px; text-align: left; position: relative;
}
.hub-card .icon { font-size: 1.7rem; }
.hub-card .name { font-weight: 800; font-size: 1.02rem; margin-top: 4px; }
.hub-card .desc { font-size: .82rem; color: var(--muted); }
.hub-card .count {
  position: absolute; top: 8px; right: 8px; background: var(--red); color: #fff;
  border-radius: 999px; min-width: 20px; height: 20px; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}
.strip { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--navy); color: #fff; padding: 14px; margin-bottom: 12px; }
.strip .strip-title { font-weight: 800; margin-bottom: 4px; }

/* Toast + modal */
#toast {
  position: fixed; left: 50%; bottom: 140px; transform: translateX(-50%); z-index: 200;
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-weight: 600; max-width: 90vw; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal { background: #fff; width: min(640px, 100%); border-radius: 18px 18px 0 0; padding: 20px 16px 30px; max-height: 85dvh; overflow-y: auto; }

/* Birthday + confetti (CSS only) */
.birthday-banner {
  background: linear-gradient(135deg, #ffe29a, #ffb3c7); border-radius: var(--radius);
  padding: 16px; text-align: center; margin-bottom: 12px; font-weight: 700;
}
.video-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
.video-wrap video { width: 100%; display: block; }
.gift-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gift-card { border: 1px solid var(--border); border-radius: 12px; padding: 10px 6px; text-align: center; background: #fff; }
.gift-card .emoji { font-size: 1.6rem; }
