/* ---- Rewards: My Thinnai (house front), sticker book, daily lamp, certificates ---- */
:root { --my-yard-1: #EBCB94; --my-yard-2: #D9A86A; --my-lane: #F3DDB2; --my-tuft: #7FA85A; --my-bubble: var(--surface); }
:root[data-theme="dark"] { --my-yard-1: #3B3027; --my-yard-2: #2C241D; --my-lane: #4A3C30; --my-tuft: #3E5A34; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --my-yard-1: #3B3027; --my-yard-2: #2C241D; --my-lane: #4A3C30; --my-tuft: #3E5A34; } }

.reward-art { display: inline-block; width: 1em; height: 1em; line-height: 0; vertical-align: bottom; }
.reward-art svg { width: 100%; height: 100%; display: block; overflow: visible; }
.reward-emoji { display: inline-block; line-height: 1; }
.is-silhouette { filter: grayscale(1) brightness(.2); opacity: .28; }
:root[data-theme="dark"] .is-silhouette { filter: grayscale(1) brightness(2.2); opacity: .3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .is-silhouette { filter: grayscale(1) brightness(2.2); opacity: .3; } }
:root[data-contrast="high"] .is-silhouette { opacity: .5; }

.my-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; position: relative; }
.chip--link { text-decoration: none; color: var(--peacock-deep); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.chip--link:hover { text-decoration: underline; }
.guest-cta { margin-top: 24px; text-align: center; }

/* The house-front picture. Sizes use container units so it looks the same at every width. */
.my-scene { position: relative; width: 100%; aspect-ratio: 1000 / 560; border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow-2); border: 4px solid var(--surface); margin: 22px 0 26px; container-type: inline-size; }
.my-scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.my-items { position: absolute; inset: 0; }
.my-item { position: absolute; transform: translate(-50%, -100%); border: 0; background: none; padding: 0; cursor: pointer; font-size: calc(var(--s, 1) * 6.2cqw); line-height: 1;
  min-width: 44px; min-height: 44px; display: grid; place-items: end center; filter: drop-shadow(0 .5cqw .4cqw rgba(0,0,0,.18)); transition: transform .25s var(--spring); border-radius: 12px; }
.my-item:hover { transform: translate(-50%, -100%) scale(1.06); }
.my-item:focus-visible { outline-offset: 2px; }
.my-item.is-flat { filter: none; }
.my-item.is-flat .reward-art { transform: scaleY(.42); transform-origin: 50% 100%; }
.my-item.is-hop { animation: my-hop .6s var(--spring); }
@keyframes my-hop { 0%, 100% { transform: translate(-50%, -100%); } 40% { transform: translate(-50%, -118%) scale(1.08); } }
.my-item.is-new { animation: my-pop .9s var(--spring) both; }
@keyframes my-pop { from { transform: translate(-50%, -100%) scale(0); } to { transform: translate(-50%, -100%) scale(1); } }
.my-new { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font: 800 12px/1 var(--f-ml); background: var(--marigold); color: var(--on-marigold); padding: 5px 8px 3px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
.my-bubble { position: absolute; transform: translate(-50%, -100%); background: var(--my-bubble); color: var(--ink); padding: 8px 14px 6px; border-radius: 16px; box-shadow: var(--shadow-2); font-size: .95rem; white-space: nowrap; pointer-events: none; z-index: 2; border: 1px solid var(--line); }
.my-bubble .ml { font-size: 1.15rem; }
.my-empty { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); width: min(92%, 460px); text-align: center; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 16px; box-shadow: var(--shadow-1); font-size: .92rem; }
.my-empty .ml { display: block; font-weight: 700; font-size: 1.05rem; color: var(--leaf); }
@media (max-width: 560px) { .my-scene { border-radius: var(--r-lg); border-width: 3px; } .my-new { font-size: 9px; padding: 3px 5px 2px; } .my-empty { font-size: .8rem; padding: 6px 10px; } .my-empty .ml { font-size: .92rem; } .my-bubble { font-size: .85rem; } }

.my-next { margin-bottom: 26px; }
.my-next-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.my-next-card { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px dashed var(--line-2); }
.my-next-card > div { flex: 1; min-width: 0; }
.my-next-art { font-size: 44px; flex: none; line-height: 1; }
.my-next-how { font-weight: 600; margin-bottom: 8px; }
.my-bar { display: block; height: 8px; border-radius: 8px; background: var(--ring-track); overflow: hidden; width: 100%; }
.my-bar i { display: block; height: 100%; background: var(--leaf); border-radius: 8px; }
.my-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr)); }
.my-grid > li { display: grid; }
.my-card { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 14px 10px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); text-align: center; font: inherit; color: var(--ink); min-height: 44px; }
button.my-card { cursor: pointer; }
button.my-card:hover { border-color: var(--leaf); }
.my-card.is-locked { background: var(--surface-2); border-style: dashed; }
.my-card.is-locked .my-bar { margin-top: 6px; }
.my-card-art { font-size: 48px; line-height: 1; height: 52px; display: grid; place-items: end center; }
.my-card-ml { font-weight: 700; font-size: 1.05rem; }
.my-card-en { font-size: .85rem; color: var(--ink-2); }
.my-card.is-hop { animation: sk-hop .5s var(--spring); }

/* Sticker book */
.sk-page { margin: 22px 0 26px; padding: 18px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.sk-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(44%, 140px), 1fr)); }
.sk-grid > li { display: grid; }
.sticker { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 12px 8px 10px; border-radius: 22px; border: 0; background: var(--surface); box-shadow: 0 3px 0 var(--line-2), 0 8px 18px rgba(43,21,20,.10); transform: rotate(var(--r, 0deg)); font: inherit; color: var(--ink); cursor: pointer; text-align: center; }
.sticker.is-hop { animation: sk-hop .5s var(--spring); }
@keyframes sk-hop { 50% { transform: rotate(0) scale(1.1); } }
.sticker-face { width: 80px; height: 80px; display: grid; place-items: center; border-radius: 50%; background: var(--zari-soft); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--zari); font-size: 46px; line-height: 1; overflow: hidden; }
.sticker-face .reward-art { width: 60px; height: 60px; }
.sticker-ml { font-weight: 700; }
.sticker-en { font-size: .82rem; color: var(--ink-2); }
.sticker.is-empty { background: transparent; box-shadow: none; border: 2px dashed var(--line-2); transform: none; cursor: default; }
.sticker.is-empty .sticker-face { background: transparent; border: 3px dashed var(--line-2); box-shadow: none; color: var(--ink-3); font: 800 1.6rem var(--f-display); }
.sticker-how { font-size: .82rem; color: var(--ink-2); min-height: 2.4em; }
.sticker .my-bar { margin-top: 4px; }

/* Daily lamp (the streak lives here too) */
.daily-lamp { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px 20px; border-radius: var(--r-lg); background: linear-gradient(160deg, var(--zari-soft), var(--surface-2)); border: 1px solid var(--line); margin-bottom: 22px; }
.dl-lamp { width: 132px; height: auto; display: block; overflow: visible; }
.dl-metal { fill: var(--zari); }
.dl-shine { fill: none; stroke: #FFE9B0; stroke-width: 3; opacity: .7; }
.dl-wick path { fill: var(--line-2); transform-box: fill-box; transform-origin: 50% 100%; }
.dl-glow { fill: transparent; }
.dl-wick.on path { fill: var(--marigold); animation: flicker 1.8s ease-in-out infinite alternate; }
.dl-wick.on .dl-glow { fill: rgba(255,200,100,.35); }
.dl-wick.on:nth-child(2) path { animation-delay: .3s; } .dl-wick.on:nth-child(3) path { animation-delay: .7s; } .dl-wick.on:nth-child(4) path { animation-delay: .2s; } .dl-wick.on:nth-child(5) path { animation-delay: .5s; }
.dl-body { min-width: 0; }
.dl-body .sec-title { margin-bottom: 4px; }
.dl-msg { font-weight: 600; margin-bottom: 10px; }
.dl-days { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.dl-days li { display: grid; justify-items: center; gap: 3px; min-width: 36px; }
.dl-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 2px dashed var(--line-2); font-size: 16px; }
.dl-days .is-done .dl-dot { border: 2px solid var(--marigold); background: var(--surface); }
.dl-days .is-today .dl-dot { box-shadow: 0 0 0 3px var(--focus); }
.dl-day { font-size: .75rem; font-weight: 700; color: var(--ink-2); }
.dl-streak { font-size: .9rem; font-weight: 600; color: var(--ink-2); }
.dl-streak .ml { color: var(--zari-deep); font-weight: 700; }
.dl-note { font-size: .85rem; color: var(--ink-2); margin-top: 4px; }
.daily-lamp.is-compact .dl-days { gap: 5px; }
.daily-lamp.is-compact .dl-days li { min-width: 30px; }
.daily-lamp.is-compact .dl-dot { width: 28px; height: 28px; font-size: 14px; }
.daily-lamp.is-compact .dl-lamp { width: 104px; }
@media (max-width: 560px) { .daily-lamp { grid-template-columns: 1fr; justify-items: center; text-align: center; } .dl-days { justify-content: center; } .dl-lamp, .daily-lamp.is-compact .dl-lamp { width: 96px; } }
:root[data-contrast="high"] .daily-lamp { background: var(--surface); }

/* Home: lamp + peek side by side */
.home-rewards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: stretch; margin: 22px 0 8px; }
.home-rewards > * { margin-bottom: 0; }
.thinnai-peek { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--r-lg); background: linear-gradient(120deg, var(--leaf-soft), var(--surface)); border: 1px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); transition: transform .2s var(--ease); min-width: 0; }
.thinnai-peek:hover { transform: translateY(-2px); }
.thinnai-peek > .icon { flex: none; color: var(--ink-2); }
.mp-row { display: flex; align-items: flex-end; font-size: 40px; line-height: 1; gap: 2px; flex: none; }
.mp-row .reward-art { width: 42px; height: 42px; }
.mp-body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.mp-title { font: 700 1.2rem var(--f-display); } .mp-title .ml { color: var(--leaf); }
.mp-sub { color: var(--ink-2); font-size: .92rem; }
.mp-next { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--zari-deep); }
.mp-next .icon { width: 1.1em; height: 1.1em; flex: none; }
:root[data-contrast="high"] .mp-title .ml { color: var(--ink); }
@media (max-width: 560px) { .mp-row { display: none; } }
.me-links { margin: 22px 0; }
@media (min-width: 1100px) { .me-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.me-links .explore-card { min-width: 0; }

/* Reward toast */
.toast-reward { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-height: 44px; }
.toast-reward .reward-emoji, .toast-reward .reward-art { font-size: 32px; width: 34px; height: 34px; flex: none; }
.toast-reward .ml { font-family: var(--f-ml); }
.toast-reward-arts { display: flex; flex: none; }
.toast-reward-arts > * + * { margin-left: -10px; }

/* ---- Certificates ---- */
.cert-sec { margin-top: 26px; }
.cert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cert-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); flex-wrap: wrap; }
.cert-row.is-ready { border: 2px solid var(--zari); background: linear-gradient(120deg, var(--zari-soft), var(--surface)); }
.cert-seal { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--stage); color: #fff; font: 800 1.3rem var(--f-display); flex: none; }
.cert-row.is-ready .cert-seal { background: var(--surface); font-size: 1.6rem; box-shadow: 0 0 0 3px var(--zari); }
.cert-row-body { flex: 1; min-width: min(100%, 200px); display: grid; gap: 6px; }
.cert-row-title { font-weight: 700; }
.cert-row-sub { display: grid; gap: 6px; color: var(--ink-2); font-size: .92rem; max-width: 360px; }
.cert-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; }
.cert-links li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cert-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.cert-tip { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--r-md); background: var(--zari-soft); color: var(--ink); margin-bottom: 18px; }
.cert-tip .icon { flex: none; margin-top: 2px; }
.cert-wrap { overflow: hidden; }
/* The certificate is paper: fixed colours in every theme */
.certificate { position: relative; max-width: 1000px; margin: 0 auto; aspect-ratio: 1.414; background: #FFFBF2; color: #2B1A14; border-radius: 10px; box-shadow: var(--shadow-2); overflow: hidden; container-type: inline-size; }
.cert-border { position: absolute; inset: 2.2cqw; border: .7cqw solid #C99A3A; border-radius: 6px; box-shadow: inset 0 0 0 .5cqw #FFFBF2, inset 0 0 0 .8cqw #7A1F3D; }
.cert-corner { position: absolute; width: 9cqw; height: 9cqw; }
.cert-corner svg { width: 100%; height: 100%; }
.cert-corner.tl { top: .6cqw; left: .6cqw; } .cert-corner.tr { top: .6cqw; right: .6cqw; } .cert-corner.bl { bottom: .6cqw; left: .6cqw; } .cert-corner.br { bottom: .6cqw; right: .6cqw; }
.cert-inner { position: absolute; inset: 5.5cqw 10cqw; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .6cqw; }
.cert-lamp svg { width: 5.5cqw; height: 5.5cqw; }
.cert-brand { font: 700 1.6cqw var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: #6B4A12; }
.cert-brand .ml { letter-spacing: 0; text-transform: none; font-size: 1.15em; }
.cert-title { font: 800 5.6cqw/1.3 var(--f-display); color: #7A1F3D; }
.cert-sub { font: 700 1.9cqw var(--f-ui); letter-spacing: .2em; text-transform: uppercase; color: #8A5A0A; margin-bottom: .8cqw; }
.cert-lead { font-size: 1.8cqw; color: #4A3A32; }
.cert-name { font: 800 5cqw/1.2 var(--f-display); color: #2B1A14; border-bottom: .25cqw solid #C99A3A; padding: 0 4cqw .4cqw; margin-bottom: .4cqw; }
.cert-stage { display: grid; gap: .2cqw; margin: .3cqw 0; }
.cert-stage .ml { font: 800 3.4cqw/1.35 var(--f-display); color: var(--stage); }
.cert-stage span:last-child { font: 600 1.7cqw var(--f-ui); color: #4A3A32; }
.cert-ml { font-size: 2.1cqw; font-weight: 700; color: #0A5A60; margin-top: .6cqw; }
.cert-sign { display: flex; justify-content: space-between; width: 100%; margin-top: 2cqw; font-size: 1.5cqw; color: #4A3A32; }
.cert-sign > div { display: grid; gap: .4cqw; min-width: 26cqw; }
.cert-line { display: block; height: 3cqw; border-bottom: .15cqw solid #4A3A32; }
.cert-date { display: block; height: 3cqw; line-height: 3cqw; border-bottom: .15cqw solid #4A3A32; font-weight: 600; color: #2B1A14; font-size: 1.8cqw; }
@media print {
  @page cert { size: landscape; margin: 8mm; }
  .certificate { page: cert; }
  body { background: #fff !important; }
  .cert-page ~ *, .topbar, .rail, .tabbar, .crumbs, .hub-crumbs, .cert-tools, .cert-tip, .app-legal, .guest-note, #toasts, .skip-link { display: none !important; }
  .shell, .main { display: block !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .certificate { box-shadow: none; max-width: none; width: 100%; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .daily-lamp .dl-note { display: none !important; }
}
