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

html {
  font-size: 4vh;
}

body {
  margin: 0;
  overflow: hidden;
  padding: 0;
  width: 100%;
  height: 100%;
  background-color: black;
  color: #FFF;
}

#canvas {
  display: block;
  position: absolute;
}

/* ── Checkpoint Labels ── */

#checkpoint-labels {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.checkpoint-label {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  transform-origin: center bottom;
  transition: opacity 0.15s ease;
  will-change: transform, left, top, opacity;
}

.checkpoint-label:hover .checkpoint-label-text {
  background: #A0704A;
}

.checkpoint-label-text {
  display: block;
  background: #8B5E3C;
  color: #fff;
  padding: 5px 14px;
  font-family: 'Arial Narrow', Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
  transition: background 0.15s ease;
}

.checkpoint-label-arrow {
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #8B5E3C;
}

/* ── Checkpoint Popup ── */

.checkpoint-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkpoint-popup.hidden {
  display: none;
}

.popup-overlay-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
}

.popup-content {
  position: relative;
  max-width: 640px;
  width: 92%;
  z-index: 1;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(90, 120, 60, 0.2);
  border-radius: 4px;
}

.popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #ccc;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s ease, color 0.15s ease;
}

.popup-close:hover {
  background: #444;
  color: #fff;
}

.popup-header {
  background: linear-gradient(135deg, #5a3e28 0%, #3d2a1a 100%);
  padding: 20px 28px;
  border-bottom: 3px solid #6a8f45;
}

.popup-subtitle {
  display: block;
  color: #8cb860;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.popup-title {
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 0;
}

.popup-body {
  background: rgba(22, 28, 20, 0.96);
  padding: 22px 28px;
}

.popup-description {
  color: #c5c5c0;
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.popup-description p {
  margin: 0 0 10px 0;
}

.popup-description p:last-child {
  margin-bottom: 0;
}

.popup-description.maintenance {
  color: #e05040;
  text-align: center;
}

.popup-format-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(106, 143, 69, 0.1);
  border: 1px solid rgba(106, 143, 69, 0.25);
  border-radius: 3px;
}

.format-label {
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #6a8f45;
  text-transform: uppercase;
  white-space: nowrap;
}

.format-code {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #8cb860;
  letter-spacing: 0.5px;
}

.popup-download {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 24px;
  background: #5a3e28;
  color: #c5c5c0;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid rgba(106, 143, 69, 0.3);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popup-download:hover {
  background: #6a8f45;
  color: #fff;
  border-color: #6a8f45;
}

/* ── Answer Section ── */

.popup-answer-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(106, 143, 69, 0.15);
}

.popup-attempt-counter {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: rgba(140, 184, 96, 0.7);
  margin-bottom: 10px;
}

.attempt-label {
  color: rgba(255, 255, 255, 0.4);
}

.attempt-count {
  color: #8cb860;
}

.popup-answer-hint {
  color: rgba(140, 184, 96, 0.6);
  font-family: 'Poppins', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.popup-answer-row {
  display: flex;
  gap: 0;
}

.popup-answer-input {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(106, 143, 69, 0.25);
  border-right: none;
  border-radius: 3px 0 0 3px;
  color: #fff;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  letter-spacing: 0.5px;
  outline: none;
  transition: border-color 0.15s ease;
}

.popup-answer-input:focus {
  border-color: #6a8f45;
}

.popup-answer-input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.popup-answer-submit {
  padding: 10px 22px;
  background: #6a8f45;
  border: 1px solid #6a8f45;
  border-radius: 0 3px 3px 0;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.popup-answer-submit:hover:not(:disabled) {
  background: #7da854;
}

.popup-answer-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.popup-answer-feedback {
  margin-top: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  min-height: 16px;
}

.popup-answer-feedback.success {
  color: #6abf69;
}

.popup-answer-feedback.error {
  color: #e06050;
}

/* ── Label States ── */

.checkpoint-label.visited .checkpoint-label-text {
  border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.checkpoint-label.completed .checkpoint-label-text {
  background: #4a7c3f;
}

.checkpoint-label.completed .checkpoint-label-arrow {
  border-top-color: #4a7c3f;
}

.checkpoint-label.locked .checkpoint-label-text {
  background: #c0392b;
}

.checkpoint-label.locked .checkpoint-label-arrow {
  border-top-color: #c0392b;
}

/* ── Progress HUD ── */

#progress-hud {
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: auto;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.55);
  border-right: 3px solid #6a8f45;
  pointer-events: none;
}

#progress-hud span {
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

#progress-hud strong {
  color: #fff;
}

.progress-divider {
  opacity: 0.3;
}

/* ── Flag Reveal ── */

.flag-reveal {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flag-reveal.hidden {
  display: none;
}

.flag-overlay-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.88);
}

.flag-content {
  position: relative;
  text-align: center;
  z-index: 1;
  max-width: 620px;
  padding: 50px 40px;
}

.flag-title {
  font-family: 'Poppins', sans-serif;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #8cb860;
  margin-bottom: 10px;
}

.flag-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 24px;
}

.flag-message {
  font-family: 'Poppins', sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 28px;
}

.flag-value {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  letter-spacing: 1px;
  color: #8cb860;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(140, 184, 96, 0.3);
  padding: 18px 28px;
  margin-bottom: 30px;
  word-break: break-all;
  user-select: all;
}

.flag-close {
  padding: 12px 30px;
  background: transparent;
  border: 1px solid rgba(140, 184, 96, 0.3);
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s ease;
}

.flag-close:hover {
  border-color: #8cb860;
  color: #fff;
}

/* ── Hidden Flag Dot ── */

.flag-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(140, 184, 96, 0.25);
  cursor: pointer;
  z-index: 55;
  transition: background 0.2s ease, transform 0.2s ease;
  animation: dotPulse 3s ease-in-out infinite;
}

.flag-dot:hover {
  background: rgba(140, 184, 96, 0.7);
  transform: scale(2);
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ── Intro Overlay ── */

.intro-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease;
}

.intro-overlay.intro-fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, rgba(15, 25, 10, 0.95) 0%, rgba(5, 10, 5, 0.98) 100%);
}

.intro-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 520px;
  padding: 40px 40px;
  opacity: 0;
  transform: translateY(20px);
}

.intro-content.intro-animate-in {
  animation: introSlideIn 0.6s ease forwards;
}

.intro-content.intro-animate-out {
  animation: introSlideOut 0.3s ease forwards;
}

@keyframes introSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes introSlideOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-15px); }
}

.intro-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 24px;
  opacity: 0.85;
}

.intro-icon svg {
  width: 100%;
  height: 100%;
}

.intro-title {
  font-family: 'Poppins', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 10px;
  text-transform: uppercase;
  color: #8cb860;
  margin-bottom: 12px;
}

.intro-line {
  width: 40px;
  height: 1px;
  background: rgba(140, 184, 96, 0.3);
  margin: 0 auto 12px;
}

.intro-subtitle {
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 36px;
}

.intro-body {
  margin-bottom: 36px;
}

.intro-body p {
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 2;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 4px 0;
}

.intro-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.intro-next {
  padding: 12px 32px;
  background: transparent;
  border: 1px solid rgba(140, 184, 96, 0.3);
  color: rgba(255, 255, 255, 0.55);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.intro-next:hover {
  border-color: #8cb860;
  color: #fff;
  background: rgba(140, 184, 96, 0.08);
}

.intro-next.intro-begin {
  border-color: #8cb860;
  color: #8cb860;
  animation: introBeginPulse 2s ease-in-out infinite;
}

.intro-next.intro-begin:hover {
  background: #8cb860;
  color: #0f190a;
  animation: none;
}

@keyframes introBeginPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(140, 184, 96, 0); }
  50% { box-shadow: 0 0 16px 3px rgba(140, 184, 96, 0.15); }
}

.intro-dots {
  display: flex;
  gap: 6px;
}

.intro-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  transition: all 0.3s ease;
}

.intro-dot.active {
  background: #8cb860;
  box-shadow: 0 0 5px rgba(140, 184, 96, 0.3);
}

.intro-skip {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 2;
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 8px 0;
}

.intro-skip:hover {
  color: rgba(255, 255, 255, 0.45);
}

.intro-skip-arrow {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.2s ease;
}

.intro-skip:hover .intro-skip-arrow {
  transform: translateX(3px);
}

