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

html, body {
  height: 100%;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #fff;
  overflow: hidden;
}

#app { position: relative; width: 100vw; height: 100vh; }

#webcam, #overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#webcam { transform: scaleX(-1); }
#overlay { pointer-events: none; }

#topbar {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  padding: 10px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
}

#banner {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.9);
  padding: 12px 24px;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  display: none;
}
#banner.show { display: block; color: #fff; }
#banner.result { color: #ffea00; font-size: 1.7rem; }

#memeImg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 50vh;
  max-width: 60vw;
  pointer-events: none;
  display: none;
}
#memeText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 4rem;
  font-weight: 900;
  color: #ffea00;
  text-shadow: 0 0 15px rgba(0,0,0,0.9);
  pointer-events: none;
  display: none;
}

#start-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.card {
  background: #111;
  border: 1px solid #333;
  padding: 32px;
  border-radius: 12px;
  max-width: 420px;
  text-align: center;
}
.card h1 { font-size: 1.6rem; margin-bottom: 10px; }
.card p { color: #aaa; margin-bottom: 12px; line-height: 1.4; }
.card .hint { font-size: 0.9rem; color: #777; margin-bottom: 20px; }
.card button {
  background: #fff;
  color: #000;
  border: none;
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}
.card button:hover { background: #ddd; }
.card .footer { margin-top: 18px; font-size: 0.85rem; }
.card .footer a { color: #6cf; text-decoration: none; }

#loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  padding: 16px 28px;
  border-radius: 8px;
  font-size: 1.1rem;
  display: none;
  z-index: 20;
}
#loading.show { display: block; }

#debug {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.7);
  padding: 6px 10px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.75rem;
  color: #ffea00;
  border-radius: 4px;
  pointer-events: none;
  white-space: pre;
  display: none;
}
