/* The advent calendar of December 2006 (habbochristmas.com/06/main.swf) over its 700 × 1100
   world. Places are the SWF's (public/advent/2006/README.md); the stage is as wide as its box
   allows, up to the world's 700 pixels, and 560 tall, instead of the SWF's 413 × 400 (the owner's
   choice, 25/11). */
.advent { width: 100%; max-width: 700px; margin: 0 auto; }
/* What the script hides stays hidden, whatever its display (the OK button is a block). */
.advent [hidden] { display: none; }
.advent-stage { position: relative; width: 100%; height: 560px; overflow: hidden; background: #22598c; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.advent-stage img { image-rendering: pixelated; }
.advent-world { position: absolute; left: 0; top: 0; width: 700px; height: 1100px; background: url(2006/scene.png) no-repeat 0 0; }
.advent-intro { position: absolute; left: 0; top: 0; pointer-events: none; }

/* A door (CalendarButton): its dotted frame is the button; under it the square of bg_mc
   (67 × 67, white at 50 %), over it the number and, on a locked click, the padlock. */
.advent-door { position: absolute; width: 79px; height: 78px; margin: -5px 0 0 -4px; padding: 0; border: 0; background: none; cursor: pointer; opacity: 0; }
.advent-door.is-in { opacity: 1; transition: opacity 200ms cubic-bezier(.39, .575, .565, 1); }
/* calBtns_mc: hidden while the world scrolls, faded up in 300 ms (fadeButtonsUp). */
.advent-world.is-off .advent-door.is-in { opacity: 0; transition: opacity 300ms cubic-bezier(.39, .575, .565, 1); pointer-events: none; }
.advent-door-bg { position: absolute; left: 5px; top: 6px; width: 67px; height: 67px; }
.advent-door-frame { position: absolute; left: 0; top: 0; }
.advent-door-number { position: absolute; left: 8px; top: 9px; }
.advent-door-lock { position: absolute; left: 20px; top: 13px; display: none; }
.advent-door:hover .advent-door-bg, .advent-door:focus-visible .advent-door-bg { background: rgba(255, 255, 255, .15); }
/* A door already opened: greyed (the owner's choice, 25/11). */
.advent-door.is-opened .advent-door-bg { background: rgba(96, 96, 96, .55); }
.advent-door.is-opened:hover .advent-door-bg, .advent-door.is-opened:focus-visible .advent-door-bg { background: rgba(128, 128, 128, .55); }
.advent-door.is-locking .advent-door-bg { background: rgba(164, 228, 255, .5); }
.advent-door.is-locking .advent-door-lock { display: block; }
.advent-door:focus { outline: 0; }

/* The arrows (au_mc, ad_mc, al_mc, ar_mc) and the 50-pixel edges that scroll the world. */
.advent-scroll { position: absolute; width: 38px; height: 38px; opacity: 0; transition: opacity 300ms cubic-bezier(.39, .575, .565, 1); pointer-events: none; background: url(2006/arrow.png) no-repeat; }
.advent-scroll img { display: none; }
.advent-scroll.is-on { background-image: url(2006/arrow_on.png); }
.advent-stage.is-active .advent-scroll { opacity: 1; }
.advent-scroll-up { left: calc(50% - 19px); top: 0; }
.advent-scroll-down { left: calc(50% - 19px); top: 522px; transform: rotate(180deg); }
.advent-scroll.is-blink-off { visibility: hidden; }

/* The red window of a door's clip (anim_mc), here Rasta Santa's present, in the middle. */
.advent-window { position: absolute; left: calc(50% - 206px); top: 145px; width: 412px; height: 269px; }
.advent-window-panel { position: absolute; left: 0; top: 0; }
.advent-window-santa { position: absolute; left: 14px; top: 50px; }
.advent-window-text { position: absolute; left: 168px; top: 132px; width: 226px; margin: 0; color: #fff; font: bold 11px/15px Verdana, Arial, sans-serif; text-align: center; }
.advent-window-text a { color: #ffcc33; }
.advent-window-button { position: absolute; left: 318px; top: 233px; display: block; height: 24px; padding: 0 20px; background: url(2006/button_m.png) repeat-x 0 0; color: #000; font: bold 11px/24px Verdana, Arial, sans-serif; text-decoration: none; }
.advent-window-button::before, .advent-window-button::after { content: ''; position: absolute; top: 0; width: 20px; height: 24px; }
.advent-window-button::before { left: -2px; background: url(2006/button_l.png) no-repeat; }
.advent-window-button::after { right: -2px; background: url(2006/button_r.png) no-repeat; }
.advent-window-button span { position: relative; z-index: 1; }
.advent-window-button:hover { text-decoration: none; color: #333; }
/* closeBtn: on the window's top right corner. The SWF had it 72 pixels higher, in the corner
   of the door's animation (swf/default.swf and dayN.swf, played above the window), which the
   archive does not have. */
.advent-close { position: absolute; left: calc(50% + 181px); top: 151px; width: 17px; height: 17px; }

/* The present of the day (giveget_mc, its frame f1_mc, 256 × 230): where the SWF had it on its
   stage, 83 pixels right and 37 above the red window. On the frame, the picture's place
   (ph_mc, 136 × 113 of red #ad0000) under its brown border; the title on the ribbon (tf0_1,
   Volter Bold 9, #7b1c12 over its white copy tf0_2, a pixel lower and to the right, centred
   on 146 pixels), and the text (tf1, Volter 9, white, 210 pixels, 2 pixels of leading). The
   SWF loaded an image of each present (icons/…, lost); here, the furni at the rooms' size,
   pixel for pixel (public/hk/furni-preview). The frame fades in over 500 ms on Tweener's sine;
   for a door just opened, it first shows the present's box (one of the game's six, the one
   that goes to the hand), which shakes until the hotel has put it there, then bursts in the
   SWF's stars and flakes, and the furni fades in (the owner's choice, 25/11). Its close
   button, in the stage's corner in the SWF, is in the frame's. */
@font-face { font-family: AdventVolter; src: url(fonts/volter.woff2) format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: AdventVolter; src: url(fonts/volter-bold.woff2) format('woff2'); font-weight: 700; font-display: block; }
.advent-present { position: absolute; left: calc(50% - 124px); top: 108px; width: 256px; height: 230px; font-family: AdventVolter, Verdana, sans-serif; font-size: 9px; -webkit-font-smoothing: none; opacity: 0; }
.advent-present.is-in { opacity: 1; transition: opacity 500ms cubic-bezier(.39, .575, .565, 1); }
.advent-present-frame { position: absolute; left: 0; top: 0; }
.advent-present-picture { position: absolute; left: 60px; top: 26px; width: 136px; height: 113px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: #ad0000; }
.advent-present-picture img { max-width: 136px; max-height: 113px; opacity: 0; }
.advent-present-picture img.is-in { opacity: 1; transition: opacity 500ms cubic-bezier(.39, .575, .565, 1) 150ms; }
/* The box: centred, shaking a few pixels and hopping (whole pixels, so that it stays sharp),
   then gone in the burst. */
.advent-present-picture .advent-present-box { position: absolute; left: 36px; top: 24px; max-width: none; max-height: none; opacity: 1; }
.advent-present-box.is-shaking { animation: advent-shake 1100ms steps(1, end) infinite; }
.advent-present-box.is-gone { animation: advent-burst 250ms ease-out forwards; }
.advent-present-burst { position: absolute; left: 128px; top: 82px; width: 0; height: 0; }
.advent-present-burst img { position: absolute; left: 0; top: 0; image-rendering: pixelated; }
@keyframes advent-shake {
	0%, 50%, 100% { transform: translate(0, 0); }
	6% { transform: translate(-3px, 0); }
	12% { transform: translate(3px, -2px); }
	18% { transform: translate(-2px, -4px); }
	24% { transform: translate(2px, -2px); }
	30% { transform: translate(-1px, 0); }
	36% { transform: translate(1px, 0); }
}
@keyframes advent-burst { to { transform: translate(0, -6px); opacity: 0; } }
.advent-present-border { position: absolute; left: 58px; top: 24px; }
.advent-present-title { position: absolute; left: 57px; top: 5px; width: 146px; color: #7b1c12; font-weight: 700; line-height: 11px; text-align: center; white-space: nowrap; overflow: hidden; }
.advent-present-title.is-shadow { left: 58px; top: 6px; color: #fff; }
.advent-present-text { position: absolute; left: 25px; top: 148px; width: 210px; height: 62px; margin: 0; color: #fff; line-height: 11px; overflow: hidden; }
.advent-present-close { position: absolute; left: 233px; top: 6px; width: 17px; height: 17px; }

.advent-note { margin: 6px 0 0; font-size: 11px; color: #666; text-align: center; }

/* Rasta Santa's greeting (advent_greeting): its 209-pixel picture on the left of his words,
   as in 2006; in a column narrower than the picture and words side by side, the picture
   above them, shrunk to the column's width. */
.advent-greeting { container-type: inline-size; }
@container (max-width: 400px) {
	.advent-greeting-picture { float: none; display: block; width: 100%; max-width: 209px; height: auto; margin: 0 auto 10px; }
	.advent-greeting-gap { display: none; }
}

/* The advent day box (advent_day): its tree on the left of its words, as in 2006; in a column
   too narrow for both, the tree under the words. */
.advent-day { container-type: inline-size; }
@container (max-width: 300px) {
	.advent-day-inner { display: flex; flex-direction: column; }
	.advent-day-tree { order: 1; float: none; align-self: center; margin: 4px 0 0; }
}
