[hidden] {
  display: none !important;
}

:root {
  --bg-canvas: #0b0c0d;
  --surface-primary: #141517;
  --surface-secondary: #191b1f;
  --surface-hover: #23262b;
  --border-subtle: #24272c;
  --border-strong: #363940;
  --brand: #00e701;
  --brand-hover: #00c701;
  --text-primary: #fff;
  --text-secondary: #b6bbc2;
  --text-muted: #a9adb5;
  --door-red: #bc0000;
  --brand-primary: #53fc18;
  --card-red: #e20c41;
  --text-disabled: #555;
  --content-width: 936px;
}

* {
  box-sizing: border-box;
}

/* keeps the layout from jumping when a tab is short enough to have no scrollbar */
html {
  scrollbar-gutter: stable;
}

/*
  The design is made for about 1440 px and most sizes are fixed (cards, dialogs, header). On a bigger screen the whole
  page is enlarged in steps, so a 2K or 4K monitor does not get tiny text on a small island in the middle.
  vh and vw units grow with the zoom as well, so they are divided by --zoom where they size something.
*/
@media (min-width: 1700px) {
  html {
    --zoom: 1.2;
    zoom: var(--zoom);
  }
}

@media (min-width: 2100px) {
  html {
    --zoom: 1.45;
    zoom: var(--zoom);
  }
}

@media (min-width: 2900px) {
  html {
    --zoom: 1.9;
    zoom: var(--zoom);
  }
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.5;
}

/* Top bar */

/* the header (index.html) sticks to the top when the page is scrolled and lies over the content (the opened doors have
   z-index 2, the falling snow 50 and the dialogs are in the top layer of the browser). The star of the garland is in it. */
.site-top {
  position: sticky;
  top: 0;
  z-index: 30;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 10px 20px;
  background: var(--surface-primary);
}

.site-logo {
  color: var(--brand);
  font-family: "Silkscreen", monospace;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.1em;
  line-height: 1;
  text-decoration: none;
}

.login-link {
  padding: 7px;
  background: var(--brand);
  border-radius: 8px;
  color: var(--surface-primary);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
}

.login-link:hover {
  background: var(--brand-hover);
}
/* Garland, see garland.js */

/* The string of lights hangs right under the header (50 px) and sticks there like the header, but it lies behind the
   content: the text, the tabs and the doors go over it, so it does not disturb. z-index -1 is above the page background
   and the snow on the ground (that one comes earlier in the page). */
.garland {
  position: sticky;
  top: 50px;
  z-index: -1;
  height: 70px;
  pointer-events: none;
}

.garland-wire-holder svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* The star hangs in the middle of the garland, the whole of it under the header, behind the content. */
.garland-star {
  position: absolute;
  left: 50%;
  top: 4px;
  pointer-events: none;
  transform: translateX(-50%);
  animation: garland-star-glow 4.5s ease-in-out infinite;
}

@keyframes garland-star-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255, 230, 120, 0.45)); }
  50% { filter: drop-shadow(0 0 7px rgba(255, 230, 120, 0.9)); }
}

/* the bulbs breathe: the glow comes and goes, the bulb itself only gets a bit dimmer. They are slow and only decoration,
   so the setting for fewer animations does not stop them. */
.garland-bulb-glow,
.garland-bulb-body {
  animation: garland-bulb-breathe var(--seconds, 5s) ease-in-out var(--delay, 0s) infinite;
}

.garland-bulb-glow {
  --low: 0.05;
}

.garland-bulb-body {
  --low: 0.55;
}

@keyframes garland-bulb-breathe {
  0%, 100% { opacity: var(--low); }
  50% { opacity: 1; }
}

/* The glow of the star lives in its animation, so it is not stopped by the setting for fewer animations (it would have no
   glow at all then). It is slow and only decoration, like the bulbs. */

/* Title */

.intro {
  margin: 20px 20px 0;
  text-align: center;
}

/* The title shrinks with the width of the window (the upper limits are the sizes of a desktop) and wraps to a second line
   when even the smallest size does not fit. */
.site-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px clamp(6px, 2.2vw, 14px);
  margin: 0;
  line-height: 1;
}

.site-title-small {
  font-size: clamp(13px, 4.2vw, 20px);
  text-transform: uppercase;
}

.site-title-big {
  color: var(--brand);
  font-size: clamp(26px, 8.4vw, 40px);
}
/* the year after the title is as green as the name, but as small as the other words */
.site-title-year {
  color: var(--brand);
}

.site-tagline {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 600;
}

/* Tabs */

.tab-bar {
  display: flex;
  width: fit-content;
  max-width: calc(100% - 40px);
  margin: 20px auto 30px;
  padding: 5px;
  background: var(--surface-primary);
  border-radius: 8px;
}

.tab-button {
  padding: 10px 20px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  cursor: pointer;
}

.tab-button:hover {
  background: var(--surface-hover);
}

.tab-button.tab-active {
  background: var(--brand);
  color: var(--surface-primary);
}

main {
  max-width: 1204px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.tab-panel > h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

/* the calendar needs no heading, but screen readers still get it */
#tab-calendar > h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* the message when there is no year to show (or the calendar did not load) and the empty message of a list */
.status-message,
.empty-message {
  margin: 100px 20px 0;
  color: var(--text-muted);
  font-size: 30px;
  line-height: 1.35;
  text-align: center;
}

.status-message a {
  color: var(--brand);
}

/* The snow on the ground, see snow.js: one shape behind the page, gentle hills at the left and right edge that run into a
   strip along the bottom. vw and vh grow with the zoom of big screens, so they are divided by it. */
.snow-ground {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.snow-landscape {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: calc(40vh / var(--zoom, 1));
}

/* The scene on the hills, see scene.js. The layer has exactly the size of the hills and every figure is placed in percent of
   it, so the figures stand on the snow at every window size. They sink a little into it. Sizes follow the height of the
   window. */
.snow-scene {
  position: absolute;
  bottom: 0;
  left: 0;
  display: none;
  width: 100%;
  height: calc(40vh / var(--zoom, 1));
}

.scene-figure {
  position: absolute;
  translate: -50% 0;
}

.scene-figure svg {
  display: block;
  width: auto;
  height: 100%;
}

.scene-tree { height: calc(26vh / var(--zoom, 1)); margin-bottom: calc(-1.5vh / var(--zoom, 1)); }
.scene-tree.small { height: calc(15vh / var(--zoom, 1)); }
.scene-bush { height: calc(8vh / var(--zoom, 1)); margin-bottom: calc(-1vh / var(--zoom, 1)); }
.scene-snowman { height: calc(11vh / var(--zoom, 1)); margin-bottom: calc(-1.2vh / var(--zoom, 1)); }
.scene-team { height: calc(12vh / var(--zoom, 1)); margin-bottom: calc(-1.4vh / var(--zoom, 1)); translate: 0 0; transform-origin: 0 100%; }

/* below this width the calendar covers the whole window */
@media (min-width: 1400px) {
  .snow-scene { display: block; }
}

/* a narrow window is mostly the calendar, the snow stays lower there */
@media (max-width: 900px) {
  .snow-landscape {
    height: calc(26vh / var(--zoom, 1));
  }
}

/* the snow, see snow.js */
.snow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  pointer-events: none;
}

/* Calendar */

#tab-calendar {
  max-width: 896px;
  margin: 0 auto;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  margin-top: 20px;
}

/* the sizes inside a tile (the number, its outline) are fractions of the tile, so it looks the same at any width */
.calendar-door {
  container-type: inline-size;
  position: relative;
  display: flex;
  aspect-ratio: 1;
  overflow: hidden;
  padding: 10%;
  background:
    linear-gradient(rgba(25, 27, 31, 0.5), rgba(25, 27, 31, 0.5)),
    var(--door-texture) center / cover,
    #fff;
  /* the picture stays inside the border, so the gaps of the dashes are white: a candy cane edge */
  background-clip: padding-box, padding-box, border-box;
  border: 2px dashed var(--door-red);
  border-radius: 10.4px;
  isolation: isolate;
}

.door-number {
  position: relative;
  z-index: 5;
  align-self: flex-start;
  /* fixed size until the grid has a width, see below */
  font-size: 63px;
  font-weight: 700;
  line-height: 1;
  /* red outline around the white number, drawn behind the fill */
  -webkit-text-stroke: 8px var(--door-red);
  paint-order: stroke fill;
}

/* class set in app.js once the grid has a width */
.calendar-grid.is-laid-out .door-number {
  font-size: 40cqw;
  -webkit-text-stroke: 5cqw var(--door-red);
}

.door-progress {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  padding: 1px 8px;
  background: rgba(20, 21, 23, 0.8);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/*
  An opened door: the door leaf is swung out towards the visitor around its left edge, so it is narrow and its free side is
  bigger (it goes over the frame), and a room full of snow-white light shows next to it. The number turns with the leaf. What is in the room
  shows in a dialog after a click.
*/
.door-opened {
  --swing: -40deg;
  /* the leaf comes out of the frame towards the visitor, so it may go over the neighbours */
  z-index: 2;
  overflow: visible;
  cursor: pointer;
  background:
    radial-gradient(circle at 70% 55%, #ffffff 0%, #e6eef7 45%, #aebfd3 100%),
    #fff;
  background-clip: padding-box, border-box;
}

/* the shadow the leaf throws on the wall and the floor of the room */
.door-opened::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.55), transparent 55%);
}

.door-opened::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(25, 27, 31, 0.35), rgba(25, 27, 31, 0.75)),
    var(--door-texture) center / cover;
  border-radius: 10px;
  box-shadow: 6px 0 18px rgba(0, 0, 0, 0.6);
  transform: perspective(600px) rotateY(var(--swing));
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.door-opened .door-number {
  z-index: 5;
  transform: perspective(600px) rotateY(var(--swing));
  transition: transform 0.25s ease;
  /* the leaf turns around the left edge of the door: 13 % of the tile = 16.25 % of the number box (80 % of the tile), no cqw */
  width: 100%;
  transform-origin: -16.25% 50%;
}

/* under the mouse the door opens a bit more and gets the green outline, so it shows that it can be clicked */
.door-opened:hover,
.door-opened:focus-visible {
  --swing: -48deg;
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* a door Heni can draw in (she is logged in and it still has a winner to draw) opens the draw on click */
.door-drawable {
  cursor: pointer;
}

.door-drawable:hover,
.door-drawable:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Prizes: the heading of the design and a grid of cards, 8 of them in a row of 1164 px */

#tab-prizes {
  max-width: 1164px;
  margin: 0 auto;
}

.prizes-title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 29px;
}

.prizes-count {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 24px;
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 128px);
  gap: 20px;
  margin-top: 20px;
}

/* Info: two columns of 635 px, the text with green headings and the photo with the link to the stream */

#tab-info {
  max-width: 635px;
  margin: 0 auto;
  color: var(--text-primary);
}

/* The upper part (how to, rules, the picture and the stream) and the row with the social networks are one card, so the
   white text can be read when the snow is behind it. The two parts have the same background, the divider is the border
   on top of the row. */
.info-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 0 10px;
  padding: 24px 14px;
  background: var(--surface-secondary);
  border-radius: 8px 8px 0 0;
}

.info-text {
  padding: 0 10px;
}

.info-text section + section {
  margin-top: 20px;
}

.info-text h2 {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
}

.info-text p {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 400;
  line-height: 17px;
}

.info-text ol {
  margin: 0;
  padding-left: 24px;
  font-size: 16px;
  font-weight: 400;
  line-height: 17px;
}

.info-text li + li {
  margin-top: 0;
}

.condition-note {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
}

.info-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.info-side img {
  display: block;
  width: 235px;
  max-width: 100%;
  height: auto;
}

.info-stream {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
}

.info-stream a {
  color: var(--brand);
  text-decoration: none;
}

.info-stream a:hover {
  text-decoration: underline;
}

.info-follow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 30px;
  position: relative;
  margin-top: 0;
  padding: 26px 20px 16px;
  background: var(--surface-secondary);
  border-radius: 0 0 8px 8px;
}

/* the divider does not run from edge to edge (that would look like a footer), it is short of the card edges */
.info-follow::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--border-strong);
}

/* the sponsors: the same card and a divider like the one above the social networks */
.info-follow.has-sponsors {
  border-radius: 0;
}

.info-sponsors {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px 30px;
  position: relative;
  padding: 26px 20px 20px;
  background: var(--surface-secondary);
  border-radius: 0 0 8px 8px;
}

.info-sponsors::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--border-strong);
}

.info-sponsors p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.info-sponsors img {
  display: block;
  height: 40px;
  width: auto;
}

.info-sponsors a {
  display: block;
  border-radius: 10px;
}

.info-follow p {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
}

.info-follow img {
  display: block;
  height: 50px;
  width: auto;
}

.info-follow a {
  display: block;
  border-radius: 10px;
}

.info-follow a:hover {
  transform: translateY(-2px);
}

@media (max-width: 700px) {
  .info-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* the prizes are in the middle on a phone, with the heading above them */
  .prize-grid {
    justify-content: center;
  }

  .prizes-title,
  .prizes-count {
    text-align: center;
  }
}

/* The page between the "Log In" link and the real login */

.gate {
  max-width: 480px;
  margin: 100px auto 0;
  padding: 0 20px;
  text-align: center;
}

.gate-title {
  margin: 0 0 28px;
  font-size: 40px;
  line-height: 1.2;
}

.gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.gate-button {
  min-width: 120px;
  padding: 12px 24px;
  background: var(--brand);
  border: 0;
  border-radius: 8px;
  color: var(--surface-primary);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.gate-button-secondary {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* a big pixel "NIE" between the question and the message */
/* the pixel font leaves empty space above its capitals, the negative margin takes it back */
.gate-refusal {
  margin: -22px 0 14px;
  color: #e4473f;
  font-family: "Silkscreen", monospace;
  font-size: 88px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 5px 5px 0 #5a1612;
}

.gate-message {
  margin: 0;
  color: var(--text-secondary);
  font-size: 20px;
}

.gate-image-container {
  display: block;
  margin: 0 auto 20px;
  position: relative;
  width: min(40vw, 360px);
  height: auto;
  overflow: hidden;
}

.gate-image {
  width: 100%;
  height: auto;
  transition: transform 2.5s ease;
  transform: rotate(0);
  
}

.gate-image:hover {
  transform: scale(3) translate(7%, -3.8%);
}

/* Smaller screens */

@media (max-width: 820px) {
  .calendar-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

@media (max-width: 520px) {
  .site-logo {
    font-size: 28px;
  }

  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

/* the logo of the authors stays in the bottom right corner, quiet and above the content but under the dialogs */
.site-credit {
  position: fixed;
  right: 20px;
  bottom: 16px;
  z-index: 10;
  width: 45px;
  height: auto;
  opacity: 0.85;
  pointer-events: none;
  user-select: none;
}
