:root {
  color-scheme: light;
  --deep: #073f49;
  --teal: #0c6670;
  --cyan: #38c8cf;
  --foam: #eafaf7;
  --paper: #f8fbf5;
  --ink: #17383c;
  --muted: #61797b;
  --gold: #f2c36e;
  --coral: #ee6f5d;
  --line: rgba(14, 80, 86, 0.14);
  --shadow: 0 18px 55px rgba(2, 40, 47, 0.24);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink);
  background: #173e43;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
a {
  color: inherit;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #fff4bb;
  outline-offset: 2px;
}

.wish-app {
  position: relative;
  isolation: isolate;
  width: min(100vw, 430px);
  height: var(--app-height, 100dvh);
  max-height: 920px;
  min-height: 620px;
  display: grid;
  grid-template-rows: auto auto auto minmax(128px, 1fr) auto auto;
  overflow: hidden;
  background: #69cfd3;
  box-shadow: var(--shadow);
}

.wish-backdrop,
.wish-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
}

.wish-backdrop {
  background: url("assets/wish-pool/wish-pool-bg.jpg") center 42% / cover no-repeat;
  transform: scale(1.015);
  animation: tide-breathe 9s ease-in-out infinite alternate;
}

.wish-shade {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(3, 50, 58, 0.76) 0, rgba(6, 72, 79, 0.26) 23%, rgba(223, 250, 244, 0.02) 49%, rgba(239, 251, 245, 0.72) 68%, #f7fbf6 84%),
    linear-gradient(90deg, rgba(4, 47, 54, 0.24), transparent 24%, transparent 76%, rgba(4, 47, 54, 0.24));
}

.wish-header {
  min-height: 82px;
  padding: max(10px, env(safe-area-inset-top)) 12px 6px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 133px;
  align-items: start;
  gap: 4px;
  color: white;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.header-tools-right {
  justify-content: flex-end;
}

.moon-dream-link {
  min-width: 30px;
  width: 30px;
  color: #ffe4a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
}

.moon-dream-link span {
  transform: translateY(-1px) rotate(-10deg);
}

.close-home-link {
  min-width: 30px;
  width: 30px;
  color: #ffe4a1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  text-decoration: none;
}

.icon-tool,
.text-tool {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  color: white;
  background: rgba(4, 60, 68, 0.4);
  backdrop-filter: blur(8px);
  text-decoration: none;
}

.icon-tool {
  width: 34px;
  padding: 0;
  font-size: 23px;
  line-height: 1;
}

.text-tool {
  font-size: 10px;
  white-space: nowrap;
}

.text-tool span {
  color: #ffe4a1;
  font-size: 13px;
}

.wish-brand {
  min-width: 0;
  text-align: center;
  text-shadow: 0 2px 12px rgba(2, 42, 48, 0.5);
}

.wish-brand > span {
  display: block;
  color: #ffe6a6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8px;
  font-weight: 700;
}

.wish-brand h1 {
  margin: 1px 0 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 29px;
  font-weight: 700;
  line-height: 1.05;
}

.wish-brand p {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  white-space: nowrap;
}

.round-panel {
  margin: 0 12px 6px;
  padding: 8px 11px 7px;
  border: 1px solid rgba(255, 239, 186, 0.25);
  border-radius: 7px;
  color: white;
  background: rgba(5, 67, 73, 0.7);
  box-shadow: 0 8px 24px rgba(2, 59, 64, 0.16);
  backdrop-filter: blur(10px);
}

.round-topline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.round-topline > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.round-topline .public-round {
  align-items: flex-start;
  flex-direction: column;
  gap: 1px;
}

.round-topline span,
.pool-copy,
.guild-panel > span {
  font-size: 9px;
}

.round-topline b {
  color: #ffe4a2;
  font-size: 10px;
}

.round-topline time {
  display: flex;
  align-items: center;
  gap: 3px;
  color: white;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 19px;
  font-weight: 800;
}

.round-topline time i,
.round-topline time em {
  font-style: normal;
}

.round-topline time i {
  min-width: 25px;
  padding: 2px 3px;
  border-radius: 4px;
  text-align: center;
  background: rgba(2, 46, 52, 0.56);
}

.pool-rate {
  justify-self: end;
}

.pool-track {
  position: relative;
  height: 6px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
}

.pool-track > i,
.guild-track > i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #48d6cd, #ffe194 68%, #ee7960);
  transition: width 500ms ease;
}

.target-mark {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 83.333%;
  width: 1px;
  background: rgba(255, 255, 255, 0.8);
}

.pool-copy {
  margin-top: 4px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.74);
}

.pool-copy > span {
  margin-right: 3px;
  color: white;
  font-weight: 700;
}

.pool-copy i {
  font-style: normal;
}

.pool-copy em {
  margin-left: auto;
  color: #ffe4a2;
  font-size: 8px;
  font-style: normal;
}

.intel-band {
  min-height: 96px;
  padding: 0 12px 5px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(112px, 0.85fr);
  gap: 7px;
}

.luck-board,
.guild-panel {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 7px;
  background: rgba(247, 253, 248, 0.87);
  box-shadow: 0 8px 22px rgba(22, 85, 87, 0.12);
  backdrop-filter: blur(10px);
}

.luck-board > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
}

.luck-board header span,
.dialog-shell header span,
.settlement-shell > span {
  color: var(--coral);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 7px;
  font-weight: 700;
}

.luck-board h2,
.guild-panel h2 {
  margin: 1px 0 0;
  font-size: 11px;
}

.luck-board header > b {
  color: var(--teal);
  font-size: 9px;
}

.luck-list {
  margin-top: 3px;
  display: grid;
  gap: 2px;
}

.luck-empty {
  padding: 7px 0 4px;
  color: var(--muted);
  font-size: 8px;
}

.luck-row {
  min-width: 0;
  height: 16px;
  display: grid;
  grid-template-columns: 15px 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  font-size: 8px;
}

.luck-row > b {
  color: var(--coral);
  text-align: center;
}

.luck-row .luck-avatar,
.record-avatar {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--teal);
  font-size: 8px;
}

.luck-row p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.luck-row > span {
  color: var(--teal);
  font-weight: 700;
}

.guild-panel {
  position: relative;
  text-align: center;
}

.guild-panel > b {
  position: absolute;
  top: 7px;
  right: 8px;
  color: rgba(238, 111, 93, 0.38);
  font-family: Georgia, serif;
  font-size: 20px;
}

.guild-track {
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(12, 102, 112, 0.1);
}

.guild-panel p {
  margin: 4px 0 3px;
  color: var(--muted);
  font-size: 8px;
}

.guild-panel button {
  height: 20px;
  padding: 0 8px;
  border: 1px solid rgba(12, 102, 112, 0.25);
  border-radius: 4px;
  color: var(--teal);
  background: transparent;
  font-size: 8px;
}

.jackpot-stage {
  position: relative;
  min-height: 128px;
  display: grid;
  place-content: center;
  justify-items: center;
  align-self: stretch;
  color: white;
  text-align: center;
  text-shadow: 0 2px 12px rgba(3, 47, 52, 0.7);
}

.jackpot-stage::before,
.jackpot-stage::after,
.jackpot-ring {
  content: "";
  position: absolute;
  left: 50%;
  top: 47%;
  border: 1px solid rgba(255, 244, 196, 0.55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.jackpot-stage::before {
  width: 178px;
  height: 178px;
}

.jackpot-stage::after {
  width: 195px;
  height: 195px;
  border-style: dashed;
  animation: ring-turn 20s linear infinite;
}

.jackpot-ring {
  width: 208px;
  height: 208px;
  border-color: rgba(78, 212, 205, 0.48);
}

.jackpot-stage img {
  width: clamp(116px, 36vw, 150px);
  aspect-ratio: 1;
  border: 2px solid rgba(255, 231, 166, 0.78);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 12px 38px rgba(3, 76, 76, 0.42), 0 0 26px rgba(255, 228, 155, 0.34);
  animation: jackpot-float 4s ease-in-out infinite;
}

.jackpot-stage > span {
  z-index: 1;
  margin-top: -3px;
  padding: 2px 8px;
  border-radius: 4px;
  color: #ffe5a2;
  background: rgba(5, 68, 73, 0.72);
  font-size: 8px;
}

.jackpot-stage h2 {
  z-index: 1;
  margin: 1px 0 0;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 19px;
  line-height: 1.1;
}

.jackpot-stage p {
  z-index: 1;
  margin: 0;
  font-size: 9px;
}

.jackpot-stage p b {
  color: #ffe49b;
}

.wish-actions {
  min-height: 52px;
  padding: 2px 12px 6px;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) 74px;
  align-items: center;
  gap: 7px;
}

.inventory-tray {
  position: relative;
  z-index: 3;
  height: calc(185px + max(10px, env(safe-area-inset-bottom)));
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: visible;
}

.inventory-tray > .wish-actions,
.inventory-tray > .inventory-dock {
  width: 100%;
  flex: 0 0 auto;
}

.wish-actions > button {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 6px;
  color: var(--deep);
  background: rgba(248, 252, 247, 0.88);
  box-shadow: 0 6px 16px rgba(3, 72, 76, 0.12);
  font-size: 10px;
}

.wish-actions .primary-wish {
  height: 46px;
  color: white;
  border-color: rgba(255, 234, 182, 0.72);
  background: linear-gradient(135deg, #df6252, #ef8264);
  box-shadow: 0 9px 22px rgba(195, 75, 62, 0.28);
}

.primary-wish:disabled {
  cursor: default;
  opacity: 0.5;
  filter: grayscale(0.45);
}

.primary-wish.has-contribution:disabled {
  opacity: 0.82;
  filter: none;
}

.primary-wish span,
.primary-wish small {
  display: block;
}

.primary-wish span {
  font-size: 13px;
}

.primary-wish span i {
  margin-right: 4px;
  color: #ffe4a0;
  font-style: normal;
}

.primary-wish small {
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 8px;
}

.inventory-dock {
  min-height: 143px;
  padding: 9px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(9, 92, 99, 0.18);
  color: var(--ink);
  background: rgba(248, 251, 245, 0.96);
  box-shadow: 0 -12px 32px rgba(8, 71, 76, 0.14);
  backdrop-filter: blur(14px);
}

.inventory-dock > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inventory-dock > header div,
.inventory-dock > header p {
  margin: 0;
  font-size: 9px;
}

.inventory-dock > header p {
  margin-left: auto;
}

.inventory-dock > header div > span {
  margin-right: 5px;
  font-weight: 700;
}

.inventory-dock > header div > b,
.inventory-dock > header p {
  color: var(--muted);
  font-weight: 400;
}

.inventory-dock > header p b {
  color: var(--coral);
}

.offering-grid {
  min-height: 102px;
  max-height: 102px;
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(12, 102, 112, 0.34) transparent;
}

.offering-grid::-webkit-scrollbar {
  width: 4px;
}

.offering-grid::-webkit-scrollbar-thumb {
  border-radius: 2px;
  background: rgba(12, 102, 112, 0.34);
}

.offering-card {
  min-width: 0;
  height: 102px;
  padding: 3px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 24px;
  gap: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
}

.offering-card-main {
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-rows: 42px auto auto;
  justify-items: center;
  overflow: hidden;
  border: 0;
  color: inherit;
  background: transparent;
}

.offering-image {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(12, 102, 112, 0.12);
  border-radius: 4px;
  background: rgba(239, 248, 244, 0.96);
}

.offering-image img {
  width: 40px;
  height: 40px;
  border-radius: 3px;
  object-fit: contain;
}

.offering-image .gift-thumb-fallback {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: white;
  background: linear-gradient(135deg, #43aeb4, #17444b);
  font-size: 17px;
  font-style: normal;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.offering-name,
.offering-card-main small {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.offering-name {
  font-size: 7px;
}

.offering-card-main small {
  color: var(--muted);
  font-size: 6px;
}

.offering-image em {
  position: absolute;
  top: 0;
  right: -7px;
  min-width: 17px;
  height: 14px;
  padding: 0 3px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: white;
  background: rgba(3, 58, 65, 0.82);
  font-size: 7px;
  font-style: normal;
}

.offering-card.is-selected {
  border-color: var(--coral);
  box-shadow: inset 0 0 0 1px var(--coral);
}

.offering-card.has-quantity {
  background: rgba(255, 248, 235, 0.96);
}

.gift-stepper {
  position: relative;
  min-width: 0;
  height: 24px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: white;
}

.gift-stepper button,
.gift-stepper input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  color: var(--teal);
  background: white;
  text-align: center;
}

.gift-stepper button {
  font-size: 13px;
}

.gift-stepper button:disabled {
  color: #b8c4c3;
  cursor: default;
}

.gift-stepper input {
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  appearance: textfield;
}

.gift-stepper input::-webkit-inner-spin-button,
.gift-stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.gift-stepper input:focus {
  position: absolute;
  inset: 0;
  z-index: 2;
  outline: 2px solid rgba(238, 111, 93, 0.55);
  outline-offset: -2px;
  font-size: 8px;
}

.wish-app.is-keyboard-open {
  overflow-y: auto;
}

.wish-app.is-keyboard-open.is-inventory-expanded .offering-grid {
  max-height: min(316px, calc(var(--app-height, 100dvh) - 250px));
}

.offering-empty {
  grid-column: 1 / -1;
  min-height: 74px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(12, 102, 112, 0.22);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  text-decoration: none;
}

.wish-app.is-inventory-expanded .inventory-tray {
  z-index: 25;
  animation: inventory-rise 220ms ease-out both;
}

.wish-app.is-inventory-expanded .wish-actions {
  background: rgba(105, 207, 211, 0.94);
  backdrop-filter: blur(10px);
}

.wish-app.is-inventory-expanded .inventory-dock {
  min-height: 0;
}

.wish-app.is-inventory-expanded .offering-grid {
  height: var(--inventory-expanded-height, 316px);
  max-height: 316px;
}

.wish-dialog,
.settlement-dialog {
  width: min(calc(100vw - 24px), 406px);
  max-width: 406px;
  max-height: min(76dvh, 650px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 24px 80px rgba(3, 43, 48, 0.35);
}

.wish-dialog::backdrop,
.settlement-dialog::backdrop {
  background: rgba(3, 40, 46, 0.58);
  backdrop-filter: blur(5px);
}

.dialog-shell {
  max-height: min(76dvh, 650px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--paper);
}

.dialog-shell > header {
  min-height: 58px;
  padding: 11px 14px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.dialog-shell h2 {
  margin: 2px 0 0;
  font-size: 17px;
}

.dialog-shell header button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: white;
  font-size: 21px;
}

.dialog-content {
  min-height: 240px;
  padding: 12px 14px 16px;
  overflow: auto;
}

.record-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 6px;
  background: rgba(12, 102, 112, 0.08);
}

.record-tabs button {
  height: 31px;
  border: 0;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
}

.record-tabs button.is-active {
  color: var(--deep);
  background: white;
  box-shadow: 0 3px 10px rgba(6, 70, 76, 0.09);
  font-weight: 700;
}

.tide-record-list {
  margin-top: 9px;
  display: grid;
  gap: 6px;
}

.tide-record {
  min-height: 49px;
  padding: 7px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.tide-record > img,
.tide-record .record-avatar {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
}

.tide-record .record-avatar {
  border-radius: 50%;
}

.tide-record p {
  min-width: 0;
  margin: 0;
}

.tide-record p b,
.tide-record p small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tide-record p b {
  font-size: 10px;
}

.tide-record p small,
.tide-record > time {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.moon-crystal-amount {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  color: var(--coral);
  font-weight: 700;
  white-space: nowrap;
  vertical-align: -3px;
}

.moon-crystal-amount img {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  object-fit: cover;
  filter: drop-shadow(0 0 4px rgba(68, 154, 225, 0.46));
}

.tide-record .moon-crystal-amount {
  gap: 2px;
  vertical-align: -2px;
}

.tide-record .moon-crystal-amount img {
  width: 11px;
  height: 11px;
}

.record-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 10px;
}

.rule-list {
  display: grid;
  gap: 8px;
}

.rule-item {
  padding: 10px;
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  gap: 9px;
  border-bottom: 1px solid var(--line);
}

.rule-item > b {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 15px;
}

.rule-item p {
  margin: 0;
}

.rule-item p b,
.rule-item p small {
  display: block;
}

.rule-item p b {
  font-size: 11px;
}

.rule-item p small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.atlas-summary {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 9px;
}

.atlas-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.atlas-card {
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.atlas-card img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 4px;
  object-fit: cover;
}

.atlas-card .gift-thumb-fallback {
  width: 100%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: white;
  background: linear-gradient(135deg, #43aeb4, #17444b);
  font-size: 24px;
  font-style: normal;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.atlas-card b,
.atlas-card small,
.atlas-card span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atlas-card b {
  margin-top: 4px;
  font-size: 9px;
}

.atlas-card small,
.atlas-card span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.atlas-card span {
  color: var(--coral);
  font-weight: 700;
}

.atlas-card.is-jackpot {
  border-color: rgba(211, 165, 82, 0.52);
  background: linear-gradient(180deg, #fffdf6, #fff8e7);
}

.prize-gallery {
  display: grid;
  gap: 7px;
}

.prize-gallery-card {
  min-width: 0;
  min-height: 62px;
  padding: 6px 8px 6px 6px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.prize-gallery-card.is-current {
  border-color: var(--gold);
  box-shadow: inset 3px 0 0 var(--coral);
  background: #fffaf0;
}

.prize-gallery-card > div {
  position: relative;
  width: 52px;
  height: 52px;
}

.prize-gallery-card img {
  width: 52px;
  height: 52px;
  border-radius: 5px;
  object-fit: cover;
}

.prize-gallery-card em {
  position: absolute;
  right: -3px;
  bottom: 3px;
  padding: 2px 4px;
  border-radius: 3px;
  color: white;
  background: var(--coral);
  font-size: 7px;
  font-style: normal;
}

.prize-gallery-card p {
  min-width: 0;
  margin: 0;
}

.prize-gallery-card p b,
.prize-gallery-card p small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prize-gallery-card p b {
  font-size: 10px;
}

.prize-gallery-card p small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.prize-gallery-card > span {
  color: var(--coral);
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
}

.settlement-shell {
  position: relative;
  isolation: isolate;
  padding: 19px 18px 16px;
  display: grid;
  justify-items: center;
  color: var(--ink);
  background: var(--paper);
  text-align: center;
}

.settlement-shell h2 {
  margin: 3px 0 12px;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 23px;
}

.settlement-winner-lead,
.settlement-reward,
.settlement-stars,
.settlement-moon-gate {
  display: none;
}

.settlement-prize-stage {
  display: grid;
  place-items: center;
}

.settlement-prize-stage img {
  grid-area: 1 / 1;
  width: 164px;
  aspect-ratio: 1;
  border: 2px solid var(--gold);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 13px 34px rgba(5, 78, 81, 0.2);
}

.settlement-shell p {
  min-height: 44px;
  margin: 13px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.settlement-shell p b {
  color: var(--coral);
}

.settlement-shell p .moon-crystal-amount img {
  width: 17px;
  height: 17px;
}

.settlement-shell button {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--teal);
  font-weight: 700;
}

.settlement-dialog.is-winner {
  width: min(calc(100vw - 24px), 390px);
  max-width: 390px;
  max-height: min(88dvh, 680px);
  box-shadow: 0 30px 90px rgba(0, 20, 24, 0.62), 0 0 0 1px rgba(242, 195, 110, 0.28);
}

.settlement-dialog.is-winner::backdrop {
  background: rgba(1, 25, 30, 0.76);
  backdrop-filter: blur(8px);
}

.settlement-dialog.is-winner .settlement-shell {
  min-height: 596px;
  padding: 25px 24px 20px;
  overflow: hidden;
  color: #f7f4df;
  background:
    linear-gradient(180deg, rgba(20, 113, 116, 0.2), transparent 32%),
    linear-gradient(150deg, #073f49 0%, #062f39 62%, #041f28 100%);
}

.settlement-dialog.is-winner .settlement-shell::before,
.settlement-dialog.is-winner .settlement-shell::after {
  position: absolute;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.settlement-dialog.is-winner .settlement-shell::before {
  inset: 8px;
  border: 1px solid rgba(242, 195, 110, 0.48);
  border-radius: 5px;
}

.settlement-dialog.is-winner .settlement-shell::after {
  right: 25px;
  bottom: 74px;
  left: 25px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(242, 195, 110, 0.58), transparent);
}

.settlement-dialog.is-winner .settlement-stars {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  pointer-events: none;
}

.settlement-dialog.is-winner .settlement-stars i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #f7d991;
  box-shadow: 0 0 9px rgba(247, 217, 145, 0.9);
  animation: settlement-star 2.8s ease-in-out infinite;
}

.settlement-dialog.is-winner .settlement-stars i:nth-child(1) { top: 116px; left: 42px; }
.settlement-dialog.is-winner .settlement-stars i:nth-child(2) { top: 168px; right: 34px; animation-delay: 650ms; }
.settlement-dialog.is-winner .settlement-stars i:nth-child(3) { top: 298px; left: 31px; animation-delay: 1.2s; }
.settlement-dialog.is-winner .settlement-stars i:nth-child(4) { top: 355px; right: 42px; animation-delay: 1.8s; }

.settlement-dialog.is-winner #settlementEyebrow {
  color: #8fe6df;
  font-size: 9px;
  font-weight: 700;
}

.settlement-dialog.is-winner .settlement-shell h2 {
  margin: 5px 0 2px;
  color: #f7d991;
  font-size: 31px;
  font-weight: 700;
  text-shadow: 0 3px 18px rgba(242, 195, 110, 0.18);
}

.settlement-dialog.is-winner .settlement-winner-lead {
  display: block;
  min-height: 0;
  margin: 0 0 12px;
  color: rgba(234, 250, 247, 0.8);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 13px;
  line-height: 1.5;
}

.settlement-dialog.is-winner .settlement-prize-stage {
  position: relative;
  width: 244px;
  height: 244px;
  margin-top: 2px;
}

.settlement-dialog.is-winner .settlement-moon-gate {
  grid-area: 1 / 1;
  display: block;
  width: 224px;
  height: 224px;
  border: 1px solid rgba(242, 195, 110, 0.72);
  border-radius: 50% 50% 5px 5px;
  background:
    linear-gradient(180deg, rgba(89, 207, 194, 0.18), rgba(13, 91, 94, 0.36)),
    #0b555d;
  box-shadow: inset 0 0 0 6px rgba(4, 43, 51, 0.48), 0 0 38px rgba(56, 200, 207, 0.12);
}

.settlement-dialog.is-winner .settlement-prize-stage::after {
  grid-area: 1 / 1;
  align-self: end;
  z-index: 2;
  width: 218px;
  height: 22px;
  margin-bottom: 8px;
  content: "";
  border: 1px solid rgba(242, 195, 110, 0.7);
  border-radius: 50%;
  background: #0b6468;
  box-shadow: 0 10px 25px rgba(0, 18, 22, 0.42);
}

.settlement-dialog.is-winner .settlement-prize-stage img {
  z-index: 3;
  width: 210px;
  height: 210px;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  filter: drop-shadow(0 15px 18px rgba(0, 23, 27, 0.38));
  box-shadow: none;
  animation: settlement-gift-arrive 560ms cubic-bezier(0.2, 0.82, 0.26, 1) both;
}

.settlement-dialog.is-winner .settlement-reward {
  display: grid;
  justify-items: center;
  margin-top: 6px;
}

.settlement-dialog.is-winner .settlement-reward strong {
  color: #f9f5df;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 21px;
}

.settlement-dialog.is-winner .settlement-reward span {
  margin-top: 3px;
  color: #f7d991;
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 700;
}

.settlement-dialog.is-winner .settlement-shell > #settlementCopy {
  min-height: 0;
  margin: 9px 0 13px;
  color: rgba(234, 250, 247, 0.7);
  font-size: 10px;
  line-height: 1.55;
}

.settlement-dialog.is-winner .settlement-shell button {
  position: relative;
  z-index: 3;
  height: 46px;
  border: 1px solid #f7d991;
  color: #073f49;
  background: #f2c36e;
  box-shadow: 0 8px 26px rgba(0, 17, 20, 0.36), inset 0 1px rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.settlement-dialog.is-winner .settlement-shell button:hover {
  background: #f7d991;
}

.offering-flight {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: 118px;
  width: 64px;
  height: 64px;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.offering-flight img {
  width: 100%;
  height: 100%;
  border: 2px solid #ffe4a0;
  border-radius: 50%;
  object-fit: cover;
}

.offering-flight.is-active {
  visibility: visible;
  animation: offering-rise 900ms ease-out both;
}

.wish-toast {
  position: absolute;
  z-index: 40;
  left: 50%;
  bottom: calc(202px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  padding: 8px 13px;
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 8px);
  border-radius: 6px;
  color: white;
  background: rgba(3, 55, 61, 0.9);
  box-shadow: 0 8px 24px rgba(2, 45, 49, 0.2);
  font-size: 10px;
  text-align: center;
  transition: 180ms ease;
}

.wish-toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes tide-breathe {
  from { transform: scale(1.015) translateY(0); }
  to { transform: scale(1.04) translateY(-4px); }
}

@keyframes ring-turn {
  from { transform: translate(-50%, -50%) rotate(0); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes jackpot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes settlement-star {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.45); }
}

@keyframes settlement-gift-arrive {
  from { opacity: 0; transform: translateY(16px) scale(0.88); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes offering-rise {
  0% { opacity: 0; transform: translate(-50%, 30px) scale(0.65) rotate(-8deg); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -260px) scale(0.35) rotate(14deg); }
}

@keyframes inventory-rise {
  from { opacity: 0.92; transform: translateY(34px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 431px) {
  .wish-app {
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
  }
}

@media (max-height: 760px) {
  .wish-header { min-height: 68px; padding-top: 7px; }
  .wish-brand h1 { font-size: 25px; }
  .round-panel { padding-top: 6px; padding-bottom: 5px; }
  .intel-band { min-height: 88px; }
  .jackpot-stage img { width: 110px; }
  .jackpot-stage::before { width: 136px; height: 136px; }
  .jackpot-stage::after { width: 150px; height: 150px; }
  .jackpot-ring { width: 162px; height: 162px; }
  .jackpot-stage h2 { font-size: 17px; }
  .inventory-dock { min-height: 130px; padding-top: 7px; }
  .inventory-tray { height: calc(172px + max(10px, env(safe-area-inset-bottom))); }
  .offering-grid { min-height: 90px; margin-top: 5px; }
  .wish-app.is-inventory-expanded .offering-grid { max-height: 280px; }
  .offering-card { height: 90px; grid-template-rows: minmax(0, 1fr) 22px; }
  .offering-card-main { grid-template-rows: 34px auto auto; }
  .offering-image { width: 34px; height: 34px; }
  .offering-image img { width: 32px; height: 32px; }
  .offering-image .gift-thumb-fallback { width: 32px; height: 32px; }
  .gift-stepper { height: 22px; grid-template-columns: 17px minmax(0, 1fr) 17px; }
  .wish-toast { bottom: calc(142px + env(safe-area-inset-bottom)); }
  .settlement-dialog.is-winner { max-height: calc(100dvh - 24px); }
  .settlement-dialog.is-winner .settlement-shell { min-height: 558px; padding: 20px 22px 17px; }
  .settlement-dialog.is-winner .settlement-winner-lead { margin-bottom: 8px; }
  .settlement-dialog.is-winner .settlement-prize-stage { width: 216px; height: 216px; margin-top: 0; }
  .settlement-dialog.is-winner .settlement-moon-gate { width: 200px; height: 200px; }
  .settlement-dialog.is-winner .settlement-prize-stage::after { width: 194px; height: 19px; margin-bottom: 7px; }
  .settlement-dialog.is-winner .settlement-prize-stage img { width: 186px; height: 186px; }
  .settlement-dialog.is-winner .settlement-reward { margin-top: 4px; }
  .settlement-dialog.is-winner .settlement-shell > #settlementCopy { margin: 7px 0 10px; }
}

@media (max-width: 370px) {
  .wish-header { grid-template-columns: 70px minmax(0, 1fr) 121px; padding-right: 8px; padding-left: 8px; }
  .header-tools { gap: 4px; }
  .text-tool { padding: 0 5px; }
  .round-panel { margin-right: 8px; margin-left: 8px; }
  .intel-band,
  .wish-actions,
  .inventory-dock { padding-right: 8px; padding-left: 8px; }
  .intel-band { grid-template-columns: minmax(0, 1.45fr) minmax(104px, 0.8fr); gap: 5px; }
  .wish-actions { grid-template-columns: 68px minmax(0, 1fr) 68px; gap: 5px; }
  .offering-grid { gap: 3px; }
  .wish-app.is-inventory-expanded .offering-grid { max-height: 312px; }
  .offering-image { width: 32px; height: 32px; }
  .offering-image img { width: 30px; height: 30px; }
  .offering-image .gift-thumb-fallback { width: 30px; height: 30px; }
  .gift-stepper { grid-template-columns: 16px minmax(0, 1fr) 16px; }
  .settlement-dialog.is-winner { width: calc(100vw - 18px); }
  .settlement-dialog.is-winner .settlement-shell { padding-right: 19px; padding-left: 19px; }
  .settlement-dialog.is-winner .settlement-shell h2 { font-size: 28px; }
}

@media (max-height: 760px) and (max-width: 370px) {
  .wish-app.is-inventory-expanded .offering-grid { max-height: 276px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
