.gift-art {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  pointer-events: none;
}
.gift-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.gift-art::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: auto 2% 5%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #060913c4 0%, #1312205e 46%, transparent 73%);
}
.gift-art__lid { transform-origin: 83% 45%; }

.elka-gift-card .gift-art { grid-area: box; max-width: 6rem; }

.gift-daily,
.gift-dialog {
  --gift-gold: #e6b879;
  --gift-paper: #fff0d4;
  --gift-muted: #c1d3d5;
  --gift-serif: Georgia, 'Times New Roman', serif;
  color: var(--gift-paper);
  box-sizing: border-box;
}
.gift-daily {
  display: grid;
  gap: .64rem;
  min-width: 0;
  padding: clamp(.75rem, 2vw, 1rem);
  border: 1px solid #a87d50;
  border-radius: 12px;
  background: radial-gradient(ellipse at 2% 2%, #5b4332, #0000 65%), #1a2c36;
  box-shadow: inset 0 0 0 3px #162631b3, 0 .4rem 1rem #070e173d;
}
.gift-daily p { margin: 0; }
.gift-daily__hero {
  display: grid;
  grid-template-areas: 'picture';
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #d6a86f;
  border-radius: .55rem;
  background: #211f26;
}
.gift-daily__picture, .gift-daily__caption { grid-area: picture; min-width: 0; }
.gift-daily__picture { display: block; }
.gift-daily__illustration { display: block; width: 100%; height: 100%; object-fit: cover; }
.gift-daily__picture .gift-daily__illustration { height: min(41dvh, 23rem); min-height: 11rem; object-position: center 54%; }
.gift-daily__caption {
  z-index: 1;
  align-self: end;
  padding: clamp(.55rem, 2.7vw, 1.22rem);
  background: linear-gradient(transparent, #131522ed 68%);
  text-shadow: 0 1px 5px #050408;
}
.gift-daily .gift-daily__day { margin: 0; color: #fff1d2; font: 650 clamp(1.45rem, 5vw, 2.25rem)/1.05 var(--gift-serif); }
.gift-daily .gift-daily__summary { margin-top: .3rem; max-width: 38ch; color: #ffe1a8; font: 650 clamp(.75rem, 2.6vw, .95rem)/1.2 system-ui, sans-serif; }
.gift-daily__won {
  display: grid;
  grid-template-columns: 3.65rem minmax(0, 1fr);
  align-items: center;
  gap: .7rem;
  padding: .42rem .65rem;
  border: 1px solid var(--toy-tier-edge, #bca87965);
  border-radius: .45rem;
  background: var(--toy-tier-stage, #282636);
}
.gift-daily__won[hidden] { display: none; }
.gift-daily__won .elka-collection-art { width: 100%; aspect-ratio: 1; }
.gift-daily__won > div > * { display: block; }
.gift-daily__won > div > span { margin-top: .15rem; color: #e9d3b3; font-size: .79rem; }
.gift-daily__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gift-daily__step:focus-visible { outline: 2px solid #ffe4a3; outline-offset: 2px; }
.gift-daily__foot { display: grid; justify-items: center; }
.gift-daily__foot:has(.gift-daily__schedule:empty):has(.gift-daily__action[hidden]) { display: none; }
.gift-daily__schedule { color: #f9daa3; font-size: .83rem; text-align: center; font-variant-numeric: tabular-nums; }
.gift-daily__schedule:empty { display: none; }
.gift-daily__action[hidden] { display: none; }

.gift-dialog {
  width: min(35rem, calc(100vw - 1.25rem));
  max-height: min(90dvh, 49rem);
  padding: clamp(.8rem, 3vw, 1.35rem);
  border: 1px solid var(--gift-gold);
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--gift-tier, #e6b879) 16%, transparent), transparent 68%),
    linear-gradient(164deg, #263d43, #142433 63%);
  box-shadow: inset 0 0 0 4px #142331, inset 0 0 0 5px #b58b5f40, 0 1.5rem 5rem #050b12cf;
}
.gift-dialog[open] { display: grid; gap: .75rem; }
.gift-dialog[data-toy-tier] { border-color: var(--toy-tier-edge); background: var(--toy-tier-stage); }
.gift-dialog::backdrop { background: #07101cc4; backdrop-filter: blur(4px); }
.gift-dialog__head { display: flex; justify-content: space-between; align-items: start; gap: .6rem; }
.gift-dialog h2 { margin: 0; font: 600 clamp(1.22rem, 4vw, 1.8rem)/1.18 var(--gift-serif); }
.gift-dialog h2:focus { outline: none; }
.gift-dialog__area { min-width: 0; display: grid; gap: .68rem; }
.gift-dialog__status { margin: 0; color: var(--gift-muted); text-align: center; font-size: .84rem; }
.gift-dialog__status:empty { display: none; }
.gift-dialog__status--spoken { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.gift-dialog__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; }
.gift-dialog__actions[hidden] { display: none; }
.gift-button {
  min-height: 2.5rem;
  padding: .46rem .8rem;
  border: 1px solid #a88c6a;
  border-radius: 6px;
  color: #fff0d4;
  background: #243940;
  font: 650 .85rem/1.26 system-ui, sans-serif;
  cursor: pointer;
}
.gift-button--quiet { min-height: 2rem; background: #172936; }
.gift-button--primary {
  border-color: #f2cf8b;
  color: #30211b;
  background: linear-gradient(180deg, #f8dca6, #d6a86f);
  box-shadow: inset 0 0 0 1px #ffefc48c, 0 2px 6px #100e1594;
}
.gift-button:hover:enabled { filter: brightness(1.11); }
.gift-button:disabled { cursor: default; color: #d3ded7; border-color: #667e77; background: #293d42; box-shadow: none; }
.gift-button:focus-visible, .gift-field select:focus-visible {
  outline: 2px solid #ffe3a2;
  outline-offset: 3px;
}
.gift-field { display: grid; gap: .32rem; justify-items: start; color: var(--gift-muted); font-size: .82rem; }
.gift-field select {
  width: 100%;
  min-height: 2.5rem;
  padding: .3rem .6rem;
  color: #fff0d4;
  background: #172934;
  border: 1px solid #a88c6a;
  border-radius: 6px;
  font: inherit;
}
.gift-stage { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 8rem; }
.gift-dialog--daily .gift-stage .gift-daily__illustration { height: min(27dvh, 14rem); border-radius: .55rem; object-position: center 54%; }
.gift-dialog--daily .gift-stage.is-reveal { display: none; }
.gift-appearance { margin: 0; padding: .6rem; border: 1px solid #be9ad4; border-radius: .5rem; background: #473355; text-align: center; color: #fff0dc; }
.gift-stage .gift-art { width: min(15rem, 62%); margin-top: -.5rem; }
.gift-stage .gift-art__lid { transition: transform 500ms cubic-bezier(.2,.94,.33,1.12), filter 380ms ease-out; }
.gift-stage.is-open .gift-art__lid { transform: translateY(-15%) rotate(13deg) scaleY(.88); filter: brightness(1.13); }
.gift-stage::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 5% 2% 8%;
  background: radial-gradient(ellipse, var(--gift-tier, #ffd38d) 0%, transparent 61%);
  opacity: .14;
}
.gift-stage.is-open:not(.is-empty)::after {
  content: '';
  position: absolute;
  pointer-events: none;
  inset: -18% 0 30%;
  background: radial-gradient(ellipse at 49% 70%, #fff1bd 0, var(--gift-tier, #ffd38d) 6%, transparent 49%);
  mix-blend-mode: screen;
  animation: gift-light 680ms ease-out both;
}
.gift-stage.is-open[data-tier]::before { opacity: .36; }
.gift-stage.is-open[data-tier]::after { animation-duration: 1050ms; }
.gift-stage.is-open.is-reveal[data-tier]::after { animation-name: gift-reveal-light; }
@keyframes gift-light { 0% { opacity: 0; transform: scale(.33); } 38% { opacity: .8; } 100% { opacity: .15; transform: scale(1.09); } }
@keyframes gift-reveal-light { 0% { opacity: .1; } 24% { opacity: .72; } 100% { opacity: .15; transform: scale(1.2); } }
.gift-sparks { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.gift-sparks i {
  position: absolute;
  inset: 54% auto auto 50%;
  width: 5px;
  height: 5px;
  background: var(--spark);
  box-shadow: 0 0 8px var(--spark);
  animation: gift-spark 940ms var(--delay) ease-out both;
}
.gift-sparks i:nth-child(3n) { width: 9px; height: 2px; }
@keyframes gift-spark {
  0% { opacity: 0; transform: translate(0, 0) rotate(45deg) scale(.1); }
  21% { opacity: 1; }
  80% { opacity: .85; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(190deg) scale(.55); }
}

.gift-slots, .gift-reel__track {
  list-style: none;
  margin: 0;
  padding: 0;
}
.gift-slots { display: flex; justify-content: center; gap: .39rem; }
.gift-slots--receipt .gift-slot:only-child { width: min(100%, 15rem); padding: .6rem; }
.gift-slots--receipt .game-prize-meta { justify-content: center; }
.gift-slots--receipt .gift-slot:only-child > :is(.elka-collection-art, .toy-motion-preview) {
  width: min(100%, 10rem, 26dvh);
}
.gift-slot {
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  gap: .26rem;
  min-width: 0;
  width: min(32%, 8.25rem);
  padding: .45rem .26rem;
  border: 1px solid color-mix(in srgb, var(--gift-tier, #ab8359) 50%, #513c4f);
  border-radius: 7px;
  color: #fff0dc;
  background: radial-gradient(ellipse at 52% 32%, #694350a3, #211d2b 82%), #36222e;
  box-shadow: inset 0 3px 8px #170f19, inset 0 0 0 2px #17121d88;
  text-align: center;
}
.gift-slot strong { align-self: end; font: 600 clamp(.67rem, 2.4vw, .84rem)/1.16 system-ui, sans-serif; overflow-wrap: anywhere; }
.gift-slot > :is(.elka-collection-art, .toy-motion-preview, canvas) { width: min(100%, 5.7rem); height: auto; aspect-ratio: 1; }
.gift-slot > .gift-garland-sample { object-fit: contain; }
.gift-slot .elka-collection-art > canvas { width: 100%; height: auto; }
.gift-note { margin: .35rem 0 0; color: var(--gift-muted); text-align: center; font-size: .82rem; }
.gift-inside > .gift-note:first-child { margin: 0 0 .5rem; }
.gift-daily [data-tier='rare'], .gift-dialog [data-tier='rare'], .gift-dialog[data-tier='rare'] { --gift-tier: #8de8ff; }
.gift-daily [data-tier='epic'], .gift-dialog [data-tier='epic'], .gift-dialog[data-tier='epic'] { --gift-tier: #df9dff; }
.gift-daily [data-tier='legendary'], .gift-dialog [data-tier='legendary'], .gift-dialog[data-tier='legendary'] { --gift-tier: #ffcb63; }

.gift-dialog:has(.gift-reel) > .gift-stage,
.gift-dialog--reveal > .gift-stage { display: none; }
.gift-dialog--reveal .gift-dialog__area { position: relative; gap: .25rem; }
.gift-dialog--reveal :is(.gift-sparks, .elka-collection-art) { overflow: clip; }
.gift-dialog--reveal .gift-slots--receipt .gift-slot:only-child {
  width: 100%;
  gap: .55rem;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.gift-dialog--reveal .gift-slots--receipt .gift-slot:only-child > :is(.elka-collection-art, .toy-motion-preview) {
  width: min(100%, 22rem, 45dvh);
}
.gift-dialog--reveal .gift-slots .gift-slot .elka-collection-art {
  background: radial-gradient(ellipse, color-mix(in srgb, var(--toy-tier-label) 32%, transparent), transparent 68%);
}
.gift-dialog--reveal .gift-slot .elka-collection-art > :is(canvas, img) {
  width: 93%;
  filter: drop-shadow(0 .55rem .65rem #0a111c9c);
}
.gift-dialog--reveal .gift-slot strong { font: 600 clamp(1.25rem, 4vw, 1.65rem)/1.15 var(--gift-serif); }
:is(.gift-dialog--reveal, .game-victory--chest) .game-prize-tag {
  padding: 0;
  border: 0;
  background: none;
  font-weight: 500;
}
:is(.gift-dialog--reveal, .game-victory--chest) .game-prize-tag + .game-prize-tag::before {
  margin-right: .32rem;
  content: '·';
}

.gift-reel {
  position: relative;
  min-width: 0;
  overflow: hidden;
  overflow: clip;
  isolation: isolate;
  border: 1px solid #8e765d;
  border-radius: 10px;
  background: #101c29;
}
.gift-reel::after {
  position: absolute;
  inset: 0;
  content: '';
  pointer-events: none;
  box-shadow: inset 2rem 0 1.2rem -1.35rem #090e1b, inset -2rem 0 1.2rem -1.35rem #090e1b;
}
.gift-reel__track {
  position: relative;
  left: 50%;
  display: flex;
  width: max-content;
  gap: .55rem;
  padding: .8rem 0 .65rem;
}
.gift-reel__track--static { left: auto; margin-inline: auto; }
.gift-slot[data-tier='common'] { --gift-tier: #c5c6ce; }
.gift-slot[data-toy-tier] { background: var(--toy-tier-fill); }
.gift-slots .gift-slot .elka-collection-art {
  min-height: 0;
  background: none;
}
.gift-reel__tile {
  display: grid;
  grid-template-rows: 7.5rem 2lh;
  flex: 0 0 7.5rem;
  gap: .38rem;
  color: #e4edf1;
  font: 500 .74rem/1.2 system-ui, sans-serif;
  text-align: center;
}
.gift-reel__tile > :is(.elka-collection-art, .gift-reel__art) {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--toy-tier-edge, #56717b);
  border-radius: .5rem;
  background: var(--toy-tier-fill, #1d3443);
}
.gift-reel__tile .elka-collection-art > :is(canvas, img) { width: 94%; }
.gift-reel__tile > .gift-reel__garland { width: 100%; height: 100%; object-fit: contain; }
.gift-reel__tile[data-toy-tier] strong { color: var(--toy-tier-label); }
.gift-reel__tile > .gift-reel__empty-art {
  background:
    radial-gradient(ellipse at 48% 18%, #344950, transparent 61%),
    linear-gradient(156deg, #253840, #182731 85%);
}
.gift-reel__empty-frame {
  position: absolute;
  inset: .48rem;
  border: 1px solid #aeb9aa42;
  border-radius: .3rem;
  color: #b7ad88;
  background:
    linear-gradient(currentColor, currentColor) top left / .65rem 1px,
    linear-gradient(currentColor, currentColor) top left / 1px .65rem,
    linear-gradient(currentColor, currentColor) top right / .65rem 1px,
    linear-gradient(currentColor, currentColor) top right / 1px .65rem,
    linear-gradient(currentColor, currentColor) bottom left / .65rem 1px,
    linear-gradient(currentColor, currentColor) bottom left / 1px .65rem,
    linear-gradient(currentColor, currentColor) bottom right / .65rem 1px,
    linear-gradient(currentColor, currentColor) bottom right / 1px .65rem;
  background-repeat: no-repeat;
}
.gift-reel__empty-art::before, .gift-reel__empty-art::after {
  position: absolute;
  width: 3px;
  height: 5px;
  content: '';
}
.gift-reel__empty-art::before {
  top: 16%;
  left: 19%;
  rotate: -22deg;
  background: #d7bc82;
  box-shadow: .48rem .08rem #78a5a9, -.1rem .47rem #bc8794;
}
.gift-reel__empty-art::after {
  right: 19%;
  bottom: 17%;
  rotate: 28deg;
  background: #c1a477;
  box-shadow: -.38rem .15rem #789da1;
}
.gift-reel__tile > .gift-reel__ticket-art {
  border-color: #9c8058;
  background: radial-gradient(ellipse at 50% 43%, #56746f, #243d41 72%, #1b313b);
}
.gift-ticket-pile {
  position: absolute;
  width: 57%;
  aspect-ratio: 1.65;
  translate: -50% -50%;
  filter: drop-shadow(0 .17rem .19rem #15191b9e);
}
.gift-ticket-pile > .gift-ticket-sheet {
  position: absolute;
  inset: 0;
  width: 100%;
  translate: calc(var(--ticket-layer) * -.065rem) calc(var(--ticket-layer) * .17rem);
  background: linear-gradient(165deg, #ffdb83, #b67748 78%, #8a552e);
}
.gift-ticket-pile > .gift-ticket-sheet--front {
  background: linear-gradient(145deg, #ffeab0, #edbb6a 65%, #b77649);
}
.gift-ticket-band {
  position: absolute;
  inset: -.08rem 17% -.28rem auto;
  width: 15%;
  border-inline: 1px solid #fae3aa9c;
  border-radius: 2px;
  background: linear-gradient(90deg, #a04648, #d18373 45%, #923f44);
}
.gift-reel__tile strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  padding-inline: .2rem;
  font-weight: inherit;
}
.gift-reel__tile.is-winner > :is(.elka-collection-art, .gift-reel__art) {
  box-shadow: inset 0 0 0 2px var(--toy-tier-edge, #ffe5a0);
}
.gift-reel__pointer {
  position: absolute;
  inset: 0 auto 0 50%;
  transform: translateX(-50%);
  width: 2px;
  z-index: 1;
  pointer-events: none;
}
.gift-reel__pointer::before, .gift-reel__pointer::after {
  content: '';
  position: absolute;
  left: 50%;
  border: .39rem solid transparent;
  transform: translateX(-50%);
}
.gift-reel__pointer::before { top: 0; border-top-color: #ffe5a0; }
.gift-reel__pointer::after { bottom: 0; border-bottom-color: #ffe5a0; }

@media (prefers-reduced-motion: reduce) {
  .gift-art__lid { transition: none !important; }
  .gift-stage.is-open::after { animation: none; opacity: .15; }
}

.yard-gift-art {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background-image: url('../art/style/yard-gifts.png');
  background-size: 300% 200%;
  background-repeat: no-repeat;
}
.yard-gift-art[data-art='presents'] { background-position: 0 0; }
.yard-gift-art[data-art='daily'] { background-position: 50% 0; }
.yard-gift-art[data-art='random'] { background-position: 100% 0; }
.yard-gift-art[data-art='collection'] { background-position: 0 100%; }
.yard-gift-art[data-art='series'] { background-position: 50% 100%; }
.yard-gift-art[data-art='epic'] { background-position: 100% 100%; }

.ec-dialog.ec-room-daily-dialog { width: min(43rem, calc(100% - 1rem)); max-width: none; }
.ec-room-daily-dialog .elka-gift-panel { padding: 0; }
.gift-daily__days li { min-width: 0; }
.gift-daily__step {
  position: relative;
  isolation: isolate;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 2.15rem;
  padding: 0;
  border: 1px solid #a88350;
  border-radius: .5rem;
  background: #2b3a31;
  color: #ffebc4;
  font: 750 .8rem/1 system-ui, sans-serif;
}
.gift-daily__step strong, .gift-daily__step-state {
  position: absolute;
  inset: auto auto .14rem .14rem;
  min-width: 1rem;
  padding: .12rem;
  border-radius: 3px;
  background: #181715e8;
}
.gift-daily__step-state { inset: .14rem .14rem auto auto; min-width: 0; color: #e5ffd5; }
.gift-daily__step[data-done='true'] { border-color: #a4bd87; }
.gift-daily__step[aria-current='step'] strong { color: #261b12; background: #ffe5a7; }
.gift-daily__step[aria-pressed='true'] { border-color: #ffffdb; outline: 1px solid #ffd782; outline-offset: 1px; }
@media (max-width: 420px) {
  .gift-daily { padding: .47rem; }
  .gift-daily__days { gap: .22rem; }
  .gift-daily__picture .gift-daily__illustration { height: 12rem; }
  .gift-daily__step strong, .gift-daily__step-state { padding: .08rem; min-width: .8rem; font-size: .67rem; }
}

@media (max-width: 760px), (pointer: coarse) {
  .gift-button, .gift-daily__step { min-height: 44px; }
}
