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

body {
  background: #0d0d0d;
  color: #fff;
  font-family: 'Segoe UI', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

h1 {
  font-size: 2.2rem;
  margin-bottom: 6px;
  color: #ffffff;
  text-align: center;
  letter-spacing: 1.0px;
}

.subtitle {
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 20px;
  text-align: center;
}

/* ── Arena layout ── */
.arena {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.cam-wrap {
  position: relative;
  width: 480px;
  height: 360px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #333;
  background: #111;
}

#video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
}

.vs {
  font-size: 2.5rem;
  font-weight: 900;
  color: #ffcc00;
  text-shadow: 0 0 20px #ffcc0088;
}

.meme-wrap {
  width: 300px;
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid #333;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

#meme-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.meme-label {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.8rem;
  color: #ffcc00;
  text-shadow: 0 1px 3px #000;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ── Status badges ── */
.status-bar {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.badge {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #888;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.active {
  background: #1e293b;
  border-color: #3b82f6;
  color: #3b82f6;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.2);
}

.gesture-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.section-label {
  color: #555;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  width: 100%;
  text-align: center;
  margin-top: 8px;
}

/* ── Loading screen ── */
#loading {
  position: fixed;
  inset: 0;
  background: #0d0d0d;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #1e293b;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

#loading p {
  color: #888;
  font-size: 0.9rem;
}

.no-meme-text {
  color: #333;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
  line-height: 1.6;
}

#debug {
  position: fixed;
  bottom: 10px;
  left: 10px;
  font-size: 11px;
  color: #444;
  font-family: monospace;
}

.btn-action {
  background: #3b82f6;
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s, transform 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-action:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

.btn-action:active {
  transform: translateY(0);
}
