/*
 * MyBB Adventskalender
 *
 * Das Plugin bringt nur Layout und Funktionszustände mit. Farben, Schriften,
 * Flächen und Schaltflächen werden aus thead, trow1, trow2 und button des
 * jeweils aktiven MyBB-Themes übernommen.
 */
:root {
  --adventx-head-bg: var(--adventx-mybb-head-bg, transparent);
  --adventx-head-image: var(--adventx-mybb-head-image, none);
  --adventx-head-color: var(--adventx-mybb-head-color, inherit);
  --adventx-head-border: var(--adventx-mybb-head-border, currentColor);
  --adventx-row1-bg: var(--adventx-mybb-row1-bg, transparent);
  --adventx-row1-image: var(--adventx-mybb-row1-image, none);
  --adventx-row1-color: var(--adventx-mybb-row1-color, inherit);
  --adventx-row1-border: var(--adventx-mybb-row1-border, currentColor);
  --adventx-row2-bg: var(--adventx-mybb-row2-bg, transparent);
  --adventx-row2-image: var(--adventx-mybb-row2-image, none);
  --adventx-row2-color: var(--adventx-mybb-row2-color, inherit);
  --adventx-row2-border: var(--adventx-mybb-row2-border, currentColor);
  --adventx-button-bg: var(--adventx-mybb-button-bg, transparent);
  --adventx-button-image: var(--adventx-mybb-button-image, none);
  --adventx-button-color: var(--adventx-mybb-button-color, inherit);
  --adventx-button-border: var(--adventx-mybb-button-border, currentColor);
}

.adventx-wrap,
.adventx-panel { box-sizing: border-box; max-width: 1120px; margin: 24px auto; padding: 0 16px; color: var(--adventx-row1-color); }
.adventx-hero,
.adventx-panel__head { box-sizing: border-box; padding: 14px 18px; margin-bottom: 12px; color: var(--adventx-head-color); border: 1px solid var(--adventx-head-border); background-color: var(--adventx-head-bg); background-image: var(--adventx-head-image); }
.adventx-kicker { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; line-height: 1.4; }
.adventx-hero h1,
.adventx-panel h1 { margin: 0 0 5px; color: inherit; font-size: clamp(18px, 2vw, 24px); line-height: 1.2; }
.adventx-intro,
.adventx-panel__head p { max-width: 760px; margin: 4px 0 0; color: inherit; line-height: 1.5; }
.adventx-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.adventx-tabs .is-active { font-weight: 700; }

.adventx-wrap .button,
.adventx-panel .button,
.adventx-header-link.button,
.adventx-launcher.button { box-sizing: border-box; color: var(--adventx-button-color) !important; border-color: var(--adventx-button-border); border-radius: 0; background-color: var(--adventx-button-bg); background-image: var(--adventx-button-image); box-shadow: none; font: inherit; line-height: normal; text-decoration: none !important; }
.adventx-wrap .button:hover,
.adventx-panel .button:hover,
.adventx-header-link.button:hover,
.adventx-launcher.button:hover { filter: brightness(1.08); }

.adventx-header-tools { box-sizing: border-box; display: flex; justify-content: flex-end; width: 100%; max-width: 1120px; margin: 10px auto 0; padding: 0 16px; }
.adventx-header-link { display: inline-flex; align-items: center; gap: 7px; }
.adventx-mini-calendar { box-sizing: border-box; display: flex; align-items: center; gap: 14px; max-width: 1120px; margin: 8px auto 18px; padding: 11px 16px; color: var(--adventx-row1-color); border: 1px solid var(--adventx-row1-border); background-color: var(--adventx-row1-bg); background-image: var(--adventx-row1-image); }
.adventx-mini-title { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; padding-right: 14px; border-right: 1px solid var(--adventx-row1-border); color: inherit !important; font-weight: 700; text-decoration: none !important; }
.adventx-mini-days { display: grid; flex: 1 1 auto; grid-template-columns: repeat(auto-fit, minmax(22px, 1fr)); gap: 3px; }
.adventx-mini-day { display: grid; min-width: 0; height: 25px; place-items: center; color: inherit !important; border: 1px solid var(--adventx-row1-border); background: transparent; font-size: 10px; font-weight: 700; text-decoration: none !important; }
.adventx-mini-day.is-today { font-weight: 900; outline: 2px solid currentColor; outline-offset: -2px; }
.adventx-mini-day.is-locked { opacity: .5; }

.adventx-calendar { display: grid; grid-template-columns: repeat(auto-fit, 150px); justify-content: center; align-items: start; gap: 16px; padding: 18px 0; }
.adventx-day,
.adventx-door { width: 150px; height: 150px; }
.adventx-day { position: relative; min-width: 0; }
.adventx-door { position: relative; isolation: isolate; display: block; box-sizing: border-box; overflow: hidden; color: var(--adventx-row1-color) !important; border: 1px solid var(--adventx-row1-border); background-color: var(--adventx-row1-bg); background-image: var(--adventx-row1-image); text-decoration: none !important; }
.adventx-day:nth-child(even) .adventx-door { color: var(--adventx-row2-color) !important; border-color: var(--adventx-row2-border); background-color: var(--adventx-row2-bg); background-image: var(--adventx-row2-image); }
.adventx-door__image { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.adventx-door__shade { position: absolute; z-index: 1; inset: 0; background: rgba(0, 0, 0, .18); }
.adventx-day:not(.has-image) .adventx-door__shade,
.adventx-door__icon { display: none; }
.adventx-door__number { position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%); color: inherit; font-size: 38px; font-weight: 700; line-height: 1; text-shadow: none; }
.adventx-day.has-image .adventx-door__number { color: #fff; text-shadow: 0 1px 3px #000; }
.adventx-day.is-open .adventx-door { cursor: pointer; }
.adventx-day.is-open .adventx-door:hover,
.adventx-day.is-open .adventx-door:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.adventx-day.is-locked { opacity: .6; }
.adventx-day.is-locked .adventx-door { cursor: default; }
.adventx-day.is-today .adventx-door,
.adventx-day.is-selected .adventx-door { outline: 3px double currentColor; outline-offset: 2px; }

.adventx-modal { position: fixed; z-index: 2147483000 !important; inset: 0; display: grid; box-sizing: border-box; place-items: center; padding: 24px; }
.adventx-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); cursor: default; }
.adventx-open-day { position: relative; z-index: 1; width: min(680px, 100%); max-height: calc(100vh - 48px); overflow: hidden; color: var(--adventx-row1-color); border: 1px solid var(--adventx-row1-border); background-color: var(--adventx-row1-bg); background-image: var(--adventx-row1-image); }
.adventx-open-day > header { position: relative; padding: 12px 48px 11px 16px; color: var(--adventx-head-color); border-bottom: 1px solid var(--adventx-head-border); background-color: var(--adventx-head-bg); background-image: var(--adventx-head-image); }
.adventx-open-day > header h2 { margin: 0; color: inherit; font-size: 18px; line-height: 1.25; }
.adventx-open-day > header > a { position: absolute; right: 12px; top: 10px; display: grid; width: 28px; height: 28px; place-items: center; color: inherit; text-decoration: none; }
.adventx-open-day__content { max-height: calc(100vh - 155px); overflow-y: auto; overscroll-behavior: contain; }
body.adventx-modal-open { overflow: hidden; }

.adventx-entry { padding: 14px 16px; }
.adventx-entry + .adventx-entry { border-top: 1px solid var(--adventx-row1-border); }
.adventx-entry__type { font-size: 10px; font-weight: 700; text-transform: uppercase; }
.adventx-entry h2 { margin: 3px 0 8px; color: inherit; font-size: 16px; }
.adventx-entry__content { color: inherit; line-height: 1.5; overflow-wrap: anywhere; }
.adventx-entry__image { display: block; width: 100%; max-height: 520px; object-fit: cover; margin: 12px 0; border: 1px solid var(--adventx-row1-border); }
.adventx-claimed,
.adventx-login { display: inline-block; margin-top: 10px; font-style: italic; }

.adventx-help { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.adventx-help article,
.adventx-option,
.adventx-year,
.adventx-editor,
.adventx-season-control,
.adventx-preparation-banner,
.adventx-profile-awards { box-sizing: border-box; color: var(--adventx-row1-color); border: 1px solid var(--adventx-row1-border); background-color: var(--adventx-row1-bg); background-image: var(--adventx-row1-image); }
.adventx-help article { position: relative; padding: 20px; }
.adventx-help article > b { position: absolute; right: 16px; top: 8px; font-size: 36px; opacity: .18; }
.adventx-help h2 { margin-top: 0; color: inherit; font-size: 18px; }
.adventx-help p { color: inherit; line-height: 1.6; }
.adventx-options { display: grid; gap: 10px; margin-bottom: 16px; }
.adventx-option { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; cursor: pointer; }
.adventx-option > span { display: grid; gap: 3px; }
.adventx-option small { color: inherit; opacity: .8; }
.adventx-unlocked,
.adventx-locked { font-size: 10px !important; font-weight: 700; text-transform: uppercase; }
.adventx-option input { position: absolute; opacity: 0; }
.adventx-option > i { position: relative; flex: 0 0 46px; height: 24px; border: 1px solid currentColor; border-radius: 20px; opacity: .65; }
.adventx-option > i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; border-radius: 50%; background: currentColor; transition: left .2s; }
.adventx-option input:checked + i { opacity: 1; }
.adventx-option input:checked + i::after { left: 24px; }
.adventx-option.is-disabled { opacity: .5; cursor: not-allowed; }

.adventx-year,
.adventx-editor { padding: 18px; margin-bottom: 15px; }
.adventx-year { display: grid; gap: 14px; padding: 0; overflow: hidden; }
.adventx-admin-section { margin-bottom: 15px; border: 1px solid var(--adventx-row1-border); }
.adventx-admin-section__head { padding: 13px 16px; color: var(--adventx-head-color); border-bottom: 1px solid var(--adventx-head-border); background-color: var(--adventx-head-bg); background-image: var(--adventx-head-image); }
.adventx-admin-section__head h2 { margin: 0; color: inherit; font-size: 16px; }
.adventx-admin-section__head p { margin: 3px 0 0; color: inherit; line-height: 1.45; }
.adventx-year__fields { display: grid; grid-template-columns: minmax(90px, .65fr) repeat(2, minmax(170px, 1fr)); gap: 12px; padding: 0 16px; }
.adventx-year__fields label,
.adventx-fields label,
.adventx-fields .adventx-field { display: grid; align-content: start; gap: 6px; }
.adventx-year__actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px; }
.adventx-year__summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0; padding: 10px 16px; color: var(--adventx-row2-color); border-top: 1px solid var(--adventx-row2-border); background-color: var(--adventx-row2-bg); background-image: var(--adventx-row2-image); }
.adventx-year__summary small { flex: 1 1 260px; }
.adventx-season-control,
.adventx-preparation-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 0 0 15px; padding: 12px 16px; }
.adventx-preparation-banner > span,
.adventx-season-control__state > span { display: grid; gap: 3px; }
.adventx-season-control__state { display: flex; align-items: center; gap: 10px; }
.adventx-season-control__state > i { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.adventx-season-control.is-inactive { opacity: .75; }
.adventx-danger { font-weight: 700 !important; }

.adventx-adminlist { overflow: hidden; }
.adventx-adminrow { display: grid; grid-template-columns: 110px minmax(190px, 1fr) 145px 190px; gap: 12px; align-items: center; padding: 11px 14px; color: var(--adventx-row1-color); border-top: 1px solid var(--adventx-row1-border); background-color: var(--adventx-row1-bg); background-image: var(--adventx-row1-image); }
.adventx-adminrow:nth-child(odd) { color: var(--adventx-row2-color); background-color: var(--adventx-row2-bg); background-image: var(--adventx-row2-image); }
.adventx-adminrow--head { color: var(--adventx-head-color); background-color: var(--adventx-head-bg); background-image: var(--adventx-head-image); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.adventx-adminrow span { display: grid; gap: 4px; }
.adventx-adminrow > span:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.adventx-adminrow form { display: inline; }
.adventx-empty { padding: 16px; text-align: center; }
.adventx-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.adventx-fields .is-wide { grid-column: 1 / -1; }
.adventx-fields .textbox,
.adventx-fields select,
.adventx-fields textarea,
.adventx-year .textbox { box-sizing: border-box; width: 100%; min-height: 34px; }
.adventx-check { display: block !important; }
.adventx-required { display: inline-block; margin-left: 6px; padding: 2px 5px; border: 1px solid currentColor; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.adventx-required[hidden] { display: none; }
.adventx-editor-guide,
.adventx-type-table { margin-bottom: 15px; padding: 18px; color: var(--adventx-row2-color); border: 1px solid var(--adventx-row2-border); background-color: var(--adventx-row2-bg); background-image: var(--adventx-row2-image); }
.adventx-editor-guide p { margin: 6px 0 10px; }
.adventx-editor-guide ul { margin: 0; padding-left: 20px; line-height: 1.7; }
.adventx-type-table h2 { margin-top: 0; font-size: 18px; }
.adventx-type-table table { width: 100%; border-collapse: collapse; }
.adventx-type-table th,
.adventx-type-table td { padding: 10px; border: 1px solid var(--adventx-row1-border); text-align: left; vertical-align: top; }
.adventx-upload-preview { display: flex !important; align-items: center; gap: 12px !important; margin-top: 5px; padding: 10px; border: 1px solid var(--adventx-row1-border); }
.adventx-upload-preview img { width: 74px; height: 74px; object-fit: cover; }

.adventx-launcher { position: fixed; right: 18px; bottom: 18px; z-index: 10000; display: flex; align-items: center; gap: 8px; }
.adventx-snow { position: fixed; inset: 0; z-index: 9999; pointer-events: none; overflow: hidden; }
.adventx-snow i { position: absolute; left: var(--x); top: -12px; width: var(--size); height: var(--size); border-radius: 50%; background: #fff; opacity: .72; animation: adventx-fall var(--d) linear var(--delay) infinite; }
@keyframes adventx-fall { to { transform: translate3d(var(--drift), 105vh, 0) rotate(360deg); } }
.adventx-lit-image,
.adventx-post-avatar,
.adventx-bauble-target { position: relative !important; display: inline-block; overflow: visible !important; }
.adventx-lightstrand { position: absolute; z-index: 3; left: 3px; right: 3px; top: 3px; display: flex; justify-content: space-around; pointer-events: none; }
.adventx-lightstrand i { width: 5px; height: 8px; border-radius: 50%; background: #f1c40f; animation: adventx-twinkle 1.8s infinite alternate; }
.adventx-lightstrand i:nth-child(2n) { background: #c0392b; animation-delay: .6s; }
.adventx-lightstrand i:nth-child(3n) { background: #27ae60; animation-delay: 1.1s; }
@keyframes adventx-twinkle { to { opacity: .35; } }
.adventx-winter-garland { position: absolute; z-index: 20; left: 7%; right: 7%; bottom: 52px; height: 140px; pointer-events: none; background: url("../images/adventskalender/winter-garland.png?v=100") center bottom / contain no-repeat; }
.adventx-festive-header,
.adventx-festive-category,
.adventx-festive-profile { position: relative !important; overflow: visible !important; }
.adventx-category-art { position: absolute; z-index: 4; inset: -18px 0; pointer-events: none; background: url("../images/adventskalender/presets/category-center.png?v=100") center / auto 120px no-repeat; }
.adventx-santa-hat { position: absolute; z-index: 8; width: 76px; height: 58px; right: -18px; top: -32px; pointer-events: none; background: url("../images/adventskalender/presets/santa-hat.png?v=100") center / contain no-repeat; animation: adventx-hat-wobble 5.2s ease-in-out infinite; }
@keyframes adventx-hat-wobble { 0%,100% { transform: rotate(6deg); } 50% { transform: rotate(9deg) translateY(-1px); } }
.adventx-snow-frame-image { position: absolute !important; z-index: 7; inset: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: fill !important; transform: scale(1.08, 1.065); pointer-events: none; }
.adventx-profile-baubles { position: absolute; z-index: 12; left: 0; right: 0; top: -46px; height: 260px; pointer-events: none; background: url("../images/adventskalender/presets/profile-baubles.png?v=100") center top / 82% auto no-repeat; }
.adventx-profile-awards { padding: 18px; margin: 18px 0; }
.adventx-badge { display: inline-block; margin: 3px; padding: 7px 10px; border: 1px solid currentColor; }

.adventx-calendar-page.has-background-image { position: relative; isolation: isolate; overflow: hidden; padding-top: 1px; }
.adventx-calendar-page.has-background-image .adventx-hero,
.adventx-calendar-page.has-background-image .adventx-preparation-banner { backdrop-filter: blur(2px); }

@media (max-width: 820px) {
  .adventx-mini-calendar { align-items: stretch; flex-direction: column; }
  .adventx-mini-title { justify-content: center; padding: 0 0 9px; border-right: 0; border-bottom: 1px solid var(--adventx-row1-border); }
  .adventx-mini-days { width: 100%; grid-template-columns: repeat(11, minmax(22px, 1fr)); }
  .adventx-help,
  .adventx-adminrow,
  .adventx-year__fields,
  .adventx-fields { grid-template-columns: 1fr; }
  .adventx-adminrow--head { display: none; }
  .adventx-fields .is-wide { grid-column: auto; }
}
@media (max-width: 520px) {
  .adventx-wrap,
  .adventx-panel { padding: 0 8px; }
  .adventx-header-tools { justify-content: center; padding: 0 8px; }
  .adventx-mini-calendar { margin-left: 8px; margin-right: 8px; padding: 10px; }
  .adventx-mini-days { grid-template-columns: repeat(7, minmax(24px, 1fr)); }
  .adventx-calendar { grid-template-columns: minmax(0, 250px); }
  .adventx-day,
  .adventx-door { width: 250px; height: 250px; }
  .adventx-door__number { font-size: 50px; }
  .adventx-launcher { right: 10px; bottom: 10px; }
  .adventx-season-control,
  .adventx-preparation-banner { align-items: stretch; flex-direction: column; }
  .adventx-modal { align-items: end; padding: 8px; }
  .adventx-open-day { width: 100%; max-height: calc(100vh - 16px); }
  .adventx-open-day__content { max-height: calc(100vh - 115px); }
}
@media (prefers-reduced-motion: reduce) {
  .adventx-snow,
  .adventx-lightstrand { display: none !important; }
  .adventx-snow.is-preview { display: block !important; }
  .adventx-santa-hat { animation: none !important; transform: rotate(6deg); }
}
