:root {
  --scr-emerald: #063f35;
  --scr-emerald-deep: #021d19;
  --scr-felt: #0a5b48;
  --scr-gold: #f4d58a;
  --scr-gold-deep: #bc8437;
  --scr-ivory: #fff9e9;
}

.scr-modal-open { overflow: hidden; }

.scr-backdrop,
.scr-backdrop * { box-sizing: border-box; }

.scr-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 28%, rgba(21, 117, 91, .22), transparent 45%),
    rgba(1, 12, 10, .86);
  opacity: 0;
  transition: opacity 180ms ease;
}

.scr-backdrop.is-visible { opacity: 1; }

.scr-card {
  position: relative;
  width: min(92vw, 520px);
  overflow: hidden;
  padding: 184px 40px 34px;
  border: 1px solid rgba(244, 213, 138, .52);
  border-radius: 28px;
  color: var(--scr-ivory);
  text-align: center;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background:
    linear-gradient(180deg, rgba(10, 91, 72, .96), rgba(2, 29, 25, .99)),
    var(--scr-emerald-deep);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, .72),
    inset 0 0 0 5px rgba(244, 213, 138, .06),
    0 0 70px rgba(23, 139, 105, .18);
  transform: translateY(16px) scale(.98);
  transition: transform 180ms ease;
}

.scr-backdrop.is-visible .scr-card { transform: none; }

.scr-card::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(244, 213, 138, .16);
  border-radius: 20px;
}

.scr-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(244, 213, 138, .34);
  border-radius: 50%;
  color: var(--scr-ivory);
  font-size: 28px;
  line-height: 1;
  background: rgba(2, 29, 25, .78);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.scr-close:hover,
.scr-close:focus-visible {
  color: var(--scr-emerald-deep);
  background: var(--scr-gold);
  transform: rotate(8deg);
  outline: 3px solid rgba(255, 255, 255, .28);
  outline-offset: 2px;
}

.scr-salon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 168px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(244, 213, 138, .28), transparent 52%),
    repeating-radial-gradient(ellipse at 50% 118%, transparent 0 24px, rgba(244, 213, 138, .08) 25px 26px),
    linear-gradient(135deg, #031b17, #0c6b53 52%, #031b17);
  border-bottom: 1px solid rgba(244, 213, 138, .35);
}

.scr-table-line {
  position: absolute;
  left: 50%;
  bottom: -58px;
  width: 330px;
  height: 140px;
  border: 2px solid rgba(244, 213, 138, .38);
  border-radius: 50%;
  transform: translateX(-50%);
}

.scr-card-mark {
  position: absolute;
  display: grid;
  width: 66px;
  height: 90px;
  place-items: center;
  border: 1px solid rgba(244, 213, 138, .6);
  border-radius: 9px;
  color: #10251f;
  font-family: Georgia, serif;
  font-size: 35px;
  background: linear-gradient(145deg, #fffdf4, #e8dfc8);
  box-shadow: 0 12px 25px rgba(0, 0, 0, .38);
}

.scr-spade { left: calc(50% - 112px); top: 52px; transform: rotate(-18deg); }
.scr-heart { left: calc(50% - 57px); top: 34px; color: #a52228; transform: rotate(-6deg); }
.scr-club { left: calc(50% + 1px); top: 34px; transform: rotate(7deg); }
.scr-diamond { left: calc(50% + 58px); top: 52px; color: #a52228; transform: rotate(19deg); }

.scr-eyebrow {
  position: relative;
  z-index: 1;
  color: var(--scr-gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .24em;
}

.scr-title {
  position: relative;
  z-index: 1;
  margin: 8px 0 18px;
  color: var(--scr-ivory);
  font-size: clamp(27px, 7vw, 38px);
  line-height: 1.2;
  letter-spacing: .08em;
}

.scr-game {
  position: relative;
  z-index: 1;
  margin: 0 auto 18px;
  padding: 14px;
  border: 1px solid rgba(244, 213, 138, .3);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(244, 213, 138, .12), transparent 65%),
    rgba(1, 20, 17, .52);
}

.scr-hand {
  position: relative;
  height: 114px;
  perspective: 700px;
}

.scr-deal-card {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 70px;
  height: 96px;
  filter: drop-shadow(0 11px 10px rgba(0, 0, 0, .32));
  transition: transform 520ms cubic-bezier(.2, .8, .2, 1);
}

.scr-deal-left { transform: translateX(-84px) rotate(-10deg); }
.scr-deal-right { transform: translateX(14px) rotate(10deg); }

.scr-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 560ms cubic-bezier(.2, .8, .2, 1);
}

.scr-card-back,
.scr-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 2px solid var(--scr-gold);
  border-radius: 9px;
  backface-visibility: hidden;
  font-family: Georgia, serif;
}

.scr-card-back {
  color: var(--scr-gold);
  font-size: 25px;
  background:
    repeating-linear-gradient(45deg, rgba(244, 213, 138, .14) 0 3px, transparent 3px 8px),
    #073b31;
  box-shadow: inset 0 0 0 4px #073b31, inset 0 0 0 5px rgba(244, 213, 138, .4);
}

.scr-card-face {
  color: #151616;
  font-size: 42px;
  background: linear-gradient(145deg, #fffdf4, #e8dfc8);
  transform: rotateY(180deg);
}

.scr-face-red { color: #a52228; }

.scr-game-chip {
  position: absolute;
  left: 50%;
  bottom: 0;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 4px dashed rgba(255, 255, 255, .72);
  border-radius: 50%;
  color: #fff1bd;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(145deg, #c4923f, #6e4618);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  opacity: .52;
  transform: translate(-50%, 18px) scale(.74);
  transition: transform 440ms ease, opacity 440ms ease, box-shadow 440ms ease;
}

.scr-game.is-dealing .scr-deal-left { animation: scrDealLeft 700ms ease both; }
.scr-game.is-dealing .scr-deal-right { animation: scrDealRight 760ms 100ms ease both; }

@keyframes scrDealLeft {
  0% { transform: translate(42px, -60px) rotate(18deg); opacity: 0; }
  100% { transform: translateX(-84px) rotate(-10deg); opacity: 1; }
}

@keyframes scrDealRight {
  0% { transform: translate(-40px, -60px) rotate(-18deg); opacity: 0; }
  100% { transform: translateX(14px) rotate(10deg); opacity: 1; }
}

.scr-game.is-dealing .scr-card-inner { animation: scrCardTension 380ms 2 alternate ease-in-out; }
@keyframes scrCardTension { to { transform: translateY(-5px); } }

.scr-game.is-revealed .scr-card-inner { transform: rotateY(180deg); }
.scr-game.is-revealed .scr-deal-left { transform: translateX(-91px) rotate(-14deg); }
.scr-game.is-revealed .scr-deal-right { transform: translateX(21px) rotate(14deg); }
.scr-game.is-revealed .scr-game-chip {
  opacity: 1;
  transform: translate(-50%, 8px) scale(1);
  box-shadow: 0 0 28px rgba(244, 213, 138, .5), 0 9px 18px rgba(0, 0, 0, .45);
}

.scr-game-button {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid #fff0bb;
  border-radius: 12px;
  color: #14241f;
  font: 900 16px/1.3 "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: linear-gradient(105deg, #b98132, #f8e2a5 48%, #c38c3c);
  box-shadow: 0 9px 20px rgba(0, 0, 0, .3);
  cursor: pointer;
  transition: transform 150ms ease, filter 150ms ease;
}

.scr-game-button:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.scr-game-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.scr-game-button:disabled { cursor: default; filter: saturate(.82); }

.scr-game-result {
  min-height: 22px;
  margin: 8px 0 0;
  color: rgba(216, 233, 227, .72);
  font-size: 13px;
  font-weight: 700;
}

.scr-game.is-revealed .scr-game-result {
  color: #fff1bd;
  text-shadow: 0 0 12px rgba(244, 213, 138, .35);
}

.scr-offer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 9px;
  padding: 18px 12px;
  border: 1px solid rgba(244, 213, 138, .35);
  border-radius: 18px;
  background: rgba(1, 20, 17, .48);
  box-shadow: inset 0 0 24px rgba(244, 213, 138, .06);
}

.scr-offer strong {
  color: var(--scr-gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 11vw, 62px);
  line-height: .9;
  text-shadow: 0 3px 20px rgba(244, 213, 138, .22);
}

.scr-offer .scr-bonus {
  color: #fff1bd;
  text-shadow: 0 0 24px rgba(244, 213, 138, .4);
}

.scr-offer-label,
.scr-unit {
  color: #d8e9e3;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}

.scr-arrow { color: var(--scr-gold-deep); font-size: 26px; }

.scr-desc {
  position: relative;
  z-index: 1;
  max-width: 390px;
  margin: 20px auto;
  color: #d3e2dd;
  font-size: 15px;
  line-height: 1.75;
}

.scr-cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 14px 20px;
  border: 1px solid #fff0bb;
  border-radius: 14px;
  color: #14241f;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
  background: linear-gradient(105deg, #b98132, #f8e2a5 48%, #c38c3c);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .32);
  transition: transform 150ms ease, filter 150ms ease;
}

.scr-cta span:last-child { font-family: Georgia, serif; font-size: 29px; line-height: .5; }
.scr-cta:hover { transform: translateY(-2px); filter: brightness(1.06); }
.scr-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.scr-note {
  position: relative;
  z-index: 1;
  margin: 15px 0 0;
  color: rgba(216, 233, 227, .68);
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 560px) {
  .scr-backdrop { align-items: end; padding: 0; }
  .scr-card {
    width: 100%;
    max-height: 94vh;
    overflow-y: auto;
    padding: 154px 20px 24px;
    border-radius: 26px 26px 0 0;
    transform: translateY(100%);
  }
  .scr-backdrop.is-visible .scr-card { transform: translateY(0); }
  .scr-salon { height: 140px; }
  .scr-card-mark { width: 56px; height: 76px; font-size: 29px; }
  .scr-spade { left: calc(50% - 94px); top: 45px; }
  .scr-heart { left: calc(50% - 48px); top: 30px; }
  .scr-club { left: calc(50% + 1px); top: 30px; }
  .scr-diamond { left: calc(50% + 48px); top: 45px; }
  .scr-offer { gap: 6px; padding: 16px 7px; }
  .scr-offer-label, .scr-unit { font-size: 13px; }
}

@media (max-width: 350px) {
  .scr-offer strong { font-size: 35px; }
  .scr-arrow { font-size: 20px; }
  .scr-title { font-size: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  .scr-backdrop,
  .scr-card,
  .scr-close,
  .scr-cta,
  .scr-deal-card,
  .scr-card-inner,
  .scr-game-chip,
  .scr-game-button { transition: none; animation: none; }
}
