:root {
  --bg: #edf4f8;
  --card: rgba(255, 255, 255, 0.96);
  --ink: #1f1f1f;
  --muted: #6a6f73;
  --accent: #8bb7c9;
  --accent-dark: #5d8ea3;
  --border: rgba(139, 183, 201, 0.35);
  --shadow: 0 20px 50px rgba(91, 124, 140, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: linear-gradient(180deg, #eef4f8 0%, #e6f0f4 100%);
}

.waiting-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.card, .admin-card {
  width: min(920px, 100%);
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 48px 36px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.75);
}

.seal-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
  perspective: 1100px;
}
.seal-3d {
  transform-style: preserve-3d;
  animation: seal-sway 7.4s ease-in-out infinite;
  will-change: transform, filter;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.09));
}
.seal-image {
  width: min(420px, 82vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.16));
}

@keyframes seal-sway {
  0% {
    transform: rotateY(-18deg) translateZ(-4px) scale(0.985);
    filter: drop-shadow(-14px 18px 24px rgba(0, 0, 0, 0.11));
  }
  25% {
    transform: rotateY(-7deg) translateZ(7px) scale(1.0);
    filter: drop-shadow(-6px 19px 26px rgba(0, 0, 0, 0.13));
  }
  50% {
    transform: rotateY(18deg) translateZ(18px) scale(1.02);
    filter: drop-shadow(14px 24px 34px rgba(0, 0, 0, 0.19));
  }
  75% {
    transform: rotateY(7deg) translateZ(7px) scale(1.0);
    filter: drop-shadow(6px 19px 26px rgba(0, 0, 0, 0.13));
  }
  100% {
    transform: rotateY(-18deg) translateZ(-4px) scale(0.985);
    filter: drop-shadow(-14px 18px 24px rgba(0, 0, 0, 0.11));
  }
}

.ornament-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 18px;
}
.ornament-image {
  width: min(520px, 80vw);
  height: auto;
  display: block;
}

.message-block { margin: 6px 0 18px; }
.lead {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 1.18;
}
.stay-hint {
  margin: 14px auto 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.4;
}

.countdown-block {
  margin: 4px 0 18px;
}
.audio-controls {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.audio-button {
  background: rgba(93, 142, 163, 0.12);
  color: var(--accent-dark);
  border: 1px solid rgba(93, 142, 163, 0.25);
}
.audio-button.active {
  background: rgba(93, 142, 163, 0.22);
}
.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.countdown-unit {
  background: rgba(139, 183, 201, 0.10);
  border: 1px solid rgba(139, 183, 201, 0.22);
  border-radius: 18px;
  padding: 18px 10px;
}
.count-value {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
}
.count-label {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04rem;
}

.fallback-text {
  color: var(--muted);
  margin-top: 12px;
}
.fallback-link a {
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(93, 142, 163, 0.4);
}

.nope-page {
  background: linear-gradient(180deg, #f4efe8 0%, #eadfce 100%);
}
.nope-card {
  max-width: 640px;
}
.nope-gif {
  width: min(420px, 82vw);
  height: auto;
  display: block;
  margin: 0 auto 18px;
  border-radius: 14px;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.16);
}
.nope-text {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.preses-admin-link {
  position: fixed;
  top: 18px;
  right: 22px;
  color: rgba(31, 31, 31, 0.22);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.04rem;
}
.preses-admin-link:hover { color: rgba(31, 31, 31, 0.48); }

.admin-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.admin-card { text-align: left; max-width: 760px; }
.admin-card.small { max-width: 460px; }
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-header h1, .admin-card h1 { margin: 0 0 8px; }
.muted { color: var(--muted); margin: 0 0 14px; }
.admin-form { display: grid; gap: 18px; }
.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
label { display: grid; gap: 8px; }
label span { font-weight: 600; }
input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: rgba(255,255,255,0.92);
}
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font: inherit;
  cursor: pointer;
  background: var(--accent-dark);
  color: white;
}
button.secondary {
  background: rgba(93, 142, 163, 0.12);
  color: var(--accent-dark);
}
.error, .success {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 0 0 14px;
}
.error { background: #fbeaea; color: #8c2d2d; }
.success { background: #e8f6ec; color: #24673a; }

@media (max-width: 720px) {
  .card, .admin-card { padding: 30px 20px; }
  .seal-image { width: min(320px, 84vw); }
  .ornament-image { width: min(360px, 78vw); }
  .countdown-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row { grid-template-columns: 1fr; }
  .admin-header { flex-direction: column; }
}
