/* Kingdom app (dark Jewel & Ink). Phone-first; centred column on wider screens. */
html, body { height: 100%; background: var(--ink); color: var(--text); overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.app { height: 100%; max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; position: relative; }
.screen { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }

/* HUD */
.hud { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--ink); z-index: 3; }
.hud-pill { display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px 6px 8px; border-radius: 999px; background: var(--velvet); border: 0; font-weight: 700; font-size: 15px; color: var(--text); }
.hud-pill small { font-size: 12px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.hud-pill .coin { font-size: 22px; }
.hud-pill .plus { width: 18px; height: 18px; border-radius: 50%; background: var(--emerald); color: var(--ink); display: grid; place-items: center; font-weight: 800; font-size: 14px; line-height: 1; }
.hud-rank { margin-left: auto; padding: 6px 12px; }
.hud-icon { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--velvet); color: var(--text-2); display: grid; place-items: center; }
.heart { width: 22px; height: 22px; flex: none; }

/* Tab bar */
.tabbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: #161B36; z-index: 3; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 12px; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button[aria-current="page"] { color: var(--gold); }
.app.playing .hud, .app.playing .tabbar { display: none; }

/* Map */
.realm { position: sticky; top: 0; z-index: 2; margin: 0 16px; padding: 10px; border-radius: 18px; background: var(--velvet); display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 18px var(--ink); }
.realm-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18); flex: none; }
.realm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.realm-text small { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.realm-text b { font-family: var(--display); font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.realm-nav { width: 32px; height: 44px; flex: none; border-radius: 10px; border: 0; background: var(--velvet-2); color: var(--text); display: grid; place-items: center; }
.realm-nav:disabled { opacity: .3; }
.path { position: relative; margin: -72px auto 0; width: 100%; }
.path svg.trail { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.node button { width: 60px; height: 60px; border-radius: 50%; border: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 22px; }
.node.done button { background: var(--gold); color: var(--ink); box-shadow: inset 0 -5px 0 var(--gold-deep); }
.node.current button { width: 84px; height: 84px; font-size: 32px; background: var(--text); color: var(--ink); box-shadow: 0 0 0 6px rgba(245,192,74,.35), inset 0 -5px 0 #C9CEEA; animation: breathe 2.4s ease-in-out infinite; }
.node.locked button { background: var(--velvet-2); color: #5A6190; box-shadow: inset 0 -4px 0 #161B36; }
.node .stars { font-size: 12px; letter-spacing: 2px; color: var(--gold); min-height: 14px; }
.node .stars i { font-style: normal; color: var(--line); }
.marker { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.marker.unlock { background: var(--gold); color: var(--ink); }
.marker.unlock.locked { background: var(--velvet); color: var(--muted); }
.chest { position: absolute; transform: translate(-50%, -50%); width: 56px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: var(--amethyst); box-shadow: inset 0 -5px 0 rgba(0,0,0,.2); }
.chest.open { background: var(--velvet-2); box-shadow: none; }
@keyframes breathe { 50% { box-shadow: 0 0 0 12px rgba(245,192,74,.12), inset 0 -5px 0 #C9CEEA; } }

/* Play */
.play { min-height: 100%; display: flex; flex-direction: column; gap: 14px; padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.play-top { display: flex; align-items: center; gap: 10px; }
.back { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--velvet); display: grid; place-items: center; color: var(--text); flex: none; }
.play-title { display: flex; flex-direction: column; }
.play-title b { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.play-title small { font-size: 12px; color: var(--muted); text-transform: capitalize; }
.hearts { margin-left: auto; display: flex; gap: 3px; }
.hearts .heart.lost path { fill: none; stroke: #3A4380; stroke-width: 2; }
.hearts.hit { animation: shake .35s; }
.clock { background: var(--velvet); border-radius: 18px; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.clock.frozen { background: #16314A; box-shadow: inset 0 0 0 2px var(--lagoon); }
.clock-row { display: flex; align-items: baseline; justify-content: space-between; }
.clock-time { font-family: var(--display); font-weight: 800; font-size: 32px; font-variant-numeric: tabular-nums; line-height: 1; }
.clock-bonus { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.clock-bonus small { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.clock-bonus b { font-family: var(--display); font-weight: 800; font-size: 22px; color: var(--gold); font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--gold); transition: width .25s linear; }
.clock.frozen .bar > i { background: var(--lagoon); }
.clock-note { font-size: 12px; color: var(--muted); }
.powers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: auto; }
.power { position: relative; border: 0; border-radius: 18px; background: var(--velvet); color: var(--text); padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 92px; }
.power svg { width: 28px; height: 28px; }
.power b { font-size: 14px; }
.power small { font-size: 12px; font-weight: 700; color: var(--gold); display: flex; align-items: center; gap: 4px; }
.power .count { position: absolute; top: -8px; right: -6px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: var(--ruby); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.power.locked { opacity: .45; }
.power.locked small { color: var(--muted); }
.power.featured { background: var(--gold); color: var(--ink); box-shadow: inset 0 -4px 0 var(--gold-deep); }
.power.featured small { color: var(--ink); }
.power:disabled { opacity: .45; }
.play-tools { display: flex; justify-content: center; gap: 24px; }

/* Panels / lists */
.pad { padding: 4px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.h1 { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.02em; }
.panel { background: var(--velvet); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { font-family: var(--body); font-size: 15px; font-weight: 700; letter-spacing: 0; display: flex; justify-content: space-between; align-items: baseline; }
.panel h2 small { font-weight: 500; font-size: 13px; color: var(--text-2); }
.row { display: flex; align-items: center; gap: 12px; }
.row-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-text b { font-size: 15px; }
.row-text small { font-size: 12px; color: var(--text-2); }
.glyph { width: 42px; height: 42px; border-radius: 12px; background: var(--line); display: grid; place-items: center; flex: none; }
.glyph svg { width: 24px; height: 24px; }
.price-btn { min-width: 70px; min-height: 40px; border: 0; border-radius: 12px; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 14px; box-shadow: inset 0 -3px 0 var(--gold-deep); display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 12px; }
.price-btn:disabled { background: var(--line); color: var(--muted); box-shadow: none; }
.tiles2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile-btn { border: 0; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; color: var(--text); min-height: 112px; }
.tile-btn b { font-size: 15px; }
.tile-btn small { font-size: 13px; font-weight: 700; display: flex; gap: 4px; align-items: center; }
.tile-btn:disabled { opacity: .5; }
.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pack { border: 0; border-radius: 18px; background: var(--velvet); color: var(--text); padding: 14px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pack .tag { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); min-height: 13px; }
.pack b { font-family: var(--display); font-weight: 800; font-size: 22px; }
.pack span.cost { width: 100%; padding: 8px 0; border-radius: 10px; background: var(--text); color: var(--ink); font-weight: 800; font-size: 13px; text-align: center; }
.pack:disabled { opacity: .6; }
.note { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.45; }
.link-btn { border: 0; background: none; color: var(--text-2); font-weight: 700; font-size: 14px; padding: 10px; min-height: 44px; }

/* Ranks */
.ranks-head { display: flex; align-items: center; justify-content: space-between; }
.live { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: #3A1A26; color: #F49AA8; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ruby); animation: blink 1.6s infinite; }
.live.off { background: var(--velvet); color: var(--muted); }
.live.off i { background: var(--muted); animation: none; }
@keyframes blink { 50% { opacity: .3; } }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: var(--velvet); }
.seg button { border: 0; border-radius: 11px; padding: 10px 0; background: transparent; color: var(--text-2); font-weight: 700; font-size: 14px; min-height: 40px; }
.seg button[aria-selected="true"] { background: var(--text); color: var(--ink); }
.ticker { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: #16314A; color: #C9F0F1; font-size: 13px; min-height: 42px; }
.ticker svg { flex: none; }
.ticker.flash { animation: tick .8s; }
@keyframes tick { 0% { background: #1E5C70; } 100% { background: #16314A; } }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: end; }
.podium > div { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--ink); flex: none; }
.podium .name { font-size: 13px; font-weight: 700; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium .step { width: 100%; border-radius: 14px 14px 0 0; background: var(--velvet); display: flex; flex-direction: column; align-items: center; padding-top: 10px; gap: 2px; }
.podium .step b { font-family: var(--display); font-weight: 800; font-size: 24px; }
.podium .step small { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lb { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #161B36; }
.lb-row.me { background: var(--gold); color: var(--ink); }
.lb-row .rk { width: 30px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 17px; }
.lb-row .nm { flex: 1; font-weight: 700; font-size: 15px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-row .sc { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.lb-gap { text-align: center; color: var(--muted); letter-spacing: 4px; }

/* Overlays */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(5,7,16,.72); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; }
.overlay.center { align-items: center; }
.overlay.full { background: #0A0D1E; align-items: stretch; }
.sheet { width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--velvet); border-radius: 26px 26px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; animation: rise .22s ease-out; }
.overlay.center .sheet { border-radius: 26px; width: calc(100% - 32px); }
.overlay.full .sheet { max-height: none; border-radius: 0; background: transparent; padding-top: calc(48px + env(safe-area-inset-top)); justify-content: flex-start; align-items: center; text-align: center; }
.sheet h2 { font-size: 28px; line-height: 1.1; }
.sheet p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.5; }
.sheet .actions { display: flex; gap: 10px; margin-top: 6px; }
.sheet .actions > * { flex: 1; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.facts div { background: var(--ink); border-radius: 14px; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.facts b { font-family: var(--display); font-weight: 800; font-size: 20px; text-transform: capitalize; }
.facts small { font-size: 12px; color: var(--muted); }
.stars-big { display: flex; gap: 6px; align-items: flex-end; justify-content: center; }
.stars-big svg { animation: pop .35s ease-out both; }
.breakdown { width: 100%; background: var(--velvet); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.breakdown .line { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; gap: 12px; }
.breakdown .line span { color: var(--text-2); }
.breakdown .line b { font-variant-numeric: tabular-nums; }
.breakdown hr { border: 0; height: 1px; background: var(--line); margin: 2px 0; width: 100%; }
.breakdown .total b { font-family: var(--display); font-weight: 800; font-size: 32px; color: var(--gold); }
.mini-cards { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-cards > div { background: var(--velvet); border-radius: 18px; padding: 14px; display: flex; align-items: center; gap: 10px; text-align: left; }
.mini-cards b { font-family: var(--display); font-weight: 800; font-size: 22px; display: block; }
.mini-cards small { font-size: 12px; color: var(--muted); }
.reward-art { width: 168px; height: 168px; border-radius: 44px; display: grid; place-items: center; background: var(--gold); box-shadow: inset 0 -10px 0 var(--gold-deep), 0 0 0 12px rgba(245,192,74,.15), 0 0 0 28px rgba(245,192,74,.06); margin: 10px 0; }
.chip-eyebrow { padding: 6px 14px; border-radius: 999px; background: var(--velvet); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-2); }
.field input { font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--ink); color: var(--text); -webkit-user-select: text; user-select: text; }
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-weight: 700; font-size: 15px; }
.switch input { width: 22px; height: 22px; accent-color: var(--gold); }
.switch.sub { padding-left: 14px; font-weight: 600; font-size: 14px; color: var(--text-2); }
.switch select { font: inherit; font-size: 16px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--ink); color: var(--text); }
/* Daily gift: a slim strip under the top bar for a few seconds (never a pop-up) */
.gift-strip { position: absolute; left: 12px; right: 12px; top: calc(env(safe-area-inset-top) + 66px); z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--velvet-2); border: 1.5px solid var(--gold-deep); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(-10px); transition: opacity .3s, transform .3s; }
.gift-strip.show { opacity: 1; transform: none; }
.gift-what { display: flex; align-items: center; gap: 6px; color: var(--gold); font-family: var(--display); font-weight: 800; font-size: 17px; white-space: nowrap; }
.gift-what svg { width: 20px; height: 20px; }
.gift-text { display: flex; flex-direction: column; line-height: 1.2; }
.gift-text strong { font-size: 14px; }
.gift-text small { color: var(--muted); font-size: 12px; }
.gift-pips { margin-left: auto; display: flex; gap: 4px; }
.gift-pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.gift-pips i.last { border-radius: 2px; transform: rotate(45deg); }
.gift-pips i.on { background: var(--gold); }
/* Daily streak, beside the day on the Daily tab */
.streak { color: var(--gold); font-weight: 700; text-transform: none; }

/* Daily inside the app */
.daily-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dchips { display: flex; gap: 6px; flex-wrap: wrap; }
.dchip { min-height: 34px; padding: 6px 10px; border-radius: 10px; border: 0; background: var(--velvet); color: var(--muted); font-weight: 700; font-size: 13px; }
.dchip.done { background: #183A30; color: #8FE3C2; }
.dchip.now { background: var(--gold); color: var(--ink); }
.board-wrap { position: relative; }
.cover { position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center; background: rgba(10,13,30,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

/* Boot */
.boot { position: fixed; inset: 0; z-index: 40; background: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; transition: opacity .3s; }
.boot p { color: var(--muted); font-size: 14px; margin: 0; max-width: 280px; text-align: center; line-height: 1.5; }
.boot.gone { opacity: 0; pointer-events: none; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.app.playing ~ .toast { bottom: calc(150px + env(safe-area-inset-bottom)); }
.price-btn .coin { background: var(--gold-deep); box-shadow: none; }

/* The climb (complete screen) */
.climb { width: 100%; border: 0; background: var(--velvet); color: var(--text); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.climb-head { display: flex; align-items: center; justify-content: space-between; }
.climb-head b { font-size: 15px; }
.climb-badge { padding: 5px 10px; border-radius: 999px; background: var(--line); color: var(--text-2); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
.climb-badge.up { background: #183A30; color: #8FE3C2; }
.climb-rows { position: relative; overflow: hidden; }
.climb-row { position: absolute; left: 0; right: 0; height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 12px; background: #161B36; }
.climb-row.me { background: var(--gold); color: var(--ink); z-index: 1; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.climb-row .rk { width: 28px; text-align: center; font-family: var(--display); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.climb-row .nm { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.climb-row .sc { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.climb-note { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.overlay.full .sheet { overflow-y: auto; max-height: 100vh; gap: 12px; padding-top: calc(28px + env(safe-area-inset-top)); }

/* How to play */
.sheet.tut { align-items: stretch !important; text-align: left !important; gap: 16px; padding-left: 20px; padding-right: 20px; }
.sheet.tut h2 { font-size: 30px; }
.tut-top { display: flex; align-items: center; justify-content: space-between; }
.tut-top .link-btn { padding: 8px 0; }
.tut-dots { display: flex; gap: 6px; }
.tut-dots i { width: 22px; height: 6px; border-radius: 999px; background: var(--line); }
.tut-dots i.on { background: var(--gold); width: 34px; }
.tut-dots i.done { background: var(--gold-deep); }
.tut-board { width: min(300px, 82vw); align-self: center; }
.tut-list { display: flex; flex-direction: column; gap: 16px; }
.tut-list .row { align-items: flex-start; }
.tut-list .glyph { background: var(--velvet); }
.tut-list .glyph svg { width: 24px; height: 24px; }
.tut-list .row-text small { font-size: 14px; line-height: 1.45; }

/* Treasury: royal bundles and gold */
.shop-section { display: flex; flex-direction: column; gap: 10px; }
.shop-h { font-family: var(--body); font-size: 15px; font-weight: 700; letter-spacing: 0; }
.bundle { background: linear-gradient(160deg, #2A2257, var(--velvet) 60%); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: inset 0 0 0 1.5px rgba(245,192,74,.25); }
.bundle.starter { background: linear-gradient(160deg, #3B2A12, var(--velvet) 65%); box-shadow: inset 0 0 0 2px rgba(245,192,74,.6); }
.bundle.quiet { background: var(--velvet); box-shadow: none; }
.bundle-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.bundle-top b { font-family: var(--display); font-weight: 800; font-size: 20px; }
.bundle-top small { font-size: 12px; color: var(--text-2); }
.tag-pill { display: inline-block; margin-left: 8px; padding: 3px 8px; border-radius: 999px; background: var(--gold); color: var(--ink); font-family: var(--body); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: 3px; }
.chips-c { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-c { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.07); font-size: 13px; font-weight: 700; }
.chip-c .coin { font-size: 15px; }
.chip-c i { display: inline-grid; width: 16px; height: 16px; }
.chip-c i svg, .chip-c svg.heart { width: 16px; height: 16px; }
.price-btn.wide { width: 100%; min-height: 48px; font-size: 16px; }
.gold-row { display: flex; align-items: center; gap: 12px; background: var(--velvet); border-radius: 16px; padding: 10px 12px; }
.gold-row .row-text b { font-size: 15px; }
.gold-row em { font-style: normal; color: #8FE3C2; font-weight: 700; }
.gold-row .tag-pill { vertical-align: 1px; }
.coin-stack { width: 42px; height: 42px; border-radius: 12px; background: var(--line); display: grid; place-items: center; flex: none; }
.coin-stack .coin { font-size: 24px; }
.unlimited-banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: #3A1A26; color: #F7C9D2; font-size: 14px; line-height: 1.4; }

/* Kingdom scenery behind the level path */
.scene-wrap { position: absolute; inset: 0; pointer-events: none; }
.scene-wrap svg { display: block; }
.scene .twinkle { animation: twinkle 3.2s ease-in-out infinite; }
.scene .flicker { animation: flicker 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .wave { animation: wave-flag 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: left center; }
@keyframes twinkle { 50% { opacity: .15; } }
@keyframes flicker { 50% { opacity: .65; transform: scale(.9); } }
@keyframes wave-flag { 50% { transform: scaleX(.86) skewY(-4deg); } }
.node .stars { text-shadow: 0 1px 3px #000; }
.marker, .chest { box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.scene .smoke { animation: smoke 4s ease-in-out infinite; }
@keyframes smoke { 50% { transform: translateY(-4px); opacity: .05; } }
.auto-btn { gap: 6px; }
.auto-btn.locked { color: var(--muted); }
.auto-btn.on { color: var(--lagoon); }
.owned-pill { padding: 8px 12px; border-radius: 12px; background: #183A30; color: #8FE3C2; font-weight: 800; font-size: 13px; }

/* Royal Sight: the gold bar under the board, and the featured card at the top of the Treasury */
[data-sight-slot][hidden], [data-auto-slot][hidden] { display: none; }
.sight-bar { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 10px; border: 0; border-radius: 16px; color: var(--text); background: linear-gradient(100deg, #3B2A12, var(--velvet) 70%); box-shadow: inset 0 0 0 1.5px rgba(245,192,74,.6); }
.sight-bar .glyph { width: 38px; height: 38px; background: rgba(255,255,255,.08); }
.sight-bar .row-text b { font-size: 15px; }
.sight-bar .row-text small { font-size: 12px; color: var(--text-2); }
.sight-price { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border-radius: 12px; background: var(--gold); color: var(--ink); font-weight: 800; font-size: 14px; box-shadow: inset 0 -3px 0 var(--gold-deep); flex: none; }
.sight-bar:active { transform: translateY(1px); }
.bundle.sight { background: linear-gradient(160deg, #3B2A12, var(--velvet) 65%); box-shadow: inset 0 0 0 2px rgba(245,192,74,.6); }
.bundle.sight .glyph { width: 48px; height: 48px; background: rgba(255,255,255,.08); }
.bundle.sight .glyph svg { width: 28px; height: 28px; }
.sight-name { font-family: var(--display); font-weight: 800; font-size: 20px !important; }
.bundle.sight .row-text small { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.sight-short { font-size: 12px; color: var(--text-2); text-align: center; }

/* Invite a friend */
.invite-card .glyph { background: rgba(245,192,74,.14); }
.invite-card small .coin { font-size: 12px; vertical-align: -1px; margin-right: 2px; }
.invite-code { border: 0; width: 100%; padding: 14px; border-radius: 18px; background: var(--ink); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: inset 0 0 0 1.5px rgba(245,192,74,.6); }
.invite-code small { font-size: 12px; font-weight: 700; color: var(--text-2); }
.invite-code b { font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .14em; color: var(--gold); -webkit-user-select: text; user-select: text; }
.invite-code span { font-size: 12px; color: var(--muted); }
.invite-enter { display: flex; align-items: flex-end; gap: 10px; }
.invite-enter .field { flex: 1; min-width: 0; }
.invite-enter input { text-transform: uppercase; width: 100%; }
.invite-enter input::placeholder { text-transform: none; font-size: 14px; }
.invite-enter .btn { min-height: 49px; }

/* Share my rank */
.share-layer { z-index: 30; }
.share-preview { align-self: center; height: min(340px, 42vh); aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: var(--ink); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.share-preview img { width: 100%; height: 100%; display: block; }
#shareRank[hidden] { display: none; }
.invite-steps { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.invite-steps > span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 14px; background: var(--ink); }
.invite-steps b { display: inline-flex; align-items: center; gap: 4px; font-size: 16px; color: var(--gold); }
.invite-steps b .coin { font-size: 14px; }
.invite-steps small { font-size: 12px; color: var(--text-2); }

/* More games */
.more-card { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; margin-top: 6px; border: 0; border-radius: 16px; background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1.5px var(--line); }
.more-card .row-text b { font-size: 14px; color: var(--text); }
.more-card .row-text small { font-size: 12px; }
.more-icons { display: flex; }
.more-icons img { border-radius: 9px; }
.more-icons img + img { margin-left: -8px; box-shadow: 0 0 0 2px var(--ink); }
.more-game img { border-radius: 14px; flex: none; }
.more-game .price-btn { text-decoration: none; }
.more-game .price-btn.soon { background: var(--line); color: var(--text); box-shadow: none; font-size: 13px; }

/* Kingdom preview on the website */
.preview-bar { position: sticky; bottom: 10px; z-index: 3; margin: 0 12px 10px; box-shadow: inset 0 0 0 1.5px rgba(245,192,74,.5), 0 8px 18px rgba(0,0,0,.45); padding: 10px 12px; border-radius: 14px; background: linear-gradient(100deg, #3B2A12, var(--velvet) 70%); display: flex; align-items: center; gap: 10px; font-size: 13px; line-height: 1.35; color: var(--text-2); }
.preview-bar b { color: var(--text); }
.preview-bar a { flex: none; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.08); color: var(--text); font-weight: 700; text-decoration: none; }
.node.app-only button { color: var(--gold); opacity: .8; }
.preview-list { display: flex; flex-wrap: wrap; gap: 6px; }
.preview-list span { padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.07); font-size: 13px; font-weight: 700; }
.preview-soon { text-align: left; color: var(--gold); font-weight: 700; }

/* Android: the keyboard slides over the page instead of resizing it, so while a text box in a
   sheet is being typed in, the sheet moves to the top of the screen to keep the box in view.
   (iPhone pans the page up by itself, so this must not apply there.) */
.android .overlay:has(input:not([type=checkbox]):focus) { align-items: flex-start; }
.android .overlay:has(input:not([type=checkbox]):focus) .sheet { margin-top: calc(8px + env(safe-area-inset-top)); border-radius: 26px; max-height: 60vh; }
.sheet:focus { outline: none; }

/* Shorter phones (iPhone 17e, SE-height screens): tighten the level screen so Undo and Clear stay on screen. */
@media (max-height: 880px) {
  .play { gap: 9px; padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .clock { padding: 9px 14px; gap: 6px; }
  .clock-note { display: none; }
  .power { min-height: 76px; padding: 8px 6px 7px; }
  .sight-bar { padding: 6px 10px; }
  .play-tools .btn { min-height: 40px; }
}
