* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
}

.back-link {
  display: inline-block;
  font-size: 11px;
  color: #555;
  text-decoration: none;
  letter-spacing: 1px;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.back-link:hover { color: #aaa; }

.header {
  text-align: center;
  padding: 10px;
}

.header h1 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #fff;
}

.header p {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  letter-spacing: 1px;
}

.viewport {
  flex: 1;
  width: 100%;
  max-width: 500px;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  min-height: 300px;
}

video,
#preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

video.active,
#preview.active {
  display: block;
}

.placeholder {
  color: #555;
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

.controls {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  padding-bottom: 10px;
}

button {
  width: 100%;
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: #fff;
  color: #111;
  transition: transform 0.1s, opacity 0.2s;
  letter-spacing: 1px;
}

button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

button.secondary {
  background: transparent;
  color: #888;
  border: 1px solid #333;
}

.file-input-wrapper {
  width: 100%;
  position: relative;
}

.file-input-wrapper input[type=file] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

/* === Silicon Valley style result badge === */
.result-badge {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 60;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
  padding: 20px;
}

.result-badge.show { display: flex; }

.badge-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #00b14f;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.15),
              0 12px 40px rgba(0, 0, 0, 0.6);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-badge.nothotdog .badge-circle {
  background: #ff2e2e;
}

.badge-icon {
  font-size: 96px;
  line-height: 1;
  color: #fff;
  font-weight: 900;
}

.badge-label {
  margin-top: 24px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.badge-tap {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.7);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.loading {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  z-index: 50;
}

.loading.show { display: flex; }

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #333;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.footer {
  font-size: 10px;
  color: #444;
  text-align: center;
  letter-spacing: 1px;
}
