:root {
  --bg: #0a0e0a;
  --terminal-bg: #0d1110;
  --header-bg: #1a1f1e;
  --green: #33ff66;
  --green-dim: #1a9e3f;
  --cyan: #5eead4;
  --amber: #fbbf24;
  --red: #f87171;
  --text: #c8f0d0;
  --text-dim: #6b8f72;
  --prompt: #33ff66;
  --shadow: rgba(51, 255, 102, 0.08);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-x: hidden;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 4px
  );
  z-index: 100;
}

.crt-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.55) 100%);
  z-index: 99;
}

.terminal-wrapper {
  width: 100%;
  max-width: 720px;
  animation: fade-in 0.8s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terminal {
  background: var(--terminal-bg);
  border: 1px solid #1f3d28;
  border-radius: 10px;
  box-shadow:
    0 0 0 1px rgba(51, 255, 102, 0.05),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 80px var(--shadow);
  overflow: hidden;
  position: relative;
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  background: var(--header-bg);
  border-bottom: 1px solid #243830;
}

.terminal-buttons {
  display: flex;
  gap: 6px;
}

.btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.btn-close { background: #ff5f57; }
.btn-minimize { background: #febc2e; }
.btn-maximize { background: #28c840; }

.terminal-title {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex: 1;
  text-align: center;
  margin-right: 3rem;
}

.terminal-body {
  padding: 1.25rem 1.5rem 1rem;
  min-height: 320px;
  font-size: 0.85rem;
  line-height: 1.65;
  overflow-y: auto;
  max-height: 55vh;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.line.command::before {
  content: "→ ";
  color: var(--green-dim);
}

.line.output {
  color: var(--text);
}

.line.success { color: var(--green); }
.line.info { color: var(--cyan); }
.line.warn { color: var(--amber); }
.line.dim { color: var(--text-dim); }

.scroll-hint-banner {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--green);
  text-align: center;
  background: rgba(51, 255, 102, 0.08);
  border-bottom: 1px solid rgba(51, 255, 102, 0.25);
  animation: blink-text 1.4s ease-in-out infinite;
}

.scroll-hint-banner.hidden {
  display: none;
}

.line .highlight {
  color: var(--green);
  font-weight: 600;
}

.invite-box {
  margin: 0.75rem 0;
  padding: 1rem 1.25rem;
  border: 1px dashed var(--green-dim);
  border-radius: 4px;
  background: rgba(51, 255, 102, 0.03);
  word-break: normal;
  overflow-wrap: normal;
}

.invite-box .label {
  color: var(--cyan);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.25rem;
}

.invite-box .value {
  color: var(--green);
  font-size: 1rem;
  font-weight: 600;
}

.ascii-art-wrap {
  margin: 0.5rem 0 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ascii-art {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-family: Consolas, "Cascadia Mono", "Lucida Console", "Courier New", monospace;
  font-size: clamp(0.42rem, 1.65vw, 0.58rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: pre;
  word-break: normal;
  overflow-wrap: normal;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  opacity: 0.95;
  min-width: min-content;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1.5rem 1rem;
  font-size: 0.85rem;
}

.prompt {
  color: var(--prompt);
  white-space: nowrap;
}

.typed-command {
  color: var(--text);
}

.cursor {
  color: var(--green);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.rsvp-section {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid #1f3d28;
  padding-top: 1.25rem;
}

.rsvp-question {
  font-size: 1.1rem;
  color: var(--green);
  margin-bottom: 1rem;
  font-weight: 600;
}

.blink-prompt {
  animation: blink-text 1.2s ease-in-out infinite;
}

@keyframes blink-text {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.rsvp-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cmd-btn {
  font-family: inherit;
  font-size: 0.8rem;
  text-align: left;
  padding: 0.65rem 1rem;
  background: rgba(51, 255, 102, 0.06);
  border: 1px solid #2a5c38;
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.cmd-btn:hover {
  background: rgba(51, 255, 102, 0.12);
  border-color: var(--green-dim);
  transform: translateX(4px);
}

.cmd-btn:active {
  transform: translateX(2px) scale(0.99);
}

.cmd-btn .cmd-prefix {
  color: var(--green);
  margin-right: 0.5rem;
}

.cmd-yes:hover {
  border-color: var(--green);
  box-shadow: 0 0 20px rgba(51, 255, 102, 0.15);
}

.cmd-no:hover {
  border-color: var(--red);
  box-shadow: 0 0 20px rgba(248, 113, 113, 0.1);
}

.hidden {
  display: none !important;
}

.response-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 10;
  animation: overlay-in 0.4s ease;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.response-content {
  text-align: center;
  width: 100%;
}

.response-ascii {
  font-size: 0.65rem;
  line-height: 1.15;
  white-space: pre;
  margin-bottom: 1rem;
}

.response-content.happy .response-ascii {
  color: var(--green);
  animation: bounce-in 0.6s ease;
}

.response-content.sad .response-ascii {
  color: var(--red);
  animation: shake 0.5s ease;
}

.response-message {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.response-content.happy .response-message {
  color: var(--green);
}

.response-content.sad .response-message {
  color: var(--red);
}

.response-sub {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.whatsapp-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text);
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid #25d366;
  border-radius: 4px;
  transition: background 0.2s, transform 0.15s;
}

.whatsapp-link:hover {
  background: rgba(37, 211, 102, 0.22);
  transform: translateY(-1px);
}

.whatsapp-link .cmd-prefix {
  color: #25d366;
  margin-right: 0.5rem;
}

.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 8px;
  height: 8px;
  top: -10px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

.rain-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  overflow: hidden;
}

.rain-drop {
  position: absolute;
  width: 2px;
  height: 20px;
  background: linear-gradient(transparent, rgba(96, 165, 250, 0.5));
  animation: rain-fall linear forwards;
}

@keyframes rain-fall {
  to {
    transform: translateY(110vh);
    opacity: 0;
  }
}

@keyframes bounce-in {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.tear {
  display: inline-block;
  animation: tear-drop 1.5s ease-in-out infinite;
}

@keyframes tear-drop {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.3; }
}

@media (max-width: 480px) {
  .terminal-body {
    font-size: 0.78rem;
    padding: 1rem;
  }

  .terminal-title {
    font-size: 0.65rem;
    margin-right: 0;
  }

  .response-ascii {
    font-size: 0.55rem;
  }
}
