body {font-family: system-ui, sans-serif; margin: 0; background: #111; color: #eee;}
#video {position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; object-fit: cover; background: #000;}
#canvas {display: none;}
header {padding: 1rem 0; font-size: 1.2rem; text-align: center;}
#uploadLabel {margin: 1rem 0; cursor: pointer; padding: 0.6rem 1rem; border: 1px solid #555; border-radius: 6px; display: inline-block;}
input[type=file] {display: none;}
#errorOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 40;
}
#errorDialog {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  color: #2c3e50;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.3s ease-out;
  min-width: 350px;
  max-width: 90%;
}
#errorDialog h3 {margin: 0 0 1rem 0; color: #e74c3c; font-size: 1.3rem;}
#errorDialog p {margin: 0 0 2rem 0; line-height: 1.5; color: #2c3e50;}
#errorDialog button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
  color: #fff;
  min-width: 120px;
}
#errorDialog button:hover {
  background: linear-gradient(135deg, #2980b9 0%, #21618c 100%);
  transform: translateY(-1px);
}
#modal, #permissionOverlay, #verificationPopup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  animation: fadeIn 0.3s ease-out;
}
#modalContent, #permissionDialog, #verificationDialog {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  color: #2c3e50;
  padding: 2rem 2.5rem;
  border-radius: 16px;
  max-width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideUp 0.3s ease-out;
  min-width: 300px;
}
#modalHeader {margin: 0 0 1.5rem 0; font-size: 1.5rem; font-weight: 600; text-align: center; color: #2c3e50;}
#modalContent.success #modalHeader {color: #27ae60;}
#modalContent.warning #modalHeader {color: #f39c12;}
#modalContent.error #modalHeader {color: #e74c3c;}
#ticketInfo {
  margin: 0 0 1.5rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #3498db;
}
#modalContent.success #ticketInfo {border-left-color: #27ae60;}
#modalContent.warning #ticketInfo {border-left-color: #f39c12;}
#modalContent.error #ticketInfo {border-left-color: #e74c3c;}
.info-row {display: flex; justify-content: space-between; margin: 0.5rem 0; font-size: 0.9rem;}
.info-label {font-weight: 600; color: #7f8c8d;}
.info-value {color: #2c3e50; font-weight: 500;}
#qrText {
  word-break: break-word;
  white-space: pre-wrap;
  margin: 0 0 2rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  border-left: 4px solid #3498db;
  font-family: Monaco, 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}
.btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
  min-width: 100px;
}
.btn:hover {transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);}
.btn.close {background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); color: #fff; width: 100%; margin: 0;}
.btn.close:hover {background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);}
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  display: none;
  z-index: 10000;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
  animation: slideUp 0.3s ease-out;
  max-width: 300px;
}
#verificationPopup {z-index: 10002;}
.verification-spinner, .spinner {width: 40px; height: 40px; border: 4px solid #e3e3e3; border-top: 4px solid #3498db; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem auto;}
.permission-step {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0.75rem 0;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.permission-step.checking {background: #f8f9fa; border-left: 4px solid #3498db;}
.permission-step.success {background: #d5f4e6; border-left: 4px solid #27ae60;}
.permission-step.error {background: #fadbd8; border-left: 4px solid #e74c3c;}
.permission-step .icon {width: 20px; height: 20px; margin-right: 10px; display: flex; align-items: center; justify-content: center; font-weight: bold;}
.permission-step.checking .icon {color: #3498db;}
.permission-step.success .icon {color: #27ae60;}
.permission-step.error .icon {color: #e74c3c;}
.permission-step .text {flex: 1; font-size: 0.9rem;}
@keyframes fadeIn {from {opacity: 0;} to {opacity: 1;}}
@keyframes slideUp {from {transform: translateY(20px); opacity: 0;} to {transform: translateY(0); opacity: 1;}}
@keyframes spin {0% {transform: rotate(0deg);} 100% {transform: rotate(360deg);}}
