/* ===== Yılbaşı teması (veli sayfası, karşılama, giriş, QR kartları) ===== */
:root {
  --night-1: #0b1a3a;
  --night-2: #13295b;
  --night-3: #1d3f7a;
  --gold: #f6c453;
  --gold-2: #ffdf8a;
  --red: #d62839;
  --red-dark: #a4161a;
  --green: #1f7a4a;
  --snow: #f7fbff;
  --text: #fdfaf2;
  --font-title: 'Pacifico', 'Brush Script MT', cursive;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body.xmas {
  font-family: var(--font-body);
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 223, 138, 0.18), transparent 55%),
    radial-gradient(ellipse at 15% 30%, rgba(98, 140, 255, 0.18), transparent 50%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

/* Yıldızlar */
body.xmas::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 25% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 40% 8%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 58% 22%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 72% 10%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1px 1px at 85% 28%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 93% 6%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 5% 45%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 66% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 33% 50%, #fff 50%, transparent 51%);
  opacity: 0.8;
  animation: twinkle 4s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes twinkle { from { opacity: 0.45; } to { opacity: 0.95; } }

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Üstteki yılbaşı ışıkları */
.lights {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 46px;
  display: flex;
  justify-content: space-around;
  padding: 0 8px;
  pointer-events: none;
  z-index: 3;
}
.lights::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -14px;
  height: 30px;
  border-bottom: 2px solid #2b3a2f;
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
.lights span {
  position: relative;
  top: 12px;
  width: 11px;
  height: 18px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--c, var(--red));
  box-shadow: 0 4px 18px 3px var(--c, var(--red));
  animation: glow 1.6s ease-in-out infinite alternate;
}
.lights span::before {
  content: '';
  position: absolute;
  top: -5px; left: 2px;
  width: 7px; height: 6px;
  background: #3b3b3b;
  border-radius: 2px;
}
.lights span:nth-child(4n+1) { --c: #ff4d5e; }
.lights span:nth-child(4n+2) { --c: #ffd447; animation-delay: .4s; }
.lights span:nth-child(4n+3) { --c: #4fe08a; animation-delay: .8s; }
.lights span:nth-child(4n+4) { --c: #5cc8ff; animation-delay: 1.2s; }
.lights span:nth-child(odd) { top: 16px; }
@keyframes glow { from { opacity: .45; box-shadow: 0 2px 6px 0 var(--c); } to { opacity: 1; } }
@media (max-width: 520px) { .lights span:nth-child(n+11) { display: none; } }

/* Alt kısım: karlı tepeler ve çam ağaçları */
.ground {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 22vh;
  max-height: 170px;
  pointer-events: none;
  z-index: 0;
}
.ground svg { width: 100%; height: 100%; display: block; }

/* Sayfa içeriği */
.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 16px 140px;
}

.school {
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .8rem;
  color: var(--gold-2);
  opacity: .9;
  text-align: center;
}

/* Okul logosu: açık zemin için tasarlandığından beyaz rozet içinde */
.logo-badge {
  display: block;
  margin: 0 auto 14px;
  padding: 6px 16px;
  width: fit-content;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, .7), 0 8px 24px rgba(0, 0, 0, .3);
}
.logo-badge img { display: block; width: 150px; height: auto; }

.xmas-title {
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(1.9rem, 7vw, 3.2rem);
  line-height: 1.25;
  margin: 0 0 22px;
  text-align: center;
  background: linear-gradient(180deg, #fff6d6 0%, var(--gold) 55%, #e0a526 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(120, 60, 0, .45)) drop-shadow(0 0 18px rgba(246, 196, 83, .35));
  max-width: 900px;
  overflow-wrap: anywhere;
}

/* Şeker kamışı çerçeveli video */
.frame {
  position: relative;
  width: fit-content;
  max-width: min(100%, 880px);
  padding: 10px;
  border-radius: 22px;
  background: repeating-linear-gradient(-45deg, var(--red) 0 14px, #fff 14px 28px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 0 4px rgba(246, 196, 83, .55);
}
.frame-inner {
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
/* Video kendi en-boy oranını korur: yatay ve dikey (telefon) videolar çerçeveye tam oturur */
.frame video {
  display: block;
  background: #000;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: max(320px, calc(100vh - 330px));
  max-height: max(320px, calc(100dvh - 330px));
  min-width: min(300px, calc(100vw - 52px));
  min-height: 170px;
}

/* Çerçeve köşesindeki fiyonk */
.bow {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 52px;
  z-index: 2;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.4));
}
.holly { position: absolute; width: 58px; height: 58px; z-index: 2; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
.holly.left { bottom: -20px; left: -16px; }
.holly.right { bottom: -20px; right: -16px; transform: scaleX(-1); }

.message {
  margin: 30px 0 0;
  width: min(100%, 760px);
  padding: 20px 24px;
  font-size: clamp(1.02rem, 3.6vw, 1.2rem);
  line-height: 1.65;
  text-align: center;
  white-space: pre-line;
  overflow-wrap: anywhere;
  border-radius: 18px;
  background: rgba(14, 32, 72, .78);
  border: 1px solid rgba(246, 196, 83, .35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.btn-xmas {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  padding: 16px 34px;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  font: 800 1.12rem var(--font-body);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(180deg, #ef3b4c, var(--red-dark));
  box-shadow: 0 0 0 3px var(--gold), 0 10px 26px rgba(214, 40, 57, .55);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-xmas:hover { transform: translateY(-2px); }
.btn-xmas:active { transform: translateY(1px); }
.btn-xmas:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.btn-xmas svg { width: 22px; height: 22px; }

.hint { margin-top: 12px; font-size: .85rem; opacity: .75; text-align: center; max-width: 520px; }

/* Bilgi / hata kartı */
.notice {
  margin-top: 8vh;
  width: min(100%, 520px);
  text-align: center;
  padding: 34px 26px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.notice .icon { font-size: 3.4rem; line-height: 1; }
.notice h1 { font-family: var(--font-title); font-weight: 400; color: var(--gold); font-size: 1.9rem; margin: 14px 0 10px; }
.notice p { margin: 0; line-height: 1.6; font-size: 1.05rem; }

.loading { margin-top: 20vh; display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: .85; }
.spinner {
  width: 46px; height: 46px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.2); border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.footer-link { margin-top: auto; padding-top: 40px; font-size: .85rem; }
.footer-link a { color: rgba(255,255,255,.7); }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
