/* TFM Immersion — Welcome back ribbon (js/tfm-immersion.js)
   Sits where the Kingdom Calendar greeting sits: under the header bar, centred.
   Mock: docs/mocks/animation-lab demo 21, variant "Band unter dem Header". */

.tfm-wb {
  position: absolute; left: 50%; z-index: 46; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 8px 10px 8px 22px; border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, rgba(14, 9, 28, .94), rgba(14, 9, 28, .82));
  border: 1px solid color-mix(in srgb, var(--area-accent, #d4a843) 32%, transparent); border-top: 0;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .6), 0 0 26px -10px var(--area-accent-glow, rgba(212, 168, 67, .5));
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.08rem; line-height: 1.35;
  color: var(--ink, #f6f1ea);
  animation: tfmWbIn 1s cubic-bezier(.2, .8, .2, 1) both;
}
.tfm-wb.is-out { opacity: 0; transform: translate(-50%, -10px); transition: opacity .6s ease, transform .6s ease; }
.tfm-wb__text { min-width: 0; }
.tfm-wb__link {
  margin-left: 8px; white-space: nowrap;
  font-family: Jost, sans-serif; font-size: .74rem; letter-spacing: .06em;
  color: var(--area-accent-soft, #e8c97a) !important; text-decoration: none !important;
  border-bottom: 1px solid color-mix(in srgb, var(--area-accent, #d4a843) 40%, transparent);
}
.tfm-wb__link em { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.05em; letter-spacing: 0; }
.tfm-wb__link:hover { color: var(--ink, #f6f1ea) !important; }
.tfm-wb__x {
  flex: 0 0 auto; background: none !important; border: 0 !important; box-shadow: none !important; min-height: 0;
  color: var(--muted, #b6afc7) !important; cursor: pointer; font-size: 1.1rem !important; line-height: 1; padding: 2px 6px !important;
}
.tfm-wb__x:hover { color: var(--ink, #f6f1ea) !important; }
@keyframes tfmWbIn { from { opacity: 0; transform: translate(-50%, -14px); } }

@media (max-width: 640px) {
  .tfm-wb { font-size: .98rem; padding: 7px 8px 8px 16px; }
  .tfm-wb__text { display: flex; flex-direction: column; }
  .tfm-wb__link { margin: 2px 0 0; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  .tfm-wb { animation-duration: .01ms; }
  .tfm-wb.is-out { transform: translateX(-50%); }
}

/* =====================================================================
   Age Gate as a gate (plugin markup .age-gate__wrapper, js/tfm-immersion.js)
   Calm and inviting: dark wooden leaves with a soft seam of light, the
   plugin dialog in front. Mock: animation lab demo 23, variant "Tor".
   ===================================================================== */
.tfm-gate-on .age-gate__background-color,
.tfm-gate-on .age-gate__background { opacity: 0 !important; }
.tfm-gate__doors, .tfm-gate-exit { position: fixed; inset: 0; perspective: 1600px; pointer-events: none; }
.tfm-gate__doors { z-index: 0; }
.tfm-gate-exit { z-index: 2147483000; }
.age-gate__wrapper .age-gate { position: relative; z-index: 2; }

.tfm-gate__leaf {
  position: absolute; top: 0; bottom: 0; width: 50.2%;
  background:
    radial-gradient(ellipse 70% 50% at 50% 45%, rgba(255, 255, 255, .04), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .22) 0 2px, transparent 2px 64px),
    linear-gradient(180deg, #221637, #120a20 70%, #0c0716);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, .55);
}
.tfm-gate__leaf.is-l { left: 0; transform-origin: left center; border-right: 1px solid color-mix(in srgb, var(--area-accent, #d4a843) 30%, transparent); }
.tfm-gate__leaf.is-r { right: 0; transform-origin: right center; border-left: 1px solid color-mix(in srgb, var(--area-accent, #d4a843) 30%, transparent); }
/* ring handles */
.tfm-gate__leaf i { position: absolute; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--area-accent, #d4a843) 70%, transparent); box-shadow: 0 0 14px var(--area-accent-glow, rgba(212, 168, 67, .35)); }
.tfm-gate__leaf.is-l i { right: 26px; }
.tfm-gate__leaf.is-r i { left: 26px; }
/* the seam of light between the leaves, breathing slowly */
.tfm-gate__light {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 6px; margin-left: -3px; z-index: 1;
  background: linear-gradient(180deg, transparent, var(--area-accent-soft, #e8c97a) 30%, var(--area-accent-soft, #e8c97a) 70%, transparent);
  filter: blur(3px); opacity: .55;
  animation: tfmGateSeam 4.5s ease-in-out infinite;
}
@keyframes tfmGateSeam { 50% { opacity: .9; } }

/* plugin dialog in the Kingdom look */
.tfm-gate-on .age-gate {
  background: rgba(14, 9, 28, .86) !important; color: var(--body-text, #e4ddf0) !important;
  border: 1px solid color-mix(in srgb, var(--area-accent, #d4a843) 30%, transparent) !important; border-radius: 18px !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 50px -10px var(--area-accent-glow, rgba(212, 168, 67, .4)) !important;
  backdrop-filter: blur(6px);
  animation: tfmGateDialog 1.6s ease both;
}
@keyframes tfmGateDialog { from { opacity: 0; transform: translateY(10px); } }
/* the logo image is 666 px wide; as a seal above the text it only needs a little room */
.tfm-gate-on .age-gate__heading-title--logo { width: auto !important; max-width: 60% !important; max-height: 120px !important; margin: 0 auto !important; }
.tfm-gate-on .age-gate__headline { font-family: "Cormorant Garamond", Georgia, serif !important; font-weight: 500 !important; color: var(--ink, #f6f1ea) !important; }
.tfm-gate-on .age-gate__subheadline, .tfm-gate-on .age-gate__challenge, .tfm-gate-on .age-gate__remember-text { color: var(--muted, #b6afc7) !important; font-family: "Cormorant Garamond", Georgia, serif !important; font-style: italic; }
.tfm-gate-on .age-gate__submit {
  border-radius: 999px !important; padding: 10px 24px !important; font-family: Jost, sans-serif !important;
  letter-spacing: .12em; text-transform: uppercase; font-size: .8rem !important; cursor: pointer;
  transition: box-shadow .4s ease, background .4s ease;
}
.tfm-gate-on .age-gate__submit--yes { background: color-mix(in srgb, var(--area-accent, #d4a843) 24%, transparent) !important; border: 1px solid var(--area-accent, #d4a843) !important; color: var(--ink, #f6f1ea) !important; }
.tfm-gate-on .age-gate__submit--yes:hover { box-shadow: 0 0 22px var(--area-accent-glow, rgba(212, 168, 67, .45)); }
.tfm-gate-on .age-gate__submit--no { background: transparent !important; border: 1px solid rgba(255, 255, 255, .18) !important; color: var(--muted, #b6afc7) !important; }

/* opening: a breath, then the leaves swing inwards and the light widens */
.tfm-gate-exit .tfm-gate__leaf { transition: transform 2.8s cubic-bezier(.55, 0, .2, 1), opacity 2.6s ease .4s; }
.tfm-gate-exit .tfm-gate__light { transition: transform 2.4s ease, opacity 2.6s ease .5s; }
.tfm-gate-exit.is-open .tfm-gate__leaf.is-l { transform: rotateY(-96deg); opacity: 0; }
.tfm-gate-exit.is-open .tfm-gate__leaf.is-r { transform: rotateY(96deg); opacity: 0; }
.tfm-gate-exit.is-open .tfm-gate__light { transform: scaleX(60); opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .tfm-gate__light, .tfm-gate-on .age-gate { animation: none; }
  .tfm-gate-exit .tfm-gate__leaf, .tfm-gate-exit .tfm-gate__light { transition: opacity .6s ease; }
  .tfm-gate-exit.is-open .tfm-gate__leaf, .tfm-gate-exit.is-open .tfm-gate__light { transform: none; opacity: 0; }
}

/* =====================================================================
   404 — map in the fog (container class tfm-404, js/tfm-immersion.js)
   Mock: animation lab demo 22, variant "Karte im Nebel".
   ===================================================================== */
.tfm-404 { position: relative; overflow: hidden; }
.tfm-404 > *:not(.tfm-404__deco) { position: relative; z-index: 1; }
.tfm-404__deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.tfm-404__map { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; }
.tfm-404__route { fill: none; stroke: var(--area-accent-soft, #e8c97a); stroke-width: 1.6; stroke-dasharray: 2 9; stroke-linecap: round; animation: tfm404Walk 2.6s ease-out both; }
@keyframes tfm404Walk { from { stroke-dasharray: 0 900; } }
.tfm-404__x { fill: none; stroke: var(--area-accent, #d4a843); stroke-width: 2; }
.tfm-404__q { fill: var(--muted, #b6afc7); font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 22px; }
.tfm-404__fog { position: absolute; inset: 0; overflow: hidden; }
.tfm-404__fog i { position: absolute; width: 70%; height: 60%; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(200, 190, 230, .10), transparent 65%); animation: tfm404Drift 28s linear infinite; }
.tfm-404__fog i:nth-child(1) { left: -20%; top: 10%; }
.tfm-404__fog i:nth-child(2) { left: 40%; top: 45%; animation-duration: 36s; animation-direction: reverse; }
.tfm-404__fog i:nth-child(3) { left: 10%; top: 60%; animation-duration: 42s; }
@keyframes tfm404Drift { 0%, 100% { transform: translateX(-10%); } 50% { transform: translateX(18%); } }

/* the four signposts: Elementor buttons with tfm-404-post + area class */
.tfm-404-post .elementor-button { border-radius: 4px 14px 14px 4px !important; background: rgba(255, 255, 255, .04) !important; border: 1px solid rgba(255, 255, 255, .12) !important; color: var(--ink, #f6f1ea) !important; letter-spacing: .08em; text-transform: uppercase; transition: transform .3s ease, border-color .3s ease, background .3s ease; }
.tfm-404-post--academy .elementor-button, .tfm-404-post--training .elementor-button { border-radius: 14px 4px 4px 14px !important; }
/* the dot lives in the flex content wrapper, so it sits beside the label instead of above it */
.tfm-404-post .elementor-button-content-wrapper { align-items: center; }
.tfm-404-post .elementor-button-content-wrapper::before { content: ''; flex: 0 0 auto; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--post-c, #d4a843); box-shadow: 0 0 10px var(--post-c, #d4a843); }
.tfm-404-post .elementor-button:hover { transform: translateY(-2px) rotate(-1deg); border-color: var(--post-c, #d4a843) !important; background: rgba(255, 255, 255, .07) !important; }
.tfm-404-post--village { --post-c: #d4a843; }
.tfm-404-post--academy { --post-c: #5ab87a; }
.tfm-404-post--square { --post-c: #40d9b0; }
.tfm-404-post--training { --post-c: #cc3355; }

/* "Back to where you were": a quiet way out, not a fifth signpost */
.tfm-404-back .elementor-button { background: transparent !important; border: 0 !important; box-shadow: none !important; color: var(--muted, #b6afc7) !important; font-family: "Cormorant Garamond", Georgia, serif !important; font-style: italic; font-size: 1.05rem !important; transition: color .3s ease; }
.tfm-404-back .elementor-button:hover { color: var(--area-accent-soft, #e8c97a) !important; }

@media (prefers-reduced-motion: reduce) {
  .tfm-404__route, .tfm-404__fog i { animation: none; }
}
