/* LOD Знайко – стилове (първо за телефон) */
:root {
  --bg: #f4f6ff;
  --ink: #1f2547;
  --muted: #5b6390;
  --brand: #4f46e5;
  --card: #ffffff;
  --ok: #22b25a;
  --bad: #e5484d;
  --gold: #ffc53d;
  --r: 20px;
  --shadow: 0 6px 0 rgba(31, 37, 71, .12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  line-height: 1.4; min-height: 100vh;
}
a { color: var(--brand); }
img, svg { max-width: 100%; }
button { font: inherit; }

/* ---------- рамка ---------- */
.site-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--brand); color: #fff; position: sticky; top: 0; z-index: 20;
}
.site-head .brand { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-size: 20px; margin-right: auto; }
.site-head .logo { font-size: 26px; }
.site-head .back { color: #fff; text-decoration: none; background: rgba(255,255,255,.18); padding: 8px 12px; border-radius: 14px; font-weight: bold; white-space: nowrap; }
.site-head .donate-mini { color: #fff; text-decoration: none; background: #ff5d8f; padding: 8px 12px; border-radius: 14px; font-weight: bold; white-space: nowrap; }
.wrap { max-width: 980px; margin: 0 auto; padding: 14px; }
.site-foot { max-width: 760px; margin: 20px auto 0; padding: 18px 16px 34px; text-align: center; color: var(--muted); font-size: 14px; }
.site-foot .small { font-size: 12px; opacity: .8; }

/* ---------- начална страница ---------- */
.hero { text-align: center; padding: 10px 0 4px; }
.hero h1 { margin: 6px 0 4px; font-size: clamp(30px, 8vw, 48px); color: var(--brand); }
.hero p { margin: 0 auto 12px; max-width: 560px; color: var(--muted); font-size: 17px; }
.wave { display: inline-block; animation: wave 1.6s infinite; transform-origin: 70% 70%; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } }

.age-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 8px 0 14px; }
.age-pick .age-lbl { font-weight: bold; color: var(--ink); margin-right: 4px; }
.age-pick button {
  border: 3px solid #d6dbff; background: #fff; color: var(--ink); padding: 10px 16px; border-radius: 999px;
  font-weight: bold; font-size: 16px; cursor: pointer;
}
.age-pick button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.age-pick.small button { padding: 7px 12px; font-size: 14px; }

.sec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 10px 0 18px; }
.sec-card {
  background: var(--c); color: #fff; text-decoration: none; border-radius: var(--r); padding: 16px 12px 14px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px;
  box-shadow: var(--shadow); transition: transform .12s;
}
.sec-card:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(31,37,71,.12); }
.sec-card .sec-emoji { font-size: 52px; line-height: 1.1; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.sec-card b { font-size: 20px; }
.sec-card small { font-size: 13px; opacity: .95; }
.sec-card em { font-style: normal; font-size: 12px; background: rgba(255,255,255,.28); border-radius: 999px; padding: 2px 10px; margin-top: 6px; }

.block h2, .donate-banner h2 { margin: 18px 0 10px; font-size: 22px; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.game-card {
  background: var(--card); border: 3px solid var(--c, #ddd); border-radius: var(--r); padding: 14px 10px;
  text-decoration: none; color: var(--ink); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px;
  box-shadow: var(--shadow); position: relative; transition: transform .12s;
}
.game-card:active { transform: translateY(3px); }
.game-card .ge { font-size: 44px; line-height: 1.15; }
.game-card b { font-size: 17px; }
.game-card small { color: var(--muted); font-size: 13px; }
.game-card .age-badge { font-style: normal; font-size: 11px; font-weight: bold; color: #fff; background: var(--c); border-radius: 999px; padding: 2px 8px; margin-top: 6px; }
.game-card.dim { opacity: .55; }

.sec-title { display: flex; align-items: center; gap: 14px; background: var(--c); color: #fff; padding: 14px 16px; border-radius: var(--r); box-shadow: var(--shadow); margin-bottom: 8px; }
.sec-title .sec-emoji { font-size: 56px; }
.sec-title h1 { margin: 0; font-size: 28px; }
.sec-title p { margin: 0; opacity: .95; }

.donate-banner {
  margin: 22px 0 6px; background: linear-gradient(135deg, #ff7aa2, #ff9a5a); color: #fff; border-radius: var(--r);
  padding: 8px 18px 18px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow);
}
.donate-banner p { margin: 0 0 8px; }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--brand); color: #fff; padding: 12px 22px; border-radius: 16px; font-weight: bold; font-size: 17px;
  box-shadow: 0 5px 0 rgba(0,0,0,.2); touch-action: manipulation;
}
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.btn.big { font-size: 20px; padding: 14px 28px; background: #fff; color: #e0457b; }
.btn.green { background: var(--ok); }
.btn.orange { background: #f39c12; }
.btn.gray { background: #8b93b8; }

/* ---------- страница на играта ---------- */
body.is-game { overflow: hidden; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #eef1ff; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.game-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 6px 8px; padding-top: max(6px, env(safe-area-inset-top));
  background: var(--c, var(--brand)); color: #fff;
}
.gb-back, .gb-btn { width: 40px; height: 40px; border-radius: 12px; background: rgba(255,255,255,.22); color: #fff; text-decoration: none; display: flex; align-items: center; justify-content: center; font-size: 22px; border: 0; cursor: pointer; flex: 0 0 auto; }
.gb-title { flex: 1 1 auto; font-weight: bold; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-age { display: flex; gap: 4px; flex: 0 0 auto; }
.gb-age button { border: 0; background: rgba(255,255,255,.22); color: #fff; border-radius: 10px; padding: 6px 7px; font-size: 12px; font-weight: bold; cursor: pointer; }
.gb-age button.on { background: #fff; color: var(--c, var(--brand)); }
.game-host { flex: 1 1 auto; min-height: 0; position: relative; overflow: auto; -webkit-overflow-scrolling: touch; }
.game-host iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0d1b2a; }

/* общи елементи за игрите */
.g-wrap { max-width: 760px; margin: 0 auto; padding: 10px 12px 18px; min-height: 100%; display: flex; flex-direction: column; gap: 10px; }
.g-top { display: flex; align-items: center; gap: 10px; }
.g-prog { flex: 1; height: 14px; background: #d9defa; border-radius: 99px; overflow: hidden; }
.g-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffc53d, #ff8a3d); border-radius: 99px; transition: width .3s; }
.g-chip { background: #fff; border-radius: 999px; padding: 4px 12px; font-weight: bold; box-shadow: 0 2px 0 rgba(31,37,71,.1); white-space: nowrap; font-size: 15px; }
.g-prompt {
  background: #fff; border-radius: var(--r); padding: 16px 14px; text-align: center; box-shadow: var(--shadow);
  font-size: clamp(24px, 7vw, 40px); font-weight: bold; position: relative; min-height: 90px; padding-left: 50px; padding-right: 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.g-prompt small { font-size: 15px; font-weight: normal; color: var(--muted); }
.g-prompt svg { max-height: 190px; width: auto; }
.g-say { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; border: 0; border-radius: 12px; background: #eef1ff; font-size: 20px; cursor: pointer; }
.g-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.g-opt {
  border: 0; border-radius: 18px; background: var(--c, #6d5dfc); color: #fff; font-weight: bold; font-size: clamp(22px, 6.5vw, 34px);
  padding: 16px 8px; cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,.2); touch-action: manipulation; min-height: 64px;
  display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.15;
}
.g-opt:nth-child(1) { --c: #6d5dfc; } .g-opt:nth-child(2) { --c: #e8590c; } .g-opt:nth-child(3) { --c: #1c9c9c; } .g-opt:nth-child(4) { --c: #d6336c; } .g-opt:nth-child(5) { --c: #5c940d; } .g-opt:nth-child(6) { --c: #1971c2; }
.g-opt:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.2); }
.g-opt.good { background: var(--ok) !important; animation: pop .35s; }
.g-opt.bad { background: #9aa0b8 !important; opacity: .55; pointer-events: none; box-shadow: none; }
.g-opt svg { max-height: 90px; width: auto; }
.g-opt .sw { width: 100%; height: 56px; border-radius: 12px; border: 3px solid rgba(255,255,255,.7); }
.g-fb { min-height: 34px; text-align: center; font-weight: bold; font-size: 22px; }
.g-fb.ok { color: var(--ok); } .g-fb.no { color: var(--bad); }
.g-note { text-align: center; color: var(--muted); font-size: 15px; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.shake { animation: shake .3s; }
.fr { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 4px; }
.fr i { font-style: normal; border-bottom: 3px solid currentColor; padding: 0 6px; }
.fr b { padding: 0 6px; }

.g-result { text-align: center; margin: auto; padding: 20px 10px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.g-result h2 { margin: 0; font-size: clamp(28px, 8vw, 44px); color: var(--brand); }
.g-stars { font-size: clamp(48px, 16vw, 90px); color: var(--gold); letter-spacing: .08em; text-shadow: 0 4px 0 rgba(0,0,0,.12); }
.g-result p { margin: 0; font-size: 19px; }
.g-result .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* ---------- дарение / текстови страници ---------- */
.card { background: #fff; border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin: 12px 0; }
.card h1, .card h2 { margin-top: 0; }
.amounts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 14px 0; }
.amount-btn {
  border: 4px solid #ffd0e0; background: #fff; border-radius: 18px; padding: 18px 8px; font-size: 30px; font-weight: bold; color: #e0457b; cursor: pointer; box-shadow: var(--shadow);
}
.amount-btn small { display: block; font-size: 13px; color: var(--muted); font-weight: normal; }
.amount-btn:active { transform: translateY(3px); }
.note { color: var(--muted); font-size: 14px; }
.alert { padding: 12px 14px; border-radius: 14px; margin: 10px 0; font-weight: bold; }
.alert.ok { background: #dcfce7; color: #14532d; }
.alert.err { background: #fee2e2; color: #7f1d1d; }
.alert.info { background: #e0e7ff; color: #312e81; }

@media (min-width: 720px) {
  .sec-grid { grid-template-columns: repeat(4, 1fr); }
  .game-grid { grid-template-columns: repeat(4, 1fr); }
  .donate-banner { flex-direction: row; align-items: center; justify-content: space-between; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .g-prompt { min-height: 60px; padding: 8px; font-size: clamp(20px, 6vh, 30px); }
  .g-opt { padding: 8px; min-height: 48px; font-size: clamp(18px, 6vh, 26px); }
  .g-wrap { gap: 6px; padding: 6px 10px; }
  .g-opts { grid-template-columns: repeat(4, 1fr); }
}
