/* Giveaway-only layout; shared chrome and controls come from digital-home/play. */
.giveaway-page .giveaway-main {
  width: 100%;
}

.giveaway-page .giveaway-shell {
  min-height: auto;
  padding-top: 18px;
  padding-bottom: 24px;
}

.giveaway-page .giveaway-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.giveaway-page .giveaway-header__meta,
.giveaway-page .giveaway-stage-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.giveaway-page .giveaway-settings h2,
.giveaway-page .giveaway-management h2,
.giveaway-page .giveaway-stage-heading h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.giveaway-page .giveaway-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.giveaway-page .giveaway-access { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
.giveaway-page .giveaway-access > .giveaway-note { flex: 1 1 280px; }
.giveaway-page .giveaway-access .giveaway-actions { margin-top: 0; }

.giveaway-page .giveaway-controls {
  margin: 0;
  min-width: 0;
}
.giveaway-page .giveaway-controls > * { grid-column: 1 / -1; }

.giveaway-page .giveaway-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
  gap: 14px;
}

.giveaway-page .giveaway-fields input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.giveaway-page .giveaway-prizes {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.giveaway-page .giveaway-prize-slot {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 16px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-strong);
  text-align: center;
}

.giveaway-page .giveaway-prize-slot > span:not(:first-child) {
  color: var(--muted);
  font-size: 0.84rem;
}

.giveaway-page .giveaway-prize-slot__number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-weight: 800;
}

.giveaway-page .giveaway-prize-slot .action-btn {
  padding: 8px 12px;
  max-width: 100%;
}

.giveaway-page .giveaway-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.giveaway-page .giveaway-stage-card {
  display: grid;
  gap: 14px;
  width: min(1260px, 100%);
  min-width: 0;
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.giveaway-page .giveaway-stage-heading {
  justify-content: space-between;
}

.giveaway-page .giveaway-stage-heading > div:first-child { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.giveaway-page .giveaway-stage-actions { min-width: 0; padding: 0; border: 0; margin: 0 0 0 auto; gap: 10px; }
.giveaway-page .giveaway-privacy { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.giveaway-page .giveaway-privacy input { width: 18px; height: 18px; accent-color: var(--brand-deep); }
.giveaway-page .giveaway-prize-slot > span.giveaway-prize-mystery {
  display: grid;
  place-items: center;
  width: 100%;
  height: 120px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 2rem;
}
@media (max-width: 1024px) {
  .giveaway-page .giveaway-stage-actions { flex-basis: 100%; margin-left: 0; }
}

.giveaway-page .giveaway-stage-heading h2 {
  margin-top: 6px;
}

.giveaway-page .giveaway-display {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  container-type: size;
  border-radius: 22px;
  background: var(--panel);
  color: var(--hero-text);
}

.giveaway-page .giveaway-scene-background {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  --giveaway-winter-art: url("/assets/giveaway/christmas/winter-landscape.webp");
  background-image: var(--giveaway-winter-art, none);
  background-position: center;
  background-size: cover;
  pointer-events: none;
}

/* The normalized anchors share one plane; landscape has more branch room.
   Every bitmap keeps its intrinsic aspect ratio. Portrait retains the 9:16 plane. */
.giveaway-page .giveaway-scene {
  position: relative;
  width: min(100cqw, 62.5cqh);
  aspect-ratio: 10 / 16;
  container-type: inline-size;
}

.giveaway-page .giveaway-tree-layer {
  position: absolute;
  inset: 0;
  --giveaway-tree-art: url("/assets/giveaway/christmas/tree.png");
  left: -2%;
  right: -2%;
  background-image: var(--giveaway-tree-art);
  background-position: center 80%;
  background-size: auto 112%;
  background-repeat: no-repeat;
  pointer-events: none;
}

.giveaway-page .giveaway-presents {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Taller hit areas use the cutouts' transparent side margins. This enlarges
   actual gift artwork without stretching it, cropping cords, or moving anchors. */
.giveaway-page .giveaway-present {
  position: absolute;
  left: var(--present-x);
  top: var(--present-y);
  width: 26%;
  aspect-ratio: 4 / 5;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  background-image: var(--giveaway-present-art, none);
  background-size: auto 210%;
  background-repeat: no-repeat;
  background-position: center;
}

.giveaway-page .giveaway-present .giveaway-present-number {
  position: absolute;
  left: 50%;
  top: 68%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: clamp(1rem, 6.8cqw, 3.5rem);
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 1px 2px #06111d, 1px 0 2px #06111d, -1px 0 2px #06111d, 0 -1px 2px #06111d;
}

.giveaway-page .giveaway-present--1 { --giveaway-present-art: url("/assets/giveaway/christmas/present-01.png"); --present-x: 50%; --present-y: 30%; }
.giveaway-page .giveaway-present--2 { --giveaway-present-art: url("/assets/giveaway/christmas/present-02.png"); --present-x: 36%; --present-y: 51%; }
.giveaway-page .giveaway-present--3 { --giveaway-present-art: url("/assets/giveaway/christmas/present-03.png"); --present-x: 64%; --present-y: 51%; }
.giveaway-page .giveaway-present--4 { --giveaway-present-art: url("/assets/giveaway/christmas/present-04.png"); --present-x: 22%; --present-y: 74%; }
.giveaway-page .giveaway-present--5 { --giveaway-present-art: url("/assets/giveaway/christmas/present-05.png"); --present-x: 50%; --present-y: 74%; }
.giveaway-page .giveaway-present--6 { --giveaway-present-art: url("/assets/giveaway/christmas/present-06.png"); --present-x: 78%; --present-y: 74%; }

/* Both native stage fullscreen and the Wheel-style document fullscreen work. */
.giveaway-page .giveaway-display:fullscreen {
  width: 100vw;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
}

.giveaway-page .giveaway-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .giveaway-page .giveaway-prizes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) and (min-width: 761px) {
  .giveaway-page .giveaway-shell { padding: 12px; gap: 10px; }
  .giveaway-page .giveaway-settings { padding: 18px; }
  .giveaway-page .giveaway-stage-card { padding: 14px; }
}

@media (max-width: 760px) {
  .giveaway-page .giveaway-shell { padding: 10px; }
  .giveaway-page .giveaway-settings { padding: 18px; }
  .giveaway-page .giveaway-fields { grid-template-columns: minmax(0, 1fr); }
  .giveaway-page .giveaway-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .giveaway-page .giveaway-display { aspect-ratio: 9 / 16; }
  .giveaway-page .giveaway-stage-card { padding: 14px; }
}

@media (max-width: 640px) {
  .giveaway-page .giveaway-actions .action-btn { width: 100%; }
}

/* Select scenery from the stage shape, including fullscreen on wide devices. */
@container (orientation: portrait) {
  .giveaway-page .giveaway-scene-background {
    --giveaway-winter-art: url("/assets/giveaway/christmas/winter-portrait.webp");
  }
}

/* Local prize setup: thumbnails are confined to cards, never the stage. */
.giveaway-page .giveaway-prize-thumbnail {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-soft);
}

.giveaway-page .giveaway-prize-filename {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.giveaway-page .giveaway-prize-slot--inactive {
  border-style: solid;
  background: var(--surface-soft);
}

.giveaway-page .giveaway-prize-error,
.giveaway-page .giveaway-storage-error {
  color: var(--ink);
  font-weight: 600;
}

.giveaway-page .giveaway-prize-error:empty {
  display: none;
}

.giveaway-page #giveawayRetrySave {
  justify-self: start;
}

.giveaway-page .giveaway-is-shuffling {
  will-change: transform;
  backface-visibility: hidden;
  pointer-events: none;
}

.giveaway-page #giveawayRoundStatus {
  color: var(--ink);
  font-weight: 800;
}

.giveaway-page #giveawaySoundStatus:empty {
  display: none;
}

.giveaway-page #giveawayRoundNote {
  min-height: 1.55em;
}

/* Native buttons keep numbers and open-state badges with their artwork. */
.giveaway-page .giveaway-present-trigger {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.giveaway-page .giveaway-present-trigger:disabled { cursor: default; }
.giveaway-page .giveaway-present-trigger:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 4px;
}
.giveaway-page .giveaway-present.giveaway-present--revealed {
  --giveaway-present-art: url('/assets/giveaway/christmas/present-open.png');
  background-size: auto 100%;
}
.giveaway-page .giveaway-present--revealed .giveaway-present-number { top: 76%; }
.giveaway-page .giveaway-present-check {
  position: absolute;
  right: 0;
  top: 6%;
  display: grid;
  place-items: center;
  width: clamp(20px, 6cqw, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--brand-deep);
  color: white;
  border: 2px solid white;
  font-size: clamp(0.8rem, 4cqw, 1.8rem);
  font-weight: 800;
}

.giveaway-page .giveaway-scratch-panel {
  width: min(980px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  margin: auto;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.giveaway-page .giveaway-scratch-panel[open] { display: grid; gap: 14px; }
.giveaway-page .giveaway-scratch-panel::backdrop { background: rgba(6, 17, 29, 0.82); }
.giveaway-page .giveaway-scratch-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.giveaway-page .giveaway-scratch-heading h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  letter-spacing: -0.04em;
}
.giveaway-page .giveaway-scratch-media {
  position: relative;
  width: 100%;
  height: clamp(150px, 56dvh, 760px);
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-soft);
}
.giveaway-page .giveaway-scratch-canvas,
.giveaway-page .giveaway-revealed-prize {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.giveaway-page .giveaway-scratch-canvas {
  touch-action: none;
  cursor: crosshair;
}
.giveaway-page .giveaway-scratch-canvas:focus-visible { outline: 3px solid var(--brand); outline-offset: -4px; }
.giveaway-page .giveaway-scratch-progress { width: 100%; height: 10px; accent-color: var(--brand-deep); }
.giveaway-page .giveaway-scratch-actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 640px) {
  .giveaway-page .giveaway-scratch-panel { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); padding: 14px; }
  .giveaway-page .giveaway-scratch-panel[open] { gap: 10px; }
  .giveaway-page .giveaway-scratch-media { height: clamp(150px, 48dvh, 760px); }
  .giveaway-page .giveaway-scratch-actions .action-btn { width: 100%; }
  .giveaway-page .giveaway-scratch-heading .action-btn { width: auto; }
}

.giveaway-page .giveaway-present-check::before { content: "\2713"; }

/* Completed prizes leave the modal top layer and stay within the tree stage. */
.giveaway-page .giveaway-spotlight-panel[open] {
  position: absolute;
  inset: 12px;
  z-index: 10;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(12px, 2cqw, 32px);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: clamp(5px, 1cqw, 14px);
  overflow: hidden;
  border: 1px solid rgba(232, 191, 90, 0.32);
  border-radius: 18px;
  background: rgba(6, 17, 29, 0.78);
  color: var(--hero-text);
  text-align: center;
}
.giveaway-page .giveaway-spotlight-title,
.giveaway-page .giveaway-spotlight-heading,
.giveaway-page .giveaway-spotlight-number { margin: 0; position: relative; z-index: 3; }
.giveaway-page .giveaway-spotlight-title {
  color: var(--hero-text);
  font-size: clamp(0.9rem, 1.9cqw, 1.6rem);
  font-weight: 600;
  overflow-wrap: anywhere;
}
.giveaway-page .giveaway-spotlight-heading {
  color: var(--gold);
  font-size: clamp(1.05rem, 3.5cqw, 3.5rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: 0.035em;
}
.giveaway-page .giveaway-spotlight-number { font-size: clamp(0.8rem, 1.3cqw, 1.1rem); }
.giveaway-page .giveaway-spotlight-media {
  height: 100%;
  min-height: 0;
  background: transparent;
  isolation: isolate;
}
.giveaway-page .giveaway-spotlight-media::before {
  content: "";
  position: absolute;
  inset: 4%;
  z-index: 0;
  background: radial-gradient(ellipse at center, rgba(255, 241, 201, 0.38), rgba(232, 191, 90, 0.16) 38%, transparent 70%);
  pointer-events: none;
}
.giveaway-page .giveaway-spotlight-image { position: relative; z-index: 1; border-radius: 12px; }
.giveaway-page .giveaway-spotlight-actions {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.giveaway-page .giveaway-spotlight-help { position: relative; z-index: 3; color: #d8e2ed; font-size: clamp(0.75rem, 1.2cqw, 0.95rem); }
.giveaway-page .giveaway-celebration { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; container-type: size; }
.giveaway-page .giveaway-celebration-snow {
  position: absolute;
  left: var(--x);
  top: -12px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: white;
  opacity: 0.75;
  animation: giveaway-celebration-snow var(--duration) var(--delay) linear infinite;
}
.giveaway-page .giveaway-celebration-sparkle {
  position: absolute;
  width: 12px;
  height: 12px;
  opacity: 0;
  color: var(--sparkle-color);
  animation: giveaway-celebration-sparkle 1.5s var(--delay) ease-in-out infinite;
}
.giveaway-page .giveaway-celebration-sparkle::before,
.giveaway-page .giveaway-celebration-sparkle::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 12px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.giveaway-page .giveaway-celebration-sparkle::after { transform: rotate(90deg); }
.giveaway-page .giveaway-celebrating .giveaway-spotlight-media::before { animation: giveaway-spotlight-glow 1.6s ease-in-out 3; }
@keyframes giveaway-celebration-snow {
  from { transform: translate3d(0, -12px, 0); opacity: 0; }
  12% { opacity: 0.75; }
  to { transform: translate3d(var(--drift), 110cqh, 0); opacity: 0; }
}
@keyframes giveaway-celebration-sparkle {
  0%, 100% { transform: scale(0.4); opacity: 0; }
  45% { transform: scale(1.2); opacity: 0.9; }
}
@keyframes giveaway-spotlight-glow { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }
@media (max-width: 640px) {
  .giveaway-page .giveaway-spotlight-panel[open] { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
  .giveaway-page .giveaway-spotlight-actions .action-btn { width: auto; min-height: 40px; padding-inline: 12px; font-size: 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
  .giveaway-page .giveaway-celebration { display: none; }
  .giveaway-page .giveaway-celebrating .giveaway-spotlight-media::before { animation: none; }
}

@container (orientation: portrait) {
  .giveaway-page .giveaway-scene { width: min(100cqw, 56.25cqh); aspect-ratio: 9 / 16; }
  .giveaway-page .giveaway-tree-layer { inset: 0; background-size: contain; background-position: center; }
}

/* Native document fullscreen follows the Wheel approach, scoped to Giveaway. */
body.giveaway-page.giveaway-is-fullscreen { overflow: hidden; overscroll-behavior: none; }
.giveaway-page.giveaway-is-fullscreen .site-header,
.giveaway-page.giveaway-is-fullscreen .site-footer,
.giveaway-page.giveaway-is-fullscreen .giveaway-header,
.giveaway-page.giveaway-is-fullscreen .giveaway-settings,
.giveaway-page.giveaway-is-fullscreen .giveaway-access,
.giveaway-page.giveaway-is-fullscreen .giveaway-management,
.giveaway-page.giveaway-is-fullscreen .giveaway-stage-heading,
.giveaway-page.giveaway-is-fullscreen #giveawayArtworkNote { display: none; }
.giveaway-page.giveaway-is-fullscreen .giveaway-shell,
.giveaway-page.giveaway-is-fullscreen .giveaway-stage-card {
  display: block;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.giveaway-page.giveaway-is-fullscreen .giveaway-display {
  width: 100vw;
  height: 100dvh;
  aspect-ratio: auto;
  border-radius: 0;
  overscroll-behavior: none;
}
.giveaway-page #giveawayLiveStatus:empty { display: none; }
.giveaway-page .giveaway-live-controls {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 20px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  background: rgba(6, 17, 29, 0.86);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.giveaway-page .giveaway-live-controls--visible,
.giveaway-page .giveaway-live-controls--touch,
.giveaway-page .giveaway-live-controls:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.giveaway-page .giveaway-live-controls .action-btn { min-height: 42px; padding-inline: 14px; font-size: 0.9rem; width: auto; }
.giveaway-page .giveaway-live-controls .action-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .giveaway-page .giveaway-live-controls { transition: none; } }
