/* ───── buttons ───── */
.btn { --bg-a: var(--surface3); --bg-b: var(--surface3); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 16px; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: .01em; background: linear-gradient(135deg, var(--bg-a), var(--bg-b)); color: #fff; transition: transform .18s var(--spring), box-shadow .2s, filter .2s; position: relative; white-space: nowrap; user-select: none; }
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active { transform: translateY(0) scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary { --bg-a: var(--coral); --bg-b: var(--orange); box-shadow: 0 10px 26px -6px rgba(255, 93, 115, .65), inset 0 -3px 0 rgba(0, 0, 0, .15); }
.btn-primary:hover { box-shadow: 0 14px 34px -6px rgba(255, 93, 115, .8), inset 0 -3px 0 rgba(0, 0, 0, .15); }
.btn-sky { --bg-a: var(--sky); --bg-b: var(--grape); box-shadow: 0 10px 26px -8px rgba(56, 182, 255, .7), inset 0 -3px 0 rgba(0,0,0,.15); }
.btn-mint { --bg-a: var(--mint); --bg-b: var(--sky); color: #06322a; box-shadow: 0 10px 26px -8px rgba(43, 227, 176, .6), inset 0 -3px 0 rgba(0,0,0,.12); }
.btn-sun { --bg-a: #ffe27a; --bg-b: var(--sun); color: #402c00; box-shadow: 0 10px 26px -8px rgba(255, 201, 51, .6), inset 0 -3px 0 rgba(0,0,0,.12); }
.btn-ghost { --bg-a: rgba(255,255,255,.1); --bg-b: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px var(--line2); }
.btn-lg { min-height: 58px; padding: 0 32px; font-size: 20px; border-radius: 20px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-icon { width: 46px; padding: 0; }
.btn-block { width: 100%; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.07); position: relative; transition: background .2s, transform .18s var(--spring); }
.iconbtn:hover { background: rgba(255,255,255,.15); transform: translateY(-1px); }
.iconbtn:active { transform: scale(.94); }
.iconbtn svg { width: 22px; height: 22px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--coral); color: #fff; font: 700 12px/20px var(--font); text-align: center; box-shadow: 0 0 0 3px var(--bg); }
.ico { width: 1.2em; height: 1.2em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill { fill: currentColor; stroke: none; }

/* ───── pills & chips ───── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; background: rgba(255,255,255,.1); font-weight: 700; font-size: 13px; backdrop-filter: blur(8px); white-space: nowrap; }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(43,227,176,.7); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 70% { box-shadow: 0 0 0 8px rgba(43,227,176,0); } 100% { box-shadow: 0 0 0 0 rgba(43,227,176,0); } }
.stars-pill { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 10px; border-radius: 99px; background: linear-gradient(135deg, rgba(255,201,51,.22), rgba(255,138,61,.16)); box-shadow: inset 0 0 0 1px rgba(255,201,51,.35); font-family: var(--display); font-weight: 600; font-size: 18px; color: #ffe9a6; }
.stars-pill .st { width: 26px; height: 26px; filter: drop-shadow(0 2px 6px rgba(255,201,51,.6)); }
.stars-pill.bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.18); } }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 99px; background: rgba(255,255,255,.07); font-weight: 800; font-size: 15px; transition: background .2s, transform .18s var(--spring); box-shadow: inset 0 0 0 1px var(--line); }
.chip:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }
.chip.on { background: linear-gradient(135deg, var(--grape), var(--pink)); box-shadow: 0 8px 20px -8px rgba(139,92,246,.9); }
.chip .emoji { font-size: 18px; }
.rarity { font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; }
.rarity.common { background: rgba(167,168,220,.18); color: #c9caf3; }
.rarity.rare { background: rgba(56,182,255,.2); color: #8ad4ff; }
.rarity.epic { background: rgba(178,124,255,.22); color: #d3b4ff; }
.rarity.legendary { background: linear-gradient(135deg, rgba(255,201,51,.3), rgba(255,138,61,.3)); color: #ffe08a; }

/* ───── cards ───── */
.card { background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.035)); border-radius: var(--r-lg); box-shadow: inset 0 0 0 1px var(--line); padding: 20px; }
.section { margin: 36px 0 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: clamp(22px, 3vw, 28px); }
.section-head a, .section-head button.link { color: var(--sky); font-weight: 800; font-size: 14px; }

/* ───── game card ───── */
.gcard { --accent: var(--grape); position: relative; display: block; text-align: left; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 8px 24px -10px rgba(0,0,0,.6); transition: transform .35s var(--spring), box-shadow .3s; overflow: hidden; cursor: pointer; isolation: isolate; animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
.gcard:hover, .gcard:focus-visible { transform: translateY(-6px) scale(1.012); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 70%, white), 0 26px 50px -14px color-mix(in srgb, var(--accent) 70%, transparent); }
.gcard:active { transform: translateY(-2px) scale(.99); }
.gcard .art { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface3); }
.gcard .art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gcard:hover .art img { transform: scale(1.08); }
.gcard .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,9,40,0) 55%, rgba(10,9,40,.55)); }
.gcard .cat { position: absolute; left: 12px; top: 12px; z-index: 2; }
.gcard .fav { position: absolute; right: 10px; top: 10px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(12,10,48,.55); backdrop-filter: blur(8px); transition: transform .2s var(--spring), background .2s; }
.gcard .fav:hover { transform: scale(1.12); background: rgba(12,10,48,.8); }
.gcard .fav svg { width: 20px; height: 20px; }
.gcard .fav.on svg { fill: var(--coral); stroke: var(--coral); animation: heart .5s var(--spring); }
@keyframes heart { 40% { transform: scale(1.5); } }
.gcard .playchip { position: absolute; right: 12px; bottom: 12px; z-index: 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #1a1948; transform: translateY(12px) scale(.6); opacity: 0; transition: .3s var(--spring); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.gcard:hover .playchip, .gcard:focus-visible .playchip { transform: none; opacity: 1; }
.gcard .playchip svg { width: 22px; height: 22px; margin-left: 2px; }
.gcard .info { padding: 14px 16px 16px; }
.gcard h3 { font-size: 20px; margin-bottom: 4px; }
.gcard .desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.gcard .meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; font-weight: 800; color: var(--muted); }
.gcard .meta .online { color: var(--mint); display: inline-flex; align-items: center; gap: 6px; }
.gcard .meta .online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px var(--mint); }
.gcard .meta .soft { color: var(--faint); }
.gcard.compact { width: 260px; flex: none; scroll-snap-align: start; }
.gcard.compact .info { padding: 10px 14px 14px; }
.gcard.compact h3 { font-size: 17px; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.hscroll { display: flex; gap: 18px; overflow-x: auto; padding: 6px 4px 22px; margin: 0 -4px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }

/* ───── avatar bits ───── */
.av { position: relative; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, var(--surface3), var(--surface)); flex: none; display: grid; place-items: center; }
.av svg { width: 100%; height: 100%; }
.av.sq { border-radius: 22%; }
.av.s32 { width: 32px; height: 32px; } .av.s44 { width: 44px; height: 44px; } .av.s56 { width: 56px; height: 56px; } .av.s72 { width: 72px; height: 72px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: #5b5d9c; box-shadow: 0 0 0 3px var(--bg2); flex: none; }
.dot.on { background: var(--mint); box-shadow: 0 0 0 3px var(--bg2), 0 0 12px var(--mint); }
.dot.play { background: var(--sky); box-shadow: 0 0 0 3px var(--bg2), 0 0 12px var(--sky); }

/* ───── forms ───── */
.input { width: 100%; height: 50px; padding: 0 18px; border-radius: 16px; border: 0; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px var(--line2); outline: none; font-weight: 700; transition: box-shadow .2s, background .2s; }
.input:focus { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 2px var(--sky); }
.input::placeholder { color: var(--faint); font-weight: 600; }
.code-input { text-align: center; letter-spacing: .3em; font-family: var(--display); font-size: 24px; text-transform: uppercase; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 16px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--line); flex-wrap: wrap; }
.seg button { padding: 9px 16px; border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--muted); transition: .2s; }
.seg button.on { background: var(--grape); color: #fff; box-shadow: 0 6px 16px -6px rgba(139,92,246,.9); }
.switch { width: 58px; height: 34px; border-radius: 99px; background: rgba(255,255,255,.14); position: relative; transition: background .25s; flex: none; }
.switch::after { content: ""; position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .3s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.switch.on { background: var(--mint); }
.switch.on::after { transform: translateX(24px); }

/* ───── modal / sheet / toast ───── */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(6, 5, 28, .72); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; animation: fade .2s both; }
.modal { width: min(100%, 460px); max-height: 90dvh; overflow: auto; background: linear-gradient(180deg, var(--surface2), var(--surface)); border-radius: var(--r-xl); padding: 26px 22px 22px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line2); animation: pop .4s var(--spring) both; text-align: center; }
.modal h3 { font-size: 26px; margin-bottom: 8px; }
.modal p { color: var(--muted); }
.modal .actions { display: flex; gap: 10px; margin-top: 20px; justify-content: center; flex-wrap: wrap; }
.modal .actions .btn { flex: 1 1 140px; }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 12px); display: flex; flex-direction: column; gap: 10px; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 20px; background: linear-gradient(135deg, #2b2a6e, #1e1d52); box-shadow: var(--shadow), inset 0 0 0 1px var(--line2); font-weight: 800; animation: toastIn .45s var(--spring) both; }
.toast.out { animation: toastOut .3s ease both; }
.toast .ti { font-size: 26px; line-height: 1; }
.toast small { display: block; color: var(--muted); font-weight: 700; font-size: 13px; }
.toast.good { box-shadow: var(--shadow), inset 0 0 0 1px rgba(43,227,176,.5); }
.toast.bad { box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,93,115,.6); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px) scale(.95); } }
.confetti { position: fixed; z-index: 400; top: 0; width: 10px; height: 14px; border-radius: 3px; pointer-events: none; animation: confetti 2.2s var(--ease) forwards; }
@keyframes confetti { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); opacity: .9; } }

/* drawers / sheets */
.drawer-wrap { position: fixed; inset: 0; z-index: 150; background: rgba(6,5,28,.55); backdrop-filter: blur(4px); animation: fade .2s both; }
.drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(100%, 420px); background: linear-gradient(180deg, var(--surface2), var(--bg2)); box-shadow: -20px 0 60px rgba(0,0,0,.5), inset 1px 0 0 var(--line2); display: flex; flex-direction: column; animation: slideIn .35s var(--ease) both; padding-top: var(--safe-t); }
.drawer.pop-top { right: 12px; left: auto; top: calc(var(--topbar-h) + 4px); bottom: auto; max-height: min(78dvh, 640px); border-radius: var(--r-lg); width: min(calc(100% - 24px), 400px); animation: pop .3s var(--spring) both; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 10px; }
.drawer-head h3 { font-size: 24px; }
.drawer-body { flex: 1; overflow: auto; padding: 4px 16px 22px; -webkit-overflow-scrolling: touch; }
@keyframes slideIn { from { transform: translateX(100%); } }
@media (max-width: 720px) {
  .drawer { width: 100%; }
  .drawer.pop-top { right: 0; left: 0; top: auto; bottom: 0; width: 100%; max-height: 82dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheetUp .38s var(--ease) both; }
}
@keyframes sheetUp { from { transform: translateY(100%); } }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .big { font-size: 46px; margin-bottom: 8px; }
.skeleton { background: linear-gradient(100deg, var(--surface) 30%, var(--surface3) 50%, var(--surface) 70%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; padding: 10px 16px; border-radius: 14px; font-weight: 800; color: var(--muted); transition: .2s; font-size: 15px; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); background: rgba(255,255,255,.06); }
.tab.on { color: #fff; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px var(--line2); }
.progress { height: 12px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--mint), var(--sky)); transition: width .8s var(--ease); }

/* suggested age on game cards / pages (set in the developer review; shown for every game) and the Parent Area age limit */
.agepill { position: absolute; left: 10px; bottom: 10px; z-index: 2; background: rgba(255, 255, 255, .94); color: #1f1a45; font-weight: 800; font-size: 12px; border-radius: 999px; padding: 2px 9px; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); }
.agepill-d { background: #fff; color: #1f1a45; font-weight: 800; }
.gcard .by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard.blocked .art img { filter: grayscale(.85) brightness(.6); }
.gcard.blocked .playchip { display: none; }
.agelock { position: absolute; inset: 0; display: grid; place-items: center; z-index: 3; color: #fff; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); text-align: center; padding: 8px; }
