/* Jenna's Room app shell, mobile first. Desktop styles live in min-width queries only. */

/* ---------- Header ---------- */
.app-header {
  position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top, 0px);
  background: var(--nav-bg); border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.header-row { display: flex; align-items: center; gap: .25rem; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: .6rem; min-height: 44px; margin-right: auto; text-decoration: none; min-width: 0; }
.brand-logo { width: 40px; height: 40px; border-radius: 11px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.wordmark { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: .04em; white-space: nowrap; }
.top-nav { display: none; }
.header-actions { display: flex; align-items: center; gap: .15rem; }
@media (max-width: 339px) { .wordmark { font-size: 1rem; letter-spacing: .03em; } }

/* ---------- Bottom tab bar: 5 destinations, Rewards in the center ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px max(4px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-right, 0px));
  background: var(--nav-bg); border-top: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.tabbar a { display: grid; justify-items: center; align-content: center; gap: 3px; min-height: 54px; text-decoration: none; color: var(--muted); touch-action: manipulation; }
.tabbar .ti { position: relative; display: grid; place-items: center; width: 54px; height: 32px; border-radius: 999px; transition: background-color .2s ease, box-shadow .25s ease, transform .2s ease; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar .tl { font-size: .78rem; font-weight: 700; letter-spacing: .01em; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] .ti { background: var(--accent-wash); color: var(--accent-ink); }
.tabbar a.center .ti { background: var(--lime); color: var(--on-lime); }
.tabbar a.center[aria-current="page"] .ti { box-shadow: var(--glow-lime); }
.tabbar a:active .ti { transform: scale(.92); }
.tabbar .ti.pop { animation: tab-pop .38s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tab-pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
.tabbar .badge-count { position: absolute; top: -5px; right: 4px; box-shadow: 0 0 0 2px var(--surface); }
main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 8px); }
body { --toast-offset: calc(var(--tabbar-h) + 14px); }

@media (min-width: 960px) {
  .tabbar { display: none; }
  main { padding-bottom: 0; }
  body { --toast-offset: 28px; }
  .brand { margin-right: 0; }
  .top-nav { display: flex; gap: .25rem; margin-left: var(--sp-4); margin-right: auto; }
  .top-nav a { position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .9rem; border-radius: 10px; text-decoration: none; font-weight: 500; color: var(--ink-2); }
  .top-nav a:hover { color: var(--ink); background: var(--surface-2); }
  .top-nav a[aria-current="page"] { color: var(--ink); font-weight: 700; }
  .top-nav a[aria-current="page"]::after { content: ""; position: absolute; left: .9rem; right: .9rem; bottom: 2px; height: 3px; border-radius: 2px; background: var(--lime); box-shadow: var(--glow-lime); }
}

/* ---------- Views ---------- */
.view { padding-top: var(--sp-3); }
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: var(--sp-2); }
.view-head h1 { font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.4rem); font-weight: 700; letter-spacing: .01em; }
.view-sub { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.block { padding-top: var(--sp-4); }
.block-tight { padding-block: var(--sp-2) var(--sp-4); }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; min-height: 44px; }
.block-head h2, .sub-title { font-size: 1.25rem; }
.sub-title { display: flex; align-items: center; gap: .45rem; margin-bottom: .6rem; }
.sub-title svg { width: 22px; height: 22px; color: var(--accent-ink); }
.hint { display: block; color: var(--muted); font-size: var(--fs-sm); font-weight: 400; }
@media (min-width: 960px) { .view { padding-top: var(--sp-5); } .block { padding-top: var(--sp-5); } }

/* ---------- Home: welcome + quick actions (the whole first screen is useful) ---------- */
.welcome {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .9rem; align-items: center;
  padding: .85rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-s);
}
.welcome-logo { width: 84px; height: 84px; border-radius: 16px; object-fit: cover; box-shadow: 0 0 0 1px rgba(34, 211, 245, .35), 0 6px 18px -6px rgba(34, 211, 245, .45); }
.welcome-text { display: grid; gap: .25rem; min-width: 0; }
.welcome h1 { font-size: 1.2rem; font-weight: 700; line-height: 1.22; letter-spacing: 0; }
@media (min-width: 600px) {
  .welcome { padding: 1.1rem 1.25rem; gap: 1.25rem; }
  .welcome-logo { width: 112px; height: 112px; border-radius: 20px; }
  .welcome h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.4rem); }
}

.quick-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .75rem; }
.qa {
  display: grid; justify-items: center; align-content: center; gap: .45rem; min-height: 96px; padding: .7rem .35rem; border: 0; border-radius: var(--r-card);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; text-align: center;
  font: 700 .95rem/1.2 var(--body); cursor: pointer; touch-action: manipulation; transition: transform .12s ease, box-shadow .2s ease;
}
.qa:active { transform: scale(.96); box-shadow: inset 0 0 0 1.5px var(--accent); }
@media (hover: hover) { .qa:hover { box-shadow: inset 0 0 0 1.5px var(--accent), var(--glow); } }
.qa-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--accent-wash); color: var(--accent-ink); transition: transform .2s; }
.qa-ico.lime { background: var(--lime); color: var(--on-lime); }
.qa-ico svg { width: 26px; height: 26px; }
.qa:active .qa-ico { transform: translateY(-2px) rotate(-4deg); }
@media (max-width: 359px) { .qa { font-size: .875rem; min-height: 88px; } .qa-ico { width: 40px; height: 40px; } }
@media (min-width: 720px) { .quick-actions { max-width: 640px; } .qa { grid-auto-flow: column; justify-content: center; min-height: 64px; gap: .7rem; } }

/* ---------- Games ---------- */
.game-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3) .7rem; }
@media (max-width: 359px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 600px) { .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 960px) { .game-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--sp-4) var(--sp-3); } }
.game { display: grid; gap: .4rem; width: 100%; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; border-radius: 16px; touch-action: manipulation; }
.game-art { position: relative; display: block; aspect-ratio: 1; border-radius: 16px; overflow: hidden; max-width: 100%; box-shadow: var(--shadow-s), 0 0 0 1px var(--line); transition: transform .16s ease, box-shadow .2s ease; }
.game-art svg, .game-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.game:active .game-art { transform: scale(.96) rotate(-1.2deg); box-shadow: 0 0 0 2px var(--accent), var(--glow); }
.game.is-featured .game-art { box-shadow: 0 0 0 1.5px rgba(200, 240, 42, .55), var(--glow-lime); }
@media (hover: hover) { .game:hover .game-art { transform: translateY(-3px); box-shadow: 0 0 0 1.5px var(--accent), var(--glow); } }
.gtag { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: .2rem; padding: .15rem .45rem; border-radius: 8px; font: 700 .75rem/1.2 var(--body); }
.gtag svg { width: 13px; height: 13px; }
.gtag.featured { background: #C8F02A; color: #0A1400; }
.gtag.popular { background: #EEF4FB; color: #0A1528; }
.game-name { font-weight: 700; font-size: .98rem; line-height: 1.2; overflow-wrap: anywhere; }
.game-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: -.2rem; }

.toolbar { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 30; background: var(--paper); padding-block: .4rem .7rem; border-bottom: 1px solid transparent; }
.toolbar.stuck { border-bottom-color: var(--line); }
.toolbar-inner { display: grid; gap: .6rem; }
@media (min-width: 720px) { .toolbar-inner { grid-template-columns: minmax(240px, 360px) minmax(0, 420px); align-items: center; } }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 2.75rem; min-height: 48px; }

/* Segmented control: equal columns, never scrolls sideways */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-control); background: var(--surface-2); }
.segmented button {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 40px; padding: 0 .3rem; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-2); font: 700 .95rem/1.1 var(--body); cursor: pointer; touch-action: manipulation; transition: background-color .15s, color .15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.segmented button svg { width: 17px; height: 17px; flex: none; }
.segmented button[aria-pressed="true"], .segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s), inset 0 0 0 1px var(--line); }
.segmented.compact button { min-height: 38px; padding: 0 .6rem; }

/* Empty states */
.empty { display: grid; justify-items: center; gap: .7rem; padding: var(--sp-5) var(--sp-3); text-align: center; color: var(--ink-2); border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.empty h2 { font-size: 1.3rem; }
.empty p { max-width: 34ch; }
.empty-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--accent-wash); color: var(--accent-ink); flex: none; }
.empty-ico.big { width: 64px; height: 64px; border-radius: 18px; }
.empty-ico.lime { background: var(--lime); color: var(--on-lime); }
.empty-ico svg { width: 28px; height: 28px; }
.empty-ico.big svg { width: 34px; height: 34px; }
.empty-card { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .9rem 1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.empty-card > div { flex: 1 1 180px; min-width: 0; }
.empty-card p { color: var(--ink-2); font-size: var(--fs-sm); }

/* ---------- Rewards: ticket-shaped cards, conditions in full-size text ---------- */
.rewards-stack { display: grid; gap: var(--sp-3); }
.reward-list { display: grid; gap: var(--sp-3); }
@media (min-width: 900px) { .reward-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.reward {
  position: relative; display: grid; gap: .9rem; padding: 1.15rem 1.1rem 1.1rem; border-radius: var(--r-card); min-width: 0;
  background: var(--feature); color: var(--on-feature);
  background-image: radial-gradient(420px 160px at 100% 0, rgba(200, 240, 42, .14), transparent 70%), radial-gradient(360px 160px at 0 100%, rgba(34, 211, 245, .12), transparent 70%);
  -webkit-mask: radial-gradient(circle 11px at 0 var(--notch, 58%), transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% var(--notch, 58%), transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 11px at 0 var(--notch, 58%), transparent 98%, #000) left / 51% 100% no-repeat, radial-gradient(circle 11px at 100% var(--notch, 58%), transparent 98%, #000) right / 51% 100% no-repeat;
  transition: transform .15s ease;
}
.reward:active { transform: scale(.99); }
.reward .r-label { display: inline-flex; align-items: center; gap: .35rem; font: 700 var(--fs-xs)/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: #C8F02A; }
.reward .r-label svg { width: 16px; height: 16px; }
.reward h3 { color: var(--on-feature); font-size: 1.15rem; }
.reward .r-benefit { font-family: var(--body); font-weight: 700; font-size: clamp(1.4rem, 1.15rem + 1vw, 1.8rem); line-height: 1.2; color: #FFFFFF; }
.reward dl { margin: 0; display: grid; gap: .55rem; padding-top: .9rem; border-top: 2px dashed rgba(238, 244, 251, .22); }
.reward dt { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--on-feature-2); }
.reward dd { margin: .1rem 0 0; color: var(--on-feature); }
.reward dd ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .2rem; }
.reward .r-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.reward .r-actions .btn { flex: 1 1 160px; }
.reward .btn-ghost { color: var(--on-feature); box-shadow: inset 0 0 0 2px rgba(238, 244, 251, .35); }
.reward .ends { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; color: #C8F02A; }
.reward .ends svg { width: 18px; height: 18px; }

.rules-card { padding: 1rem 1.1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.rules-card ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .35rem; color: var(--ink-2); }
.pill-list { list-style: none; padding: 0 !important; display: flex !important; flex-wrap: wrap; gap: .4rem; }
.pill-list li { padding: .35rem .75rem; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: var(--fs-sm); }

/* ---------- Reasons, reviews, contact ---------- */
.reasons { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.reasons li { display: grid; gap: .35rem; align-content: start; padding: .85rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.reasons .r-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-wash); color: var(--accent-ink); }
.reasons .r-ico svg { width: 22px; height: 22px; }
.reasons strong { font-size: 1rem; line-height: 1.25; }
.reasons span.t { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; }
.reasons.compact li { background: var(--surface-2); box-shadow: none; }
@media (max-width: 359px) { .reasons { grid-template-columns: 1fr; } }
@media (min-width: 960px) { .reasons:not(.compact) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.review-list { display: grid; gap: .6rem; }
@media (min-width: 720px) { .review-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.review { display: grid; gap: .5rem; padding: 1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.stars { display: inline-flex; gap: 2px; color: #E7B400; }
:root[data-theme="dark"] .stars { color: #C8F02A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stars { color: #C8F02A; } }
.stars svg { width: 18px; height: 18px; }
.review blockquote { margin: 0; color: var(--ink); }
.review footer { font-size: var(--fs-sm); color: var(--muted); }
.review footer strong { color: var(--ink-2); }
.review-summary { font-weight: 700; margin-bottom: .6rem; }

.contact-cta { display: grid; gap: .9rem; padding: 1.1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-s); }
.contact-cta p { color: var(--ink-2); margin-top: .25rem; }
.cta-buttons { display: grid; gap: .5rem; }
@media (min-width: 720px) { .contact-cta { grid-template-columns: 1fr auto; align-items: center; } .cta-buttons { grid-auto-flow: column; } }

/* ---------- Chat hub ---------- */
.chat-hub { display: grid; gap: var(--sp-3); padding-bottom: var(--sp-4); max-width: 720px; }
.msg-card { background: var(--surface); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-s); padding: .9rem; display: grid; gap: .75rem; }
.assistant-id { display: flex; align-items: center; gap: .7rem; }
.assistant-id > div { display: grid; flex: 1; min-width: 0; }
.bot-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-wash); color: var(--accent-ink); flex: none; }
.bot-avatar svg { width: 26px; height: 26px; }
.auto-tag { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.conv-list { display: grid; gap: .1rem; }
.conv-list:empty { display: none; }
.conv-item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: .75rem; align-items: center; width: 100%; padding: .7rem .4rem; border: 0; border-radius: var(--r-control); background: transparent; text-align: left; cursor: pointer; touch-action: manipulation; }
.conv-item:active { background: var(--surface-2); }
@media (hover: hover) { .conv-item:hover { background: var(--surface-2); } }
.conv-item + .conv-item { box-shadow: 0 -1px 0 var(--line); }
.conv-item .avatar { width: 44px; height: 44px; }
.conv-main { display: grid; gap: .1rem; min-width: 0; }
.conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; min-width: 0; }
.conv-title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.conv-preview { color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-item.unread .conv-preview { color: var(--ink); font-weight: 700; }
.conv-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .2rem; }
.conv-skeleton { display: grid; gap: .5rem; padding: .5rem; }
.conv-skeleton span { height: 18px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.conv-skeleton span:last-child { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.topic-intro { color: var(--ink-2); font-size: var(--fs-sm); }
.topic-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .6rem; }
.topic-grid button {
  display: flex; align-items: center; gap: .55rem; min-height: 56px; padding: .6rem .75rem; border: 0; border-radius: var(--r-control);
  background: var(--surface-2); color: var(--ink); font-weight: 700; font-size: .98rem; text-align: left; line-height: 1.2; cursor: pointer; touch-action: manipulation; transition: transform .12s;
}
.topic-grid button svg { width: 22px; height: 22px; flex: none; color: var(--accent-ink); }
.topic-grid button:active { transform: scale(.97); background: var(--surface-3); }
@media (hover: hover) { .topic-grid button:hover { background: var(--surface-3); } }
.topic-grid button[data-chat-start="opt:human"], .topic-grid button[data-opt="opt:human"] { background: var(--ink); color: var(--paper); }
.topic-grid button[data-chat-start="opt:human"] svg, .topic-grid button[data-opt="opt:human"] svg { color: inherit; }
@media (max-width: 339px) { .topic-grid { grid-template-columns: 1fr; } }
.contact-list { display: grid; gap: .5rem; }
.reply-note { color: var(--muted); font-size: var(--fs-sm); display: flex; align-items: center; gap: .4rem; }
.reply-note:empty { display: none; }

/* ---------- More ---------- */
.more-stack { display: grid; gap: var(--sp-3); padding-bottom: var(--sp-4); max-width: 760px; }
.jump { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.jump a { display: grid; justify-items: center; gap: .3rem; padding: .7rem .2rem; border-radius: var(--r-control); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; font-weight: 700; font-size: .9rem; transition: transform .12s; }
.jump a:active { transform: scale(.96); }
.jump svg { width: 24px; height: 24px; color: var(--accent-ink); }
.jump[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { padding: 1.1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: .8rem; scroll-margin-top: calc(var(--header-h) + 12px); }
.card h2 { font-size: 1.3rem; }
.about-head { display: flex; align-items: center; gap: .9rem; }
.about-head img { width: 64px; height: 64px; border-radius: 14px; flex: none; }
.since { color: var(--accent-ink); font-weight: 700; font-size: var(--fs-sm); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; margin: 0; }
.facts div { padding: .7rem .8rem; border-radius: var(--r-control); background: var(--surface-2); }
.facts dt { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: .15rem 0 0; font-weight: 700; font-size: 1.1rem; }
.contact-rows { display: grid; gap: .5rem; }
.contact-row { display: flex; align-items: center; gap: .8rem; min-height: 56px; padding: .55rem .7rem; border-radius: var(--r-control); background: var(--surface-2); text-decoration: none; color: var(--ink); }
.contact-row > svg { width: 22px; height: 22px; color: var(--accent-ink); flex: none; }
.contact-row.tg > svg { color: var(--telegram); }
.contact-row > div { display: grid; flex: 1; min-width: 0; }
.contact-row strong { overflow-wrap: anywhere; }
.contact-row .go { width: 20px; height: 20px; color: var(--muted); }
.contact-row:active { background: var(--surface-3); }
.setting-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 52px; }
.setting-row + .setting-row { border-top: 1px solid var(--line); padding-top: .5rem; }
.switch { position: relative; width: 62px; height: 38px; border-radius: 999px; border: 0; background: var(--surface-3); cursor: pointer; flex: none; transition: background-color .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-s); transition: translate .2s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { translate: 24px 0; }
.card .segmented { width: min(230px, 100%); flex: none; }
.care .sub-title svg { color: var(--badge); }
.care p { color: var(--ink-2); }

/* ---------- Footer ---------- */
.app-footer { padding-block: var(--sp-4); margin-top: var(--sp-4); border-top: 1px solid var(--line); }
.app-footer p { font-size: var(--fs-sm); color: var(--muted); max-width: 80ch; }
.app-footer p + p { margin-top: .4rem; }

/* ---------- Sheet content: game details and chooser ---------- */
.gd { display: grid; gap: .9rem; }
.gd-head { display: flex; gap: .9rem; align-items: center; }
.gd-art { width: 88px; height: 88px; border-radius: 18px; overflow: hidden; flex: none; box-shadow: 0 0 0 1px var(--line), var(--glow); }
.gd-art svg, .gd-art img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gd-head h2 { font-size: 1.45rem; }
.gd-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; }
.gd-tags span { padding: .15rem .55rem; border-radius: 999px; background: var(--surface-2); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.gd p { color: var(--ink-2); }
.gd ol { margin: 0; padding-left: 1.3rem; display: grid; gap: .3rem; color: var(--ink-2); }
.gd .gd-actions { display: grid; gap: .5rem; }
.sheet-list { display: grid; border-radius: var(--r-control); overflow: hidden; background: var(--surface-2); }
.sheet-list > * {
  display: flex; align-items: center; gap: .85rem; min-height: 60px; padding: .5rem 1rem; border: 0; background: transparent; color: var(--ink);
  font: 700 1.0625rem var(--body); text-align: left; cursor: pointer; text-decoration: none;
}
.sheet-list > * + * { border-top: 1px solid var(--line); }
.sheet-list svg { width: 24px; height: 24px; color: var(--accent-ink); flex: none; }
.sheet-list .tg svg { color: var(--telegram); }
.sheet-list > *:active { background: var(--surface-3); }
.sheet-list .hint { font-weight: 400; }
.sheet-list span { display: grid; }
.sheet-title { font-size: 1.2rem; margin: .2rem 0 .7rem; }

/* ---------- Featured reward: a brief shimmer when it appears, then still ---------- */
.reward.is-featured { box-shadow: var(--glow-lime); }
.reward.is-featured::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .13) 50%, transparent 65%);
  background-size: 250% 100%; background-position: 130% 0; animation: shimmer-once 2.4s .6s ease-in-out 2;
}
@keyframes shimmer-once { to { background-position: -130% 0; } }

/* ---------- Reviews: placeholder marking ---------- */
.review-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.ph-pill { padding: .15rem .55rem; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; background: var(--warn-wash); color: var(--warn); border: 1px dashed currentColor; }
.review.is-placeholder { box-shadow: inset 0 0 0 1.5px var(--line-strong); border: 0; }
.placeholder-note { display: flex; gap: .4rem; align-items: center; margin-bottom: .6rem; font-size: var(--fs-sm); color: var(--warn); font-weight: 700; }
.review-summary { font-weight: 700; color: var(--accent-ink); }

/* ---------- Emoji topic icons ---------- */
.topic-grid .emo { font-size: 1.3rem; line-height: 1; flex: none; width: 24px; text-align: center; }

/* ---------- Poker-chip loading spinner ---------- */
.chip-loader { display: grid; place-items: center; padding: 1.2rem 0; }
.chip-spin {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle, var(--surface) 0 38%, transparent 39%), repeating-conic-gradient(var(--accent) 0 30deg, var(--lime) 30deg 60deg);
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--line); animation: chip-spin 1s linear infinite;
}
@keyframes chip-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chip-spin { animation: none !important; } }

/* ---------- Telegram shortcut: gentle pulse, three times, then still ---------- */
.icon-btn.tg.pulse { position: relative; }
.icon-btn.tg.pulse::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; box-shadow: 0 0 0 0 color-mix(in srgb, var(--telegram) 55%, transparent); animation: tg-pulse 1.8s 1s ease-out 3; }
@keyframes tg-pulse { 70% { box-shadow: 0 0 0 10px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Subtle light/dark transition (only during a manual switch) ---------- */
:root.theme-anim body, :root.theme-anim .app-header, :root.theme-anim .tabbar, :root.theme-anim .card, :root.theme-anim .welcome,
:root.theme-anim .qa, :root.theme-anim .reasons li, :root.theme-anim .review, :root.theme-anim .msg-card, :root.theme-anim .empty, :root.theme-anim .empty-card {
  transition: background-color .4s ease, color .4s ease, box-shadow .4s ease !important;
}

/* Home shows reasons as compact titles; More shows the full text */
.reasons.tight li { grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: .65rem; padding: .7rem; }
.reasons.tight span.t { display: none; }
.reasons.tight strong { font-size: .95rem; }

.welcome .kicker { text-transform: none; letter-spacing: .04em; font-size: var(--fs-sm); }
.welcome h1 { font-size: 1.45rem; }
@media (min-width: 600px) { .welcome h1 { font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.6rem); } }

/* ---------- Floating Telegram button: small, above the tab bar, hides while scrolling down ---------- */
.fab-tg {
  position: fixed; z-index: 44; right: max(14px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px);
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  background: var(--telegram); color: #fff; box-shadow: 0 8px 22px -6px rgba(31, 143, 203, .6), 0 0 0 3px var(--paper);
  transition: transform .25s ease, opacity .25s ease, visibility 0s; text-decoration: none;
}
.fab-tg svg { width: 26px; height: 26px; margin-left: -2px; }
.fab-tg:active { transform: scale(.92); }
.fab-tg.away { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility 0s .2s; }
.fab-tg::after { content: ""; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(31, 143, 203, .5); animation: tg-pulse 1.8s 1.2s ease-out 3; }
html.chat-open .fab-tg { display: none; }
@media (min-width: 960px) { .fab-tg { bottom: 24px; right: 24px; } }
/* Leave room so the last lines of every view can scroll clear of the button */
main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 76px); }
@media (min-width: 960px) { main { padding-bottom: 88px; } }

/* Assistant picture (approved character) */
.avatar img, .bot-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.bot.pic, .bot-avatar.pic { background: none; padding: 0; overflow: hidden; }
.bot-avatar.pic { border-radius: 14px; box-shadow: 0 0 0 1.5px var(--accent); }


/* ---------- Phase 3 features, drawn only with the Phase 1+2 tokens and component patterns ----------
   (no new colors, no glass, no new accent system: cards = .card/.rules-card look, pills = .chip-status,
   inputs = .input, tabs = .segmented, facts = .facts) */

/* Game username saver: sits above the Official site button in the game sheet */
.gd-username { display: grid; gap: .45rem; padding: .85rem .9rem; border-radius: var(--r-control); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.gd-username-label { font-weight: 700; }
.gd-username-row, .gd-username-plain-row { display: flex; gap: .45rem; align-items: stretch; }
.gd-username-row .input { flex: 1; min-width: 0; }
.gd-username-row .btn, .gd-username-plain-row .btn { flex: none; }
.gd-username-plain {
  flex: 1; min-width: 0; display: flex; align-items: center; padding: 0 1rem; border-radius: var(--r-control);
  background: var(--surface-2); color: var(--ink);
  font: 700 1rem var(--mono); overflow-wrap: anywhere;
}
.gd-username-err { color: var(--danger); font-weight: 700; }

/* Platform status board (Online / Maintenance / Limited only) */
.status-board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.status-board.compact { margin-bottom: .85rem; }
@media (min-width: 600px) { .status-board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .status-board:not(.compact) { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.status-board li {
  display: flex; align-items: center; gap: .5rem; min-height: 52px; padding: .55rem .75rem; min-width: 0;
  border-radius: var(--r-control); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.status-board .st-name { font-weight: 700; font-size: var(--fs-sm); line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.status-board .chip-status { margin-left: auto; flex: none; }
.st-online { background: var(--ok-wash); color: var(--ok); }
.st-limited { background: var(--warn-wash); color: var(--warn); }
.st-maintenance { background: var(--danger-wash); color: var(--danger); }
.gd-tags span.chip-status.st-online { background: var(--ok-wash); color: var(--ok); }
.gd-tags span.chip-status.st-limited { background: var(--warn-wash); color: var(--warn); }
.gd-tags span.chip-status.st-maintenance { background: var(--danger-wash); color: var(--danger); }

/* 24-hour rule: main highlight on Rewards (rules-card look) */
.rule-highlight {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .85rem; align-items: start;
  padding: 1rem 1.1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
}
.rule-highlight-ico { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-wash); color: var(--accent-ink); }
.rule-highlight-ico svg { width: 22px; height: 22px; }
.rule-kicker { margin: 0 0 .25rem; }
.rule-text { margin: 0; font-weight: 700; color: var(--ink); }

/* Refer a friend (rules-card look) */
.refer-card { padding: 1rem 1.1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: .7rem; }
.refer-head .sub-title { margin-bottom: .2rem; }
.refer-code-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.refer-code-row code {
  font: 700 1.1rem var(--mono); letter-spacing: .06em; padding: .55rem .85rem;
  border-radius: var(--r-control); background: var(--surface-2); color: var(--ink);
}

/* Your Account (.card; logo centered above the title) */
.account-card { justify-items: stretch; }
.account-logo-wrap { display: grid; place-items: center; justify-self: center; }
.account-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; display: block; }
.account-card > h2 { text-align: center; }
.account-sub { text-align: center; margin-top: -.4rem; }
.auth-form { display: grid; gap: .75rem; margin-top: .8rem; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s), inset 0 0 0 1px var(--line); }
.hint-inline { font-weight: 400; color: var(--muted); }
#accountSignedIn { display: grid; gap: .8rem; }
#accountSignedIn[hidden] { display: none; }
.account-ref .kicker { margin-bottom: .25rem; }
.acc-rewards { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.acc-rewards li { display: grid; gap: .1rem; padding: .7rem .8rem; border-radius: var(--r-control); background: var(--surface-2); }
.acc-rewards strong { color: var(--ink); }
.account-card .segmented { width: 100%; }

/* ---------- Cream theme (light, the default): artifact look ----------
   Gold reward tickets, warm surfaces, red live dot on the Rewards tab.
   Scoped to :root:not([data-theme="dark"]) so dark mode keeps its navy look. */

/* Gold ticket reward cards */
:root:not([data-theme="dark"]) .reward {
  background-image:
    radial-gradient(420px 160px at 100% 0, rgba(255, 255, 255, .35), transparent 70%),
    radial-gradient(360px 160px at 0 100%, rgba(146, 64, 14, .18), transparent 70%),
    linear-gradient(165deg, #F8CD3F 0%, #F0A800 100%);
  background-color: #F5B301;
  color: #221B10;
  box-shadow: var(--shadow);
}
:root:not([data-theme="dark"]) .reward .r-label { color: #5B2E06; }
:root:not([data-theme="dark"]) .reward h3 { color: #221B10; }
:root:not([data-theme="dark"]) .reward .r-benefit { color: #221B10; }
:root:not([data-theme="dark"]) .reward dl { border-top: 2px dashed rgba(34, 27, 16, .28); }
:root:not([data-theme="dark"]) .reward dt { color: #5B2E06; }
:root:not([data-theme="dark"]) .reward dd { color: #221B10; }
:root:not([data-theme="dark"]) .reward .ends { color: #5B2E06; }
:root:not([data-theme="dark"]) .reward .btn-ghost { color: #221B10; box-shadow: inset 0 0 0 2px rgba(34, 27, 16, .35); }
:root:not([data-theme="dark"]) .reward .r-actions .btn-primary { background: #221B10; color: #FAF6EE; }
:root:not([data-theme="dark"]) .reward .r-actions .btn-primary:active { background: #3E3222; }

/* Rewards tab: pulsing red live dot (the attention-catcher) */
.tabbar [data-tab="rewards"] .ti::after {
  content: ""; position: absolute; top: 5px; right: 14px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--badge); box-shadow: 0 0 0 2px var(--nav-bg, #FAF6EE);
}
@media (prefers-reduced-motion: no-preference) {
  .tabbar [data-tab="rewards"] .ti::after { animation: reward-dot 1.6s ease-in-out infinite; }
  @keyframes reward-dot { 50% { transform: scale(1.4); opacity: .7; } }
}

/* Cream hero: soft warm card, serif headline inherits --display */
:root:not([data-theme="dark"]) .welcome {
  background: linear-gradient(170deg, #FFFDF7 0%, #F8F0DC 100%);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-s);
}

/* ---------- Welcome sub + getting-started checklist (both themes) ---------- */
.welcome-sub { margin: .55rem 0 0; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.checklist .block-head { margin-bottom: .2rem; }
.checklist .block-head .link { background: none; border: 0; padding: .4rem .2rem; font: 700 var(--fs-sm) var(--body); color: var(--accent-ink); cursor: pointer; min-height: 44px; }
.checklist-steps { list-style: none; margin: .7rem 0 0; padding: 0; display: grid; gap: .45rem; }
.checklist-steps li a { display: flex; gap: .75rem; align-items: center; padding: .7rem .8rem; border-radius: var(--r-control); background: var(--surface-2); text-decoration: none; color: var(--ink); min-height: 44px; }
.checklist-steps li a:active { transform: scale(.99); }
.cs-num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: var(--fs-sm); }
.checklist-steps strong { display: block; font-size: 1rem; }
.cs-sub { display: block; font-size: var(--fs-sm); color: var(--muted); }
