/* ============ RESET & BASE ============ */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: #0d0d1a;
  color: #eafcea;
  font-family: 'Press Start 2P', monospace;
  overflow-x: hidden;
  min-height: 100%;
  image-rendering: pixelated;
}
body { position: relative; line-height: 1.6; }

#matrix-canvas {
  position: fixed; inset: 0; z-index: 0; opacity: 0.22; pointer-events: none;
}
#crt-overlay {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

#app { position: relative; z-index: 1; max-width: 900px; margin: 0 auto; padding: 24px 16px 80px; }

/* ============ SCREENS ============ */
.screen { display: none; animation: fadein 0.4s ease; }
.screen.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

/* ============ BOOT SCREEN ============ */
#boot-screen { text-align: left; padding-top: 10vh; }
.terminal {
  background: #000;
  border: 4px solid #39ff14;
  padding: 20px;
  font-size: 11px;
  box-shadow: 0 0 20px rgba(57,255,20,0.35);
}
.terminal .line { margin: 10px 0; color: #39ff14; }
.status-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.status-line .label { white-space: nowrap; }
.status-line .dots {
  flex: 1 1 24px;
  min-width: 12px;
  border-bottom: 3px dotted #1c5c14;
  margin-bottom: 3px;
  align-self: flex-end;
}
.status-line .status { white-space: normal; word-break: break-word; }
.ok { color: #39ff14; }
.warn { color: #ffcc00; }
.err { color: #ff4d4d; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.big-btn { display: block; margin: 30px auto 0; }

/* ============ BUTTONS (8-bit) ============ */
.pixel-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #0d0d1a;
  background: #ffd23f;
  border: none;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow:
    inset -4px -4px 0 #b8860b,
    inset 4px 4px 0 #fff4c2,
    0 6px 0 #7a5c00;
  image-rendering: pixelated;
  transition: transform 0.05s ease;
}
.pixel-btn:active { transform: translateY(4px); box-shadow: inset -4px -4px 0 #b8860b, inset 4px 4px 0 #fff4c2, 0 2px 0 #7a5c00; }
.small-btn { font-size: 10px; padding: 10px 12px; margin: 8px 6px 0 0; background: #6ee7ff; box-shadow: inset -4px -4px 0 #0284c7, inset 4px 4px 0 #d6f6ff, 0 6px 0 #075985; }
.yes-btn { background: #7CFC9C; box-shadow: inset -4px -4px 0 #1e8f45, inset 4px 4px 0 #d9ffe4, 0 6px 0 #145c2c; }
.no-btn { background: #ff6b6b; box-shadow: inset -4px -4px 0 #a11d1d, inset 4px 4px 0 #ffd6d6, 0 6px 0 #6e0f0f; position: fixed; z-index: 40; }
#no-btn.escaping { position: fixed; }

.taunt { min-height: 20px; font-size: 10px; color: #ffcc66; margin-top: 8px; }

/* ============ INVITE SCREEN ============ */
h1.glitch {
  position: relative;
  font-size: clamp(22px, 6vw, 44px);
  text-align: center;
  color: #ff2e63;
  text-shadow: 3px 3px 0 #0d0d1a;
  margin-bottom: 6px;
}
h1.glitch::before, h1.glitch::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0; width: 100%;
  clip-path: inset(0 0 0 0);
}
h1.glitch::before { color: #6ee7ff; animation: glitch1 2.4s infinite linear alternate-reverse; }
h1.glitch::after { color: #ffd23f; animation: glitch2 3s infinite linear alternate-reverse; }
@keyframes glitch1 { 0% { clip-path: inset(0 0 90% 0); transform: translate(-2px,-1px);} 50% {clip-path: inset(40% 0 40% 0); transform: translate(2px,1px);} 100% {clip-path: inset(80% 0 0 0); transform: translate(-1px,2px);} }
@keyframes glitch2 { 0% { clip-path: inset(80% 0 0 0); transform: translate(2px,1px);} 50% {clip-path: inset(10% 0 60% 0); transform: translate(-2px,-1px);} 100% {clip-path: inset(30% 0 30% 0); transform: translate(1px,-2px);} }

.alert-sub { text-align: center; font-size: 11px; color: #6ee7ff; margin-bottom: 20px; }
.version { color: #ffd23f; }

.pixel-border {
  border: 4px solid #eafcea;
  box-shadow: 6px 6px 0 #000;
  background: #14142b;
  padding: 18px;
  margin: 18px 0;
}

.card p, .details p { font-size: 12px; }
.typewriter { min-height: 60px; font-size: 12px; border-right: 2px solid #eafcea; white-space: pre-wrap; }

.corp-jokes { font-size: 11px; margin: 20px 0; display: grid; gap: 10px; }
.corp-jokes p { background: #1c1c3a; border-left: 4px solid #6ee7ff; padding: 8px 10px; }

.details p { margin: 8px 0; }
.tbd { color: #ffcc66; }
.fine-print { font-size: 8px; color: #8888aa; margin-top: 12px; }
.fine-print.center { text-align: center; }

.rsvp-buttons { display: flex; gap: 20px; justify-content: center; align-items: center; margin: 30px 0 6px; flex-wrap: wrap; position: relative; min-height: 60px; }

/* ============ NAME MODAL ============ */
.modal { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.75); align-items: center; justify-content: center; }
.modal.active { display: flex; }
.modal-content { max-width: 420px; width: 90%; text-align: center; }
.modal-content h2 { font-size: 14px; color: #ffd23f; }
.modal-content p { font-size: 11px; }
#name-input {
  width: 100%; font-family: 'Press Start 2P', monospace; font-size: 12px;
  padding: 10px; margin: 14px 0; background: #0d0d1a; color: #39ff14;
  border: 3px solid #39ff14; outline: none;
}
.modal-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.status-msg { font-size: 10px; min-height: 16px; color: #7CFC9C; }

/* ============ CHALKBOARD ============ */
.board-title { text-align: center; font-size: 18px; color: #ffd23f; }
.chalkboard {
  background: #1b3a2e;
  border: 12px solid #6b4423;
  border-radius: 6px;
  padding: 24px;
  box-shadow: 0 8px 0 #3d2812, inset 0 0 40px rgba(0,0,0,0.4);
  font-family: 'Caveat', cursive;
  color: #f4f1de;
}
.chalkboard-header { font-family: 'Press Start 2P', monospace; font-size: 10px; opacity: 0.6; margin-bottom: 16px; }
.chalk-list { list-style: none; padding: 0; margin: 0; font-size: 28px; display: grid; gap: 6px; }
.chalk-list li { border-bottom: 1px dashed rgba(255,255,255,0.15); padding-bottom: 4px; }
.chalk-list li::before { content: "🍕 "; }
.chalk-empty { font-family: 'Press Start 2P', monospace !important; font-size: 10px !important; opacity: 0.5; }
.chalk-empty::before { content: "" !important; }
.chalk-count { margin-top: 16px; font-family: 'Press Start 2P', monospace; font-size: 10px; opacity: 0.7; }
.back-btn { margin-bottom: 16px; }

/* ============ MENU ============ */
.menu-sub { text-align: center; font-size: 10px; color: #6ee7ff; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 18px; }
.menu-card { text-align: center; }
.menu-card h3 { font-size: 12px; color: #ffd23f; margin: 10px 0 4px; }
.menu-card .tag { font-size: 9px; color: #6ee7ff; }
.menu-card p:not(.tag) { font-size: 10px; color: #cfd8dc; }

/* pixel pizza sprites via box-shadow pixel art (8x8 grid, scaled) */
.pixel-pizza {
  width: 64px; height: 64px; margin: 0 auto 10px;
  position: relative;
  transform: scale(1);
}
.pizza-1 { background: radial-gradient(circle at 50% 50%, #ffd23f 55%, #e8a33d 60%, transparent 62%); }
.pizza-2, .pizza-3, .pizza-4 { background: radial-gradient(circle at 50% 50%, #ffd23f 55%, #e8a33d 60%, transparent 62%); }
.pixel-pizza::before { content: "🍕"; font-size: 44px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; filter: saturate(1.3); }
.pizza-1::before { content: "🍕"; }
.pizza-2::before { content: "🍕"; }
.pizza-3::before { content: "🍄"; }
.pizza-4::before { content: "🧀"; }

/* ============ FOOTER ============ */
#site-footer { position: relative; z-index: 1; text-align: center; font-size: 9px; color: #6b6b8a; padding: 30px 12px 40px; }
.tiny { font-size: 8px; opacity: 0.6; }

/* ============ SECRET BANNER ============ */
.secret-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: #ffd23f; color: #0d0d1a; text-align: center;
  font-size: 11px; padding: 10px; transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.secret-banner.show { transform: translateY(0); }

/* ============ CONFETTI ============ */
#confetti-root { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetto { position: absolute; top: -10px; width: 8px; height: 8px; opacity: 0.9; }

/* ============ MOBILE ============ */
@media (max-width: 640px) {
  .pixel-btn { font-size: 10px; padding: 12px 14px; }
  .terminal { font-size: 9px; padding: 14px; }
  .status-line { flex-direction: column; align-items: flex-start; gap: 2px; }
  .status-line .dots { display: none; }
  .status-line .status { margin-left: 14px; }
  .rsvp-buttons { flex-direction: column; }
  .no-btn.escaping { position: fixed; }
  h1.glitch { font-size: 22px; }
  .chalk-list { font-size: 22px; }
  .menu-grid { grid-template-columns: 1fr; }
  #name-modal .modal-content { padding: 14px; }
  .modal-buttons { flex-direction: column; }
  .modal-buttons .pixel-btn { width: 100%; }
}

@media (max-width: 400px) {
  .terminal { font-size: 8px; }
  h1.glitch { font-size: 18px; }
}
