@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Inter:wght@400;500;600&display=swap");

:root {
  color-scheme: dark;
  --ink: #050706;
  --bone: #e5dec1;
  --bone-muted: #a7aa91;
  --green: #7cc98a;
  --green-bright: #b3ef9c;
  --panel: rgba(5, 9, 8, 0.76);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
}

body {
  min-height: 100svh;
  overflow: hidden;
  color: var(--bone);
  font-family: "Inter", system-ui, sans-serif;
  background:
    radial-gradient(circle at 78% 30%, rgba(24, 89, 64, 0.2), transparent 34%),
    radial-gradient(circle at 18% 72%, rgba(75, 28, 86, 0.18), transparent 40%),
    #050706;
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.3vh, 18px);
  height: 100svh;
  padding: clamp(12px, 2vw, 28px);
}

.topbar,
.footer-note {
  width: min(100%, 1600px);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.title-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
}

.title-lockup > div {
  display: grid;
  gap: 1px;
}

.fyendal-logo {
  display: block;
  width: clamp(42px, 4vw, 62px);
  height: clamp(42px, 4vw, 62px);
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.5));
}

.eyebrow {
  color: var(--green);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #f2edd9;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1.2rem, 2vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.live-status {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(214, 224, 198, 0.16);
  border-radius: 999px;
  color: rgba(229, 222, 193, 0.72);
  background: rgba(9, 14, 12, 0.66);
  backdrop-filter: blur(12px);
  font-size: 0.72rem;
}

.live-status strong {
  color: var(--bone);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d6a85d;
  box-shadow: 0 0 10px currentColor;
}

.status-dot.online {
  color: var(--green-bright);
  background: currentColor;
}

.status-dot.offline {
  color: #d16d67;
  background: currentColor;
}

.status-divider {
  width: 1px;
  height: 14px;
  background: rgba(229, 222, 193, 0.2);
}

.reveal-stage {
  position: relative;
  align-self: center;
  justify-self: center;
  width: min(100%, calc((100svh - 196px) * 16 / 9));
  height: auto;
  max-height: calc(100svh - 196px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(193, 214, 186, 0.2);
  border-radius: clamp(10px, 1.5vw, 22px);
  background: #080c0a;
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(0, 0, 0, 0.7),
    inset 0 0 60px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  isolation: isolate;
}

.reveal-stage::before {
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 1px solid rgba(217, 230, 197, 0.1);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

#reveal-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.vignette {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.24), transparent 16%, transparent 78%, rgba(0, 0, 0, 0.35)),
    radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.45));
}

.loading-panel {
  position: absolute;
  z-index: 8;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: rgba(229, 222, 193, 0.7);
  background: #080c0a;
  transition: opacity 0.6s ease, visibility 0.6s;
}

.loading-panel.hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-panel p {
  margin: 0;
  font-family: "Cinzel", Georgia, serif;
  letter-spacing: 0.08em;
}

.loading-mark {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(179, 239, 156, 0.14);
  border-top-color: var(--green-bright);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.progress-panel {
  position: absolute;
  z-index: 5;
  top: clamp(12px, 2vw, 24px);
  left: clamp(12px, 2vw, 24px);
  width: min(210px, 34vw);
  padding: 12px 14px 11px;
  border: 1px solid rgba(223, 229, 205, 0.18);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.counter-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.counter {
  color: #f1ecd8;
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(1rem, 1.8vw, 1.45rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.counter.bump {
  animation: counter-bump 0.28s ease;
}

.counter-label {
  color: rgba(229, 222, 193, 0.58);
  font-size: clamp(0.58rem, 0.9vw, 0.7rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.progress-track {
  height: 3px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(229, 222, 193, 0.12);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4b8d69, #b3ef9c);
  box-shadow: 0 0 8px rgba(179, 239, 156, 0.5);
  transition: width 0.35s ease;
}

.interaction-hint {
  position: absolute;
  z-index: 5;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(223, 229, 205, 0.2);
  border-radius: 999px;
  color: rgba(241, 236, 216, 0.9);
  background: rgba(6, 10, 8, 0.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.25s ease, border-color 0.25s ease;
  animation: breathe 2.5s ease-in-out infinite;
}

.interaction-hint:hover {
  border-color: rgba(179, 239, 156, 0.5);
  transform: translateY(-2px);
}

.interaction-hint:disabled {
  cursor: default;
  animation: none;
}

.bone-cursor {
  color: var(--green-bright);
}

.reveal-stage.complete .progress-panel,
.reveal-stage.complete .interaction-hint {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.footer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: rgba(229, 222, 193, 0.44);
  font-size: 0.68rem;
  letter-spacing: 0.035em;
  text-align: center;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 7px;
}

.social-links a {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(229, 222, 193, 0.16);
  border-radius: 50%;
  color: rgba(229, 222, 193, 0.72);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-links a:hover,
.social-links a:focus-visible {
  border-color: var(--green-bright);
  color: var(--green-bright);
  outline: none;
  transform: translateY(-2px);
}

.social-links svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.34), 0 0 0 0 rgba(179, 239, 156, 0); }
  50% { box-shadow: 0 8px 30px rgba(0, 0, 0, 0.34), 0 0 0 6px rgba(179, 239, 156, 0.08); }
}

@keyframes counter-bump {
  50% { color: var(--green-bright); transform: scale(1.12); }
}

@media (max-width: 700px) {
  .app-shell {
    grid-template-rows: auto minmax(0, 1fr);
    padding: 10px;
  }

  .topbar {
    align-items: flex-start;
  }

  .title-lockup {
    gap: 7px;
  }

  .live-status {
    padding: 0 10px;
  }

  .status-divider,
  #connection-label {
    display: none;
  }

  .reveal-stage {
    width: min(100%, calc((100svh - 104px) * 16 / 9));
    height: auto;
    max-height: calc(100svh - 104px);
    border-radius: 10px;
  }

  .footer-note {
    display: none;
  }

  .interaction-hint {
    padding: 8px 11px;
    font-size: 0.68rem;
  }
}

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