:root {
  color-scheme: dark;
  --text: #fffdf2;
  --muted: rgba(255, 255, 255, 0.78);
  --gold: #ffe38d;
  --cyan: #73eaff;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; }

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: #102b3d url("../galeri/background/gate1.webp") center / cover fixed no-repeat;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(3, 16, 29, 0.52), rgba(11, 14, 39, 0.23) 46%, rgba(3, 12, 25, 0.86)),
    radial-gradient(circle at 50% 22%, transparent 0 18%, rgba(2, 9, 20, 0.35) 78%);
}

body.modal-open { overflow: hidden; }
a, button { font: inherit; -webkit-tap-highlight-color: transparent; }

.ambient { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora { position: absolute; width: min(42rem, 75vw); aspect-ratio: 1; border-radius: 50%; filter: blur(100px); opacity: 0.19; animation: drift 10s ease-in-out infinite alternate; }
.aurora-one { left: -18rem; bottom: -18rem; background: #20dfff; }
.aurora-two { right: -18rem; top: -18rem; background: #ff8a43; animation-delay: -5s; }
.sparkle { position: absolute; width: var(--size); height: var(--size); left: var(--left); top: var(--top); border-radius: 50%; background: #fffbd1; box-shadow: 0 0 8px #fff, 0 0 17px var(--color); opacity: 0; animation: twinkle var(--speed) ease-in-out var(--delay) infinite; }

.topbar {
  width: min(1320px, calc(100% - 28px));
  min-height: 74px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 5;
}

.round-link, .guide-chip {
  min-height: 49px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 19, 34, 0.68);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(14px);
}

.round-link { width: fit-content; gap: 9px; padding: 8px 16px; text-decoration: none; font-size: 0.86rem; }
.round-link:first-child span { font-size: 1.4rem; }
.home-link { justify-self: end; padding: 5px 16px 5px 7px; }
.home-link img { width: 39px; height: 39px; object-fit: contain; }

.guide-chip { justify-self: center; gap: 9px; padding: 4px 15px 4px 5px; }
.guide-chip img { width: 45px; height: 45px; object-fit: contain; }
.guide-chip span { display: flex; flex-direction: column; }
.guide-chip small { color: rgba(255, 255, 255, 0.65); font-size: 0.65rem; }
.guide-chip strong { color: #fff0a6; line-height: 1; }

.gates-shell { width: min(1320px, calc(100% - 28px)); margin: auto; padding: 8px 0 42px; }

.gate-heading { max-width: 850px; margin: 0 auto 18px; text-align: center; text-shadow: 0 3px 17px rgba(0, 0, 0, 0.78); }
.gate-heading > p { margin: 0 0 2px; color: var(--gold); font-size: clamp(0.72rem, 1.4vw, 0.9rem); font-weight: 900; letter-spacing: 0.13em; text-transform: uppercase; }
.gate-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.4rem, 6vw, 4.8rem); line-height: 0.98; background: linear-gradient(180deg, #fff 2%, #fff1a6 48%, #ffbe5d 82%, #fff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 rgba(83, 39, 15, 0.38)); }

.heading-actions { margin-top: 12px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 9px 15px; }
.movie-trigger { min-height: 44px; display: inline-flex; align-items: center; gap: 9px; padding: 8px 17px; border: 1px solid rgba(255, 255, 255, 0.38); border-radius: 999px; color: #fff; background: rgba(4, 34, 51, 0.76); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); cursor: pointer; font-weight: 900; }
.movie-trigger span { width: 28px; height: 28px; display: grid; place-items: center; padding-left: 2px; border-radius: 50%; color: #17414d; background: var(--gold); font-size: 0.8rem; }
.movie-trigger:hover, .movie-trigger:focus-visible { outline: 3px solid rgba(255, 227, 141, 0.6); background: rgba(7, 67, 87, 0.9); }
.helper-text { color: rgba(255, 255, 255, 0.73); font-size: 0.82rem; }

.gate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.5vw, 20px); }

.gate-card {
  min-height: 450px;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 27px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(155deg, rgba(9, 48, 65, 0.94), rgba(11, 19, 42, 0.97));
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42), inset 0 0 34px rgba(255, 255, 255, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.gate-card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.48; }
.gate-one::before { background: radial-gradient(circle at 50% 30%, #7ad9ff, transparent 52%); }
.gate-two::before { background: radial-gradient(circle at 50% 30%, #76e6a7, transparent 52%); }
.gate-three::before { background: radial-gradient(circle at 50% 30%, #ff8c55, transparent 52%); }
.gate-four::before { background: radial-gradient(circle at 50% 30%, #ffd977, transparent 52%); }

html[data-world="lili"] {
  --gold: #ffd7f2;
  --cyan: #ffa6e4;
}

html[data-world="lili"] .aurora-one { background: #ff6dcc; }
html[data-world="lili"] .aurora-two { background: #86d8ff; }
html[data-world="lili"] .gate-card { background: linear-gradient(155deg, rgba(94, 37, 104, 0.95), rgba(24, 22, 62, 0.97)); }
html[data-world="lili"] .guide-chip strong { color: #ffd5f2; }
html[data-world="lili"] .movie-trigger span { color: #6b2c6d; }

.gate-card:hover, .gate-card:focus-visible { transform: translateY(-8px); outline: none; border-color: rgba(255, 247, 190, 0.8); box-shadow: 0 31px 64px rgba(0, 0, 0, 0.5), 0 0 27px rgba(255, 225, 127, 0.32); }

.gate-number { position: absolute; top: 12px; left: 12px; z-index: 3; min-height: 34px; display: inline-flex; align-items: center; padding: 5px 11px; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 999px; color: #fff3b0; background: rgba(4, 16, 31, 0.68); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.07em; text-transform: uppercase; backdrop-filter: blur(8px); }

.gate-art { height: 245px; overflow: hidden; display: block; background: #f6f0df; }
.gate-art img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform 0.35s ease; }
.gate-card:hover .gate-art img, .gate-card:focus-visible .gate-art img { transform: scale(1.05); }

.gate-copy { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 15px 15px 17px; text-align: center; }
.gate-copy strong { min-height: 53px; display: flex; align-items: center; justify-content: center; font-family: Georgia, serif; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.05; }
.gate-copy small { min-height: 54px; display: block; margin-top: 6px; color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.enter-label { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; margin-top: auto; padding: 7px 14px; border: 1px solid rgba(255, 255, 255, 0.32); border-radius: 999px; background: rgba(255, 255, 255, 0.11); color: #fff4b3; font-size: 0.8rem; font-weight: 900; }

.movie-modal[hidden] { display: none; }
.movie-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(1, 6, 17, 0.84); backdrop-filter: blur(16px); }
.movie-panel { width: min(1050px, 100%); max-height: calc(100svh - 36px); position: relative; overflow: auto; border: 1px solid rgba(255, 255, 255, 0.34); border-radius: 26px; background: linear-gradient(145deg, rgba(8, 42, 60, 0.98), rgba(42, 20, 55, 0.98)); box-shadow: 0 35px 100px rgba(0, 0, 0, 0.76); }
.movie-panel header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px 11px 22px; }
.movie-panel header small { color: var(--gold); font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; }
.movie-panel h2 { margin: 1px 0 0; font-family: Georgia, serif; font-size: clamp(1.2rem, 3vw, 1.8rem); }
.close-movie { width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%; color: #fff; background: rgba(255, 255, 255, 0.1); cursor: pointer; font-size: 2rem; line-height: 1; }
.video-frame { width: calc(100% - 24px); aspect-ratio: 16 / 9; margin: 0 12px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 18px; background: #030713; }
.video-frame video { width: 100%; height: 100%; display: block; object-fit: contain; }
.movie-panel > p { margin: 0; padding: 13px 18px 17px; color: var(--muted); text-align: center; font-size: 0.84rem; }

@keyframes drift { to { transform: translate3d(8%, -5%, 0) scale(1.08); } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(0.3); } 50% { opacity: 0.92; transform: scale(1); } }

@media (max-width: 1080px) {
  body { background-attachment: scroll; }
  .gate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gate-card { min-height: 410px; }
}

@media (max-width: 620px) {
  .topbar, .gates-shell { width: min(100% - 18px, 1320px); }
  .topbar { min-height: 64px; }
  .round-link { width: 46px; min-height: 46px; padding: 4px; justify-content: center; }
  .round-link strong { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .home-link img { width: 38px; height: 38px; }
  .guide-chip { min-height: 46px; padding-right: 12px; }
  .guide-chip img { width: 40px; height: 40px; }
  .gates-shell { padding-top: 5px; }
  .gate-heading { margin-bottom: 14px; }
  .helper-text { width: 100%; }
  .gate-grid { grid-template-columns: 1fr; }
  .gate-card { min-height: 0; display: grid; grid-template-columns: 42% 58%; grid-template-rows: auto; }
  .gate-number { top: 9px; left: 9px; }
  .gate-art { width: 100%; height: 100%; min-height: 225px; }
  .gate-copy { min-height: 225px; padding: 14px 12px; }
  .gate-copy strong { min-height: 47px; font-size: 1.2rem; }
  .gate-copy small { min-height: 0; font-size: 0.73rem; }
  .enter-label { min-height: 38px; padding: 6px 11px; }
  .movie-modal { padding: 8px; }
  .movie-panel { max-height: calc(100svh - 16px); border-radius: 18px; }
  .movie-panel header { min-height: 62px; padding: 8px 9px 8px 14px; }
  .video-frame { width: calc(100% - 12px); margin: 0 6px; border-radius: 12px; }
}

@media (max-width: 390px) {
  .guide-chip small { display: none; }
  .guide-chip { padding-right: 10px; }
  .gate-card { grid-template-columns: 40% 60%; }
  .gate-copy strong { font-size: 1.08rem; }
  .gate-copy small { font-size: 0.68rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
