/* 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: 44px; 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(auto-fit, minmax(64px, 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); background: var(--surface-2); }
.sheet-list > :first-child { border-radius: var(--r-control) var(--r-control) 0 0; }
.sheet-list > :last-child { border-radius: 0 0 var(--r-control) var(--r-control); }
.sheet-list > :only-child { border-radius: var(--r-control); }
.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); }

/* ---------- LIVE signal for active rewards ---------- */
.live-dot { position: relative; display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--live); vertical-align: middle; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--live); animation: live-ping 1.4s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes live-ping { 0% { transform: scale(1); opacity: .75; } 100% { transform: scale(2.8); opacity: 0; } }
.live-head { display: inline-flex; align-items: center; gap: .6rem; }
.live-pill { display: inline-flex; align-items: center; gap: .45rem; padding: .28rem .65rem; border-radius: 999px; background: var(--live-wash); color: var(--live-ink); font: 700 .8rem/1 var(--body); letter-spacing: .1em; }
.reward .r-label .live-dot { width: 8px; height: 8px; background: #FF3B4A; }
.reward .r-label .live-dot::after { background: #FF3B4A; }

/* Rewards tab: red icon with a "beep" glow and a pinging dot */
.tabbar a.has-live .ti { color: var(--live); animation: live-beep 1.6s ease-out infinite; }
.tabbar a.has-live[aria-current="page"] .ti { background: var(--live-wash); color: var(--live); }
.tabbar a.has-live .ti svg { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--live) 70%, transparent)); }
.tabbar a.has-live .ti::after {
  content: ""; position: absolute; top: 1px; right: 10px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--live); box-shadow: 0 0 0 2px var(--nav-bg); animation: live-dot-ping 1.4s ease-out infinite;
}
@keyframes live-beep {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes live-dot-ping { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(1.25); } }
.nav-live { margin-left: .15rem; }

/* Reduced motion: keep the red signal, drop the movement */
@media (prefers-reduced-motion: reduce) {
  .live-dot::after { display: none; }
  .tabbar a.has-live .ti { animation: none !important; box-shadow: 0 0 0 2px color-mix(in srgb, var(--live) 45%, transparent); }
  .tabbar a.has-live .ti::after { animation: none !important; }
}

/* =====================================================================
   GOLD IDENTITY: component styling (v1 gold on rich black/navy)
   ===================================================================== */
h1, h2, h3, .view-head h1 { font-weight: 800; }
.view-head h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.6rem); letter-spacing: -0.03em; }
.wordmark { font-weight: 800; letter-spacing: -0.01em; }
.app-header { border-bottom-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.welcome { background: linear-gradient(135deg, #131A2B, #0A0D14); box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .35), var(--glow); }
.welcome h1 { color: #F4F2EC; }
.welcome .kicker { color: #F5C542; }
.welcome-logo { box-shadow: 0 0 0 2px #F5C542, 0 8px 22px -6px rgba(245, 197, 66, .55); }
.qa-ico, .qa-ico.lime { background: var(--accent); color: var(--on-accent); box-shadow: var(--glow); }
.tabbar a.center .ti { background: var(--accent); color: var(--on-accent); }
.tabbar a[aria-current="page"]:not(.center):not(.has-live) .ti { background: var(--accent-wash); color: var(--accent-ink); }
.top-nav a[aria-current="page"]::after { background: var(--accent); box-shadow: var(--glow); }
.kicker, .since, .link-arrow { color: var(--accent-ink); }
.send { background: var(--accent); color: var(--on-accent); }
.bot-avatar.pic, .avatar.bot.pic { box-shadow: 0 0 0 1.5px var(--accent); }
.empty-ico, .reasons .r-ico, .bot-avatar { background: var(--accent-wash); color: var(--accent-ink); }
.empty-ico.lime { background: var(--accent); color: var(--on-accent); }
.switch[aria-checked="true"] { background: var(--accent); }
.jump svg, .sub-title svg, .contact-row > svg, .topic-grid button svg, .sheet-list svg { color: var(--accent-ink); }

/* ---------- Rotating gold halos around every game icon ---------- */
@property --halo-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.halo { position: relative; display: block; padding: 3px; border-radius: 19px; isolation: isolate; }
.halo::before, .halo::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: conic-gradient(from var(--halo-a), transparent 0 18%, #F5C542 30%, #FFF1B8 36%, #F5C542 42%, transparent 54% 68%, #FF9F1C 78%, #F5C542 84%, transparent 94%);
  animation: halo-spin 3.2s linear infinite;
}
.halo::after { inset: -4px; filter: blur(9px); opacity: .75; }
@keyframes halo-spin { to { --halo-a: 360deg; } }
.halo .game-art { border-radius: 16px; box-shadow: none; }
.game:nth-child(2n) .halo::before, .game:nth-child(2n) .halo::after { animation-duration: 3.8s; animation-direction: reverse; }
.gd-art.halo { padding: 3px; border-radius: 21px; overflow: visible; box-shadow: none; width: 94px; height: 94px; }
.gd-art.halo > .inner { display: block; width: 100%; height: 100%; border-radius: 18px; overflow: hidden; }
.gd-art.halo > .inner img, .gd-art.halo > .inner svg { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (prefers-reduced-motion: reduce) {
  .halo::before, .halo::after { animation: none !important; background: linear-gradient(135deg, #F5C542, #B98600); }
  .halo::after { opacity: .35; }
}

/* ---------- Tilt toward the finger (set by js/fx.js) ---------- */
.game .halo { transform: perspective(600px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--sc, 1)); transition: transform .18s ease; }
.game.tilting .halo { transition: none; }
.game.tilting .game-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 225, 120, .45), transparent 60%); pointer-events: none; }

/* ---------- Tap ripple (js/fx.js) ---------- */
.ripple-host { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%) scale(0); background: radial-gradient(circle, rgba(255, 214, 90, .55), rgba(242, 183, 5, .18) 60%, transparent 70%); animation: ripple .55s ease-out forwards; }
@keyframes ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }

/* ---------- Tab icons bounce when pressed ---------- */
.tabbar .ti.bounce { animation: tab-bounce .42s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes tab-bounce { 0% { transform: scale(.82); } 55% { transform: scale(1.14) translateY(-3px); } 100% { transform: none; } }

/* ---------- Reward tickets: glow, shimmer, lift ---------- */
.reward { background: linear-gradient(160deg, #131A2B, #090C13); box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .35), 0 12px 30px -16px rgba(245, 197, 66, .45); overflow: hidden; }
.reward .r-label { color: #F5C542; }
.reward dl { border-top-color: rgba(245, 197, 66, .35); }
.reward .ends { color: #F5C542; }
.reward .btn-lime { background: #F5C542; color: #131A2B; }
.reward:active, .reward.pressed { transform: translateY(-3px) scale(1.01); box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, .7), 0 18px 40px -14px rgba(245, 197, 66, .6); }
@media (hover: hover) { .reward:hover { transform: translateY(-3px); } }
.reward::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255, 236, 170, .16) 50%, transparent 62%); background-size: 260% 100%; animation: ticket-shine 4.5s ease-in-out infinite; }
@keyframes ticket-shine { 0%, 55% { background-position: 140% 0; } 100% { background-position: -140% 0; } }
.reward.is-featured { background: linear-gradient(160deg, #FFD24A, #F2B705 55%, #D99A00); color: #131A2B; box-shadow: 0 14px 34px -12px rgba(242, 183, 5, .7); }
.reward.is-featured .r-label, .reward.is-featured .r-benefit, .reward.is-featured h3, .reward.is-featured dd, .reward.is-featured .ends { color: #131A2B; }
.reward.is-featured dt { color: #4A3A00; }
.reward.is-featured dl { border-top-color: rgba(19, 26, 43, .3); }
.reward.is-featured .btn-lime { background: #131A2B; color: #F5C542; box-shadow: none; }
.reward.is-featured .btn-ghost { color: #131A2B; box-shadow: inset 0 0 0 2px rgba(19, 26, 43, .45); }
.reward.is-featured::before { background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .45) 50%, transparent 62%); background-size: 260% 100%; }
.reward .claimed-note { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; border-radius: 12px; background: rgba(245, 197, 66, .14); color: inherit; font-weight: 700; }
.reward.is-featured .claimed-note { background: rgba(19, 26, 43, .12); }
.reward.leaving { animation: ticket-out .5s ease forwards; }
@keyframes ticket-out { to { opacity: 0; transform: translateY(-12px) scale(.96); } }
@media (prefers-reduced-motion: reduce) { .reward::before { animation: none !important; } .reward:active, .reward.pressed, .reward:hover { transform: none; } }

/* ---------- Claim burst (js/fx.js) ---------- */
.burst-bit { position: fixed; z-index: 95; width: 9px; height: 9px; border-radius: 2px; pointer-events: none; background: #F5C542; box-shadow: 0 0 8px rgba(245, 197, 66, .8); animation: burst .75s cubic-bezier(.15, .8, .3, 1) forwards; }
.burst-bit:nth-child(3n) { background: #FFF1B8; border-radius: 50%; }
.burst-bit:nth-child(4n) { background: #FF3B4A; }
@keyframes burst { to { transform: translate(var(--bx), var(--by)) rotate(var(--br)); opacity: 0; } }

/* ---------- ACTIVE NOW badge: red dot with expanding rings ---------- */
.live-pill { gap: .55rem; padding: .35rem .75rem .35rem .6rem; background: #1A0507; color: #FF6B76; box-shadow: inset 0 0 0 1px rgba(255, 59, 74, .45), 0 0 18px -4px rgba(255, 59, 74, .55); }
.live-pill .live-dot { width: 10px; height: 10px; background: #FF3B4A; }
.live-pill .live-dot::before, .live-pill .live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid #FF3B4A; background: none; animation: ring 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
.live-pill .live-dot::before { animation-delay: .9s; }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(3.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-pill .live-dot::before, .live-pill .live-dot::after { display: none; } }

/* ---------- Scratch-off ticket ---------- */
.scratch { position: relative; display: grid; gap: .8rem; padding: 1.1rem; border-radius: var(--r-card); background: linear-gradient(160deg, #131A2B, #090C13); color: #F4F2EC; box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, .55), var(--glow); }
.scratch .r-label { display: inline-flex; align-items: center; gap: .4rem; font: 700 var(--fs-xs)/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: #F5C542; }
.scratch-area { position: relative; height: 128px; border-radius: 14px; overflow: hidden; background: #F4F2EC; color: #131A2B; display: grid; place-items: center; text-align: center; touch-action: none; }
.scratch-area .prize { font: 800 1.7rem/1.1 var(--display); padding: 0 1rem; }
.scratch-area .prize small { display: block; font: 700 .85rem var(--body); color: #535B6F; margin-top: .3rem; }
.scratch-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.scratch .code { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .55rem .8rem; border-radius: 12px; background: rgba(245, 197, 66, .12); font-size: var(--fs-sm); }
.scratch .code strong { font-family: var(--mono); letter-spacing: .06em; color: #F5C542; }
.scratch .hint { color: #C4CBDD; }

/* ---------- Account ---------- */
.acct-card { display: grid; gap: .9rem; padding: 1.1rem; border-radius: var(--r-card); background: linear-gradient(135deg, #131A2B, #0A0D14); color: #F4F2EC; box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .35), var(--glow); }
.acct-card h2 { color: #F4F2EC; font-size: 1.35rem; }
.acct-card p, .acct-card .hint { color: #C4CBDD; }
.acct-row { display: flex; align-items: center; gap: .8rem; }
.acct-avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #F5C542; color: #131A2B; font: 800 1.2rem/1 var(--display); flex: none; }
.acct-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.acct-actions .btn { flex: 1 1 140px; }
.acct-card .btn-ghost { color: #F4F2EC; box-shadow: inset 0 0 0 2px rgba(244, 242, 236, .35); }
.history { display: grid; gap: .5rem; }
.hist-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .7rem .75rem; border-radius: var(--r-control); background: var(--surface-2); text-align: left; border: 0; width: 100%; color: inherit; font: inherit; }
button.hist-item { cursor: pointer; }
.hist-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-wash); color: var(--accent-ink); }
.hist-ico svg { width: 20px; height: 20px; }
.hist-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item span.hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-when { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.form { display: grid; gap: .9rem; }
.form .err { min-height: 0; }
.guest-banner { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; padding: .9rem 1rem; border-radius: var(--r-card); background: var(--accent-wash); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.guest-banner > div { flex: 1 1 200px; }
.guest-banner p { color: var(--ink-2); font-size: var(--fs-sm); }
.header-actions .acct-btn { width: 44px; height: 44px; }
.header-actions .acct-btn .mini { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 800 .85rem/1 var(--display); }

/* ---------- Floating Telegram side button: gold on black ---------- */
.fab-tg { background: #131A2B; color: #F5C542; box-shadow: 0 0 0 2px #F5C542, 0 10px 26px -6px rgba(245, 197, 66, .55), 0 0 0 5px var(--paper); }
.fab-tg::after { box-shadow: 0 0 0 0 rgba(245, 197, 66, .55); }

/* ---------- Send button pulses gold once there's text ---------- */
.send.ready { animation: send-pulse 1.6s ease-in-out infinite; }
@keyframes send-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 197, 66, .55); } 50% { box-shadow: 0 0 0 8px transparent; } }

/* ---------- Light/dark cross-fade (View Transitions) ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; }

.scratch.leaving { animation: ticket-out .5s ease forwards; }
/* ---------- Inside a game: verified catalog ---------- */
.catalog { display: grid; gap: .6rem; }
.catalog-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem .6rem; }
.catalog-grid li { display: grid; gap: .3rem; min-width: 0; }
.cat-art { display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1.5px rgba(245, 197, 66, .55), var(--glow); }
.cat-art svg { width: 100%; height: 100%; display: block; }
.cat-name { font-weight: 700; font-size: .92rem; line-height: 1.2; overflow-wrap: anywhere; }
.cat-kind { font-size: var(--fs-xs); color: var(--muted); }
#history-title { scroll-margin-top: calc(var(--header-h) + 12px); }

/* Content failed to load: say so, offer a retry (never disguise it as "coming soon") */
.load-error { position: sticky; top: calc(var(--header-h) + env(safe-area-inset-top, 0px)); z-index: 35; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1rem; padding: .7rem 16px; background: var(--danger-wash); color: var(--danger); font-weight: 700; text-align: center; }
.sheet-title svg { width: 22px; height: 22px; vertical-align: -4px; color: var(--accent-ink); }
.form .check { display: flex; align-items: center; gap: .7rem; min-height: 44px; font-weight: 700; color: var(--ink); cursor: pointer; }
.form .check input { width: 26px; height: 26px; margin: 0; accent-color: var(--accent); flex: none; }
.catalog-empty { display: grid; gap: .4rem; padding: .85rem 1rem; border-radius: var(--r-control); background: var(--accent-wash); }

/* =================== Phase 2: accounts, live extras =================== */
/* Header: bell with live count; on very narrow phones the theme switch lives in More › Settings */
.bell-btn { position: relative; }
.bell-btn .badge-count { position: absolute; top: 2px; right: 0; box-shadow: 0 0 0 2px var(--surface); }
.bell-btn.ring svg { animation: bell-ring .7s ease; transform-origin: 50% 10%; }
@keyframes bell-ring { 20% { rotate: 14deg; } 40% { rotate: -12deg; } 60% { rotate: 8deg; } 80% { rotate: -4deg; } }
@media (max-width: 399px) { .header-actions [data-action="theme"] { display: none; } }
@media (prefers-reduced-motion: reduce) { .bell-btn.ring svg { animation: none; } }

/* Member home: greeting + profile dashboard + rewards highlighted */
.member { display: grid; gap: .85rem; padding: 1.1rem; border-radius: var(--r-card); background: linear-gradient(140deg, #131A2B, #0A0D14 70%); color: #F4F2EC; box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .4), var(--glow); }
.m-hero { display: flex; align-items: center; gap: .9rem; }
.m-avatar { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; flex: none; background: radial-gradient(circle at 30% 25%, #FFE08A, #F2B705 55%, #B98600); color: #131A2B; font: 800 1.35rem/1 var(--display); box-shadow: 0 0 0 3px #131A2B, 0 0 0 5px #F5C542, 0 8px 22px -6px rgba(245, 197, 66, .6); }
.m-hello { min-width: 0; display: grid; gap: .1rem; }
.m-hello .kicker { color: #F5C542; text-transform: none; letter-spacing: .04em; font-size: var(--fs-sm); }
.m-hello h1 { color: #F4F2EC; font-size: clamp(1.45rem, 1.2rem + 1.4vw, 2.2rem); line-height: 1.1; overflow-wrap: anywhere; }
.member .hint { color: #C4CBDD; }
.m-ids { display: flex; flex-wrap: wrap; gap: .4rem; }
.id-chip { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; min-height: 32px; padding: .2rem .65rem .2rem .45rem; border-radius: 999px; background: rgba(245, 197, 66, .12); color: #F4F2EC; box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .35); font-size: var(--fs-sm); font-weight: 700; overflow-wrap: anywhere; }
.id-chip svg { width: 18px; height: 18px; flex: none; color: #F5C542; }
.m-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.m-stat { display: grid; justify-items: center; gap: .1rem; min-height: 64px; padding: .55rem .3rem; border-radius: 14px; background: rgba(244, 242, 236, .06); box-shadow: inset 0 0 0 1px rgba(244, 242, 236, .12); color: #F4F2EC; text-decoration: none; text-align: center; transition: transform .15s, background-color .15s; }
.m-stat strong { font: 800 1.5rem/1.1 var(--display); color: #F5C542; }
.m-stat span { font-size: var(--fs-xs); font-weight: 700; color: #C4CBDD; }
.m-stat:active { transform: scale(.97); background: rgba(245, 197, 66, .12); }
.m-ticket { display: grid; grid-template-columns: 46px minmax(0, 1fr) 20px; align-items: center; gap: .75rem; width: 100%; min-height: 64px; padding: .7rem .8rem; border: 0; border-radius: 14px; cursor: pointer; text-align: left; font: inherit;
  background: linear-gradient(135deg, #FFD24A, #F2B705 60%, #D99A00); color: #131A2B; box-shadow: 0 10px 26px -10px rgba(242, 183, 5, .8); position: relative; overflow: hidden; }
.m-ticket strong { display: block; }
.m-ticket .hint { color: #4A3A00 !important; font-size: var(--fs-sm); }
.m-ticket .go { width: 20px; height: 20px; }
.mt-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #131A2B; color: #F5C542; }
.mt-ico svg { width: 24px; height: 24px; }
.m-ticket::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .5) 50%, transparent 62%); background-size: 260% 100%; animation: ticket-shine 3.5s ease-in-out infinite; }
.m-rewards .block-head { margin: 0 0 .5rem; }
.m-rewards h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: 1.15rem; color: #F4F2EC; }
.m-rewards .link-arrow { color: #F5C542; }
.live-pill.sm { padding: .2rem .55rem .2rem .45rem; font-size: .72rem; }
.m-rw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.m-rw { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: .7rem; min-height: 56px; padding: .5rem .55rem .5rem .8rem; border-radius: 14px; background: rgba(244, 242, 236, .06); box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .3); }
.m-rw-main { min-width: 0; display: grid; }
.m-rw-main strong { color: #F4F2EC; }
.m-rw .btn-lime { background: #F5C542; color: #131A2B; }
.m-rw.done { opacity: .8; }
.m-rw.done .live-dot { background: #5BC79A; } .m-rw.done .live-dot::after { display: none; }
.claimed-note.small { display: inline-flex; align-items: center; gap: .3rem; font-size: var(--fs-xs); font-weight: 700; color: #5BC79A; }
.claimed-note.small svg { width: 16px; height: 16px; }
@media (min-width: 760px) {
  .member { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 1.5rem; padding: 1.4rem 1.5rem; }
  .m-hero, .m-ids, .m-stats, .m-ticket { grid-column: 1; }
  .m-rewards { grid-column: 2; grid-row: 1 / span 4; align-self: start; }
}
@media (prefers-reduced-motion: reduce) { .m-ticket::before { animation: none; } .m-stat:active { transform: none; } }

/* Platform status (set by the team in the admin portal) */
.pstat { display: inline-flex; align-items: center; gap: .3rem; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.pstat .pdot { width: 8px; height: 8px; border-radius: 50%; background: #8A93A6; flex: none; }
.pstat.st-online { color: var(--ok); } .pstat.st-online .pdot { background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.pstat.st-maintenance { color: var(--danger); } .pstat.st-maintenance .pdot { background: #EF4444; }
.pstat.st-limited { color: var(--warn); } .pstat.st-limited .pdot { background: #F59E0B; }
.gd-tags .pstat.big { padding: .15rem .6rem; border-radius: 999px; background: var(--surface-2); }

/* Game username saver: just above the official link */
.saver { display: grid; gap: .5rem; padding: .9rem 1rem; border-radius: var(--r-control); background: var(--surface-2); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 40%, transparent); }
.saver .sheet-title { margin: 0; font-size: 1.05rem; }
.saved-name { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.saved-name strong { flex: 1 1 140px; min-width: 0; padding: .55rem .8rem; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font: 700 1.15rem/1.3 var(--mono); overflow-wrap: anywhere; user-select: all; }
.gu-form { display: flex; gap: .5rem; }
.gu-form .input { flex: 1; min-width: 0; }
.saver .prompt { display: flex; gap: .4rem; color: var(--accent-ink); font-weight: 700; }
.saver .hint svg, .saver .prompt svg, .official-none svg { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.official { margin-top: -.1rem; }
.official svg { width: 20px; height: 20px; }
.official-none { display: flex; gap: .4rem; align-items: center; }

/* Sign-up / log-in sheet: four paths */
.acct-sheet { gap: .75rem; }
.prov-list { display: grid; gap: .5rem; }
.prov { display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 52px; padding: .6rem 1rem; border: 0; border-radius: var(--r-control); cursor: pointer; text-decoration: none; font: 700 1rem/1.2 var(--body);
  background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: box-shadow .15s, transform .12s; }
.prov svg { width: 24px; height: 24px; flex: none; }
.prov[data-prov="telegram"] svg { color: var(--telegram); }
.prov[data-prov="phone"] svg, .prov[data-prov="password"] svg { color: var(--accent-ink); }
.prov:active { transform: scale(.985); }
.prov[aria-expanded="true"] { box-shadow: inset 0 0 0 2px var(--accent), var(--glow); }
@media (hover: hover) { .prov:hover { box-shadow: inset 0 0 0 1.5px var(--ink); } }
#actionSheet { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }

/* Support presence: honest, from real admin sessions */
.presence, .chat-presence { display: flex; align-items: center; gap: .45rem; font-weight: 700; }
.presence { padding: .55rem .8rem; border-radius: 12px; background: var(--surface-2); font-size: var(--fs-sm); }
.chat-presence { font-size: .75rem; color: var(--muted); margin-top: .05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-presence .p-text:empty + *, .chat-presence:has(.p-text:empty) { display: none; }
.p-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: #8A93A6; flex: none; }
[data-presence][data-state="online"] .p-dot, [data-presence][data-state="team"] .p-dot { background: #22C55E; }
[data-presence][data-state="online"] .p-dot::after, [data-presence][data-state="team"] .p-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22C55E; animation: live-ping 1.8s cubic-bezier(0, 0, .2, 1) infinite; }
[data-presence][data-state="online"], [data-presence][data-state="team"] { color: var(--ok); }
@media (prefers-reduced-motion: reduce) { .p-dot::after { display: none; } }

/* "Scratch-off received": pops up pointing at the Rewards tab */
.bonus-pop { position: fixed; z-index: 70; right: 12px; left: 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
  display: flex; align-items: center; gap: .75rem; min-height: 64px; padding: .7rem 1rem .7rem .7rem; border: 0; border-radius: 18px; cursor: pointer; text-align: left; font: inherit;
  background: linear-gradient(135deg, #131A2B, #0A0D14); color: #F4F2EC; box-shadow: 0 0 0 2px #F5C542, 0 18px 40px -10px rgba(0, 0, 0, .55), 0 0 30px -6px rgba(245, 197, 66, .6); }
.bonus-pop strong { display: block; color: #F5C542; font-size: 1.05rem; }
.bonus-pop .hint { color: #C4CBDD; font-size: var(--fs-sm); }
.bonus-pop::after { content: ""; position: absolute; bottom: -9px; right: calc(30% - 9px); width: 18px; height: 18px; background: #0E121B; rotate: 45deg; box-shadow: 2px 2px 0 0 #F5C542; }
.bp-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: #F5C542; color: #131A2B; flex: none; }
.bp-ico svg { width: 26px; height: 26px; }
.bonus-pop.in { animation: pop-in .5s cubic-bezier(.3, 1.6, .5, 1); }
.bonus-pop.in .bp-ico { animation: gift-wiggle 1s ease .4s 2; }
@keyframes pop-in { from { transform: translateY(30px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes gift-wiggle { 25% { rotate: -12deg; } 50% { rotate: 10deg; } 75% { rotate: -6deg; } }
@media (min-width: 960px) { .bonus-pop { left: auto; right: 24px; top: calc(var(--header-h) + 12px); bottom: auto; width: 360px; } .bonus-pop::after { top: -9px; bottom: auto; right: 120px; box-shadow: -2px -2px 0 0 #F5C542; } }
@media (prefers-reduced-motion: reduce) { .bonus-pop.in, .bonus-pop.in .bp-ico { animation: none; } }
.scratch.flash { animation: ticket-flash 1.4s ease; }
@keyframes ticket-flash { 0%, 100% { box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, .55), var(--glow); } 30% { box-shadow: inset 0 0 0 3px #F5C542, 0 0 0 6px rgba(245, 197, 66, .35), 0 0 40px rgba(245, 197, 66, .7); } }
@media (prefers-reduced-motion: reduce) { .scratch.flash { animation: none; box-shadow: inset 0 0 0 3px #F5C542; } }
.bonus-items { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .5rem; }
.bonus-items li { display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border-radius: 12px; background: var(--accent-wash); }
.bonus-items li svg { width: 24px; height: 24px; color: var(--accent-ink); flex: none; }
.bonus-items strong { display: block; }

/* Announcement pop-up */
.ann-scrim { position: fixed; inset: 0; z-index: 88; background: var(--scrim); }
.ann { position: fixed; z-index: 90; left: 16px; right: 16px; top: 50%; translate: 0 -50%; max-width: 440px; margin: 0 auto; display: grid; gap: .55rem; justify-items: start;
  padding: 1.4rem 1.25rem 1.1rem; border-radius: var(--r-sheet); background: linear-gradient(160deg, #161C28, #0A0D14); color: #F4F2EC; box-shadow: 0 0 0 1.5px #F5C542, 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 50px -10px rgba(245, 197, 66, .5); max-height: calc(100dvh - 40px); overflow-y: auto; }
.ann .kicker { color: #F5C542; }
.ann h2 { color: #F4F2EC; font-size: 1.45rem; }
.ann p#annBody { color: #CDD1DC; white-space: pre-line; }
.ann-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: #F5C542; color: #131A2B; }
.ann-ico svg { width: 28px; height: 28px; }
.ann .btn { margin-top: .4rem; }
@media (prefers-reduced-motion: no-preference) { .ann:not([hidden]) { animation: ann-in .38s cubic-bezier(.3, 1.4, .5, 1); } @keyframes ann-in { from { opacity: 0; scale: .92; } to { opacity: 1; scale: 1; } } }

/* Notification center */
.n-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; max-height: min(60dvh, 520px); overflow-y: auto; }
.n-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: .7rem; align-items: start; padding: .7rem .75rem; border-radius: var(--r-control); background: var(--surface-2); color: inherit; text-decoration: none; }
a.n-item:active { background: var(--surface-3); }
.n-main { display: grid; gap: .1rem; min-width: 0; }
.n-main .hint { overflow-wrap: anywhere; }
.n-when { font-size: var(--fs-xs); color: var(--muted); font-weight: 700; }
.n-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-wash); color: var(--accent-ink); }
.n-ico svg { width: 20px; height: 20px; }
.n-ico.k-status { background: var(--surface-3); color: var(--ink); }
.n-ico.k-announcement { background: #131A2B; color: #F5C542; }
.n-new { width: 10px; height: 10px; border-radius: 50%; background: var(--live); margin-top: .4rem; }
.n-empty { display: flex; gap: .7rem; align-items: center; padding: 1rem; border-radius: var(--r-control); background: var(--surface-2); }
.n-empty > svg { width: 28px; height: 28px; color: var(--muted); flex: none; }
.n-empty strong { display: block; }
.install-steps { margin: 0 0 .5rem; padding-left: 1.3rem; display: grid; gap: .5rem; }
#installRow .btn svg { width: 18px; height: 18px; }
.scratch .btn-ghost { color: #F4F2EC; box-shadow: inset 0 0 0 2px rgba(244, 242, 236, .4); }

/* =================== Phase 3 (existing tokens and components only) =================== */
.welcome-sub { color: #C4CBDD; font-size: var(--fs-sm); line-height: 1.45; margin-top: .15rem; }

/* Getting-started checklist */
.checklist { display: grid; gap: .7rem; margin-top: var(--sp-3); padding: 1rem; border-radius: var(--r-card); background: var(--surface); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow-s); }
.cl-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cl-head h2 { font-size: 1.15rem; }
.cl-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.cl-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #F5C542, #F2B705); transition: width .4s ease; }
.cl-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.cl-steps li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: .7rem; }
.cl-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-wash); color: var(--accent-ink); font: 800 1rem/1 var(--display); }
.cl-num svg { width: 18px; height: 18px; }
.cl-steps li.done .cl-num { background: var(--ok-wash); color: var(--ok); }
.cl-steps li.done strong { text-decoration: line-through; text-decoration-color: var(--muted); }
.cl-main { display: grid; min-width: 0; }
.cl-main .hint { font-size: var(--fs-sm); }

/* "Why players choose us": the four verified figures */
.fact-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.fact { position: relative; display: grid; gap: .1rem; align-content: start; padding: .9rem; border-radius: var(--r-card); overflow: hidden; min-width: 0; }
.f-ico { position: relative; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; margin-bottom: .35rem; }
.f-ico svg { width: 22px; height: 22px; }
.f-num { font: 800 clamp(1.7rem, 1.3rem + 2vw, 2.4rem)/1 var(--display); letter-spacing: -.01em; }
.f-label { font-weight: 700; font-size: var(--fs-sm); }
.f-title { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; opacity: .75; }
.fact.f-players { background: linear-gradient(150deg, #131A2B, #0A0D14); color: #F4F2EC; box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .4), var(--glow); }
.fact.f-players .f-num { color: #F5C542; }
.fact.f-players .f-ico { background: rgba(245, 197, 66, .14); color: #F5C542; }
.fact.f-games { background: linear-gradient(150deg, #FFD24A, #F2B705 60%, #D99A00); color: #131A2B; box-shadow: 0 10px 26px -12px rgba(242, 183, 5, .7); }
.fact.f-games .f-ico { background: #131A2B; color: #F5C542; }
.fact.f-reply { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.fact.f-reply .f-num { color: var(--accent-ink); }
.fact.f-reply .f-ico { background: var(--accent-wash); color: var(--accent-ink); }
.fact.f-team { background: var(--accent-wash); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.fact.f-team .f-ico { background: #131A2B; color: #F5C542; }
.f-live { position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 2px var(--surface), 0 0 10px #22C55E; }
.f-live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #22C55E; animation: live-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
.facts dt { display: flex; align-items: center; gap: .4rem; }
.facts dt svg { width: 16px; height: 16px; color: var(--accent-ink); }
.facts dt .f-live { position: relative; top: auto; right: auto; width: 10px; height: 10px; box-shadow: 0 0 8px #22C55E; flex: none; }
@media (min-width: 960px) { .fact-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .f-live::after { display: none; } }

/* The 24-hour rule: the main rule */
.rule-main { display: grid; gap: .45rem; padding: .9rem 1rem; border-radius: var(--r-control); background: linear-gradient(150deg, #131A2B, #0A0D14); color: #F4F2EC; box-shadow: inset 0 0 0 1.5px #F5C542, var(--glow); }
.rule-main p { font-weight: 700; font-size: 1.05rem; line-height: 1.45; color: #F4F2EC; }
.rule-badge { display: inline-flex; align-items: center; gap: .4rem; justify-self: start; padding: .2rem .65rem; border-radius: 999px; background: #F5C542; color: #131A2B; font: 800 var(--fs-xs)/1.4 var(--body); text-transform: uppercase; letter-spacing: .06em; }
.rule-badge svg { width: 15px; height: 15px; }

/* Referral card */
.referral-card { display: grid; gap: .7rem; padding: 1.1rem; border-radius: var(--r-card); background: linear-gradient(160deg, #131A2B, #090C13); color: #F4F2EC; box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .45), var(--glow); }
.referral-card .r-label { display: inline-flex; align-items: center; gap: .4rem; font: 700 var(--fs-xs)/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: #F5C542; }
.referral-card h2 { color: #F4F2EC; font-size: 1.3rem; }
.referral-card .hint { color: #C4CBDD; }
.ref-code { display: flex; align-items: center; gap: .5rem; padding: .5rem .5rem .5rem .9rem; border-radius: 14px; background: rgba(245, 197, 66, .12); box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, .55); }
.ref-code strong { flex: 1; min-width: 0; font: 700 1.45rem/1.2 var(--mono); letter-spacing: .12em; color: #F5C542; overflow-wrap: anywhere; user-select: all; }
.referral-card .btn-lime { background: #F5C542; color: #131A2B; }
.ref-redeem { display: grid; gap: .4rem; padding-top: .7rem; border-top: 1px dashed rgba(245, 197, 66, .35); }
.ref-redeem label { font-weight: 700; }
.ref-row { display: flex; gap: .5rem; }
.ref-row .input { flex: 1; min-width: 0; letter-spacing: .08em; }
.referral-card .err { color: #FF8A80; }

/* Prize wheel (only rendered when switched on) */
.spin-card { display: grid; gap: .6rem; justify-items: center; padding: 1.1rem; border-radius: var(--r-card); background: radial-gradient(circle at 50% 0%, #1F2635, #090C13 70%); color: #F4F2EC; box-shadow: inset 0 0 0 1.5px rgba(245, 197, 66, .55), var(--glow); text-align: center; }
.spin-card .r-label { display: inline-flex; align-items: center; gap: .4rem; font: 700 var(--fs-xs)/1.2 var(--body); letter-spacing: .08em; text-transform: uppercase; color: #F5C542; }
.spin-card h2 { color: #F4F2EC; font-size: 1.35rem; }
.wheel-wrap { position: relative; width: min(300px, 100%); aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; filter: drop-shadow(0 0 18px rgba(245, 197, 66, .45)); }
.wheel svg { width: 100%; height: 100%; display: block; }
.wheel-rot { transform-box: view-box; transform-origin: 110px 110px; }
.wheel-pointer { position: absolute; z-index: 2; top: -6px; left: 50%; translate: -50% 0; width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 26px solid #F5C542; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.wheel-hub { position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%; border: 4px solid #F5C542; background: #131A2B; color: #F5C542; font: 800 1rem/1 var(--display); letter-spacing: .06em; cursor: pointer; box-shadow: 0 0 0 4px #131A2B, 0 0 24px rgba(245, 197, 66, .7); }
.wheel-hub:active { transform: scale(.95); }
.wheel-hub[disabled] { opacity: .6; cursor: default; }
.spin-left { font-weight: 700; color: #C4CBDD; }
.spin-result { min-height: 1.4em; font: 800 1.2rem/1.3 var(--display); color: #F5C542; }
.odds { width: 100%; text-align: left; }
.odds summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: #F5C542; }
.odds ul { list-style: none; margin: 0 0 .5rem; padding: 0; display: grid; gap: .3rem; }
.odds li { display: flex; justify-content: space-between; gap: .5rem; padding: .35rem .6rem; border-radius: 10px; background: rgba(244, 242, 236, .06); }
.odds .hint { color: #C4CBDD; }

/* Room Passport */
.passport h2 { display: flex; align-items: center; gap: .45rem; }
.passport h2 svg { width: 24px; height: 24px; color: var(--accent-ink); }
.stamps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.stamp { display: grid; justify-items: center; gap: .25rem; padding: .8rem .5rem; border-radius: var(--r-control); text-align: center; border: 2px dashed var(--line-strong); color: var(--muted); }
.stamp strong { font-size: .9rem; line-height: 1.2; }
.st-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); }
.st-ico svg { width: 22px; height: 22px; }
.st-date { font-size: var(--fs-xs); font-weight: 700; }
.stamp.got { border: 2px solid var(--accent); color: var(--ink); background: var(--accent-wash); }
.stamp.got .st-ico { background: #131A2B; color: #F5C542; box-shadow: 0 0 0 3px var(--accent), 0 0 14px rgba(245, 197, 66, .5); rotate: -8deg; }
.stamp.got .st-date { color: var(--accent-ink); }
@media (min-width: 600px) { .stamps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Guide me */
.guide-btn { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; gap: .7rem; width: 100%; min-height: 60px; padding: .6rem .8rem; border: 0; border-radius: var(--r-card); cursor: pointer; text-align: left; font: inherit; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent); }
.guide-btn strong { display: block; }
.guide-btn .hint { font-size: var(--fs-sm); }
.guide-btn .go { width: 20px; height: 20px; color: var(--muted); }
.g-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #131A2B; color: #F5C542; }
.g-ico svg { width: 24px; height: 24px; }
.guide-suggest { display: flex; flex-wrap: wrap; gap: .4rem; }
.guide-suggest button { min-height: 44px; padding: .35rem .8rem; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: 700 .88rem/1.2 var(--body); cursor: pointer; text-align: left; }
.guide-answer { padding: .7rem .9rem; border-radius: 12px; background: var(--accent-wash); font-weight: 700; }
.guide-glow { position: relative; z-index: 1; animation: guide-glow 2.4s ease; border-radius: var(--r-card); }
@keyframes guide-glow { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 20%, 70% { box-shadow: 0 0 0 3px #F5C542, 0 0 34px rgba(245, 197, 66, .75); } }
@media (prefers-reduced-motion: reduce) { .guide-glow { animation: none; outline: 3px solid #F5C542; outline-offset: 2px; } }

/* Shared moment: a gold wave + one-line banner for a real event */
.moment { position: fixed; z-index: 92; inset: 0; pointer-events: none; display: grid; place-items: center; overflow: hidden; }
.moment-wave { position: absolute; inset: -20% -60%; background: linear-gradient(100deg, transparent 35%, rgba(245, 197, 66, .0) 40%, rgba(245, 197, 66, .28) 50%, rgba(245, 197, 66, 0) 60%, transparent 65%); transform: translateX(-60%); }
.moment-text { position: relative; margin: 0 16px; padding: .7rem 1.2rem; border-radius: 999px; background: #131A2B; color: #F5C542; font: 800 clamp(.95rem, .8rem + 1vw, 1.25rem)/1.25 var(--display); letter-spacing: .06em; text-transform: uppercase; text-align: center; box-shadow: 0 0 0 2px #F5C542, 0 18px 40px -10px rgba(0, 0, 0, .55), 0 0 40px rgba(245, 197, 66, .5); }
.moment.run .moment-wave { animation: moment-wave 2.4s ease-in-out forwards; }
.moment.run .moment-text { animation: moment-text 2.8s ease forwards; }
@keyframes moment-wave { to { transform: translateX(60%); } }
@keyframes moment-text { 0% { opacity: 0; scale: .9; } 12%, 82% { opacity: 1; scale: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .moment-wave { display: none; } .moment.run .moment-text { animation: none; } }

/* Room mood: a touch more life when a real person is online, calmer when away */
body.mood-live .halo::before { animation-duration: 2.6s; }
body.mood-live .live-pill { box-shadow: inset 0 0 0 1px rgba(255, 59, 74, .55), 0 0 24px -2px rgba(255, 59, 74, .65); }
body.mood-quiet .halo::before { animation-duration: 6s; }
body.mood-quiet .halo::after { opacity: .5; }

/* Secret corner: the back room */
.backroom { position: fixed; z-index: 90; inset: 0; overflow-y: auto; background: radial-gradient(circle at 50% 10%, rgba(245, 197, 66, .22), transparent 55%), repeating-linear-gradient(45deg, #0E121B 0 14px, #121827 14px 28px); }
.backroom-inner { max-width: 440px; margin: 0 auto; min-height: 100%; display: grid; align-content: center; justify-items: center; gap: .8rem; padding: 2rem 16px calc(2rem + env(safe-area-inset-bottom, 0px)); text-align: center; }
.backroom-inner img { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 0 0 3px #F5C542, 0 0 40px rgba(245, 197, 66, .6); }
.backroom h2 { color: #F4F2EC; font-size: 1.8rem; }
.backroom .kicker { color: #F5C542; }
.backroom .lore { background: #161C28; box-shadow: inset 0 0 0 1px rgba(245, 197, 66, .4); color: #CDD1DC; text-align: left; }
.backroom .hint { color: #F5C542; font-weight: 700; }
.guide-chip { display: inline-flex; align-items: center; gap: .35rem; }
.guide-chip svg { width: 18px; height: 18px; color: var(--accent-ink); }

/* Account page logo: fixed size, centred, never squashed or shifted */
.about-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: .9rem; }
.about-head img { display: block; width: 64px; height: 64px; aspect-ratio: 1; object-fit: cover; align-self: center; justify-self: center; }
.acct-row { align-items: center; }
.acct-avatar { aspect-ratio: 1; align-self: center; }

@media (max-width: 599px) {
  .cl-steps li { grid-template-columns: 34px minmax(0, 1fr); align-items: start; }
  .cl-steps li .btn { grid-column: 2; justify-self: start; }
}
