/* Advent arcade doors (public/advent.js). Loaded after games.css and christmas.css. */
.ad-board { position: relative; }
.ad-stage { position: relative; overflow: hidden; border-radius: 20px; background: var(--night); box-shadow: 0 24px 60px -30px rgb(10 12 23 / .6), inset 0 0 0 1px rgb(224 176 82 / .25); }
.ad-canvas { display: block; width: 100%; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.ad-drop .ad-canvas, .ad-stack .ad-canvas, .ad-dash .ad-canvas { cursor: pointer; }
.ad-snow .ad-canvas { cursor: crosshair; }

/* start card over the stage */
.ad-over { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 16px; background: rgb(10 12 23 / .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-radius: 20px; }
.ad-over[hidden] { display: none; }
.ad-card { width: min(100%, 360px); padding: 24px 22px 20px; border-radius: 20px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 30px 80px rgb(10 12 23 / .4); animation: ad-in .45s cubic-bezier(.2, .8, .2, 1); }
@keyframes ad-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.ad-kicker { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #b8862a; }
.ad-card h2 { margin: 6px 0 10px; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: .95; letter-spacing: -0.03em; }
.ad-hint { font-size: 15px; line-height: 1.5; color: var(--muted-light); }
.ad-best { margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--green); }
.ad-go { width: 100%; height: 50px; margin-top: 18px; font-size: 16px; }
.gm-again { width: 100%; height: 46px; margin-top: 22px; }
.gm-again + .gm-share { margin-top: 10px; }

/* String the Lights */
.ad-lights { padding: 14px; background: var(--night); }
.ad-lights-head { display: flex; justify-content: space-between; margin: 0 4px 10px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #c3c7d8; font-variant-numeric: tabular-nums; }
.ad-lights-head span:last-child { color: var(--gold-2); }
.ad-lights-board { touch-action: none; max-width: 100%; }
.ad-l-ground { fill: #0e1430; }
.ad-l-cell { fill: #161d38; }
.ad-l-wire { fill: none; stroke-width: .3; stroke-linecap: round; stroke-linejoin: round; opacity: .85; pointer-events: none; }
.ad-l-wire.is-done { opacity: 1; stroke-width: .14; filter: drop-shadow(0 0 .06px currentColor); }
.ad-l-mini { pointer-events: none; filter: drop-shadow(0 0 .08px #fff6df); animation: ad-twinkle 1.6s ease-in-out infinite alternate; }
.ad-l-bulb { pointer-events: none; }
.ad-l-bulb ellipse { opacity: .55; transition: opacity .25s, filter .25s; }
.ad-l-cap { fill: #6b7189; }
.ad-l-bulb.is-on ellipse { opacity: 1; filter: drop-shadow(0 0 .14px #fff6df); }
@keyframes ad-twinkle { from { opacity: .55; } to { opacity: 1; } }
.ad-lights.is-flash { animation: ad-flash .7s ease-out; }
@keyframes ad-flash { 30% { box-shadow: 0 0 0 4px var(--gold-2), 0 0 60px rgb(243 199 95 / .6); } }

/* Cookie Icing */
.ad-icing { padding: 18px 16px 22px; background: radial-gradient(120% 90% at 50% 0%, #1d2a52, var(--night)); }
.ad-icing-status { margin-bottom: 14px; text-align: center; font-family: var(--serif); font-size: 28px; line-height: 1.1; color: var(--paper); min-height: 1.2em; }
.ad-icing-tray { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 360px; margin: 0 auto; }
.ad-cookie { position: relative; aspect-ratio: 1; padding: 6px; border: 0; border-radius: 50%; background: none; cursor: pointer; transition: transform .12s; -webkit-tap-highlight-color: transparent; }
.ad-cookie svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ad-cookie-base { fill: #c48a52; }
.ad-cookie-rim { fill: none; stroke: #9c6635; stroke-width: 3; stroke-dasharray: 2 6; }
.ad-cookie-ice { fill: var(--ice); opacity: .35; stroke: #fffaf2; stroke-width: 2.5; stroke-linejoin: round; transition: opacity .12s, filter .12s; }
.ad-cookie.is-lit { transform: scale(1.06); }
.ad-cookie.is-lit .ad-cookie-ice { opacity: 1; filter: drop-shadow(0 0 10px var(--ice)); }
.ad-cookie:active { transform: scale(.96); }
.ad-cookie.is-wrong { animation: ad-shake .4s; }
@keyframes ad-shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.ad-cookie.is-wrong .ad-cookie-ice { fill: #b3261e; opacity: .8; }
.ad-cookie.is-hint .ad-cookie-ice { opacity: 1; animation: ad-twinkle .4s ease-in-out 3 alternate; }
.ad-cookie-key { position: absolute; right: 8%; bottom: 8%; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgb(10 12 23 / .6); color: #c3c7d8; font-size: 11px; font-weight: 600; }
.ad-icing.is-watching .ad-cookie { cursor: default; }
@media (hover: none) { .ad-cookie-key { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .ad-card, .ad-l-mini, .ad-lights.is-flash, .ad-cookie.is-hint .ad-cookie-ice { animation: none; }
}

/* tool buttons under a stage */
.ad-tools { display: flex; justify-content: center; gap: 8px; padding: 12px; background: var(--night); }
.ad-tools.is-hidden { visibility: hidden; }
.ad-tool { height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--night-line); background: var(--night-2); color: var(--paper); font: 500 14px var(--sans); cursor: pointer; transition: border-color .15s, background-color .15s; }
.ad-tool:hover:not(:disabled) { border-color: var(--gold); }
.ad-tool:disabled { opacity: .4; cursor: default; }
.ad-tool.is-solid { background: var(--gold-2); border-color: var(--gold-2); color: var(--night); }
.ad-dl { width: 100%; height: 46px; margin-top: 18px; text-decoration: none; }

/* Ornament Sort */
.ad-sort { padding: 14px 14px 22px; background: radial-gradient(120% 90% at 50% 0%, #1d2a52, var(--night)); }
.ad-sort-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; font-size: 14px; color: #c3c7d8; font-variant-numeric: tabular-nums; }
.ad-sort-head strong { color: var(--paper); font-size: 17px; }
.ad-sort-elf { color: var(--gold-2); font-weight: 600; }
.ad-shelf { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 46px 14px; padding: 34px 6px 0; }
.ad-tube {
  height: clamp(150px, 34vw, 196px); padding: 0; border: 2px solid rgb(223 233 239 / .35); border-top-color: transparent; border-radius: 4px 4px 30px 30px;
  background: linear-gradient(90deg, rgb(255 255 255 / .06), rgb(255 255 255 / .02) 40%, rgb(255 255 255 / .08)); cursor: pointer; transition: border-color .15s, background-color .15s;
}
.ad-tube:hover { border-color: rgb(243 199 95 / .6); border-top-color: transparent; }
.ad-tube.is-no { animation: ad-shake .35s; }
.ad-orb {
  position: absolute; z-index: 2; border-radius: 50%; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgb(255 255 255 / .7), transparent 32%), var(--c);
  box-shadow: inset 0 -6px 10px rgb(0 0 0 / .22), 0 4px 10px rgb(0 0 0 / .3);
  transition: left .32s cubic-bezier(.3, .8, .3, 1), top .32s cubic-bezier(.3, .8, .3, 1);
}
.ad-orb::before { content: ''; position: absolute; left: 50%; top: -12%; width: 26%; height: 16%; transform: translateX(-50%); border-radius: 2px; background: #c9ced6; }
.ad-orb.is-up { filter: drop-shadow(0 0 10px var(--c)); }
.ad-orb.is-done { animation: ad-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes ad-pop { 50% { transform: translateX(-50%) scale(1.18); } }
.ad-sort.is-won .ad-orb { filter: drop-shadow(0 0 8px var(--c)); }

/* Wrap It Up */
.ad-wrap { padding: 14px; background: var(--night); }
.ad-wrap-board { touch-action: none; max-width: 100%; overflow: visible; }
.ad-wrap-base { fill: #f3f1ec; }
.ad-wrap-slot { fill: none; stroke: rgb(10 12 23 / .14); stroke-width: .03; stroke-dasharray: .08 .07; }
.ad-wrap-rule { stroke: rgb(243 241 236 / .18); stroke-width: .02; }
.ad-piece { cursor: grab; transition: transform .2s cubic-bezier(.3, .9, .3, 1); }
.ad-piece.is-drag { cursor: grabbing; transition: none; filter: drop-shadow(0 .1px .14px rgb(0 0 0 / .5)); }
.ad-piece-cell { stroke: rgb(10 12 23 / .3); stroke-width: .03; }
.ad-piece-ribbon { fill: none; stroke: #fffaf2; stroke-width: .09; opacity: .9; pointer-events: none; }
.ad-piece-bow { fill: none; stroke: #fffaf2; stroke-width: .07; stroke-linejoin: round; pointer-events: none; }
.ad-wrap.is-flash { animation: ad-flash .7s ease-out; }
