/* ── Win2dao Reborn (Phase 2 Power Up — Angbao Ticket) Screen Style ──
 *
 * Layout model
 * ------------
 * Uses the canvas-scaler stage model (1024 × 1522 design px, Figma node 2008:12),
 * centered horizontally on a solid #000 backdrop.
 * `.page-win2dao-reborn` is a CSS inline-size container (`100cqw` = visible width)
 * so all layers scale responsively on narrow viewports without shifting vertically.
 */

#screen-win2dao-reborn {
  overflow: hidden;
  height: var(--content-height, 932px) !important;
  background: #000 !important;

  /* Design frame (Figma Background-P2 2008:12: 1024 × 1522) */
  --w2dr-frame-w: 1024;
  --w2dr-frame-h: 1522;

  /* Title: Component Set 2008:33 — all 5 variants bottom-aligned at y = 1246 */
  --w2dr-title-bottom: 1246;
  --w2dr-title-w: 794;

  /* Button: Component Set 2008:17 — all 5 variants centered at cy = 1329 */
  --w2dr-btn-cy: 1329;
  --w2dr-btn-w: 564;
}

/* Exact Figma widths per language variant */
#screen-win2dao-reborn.w2dr-lang-en {
  --w2dr-title-w: 794;
  --w2dr-btn-w: 564;
}
#screen-win2dao-reborn.w2dr-lang-zh {
  --w2dr-title-w: 794;
  --w2dr-btn-w: 540;
}
#screen-win2dao-reborn.w2dr-lang-th {
  --w2dr-title-w: 853;
  --w2dr-btn-w: 537;
}
#screen-win2dao-reborn.w2dr-lang-id {
  --w2dr-title-w: 794;
  --w2dr-btn-w: 737;
}
#screen-win2dao-reborn.w2dr-lang-ms {
  --w2dr-title-w: 794;
  --w2dr-btn-w: 773;
}

.page-win2dao-reborn {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #000 !important;
  background-color: #000 !important;
  background-image: none !important;
  container-type: inline-size;
}

#screen-win2dao-reborn .page-win2dao-reborn::before,
#screen-win2dao-reborn .page-win2dao-reborn::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

/* Stage: fixed-ratio box matching the 1024 × 1522 background art */
.w2dr-stage {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: calc(var(--content-height, 932px) * 1024 / 1522);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

.w2dr-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.w2dr-layer {
  position: relative;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.w2dr-loc {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.w2dr-loc.is-ready {
  opacity: 1;
}

/* ── W2D Logo (Figma 2008:16: 330×330 box at x=20, top below global Joker logo) ── */
.w2dr-logo-wrap {
  position: absolute;
  top: calc(-10 / var(--w2dr-frame-h) * 100%);
  left: max(calc(20 / var(--w2dr-frame-w) * 100%), calc(50% - 50cqw + 2px));
  width: min(calc(330 / var(--w2dr-frame-w) * 100%), 42cqw);
  aspect-ratio: 1 / 1;
  z-index: 3;
  pointer-events: none;
}

.w2dr-logo {
  position: absolute;
  left: calc(25 / 385 * 100%);
  top: calc(107 / 385 * 100%);
  width: calc(335 / 385 * 100%);
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.75));
}

#screen-win2dao-reborn.w2dr-lang-zh .w2dr-logo {
  left: calc(18 / 385 * 100%);
  top: calc(18 / 385 * 100%);
  width: calc(349 / 385 * 100%);
}

/* ── Title (Bottom-anchored at y=1246, responsive width, fixed vertical position) ── */
.w2dr-title-wrap {
  position: absolute;
  left: 50%;
  top: calc(var(--w2dr-title-bottom) / var(--w2dr-frame-h) * 100%);
  width: min(calc(var(--w2dr-title-w) / var(--w2dr-frame-w) * 100%), 94cqw);
  transform: translate(-50%, -100%);
  z-index: 4;
  pointer-events: none;
}

.w2dr-title {
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.85));
}

/* ── CTA Button (Centered at cy=1329) ── */
.w2dr-btn-wrap {
  position: absolute;
  left: 50%;
  top: calc(var(--w2dr-btn-cy) / var(--w2dr-frame-h) * 100%);
  width: min(calc(var(--w2dr-btn-w, 564) / var(--w2dr-frame-w) * 100%), 86cqw);
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.w2dr-action-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: w2dr-pulse 2s infinite ease-in-out;
  transform-origin: 50% 50%;
  transition: filter 0.3s ease;
  will-change: transform;
  backface-visibility: hidden;
}

.w2dr-action-btn:hover {
  animation-play-state: paused;
  transform: scale(1.06);
  filter: brightness(1.15) drop-shadow(0 0 18px rgba(255, 75, 43, 0.65));
}

.w2dr-action-btn:active {
  animation-play-state: paused;
  transform: scale(0.95);
}

.w2dr-btn-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.7));
}

@keyframes w2dr-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Center the square Win2Dao logo thumbnail inside the 112×92 bottom-nav card */
#tab-win2dao-reborn .bottom-nav__thumb {
  object-position: center center;
}

#tab-win2dao-reborn.bottom-nav__card--active {
  outline: 2px solid #ff3b2f !important;
  box-shadow:
    0 0 14px rgba(255, 59, 47, 0.45),
    0 0 30px rgba(255, 59, 47, 0.2) !important;
}

