.app-shell { width: min(100%, 480px); min-height: 100svh; margin-inline: auto; overflow: hidden; }
.screen { position: relative; min-height: 100svh; padding: max(60px, env(safe-area-inset-top, 0px)) 0 calc(114px + env(safe-area-inset-bottom, 0px)); }

.roulette-window { position: relative; height: 202px; margin-top: 60px; padding-block: 20px; overflow: hidden; border-block: 1px solid var(--line); background: var(--surface); }
.roulette-track { display: flex; gap: 10px; width: max-content; height: 160px; will-change: transform; backface-visibility: hidden; }
.reward-card { position: relative; display: block; width: 190px; height: 160px; flex: 0 0 190px; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 20px; background: var(--surface); text-align: center; }
.reward-card > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.reward-card.has-custom-art > img { object-fit: contain; }
.reward-title { position: absolute; z-index: 1; right: 8px; bottom: 12px; left: 8px; color: #fff; font-family: Geist, Inter, sans-serif; font-size: 16px; font-weight: 400; line-height: 19px; text-shadow: 0 1px 5px #0008; }
.has-custom-art .reward-title { padding: 4px; border-radius: 6px; background: #000a; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 5px; width: max-content; max-width: calc(100% - 30px); min-height: 38px; margin: 40px auto 0; padding: 10px 16px; border: 1px solid #fff; border-radius: 40px; background: #fff; color: #000; font-size: 12px; line-height: 16px; transition: transform 140ms ease, opacity 160ms ease; }
.primary-button .figma-icon { width: 16px; height: 16px; }
.primary-button.is-unavailable { border-color: var(--line); background: var(--surface); color: #777; }
.primary-button.is-unavailable .figma-icon { filter: brightness(0) invert(.45); }
.primary-button:disabled:not(.is-unavailable) { opacity: .55; }
.roulette-empty { margin: 60px 15px 0; padding: 36px 20px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); font-size: 14px; line-height: 20px; text-align: center; }
.app-error { display: grid; justify-items: center; gap: 10px; margin: 20px 15px 0; padding: 15px; border: 1px solid #542a2a; border-radius: 12px; color: #ffa3a3; font-size: 13px; line-height: 18px; text-align: center; }
.app-error button { min-height: 36px; padding: 8px 16px; border: 1px solid #6c3a3a; border-radius: 30px; background: transparent; }

.confetti-lottie { position: fixed; z-index: 30; inset: 0; pointer-events: none; }
.confetti-lottie.is-complete { display: none; }

.profile-content { margin: 20px 15px 0; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 20px; }
.profile-stats > span { display: flex; align-items: center; min-width: 0; height: 50px; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.profile-stats b { font-size: 24px; font-weight: 400; line-height: 29px; }
.profile-stats small { color: #eee; font-size: 10px; line-height: 12px; }
.profile-stats .best-prize-stat { gap: 5px; padding: 5px; }
.best-prize-stat > img { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 5px; object-fit: cover; }
.best-prize-stat > .figma-icon { width: 30px; height: 30px; opacity: .5; }
.best-prize-stat > span { min-width: 0; }
.best-prize-stat small { display: block; white-space: nowrap; }
.profile-stats .profile-best-prize { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; line-height: 10px; text-overflow: ellipsis; white-space: nowrap; }
.prize-rules { width: 100%; min-height: 143px; margin: 40px 0 0; }
.profile-inventory { margin: 40px 15px 0; }
.profile-inventory .mobile-section-title { margin-bottom: 14px; }
.inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.reward-card.is-inventory { width: 100%; height: 100px; border-radius: 10px; }
.is-inventory .reward-title { right: 4px; bottom: 8px; left: 4px; font-size: 10px; line-height: 12px; }
.inventory-placeholder { display: grid; place-items: center; height: 100px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: #444; font-size: 10px; line-height: 12px; }
.expiry { position: absolute; z-index: 2; top: 5px; right: 5px; padding: 3px 6px; border-radius: 10px; background: #0009; color: #fff; font-size: 8px; line-height: 10px; }
.is-locked > img { filter: blur(3px); transform: scale(1.06); }
.is-locked .reward-title { filter: blur(2px); opacity: .55; }
.is-locked::after { position: absolute; inset: 0; background: #0003; content: ""; }
.is-locked .expiry { top: 50%; right: 0; left: 0; display: grid; justify-items: center; gap: 3px; padding: 0; border-radius: 0; background: transparent; font-size: 10px; line-height: 12px; transform: translateY(-50%); }
.is-locked .expiry .figma-icon { width: 24px; height: 24px; }
.is-redeemed { opacity: .45; }
.inventory-empty { margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 16px; }
.profile-preferences { display: flex; justify-content: center; margin: 24px 15px 0; }
.notification-toggle { min-height: 36px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 30px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 16px; }
.notification-toggle:disabled { opacity: .5; }

body.has-qr-dialog { overflow: hidden; }
.claim-dialog { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: 20px 15px; background: #0007; backdrop-filter: blur(5px); animation: dialog-in 160ms ease both; }
.claim-sheet { position: relative; width: min(294px, 100%); min-height: 355px; margin: auto; padding: 30px 20px 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: center; }
.claim-close { position: absolute; top: 3px; right: 4px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #888; font-size: 23px; line-height: 1; }
.claim-qr { width: 220px; max-width: 100%; height: 220px; margin-inline: auto; padding: 12px; background: #d9d9d9; }
.claim-qr svg { display: block; width: 100%; height: 100%; }
.claim-sheet h2 { margin: 20px 0 5px; font-size: 20px; font-weight: 400; line-height: 24px; }
.claim-sheet p { max-width: 210px; margin: 0 auto; color: var(--muted); font-size: 10px; line-height: 12px; }
.qr-code-button { display: block; min-height: 30px; margin: 10px auto 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 20px; background: transparent; color: #ccc; font-size: 11px; line-height: 16px; letter-spacing: -.03em; }
.claim-sheet .primary-button { margin-top: 20px; }
.claim-sheet.is-expired { display: grid; align-content: center; }
.claim-sheet.is-expired .figma-icon { margin-inline: auto; }
.reward-toast { position: fixed; z-index: 90; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); left: 50%; display: grid; gap: 4px; width: max-content; max-width: min(440px, calc(100% - 30px)); padding: 12px 16px; overflow-wrap: anywhere; border-radius: 12px; background: #fff; color: #000; font-size: 13px; line-height: 18px; letter-spacing: -.03em; transform: translateX(-50%); animation: dialog-in 160ms ease both; }
.reward-toast strong { font-weight: 500; }
.reward-toast span { color: #666; font-size: 12px; }

.app-loader { position: fixed; z-index: 100; inset: 0; display: grid; place-content: center; justify-items: center; gap: 20px; background: #000; transition: opacity 200ms ease; }
.app-loader > img { width: 32px; height: 40px; }
.app-loader > span { width: 48px; height: 3px; overflow: hidden; border-radius: 3px; background: #222; }
.app-loader > span::after { display: block; width: 50%; height: 100%; border-radius: inherit; background: #fff; animation: loader-move 900ms ease-in-out infinite alternate; content: ""; }
.app-loader.is-hidden { opacity: 0; pointer-events: none; }
@keyframes loader-move { to { transform: translateX(100%); } }
@keyframes dialog-in { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 359px) {
  .profile-stats > span { gap: 6px; padding-inline: 8px; }
  .profile-stats b { font-size: 21px; }
  .profile-stats .best-prize-stat { padding: 4px; }
  .best-prize-stat > img { width: 27px; height: 32px; flex-basis: 27px; }
  .profile-stats small { font-size: 9px; }
}
