:root {
  --bg-deep: #071526;
  --bg-mid: #0e2a45;
  --bg-warm: #7a3b2e;
  --gold: #ffd24a;
  --gold-soft: #ffe9a0;
  --ink: #f4f8ff;
  --muted: rgba(244, 248, 255, 0.68);
  --glass: rgba(255, 255, 255, 0.08);
  --energy: #3ecf9a;
  --energy-low: #e07a3d;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --top-offset: 100px;
  --tabbar-h: 68px;
  --font-display: "Outfit", sans-serif;
  --font-body: "Sora", sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-deep);
}

body {
  position: relative;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% 110%, #c45d3a 0%, transparent 55%),
    radial-gradient(90% 70% at 15% 20%, #1a5f7a 0%, transparent 48%),
    linear-gradient(180deg, #04101f 0%, var(--bg-mid) 48%, var(--bg-warm) 100%);
}

.sky__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  animation: drift 10s ease-in-out infinite alternate;
}

.sky__glow--a {
  width: 240px;
  height: 240px;
  left: -40px;
  top: 18%;
  background: #1f6f8b;
}

.sky__glow--b {
  width: 280px;
  height: 280px;
  right: -60px;
  bottom: 12%;
  background: #d4673a;
  animation-delay: -4s;
}

.sky__stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.sky__stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.35;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
}

.app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  padding:
    calc(var(--top-offset) + var(--safe-top) + 8px)
    16px
    calc(var(--tabbar-h) + 10px + var(--safe-bottom));
}

.top {
  position: fixed;
  top: calc(var(--safe-top) + 56px);
  left: 16px;
  right: 16px;
  height: 52px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.profile {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  max-width: calc(100% - 126px);
  margin-right: auto;
}

.profile__frame {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  padding: 3px;
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 210, 74, 0.55), rgba(255, 255, 255, 0.08) 45%, rgba(62, 207, 154, 0.35));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.profile__frame::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 11px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.balance {
  pointer-events: auto;
  flex-shrink: 0;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 4px 0 8px;
  border-radius: 999px;
  background: rgba(8, 22, 40, 0.72);
  border: 1px solid rgba(255, 210, 74, 0.28);
  backdrop-filter: blur(12px);
}

.balance__icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.balance__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--gold-soft);
  min-width: 1.2em;
  line-height: 1;
  transition: transform 0.12s ease;
}

.balance__value.is-bump {
  transform: scale(1.12);
}

.balance__plus {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd24a, #f0a000);
  color: #1a1200;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 2px;
}

.balance__plus:active {
  transform: scale(0.94);
}

.profile__avatar,
.profile__photo {
  width: 100%;
  height: 100%;
  border-radius: 11px;
  flex-shrink: 0;
}

.profile__avatar {
  display: grid;
  place-items: center;
  background: rgba(8, 22, 40, 0.92);
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  border: 0;
}

.profile__avatar[hidden],
.profile__photo[hidden],
.page[hidden],
.tab__soon[hidden] {
  display: none !important;
}

.profile__photo {
  display: block;
  object-fit: cover;
  border: 0;
}

.profile__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}

.profile__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile__sub {
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upgrade {
  width: 100%;
  margin-top: 12px;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(255, 210, 74, 0.22), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 210, 74, 0.22);
  color: var(--ink);
  font-family: var(--font-body);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.upgrade:active {
  transform: scale(0.98);
}

.upgrade:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.upgrade__title {
  font-weight: 600;
  font-size: 0.9rem;
}

.upgrade__cost {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-soft);
  font-size: 0.92rem;
}

.pages {
  min-height: 0;
  height: 100%;
  position: relative;
}

.page {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.page--home {
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.page--home.is-active {
  display: flex;
}

.stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
  min-height: 0;
  padding: 0;
}

.stage__center {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.stage__bottom {
  width: min(94vw, 360px);
  flex-shrink: 0;
  padding-bottom: 6px;
}

.score {
  display: none !important;
}

.score__label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.score__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 10vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--gold-soft);
  text-shadow: 0 8px 30px rgba(255, 210, 74, 0.25);
  transition: transform 0.12s ease;
}

.score__value.is-bump {
  transform: scale(1.08);
}

.score__rate {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
}

.shop {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.shop-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 8px 10px 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.12s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.shop-card:active {
  transform: scale(0.97);
}

.shop-card:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.shop-card__icon {
  width: 20px;
  height: 20px;
  color: var(--gold-soft);
  display: block;
}

.shop-card__meta,
.shop-card__info,
.shop-card__title,
.shop-card__gain {
  display: none !important;
}

.shop-card__cost {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--gold-soft);
  white-space: nowrap;
  line-height: 1.15;
}

.shop-card__level {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1;
}

.stats,
.upgrade,
.score__meta,
.score__level {
  display: none !important;
}

.star-btn {
  position: relative;
  width: min(52vw, 196px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  touch-action: manipulation;
  padding: 0;
  margin: 0;
}

.star-btn.is-empty {
  opacity: 0.55;
  filter: grayscale(0.35);
}

.star-btn__icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(255, 180, 40, 0.35));
  transition: transform 0.12s ease;
  will-change: transform;
  pointer-events: none;
}

.star-btn:active .star-btn__icon,
.star-btn.is-hit .star-btn__icon {
  transform: scale(0.9);
}

.energy {
  width: min(94vw, 360px);
}

.energy__row {
  display: contents;
}

.energy__main {
  width: 100%;
  min-width: 0;
}

.energy__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.energy__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.energy__fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2aa87a, var(--energy));
  transition: width 0.25s ease, background 0.25s ease;
}

.energy.is-low .energy__fill {
  background: linear-gradient(90deg, #c45d3a, var(--energy-low));
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.stat {
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  text-align: center;
}

.stat__label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}

.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}

.panel {
  width: 100%;
  max-width: 100%;
  padding: 8px 2px 20px;
  overflow-x: hidden;
  box-sizing: border-box;
}

.panel__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
}

.panel__text {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel__section {
  margin: 18px 0 4px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
}

.panel__hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.bp {
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.bp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}

.bp__head > div {
  min-width: 0;
  flex: 1;
}

.bp__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
}

.bp__sub {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.bp__buy {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: linear-gradient(145deg, #ffd24a, #f0a000);
  color: #1a1200;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  white-space: nowrap;
}

.bp__buy:disabled {
  opacity: 0.55;
  cursor: default;
  background: rgba(62, 207, 154, 0.25);
  color: #9be7c8;
}

.bp__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 12px;
}

.bp__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0a000, var(--gold));
  transition: width 0.25s ease;
}

.bp__track {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  padding: 0 24px 8px 2px;
  margin: 0;
  scrollbar-width: none;
  scroll-padding-inline-end: 24px;
}

.bp__track::-webkit-scrollbar {
  display: none;
}

.bp-track__end {
  flex: 0 0 20px;
  width: 20px;
  height: 1px;
  pointer-events: none;
}

.bp-node {
  flex: 0 0 72px;
  width: 72px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.bp-node__lv {
  text-align: center;
  font-size: 0.64rem;
  color: var(--muted);
  font-weight: 700;
}

.bp-node__btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 5px 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  cursor: pointer;
  min-height: 42px;
}

.bp-node__btn.is-premium {
  border-color: rgba(255, 210, 74, 0.35);
}

.bp-node__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.bp-node__btn.is-ready {
  border-color: rgba(255, 210, 74, 0.55);
  color: var(--gold-soft);
}

.bp-node__btn.is-claimed {
  border-color: rgba(62, 207, 154, 0.35);
  color: #9be7c8;
  opacity: 0.85;
}

.bp-node__tag {
  font-size: 0.56rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bp-node__reward {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.72rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.task {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
}

.task__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.task__text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.task__title {
  font-weight: 650;
  font-size: 0.84rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task__desc {
  margin-top: 1px;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task__btn {
  border: 0;
  border-radius: 8px;
  padding: 5px 8px;
  background: rgba(255, 210, 74, 0.18);
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  cursor: pointer;
  flex: 0 0 auto;
  max-width: 38%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.task.is-claimed .task__btn {
  background: rgba(62, 207, 154, 0.16);
  color: #9be7c8;
}

.task.is-ready {
  border-color: rgba(255, 210, 74, 0.32);
  box-shadow: none;
}

.task__bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.task__bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0a000, var(--gold));
  transition: width 0.25s ease;
}

.task__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.task__progress {
  font-size: 0.68rem;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-radius: 16px;
  background: var(--glass);
  margin-bottom: 12px;
}

.ref-card__label {
  color: var(--muted);
  font-size: 0.85rem;
}

.ref-card__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--gold-soft);
}

.ref-link-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.ref-link {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--ink);
  font-size: 0.78rem;
  outline: none;
}

.ref-copy {
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(255, 210, 74, 0.22);
  color: var(--gold-soft);
  font-weight: 700;
  font-family: var(--font-display);
  cursor: pointer;
}

.ref-list__title {
  margin: 18px 0 10px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.ref-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-list__empty {
  margin: 0;
  padding: 14px;
  border-radius: 14px;
  background: var(--glass);
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.ref-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(10px);
}

.ref-user__avatar,
.ref-user__photo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ref-user__avatar {
  display: grid;
  place-items: center;
  background: rgba(255, 210, 74, 0.16);
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
}

.ref-user__photo {
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.ref-user__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ref-user__name {
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-user__sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.ref-user__bonus {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gold-soft);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.tabbar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(10px + var(--safe-bottom));
  height: var(--tabbar-h);
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding: 8px 6px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(14, 42, 69, 0.55) 0%,
    rgba(7, 21, 38, 0.42) 100%
  );
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 10px 28px rgba(0, 0, 0, 0.28);
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(244, 248, 255, 0.58);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  min-width: 0;
  padding: 6px 4px;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab.is-active {
  color: var(--gold-soft);
  background: rgba(255, 210, 74, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 74, 0.18);
}

.tab__icon {
  width: 22px;
  height: 22px;
}

.tab__label {
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tab__soon {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #071526;
  background: var(--gold);
  border-radius: 999px;
  padding: 2px 6px;
  animation: tipPop 0.2s ease;
}

.float-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}

.floater {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gold-soft);
  animation: floatUp 0.85s ease-out forwards;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

@keyframes tipPop {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes drift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(24px);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.9;
  }
}

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 70px)) scale(1.2);
  }
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] {
  display: none !important;
}

.sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 8, 18, 0.62);
  cursor: pointer;
}

.sheet__panel {
  position: relative;
  width: min(100%, 420px);
  max-height: min(72vh, 520px);
  overflow: auto;
  padding: 10px 16px calc(18px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 40%),
    #0c2238;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  animation: sheetUp 0.22s ease-out;
}

.sheet__handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  margin: 2px auto 14px;
}

.sheet__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
}

.sheet__text {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 0.86rem;
}

.pack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.pack:active {
  transform: scale(0.98);
}

.pack:disabled {
  opacity: 0.5;
  cursor: wait;
}

.pack__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pack__stars {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--gold-soft);
}

.pack__hint {
  font-size: 0.74rem;
  color: var(--muted);
}

.pack__price {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 210, 74, 0.18);
  color: var(--gold-soft);
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.rules {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: rgba(4, 12, 24, 0.92);
  pointer-events: none;
}

.rules[hidden] {
  display: none !important;
}

.rules__panel {
  pointer-events: auto;
  width: 100%;
  max-width: 440px;
  margin: calc(var(--top-offset) + var(--safe-top)) auto 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  max-height: calc(100% - var(--top-offset) - var(--safe-top));
  padding: 4px 18px calc(14px + var(--safe-bottom));
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.rules__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.rules__logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(255, 180, 40, 0.35));
}

.rules__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  font-weight: 700;
}

.rules__title {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.15;
}

.rules__lead {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.rules__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  padding: 0 2px 12px 0;
  margin-bottom: 10px;
}

.rules__list {
  margin: 0;
  padding: 0 0 8px 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rules__list li {
  color: rgba(244, 248, 255, 0.9);
  font-size: 0.86rem;
  line-height: 1.5;
  padding-left: 4px;
}

.rules__list strong {
  color: var(--gold-soft);
  font-weight: 700;
}

.rules__accept {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 14px 16px;
  background: linear-gradient(145deg, #ffd24a, #f0a000);
  color: #1a1200;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  flex-shrink: 0;
}

.rules__accept:active {
  transform: scale(0.98);
}

body.is-rules-locked .app,
body.is-rules-locked .float-layer,
body.is-rules-locked .sheet {
  visibility: hidden;
  pointer-events: none;
}

