:root {
  --bg: var(--tg-theme-secondary-bg-color, #faf5f7);
  --card: var(--tg-theme-section-bg-color, var(--tg-theme-bg-color, #ffffff));
  --text: var(--tg-theme-text-color, #1f1a1d);
  --hint: var(--tg-theme-hint-color, #7c7277);
  --pink: #e8a0bf;
  --pink-strong: #c9628f;
  --line: rgba(120, 90, 105, .16);
  --danger: #c0364f;
  --ok: #059669;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
#app {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 16px 16px calc(84px + env(safe-area-inset-bottom));
}
h1 { font-size: 24px; line-height: 1.2; margin: 4px 0 14px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
p { margin: 0 0 10px; }
a { color: var(--pink-strong); }
.hint { color: var(--hint); font-size: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px; margin-bottom: 12px; overflow-wrap: anywhere;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row > * { min-width: 0; }
.tap { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; text-decoration: none; }
.row.tap { display: flex; }
.btn {
  display: block; width: 100%; min-height: 46px; padding: 12px 16px; border: 0; border-radius: 12px;
  background: var(--pink-strong); color: #fff; font: 600 16px/1.3 inherit; font-family: inherit;
  text-align: center; text-decoration: none; cursor: pointer;
}
.btn--ghost { background: transparent; color: var(--pink-strong); border: 1px solid var(--pink-strong); }
.btn--quiet { background: transparent; color: var(--danger); }
.btn[disabled] { opacity: .55; cursor: default; }
.stack > * + * { margin-top: 8px; }
.bonus { background: linear-gradient(135deg, #e8a0bf, #c9628f); color: #fff; border: 0; }
.bonus .hint { color: rgba(255, 255, 255, .88); }
.points { font-size: 34px; font-weight: 700; line-height: 1.15; margin: 4px 0; }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .32); overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; background: #fff; border-radius: 4px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.tile { margin: 0; min-height: 92px; }
.tile b { display: block; margin-top: 4px; }
.emoji { font-size: 24px; line-height: 1; }
.banner { color: #fff; border: 0; }
.banner .hint { color: rgba(255, 255, 255, .9); }
.tag { display: inline-block; flex: none; white-space: nowrap; padding: 2px 10px; border-radius: 999px; background: rgba(232, 160, 191, .24); color: var(--pink-strong); font-size: 13px; font-weight: 600; }
.tag--soon { background: rgba(192, 54, 79, .12); color: var(--danger); }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 4px; }
.tabs button { flex: none; min-height: 38px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.tabs button.on { background: var(--pink-strong); border-color: var(--pink-strong); color: #fff; }
label { display: block; margin: 12px 0 4px; font-size: 14px; color: var(--hint); }
input, select {
  width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 12px;
}
.msg { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; background: rgba(192, 54, 79, .1); color: var(--danger); }
.msg--ok { background: rgba(5, 150, 105, .1); color: var(--ok); }
.center { text-align: center; padding: 48px 12px; }
.frame { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--card); }
.frame__bar { display: flex; gap: 8px; padding: 8px; border-bottom: 1px solid var(--line); }
.frame__bar .btn { min-height: 40px; padding: 8px; font-size: 14px; }
.frame iframe { flex: 1; width: 100%; border: 0; }
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: center;
  background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
#nav[hidden] { display: none; }
#nav a {
  flex: 1 1 0; min-width: 0; max-width: 112px; min-height: 58px; padding: 8px 2px; text-align: center;
  font-size: 12px; line-height: 1.2; color: var(--hint); text-decoration: none;
}
#nav a span { display: block; font-size: 20px; line-height: 1.25; }
#nav a.on { color: var(--pink-strong); font-weight: 600; }
