*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #05060a;
  color: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
}

.wrapper {
  width: 100%;
  max-width: 500px;
  padding: 16px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  text-align: center;
}

.hint {
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 16px;
  color: #c5c5c5;
}

.hint code {
  background: #1a1b22;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.85em;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}

video {
  display: block;
  width: 100%;
  height: auto;
}

/* Simple outer frame where the 8 blocks should sit */
.scan-frame {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 35%;
  bottom: 35%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  pointer-events: none;
}

button#scanButton {
  display: block;
  width: 100%;
  padding: 10px 14px;
  margin: 0 auto 8px;
  border-radius: 999px;
  border: none;
  background: #f5f5f5;
  color: #05060a;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
}

button#scanButton:active {
  transform: scale(0.97);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}

button#scanButton:disabled {
  opacity: 0.5;
  cursor: default;
  box-shadow: none;
}

.status {
  min-height: 1.4em;
  font-size: 0.85rem;
  color: #b0b0b0;
  margin-bottom: 4px;
  text-align: center;
  word-break: break-word;
}

.result {
  min-height: 2.4em;
  padding: 10px 12px;
  border-radius: 8px;
  background: #11131b;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
  word-break: break-word;
}

/* Modal */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #11131b;
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 280px;
  width: 80%;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}

.modal-content p {
  margin: 0 0 12px;
  font-size: 1rem;
}

#modalOk {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  background: #f5f5f5;
  color: #05060a;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

#modalOk:active {
  transform: scale(0.97);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
}
