@font-face {
  font-family: "CozetteVector";
  src: url("../assets/fonts/CozetteVector.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

.quiz-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  color: #000;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--quiz-duration, 1000ms) ease-in-out;
  font-family: "CozetteVector", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.quiz-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.quiz-dialog {
  font-family: "CozetteVector", system-ui, sans-serif;
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  text-align: center;
  image-rendering: auto;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
  transform: scale(0);
  opacity: 0;
  transition: transform var(--quiz-duration, 1000ms) ease-in-out, opacity var(--quiz-duration, 1000ms) ease-in-out;
  will-change: transform, opacity;
  position: relative;
}

.quiz-overlay.active .quiz-dialog {
  transform: scale(1);
  opacity: 1;
}

.quiz-dialog.monitor-frame {
  box-sizing: border-box;
  width: 1024px;
  height: 768px;
  max-width: min(1024px, calc(100vw - 32px));
  max-height: min(768px, calc(100vh - 32px));
  border: 16px solid #e5ddc8;
  border-radius: 12px;
  padding: 0;
  background: #0078d4;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 600px) {
  .quiz-dialog.monitor-frame {
    border-width: 12px;
    border-radius: 10px;
  }
}

.monitor-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
  background: #0078d4;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.quiz-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 50%;
  color: #333;
  font-size: 24px;
  font-family: Arial, sans-serif;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  z-index: 100;
}

.quiz-close-btn:hover {
  background: #e30611;
  color: #fff;
  border-color: #c0050e;
}

.overlay-dialog-btn {
  font-family: "CozetteVector", system-ui, sans-serif;
  margin-top: 16px;
  padding: 12px 20px;
  border-radius: 6px;
  border: none;
  background: #e30611;
  color: #fff;
  font-weight: 400;
  font-size: 18px;
  cursor: pointer;
}

.overlay-dialog-btn:hover {
  filter: brightness(1.1);
}

.overlay-dialog-btn:active {
  transform: translateY(1px);
}

.overlay-dialog-btn:disabled {
  background: #999;
  color: #fff;
  cursor: not-allowed;
  filter: none;
}

.quiz-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
  font-size: 18px;
}

.quiz-step[hidden] {
  display: none !important;
}

.quiz-step.step-visible {
  opacity: 1;
}

.screen-frame {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  color: #000;
}

.mail-screen {
  justify-content: center;
  align-items: center;
}

.mail-popup {
  max-width: 320px;
  width: 100%;
  background: #fff;
  color: #000;
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.mail-frame {
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: 8px;
  flex: none;
  min-height: 0;
}

.desktop {
  position: relative;
  color: #000;
}

.mail-icon-text {
  font-size: 24px;
  margin: 0 0 8px;
  display: inline-block;
}

.mail-icon-img {
  display: block;
  max-height: 96px;
  width: auto;
  margin: 0px auto 0px;
  animation: mail-icon-pulse 1.5s ease-in-out 2s infinite;
}

@keyframes mail-icon-pulse {
  0%, 66.67% { transform: scale(1); }
  73.33% { transform: scale(1.12); }
  80% { transform: scale(1); }
  86.67% { transform: scale(1.12); }
  93.33%, 100% { transform: scale(1); }
}

.notification-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.letter-screen {
  align-self: stretch;
  flex: 1;
}

.letter-screen .screen-frame {
  flex: 1;
  min-height: 0;
  justify-content: flex-start;
  align-items: flex-start;
  margin-bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.letter-wrap {
  text-align: left;
  max-width: 100%;
  width: 100%;
}

.letter-from,
.letter-subject {
  margin: 0 0 6px;
  font-size: 18px;
  color: #333;
}

.letter-body {
  margin: 8px 0 0;
  font-size: 18px;
  line-height: 1.35;
  min-height: 1.35em;
}

.exercise-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #ccc;
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.exercise-block.visible {
  opacity: 1;
  pointer-events: auto;
}

.npv-label {
  display: block;
  font-size: 18px;
  margin-bottom: 6px;
}

.npv-input {
  font-family: "CozetteVector", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.3;
  width: 100%;
  max-width: 280px;
  padding: 16px 14px 14px;
  margin-bottom: 12px;
  border: 2px solid #999;
  border-radius: 6px;
  background: #fff;
  color: #000;
  box-sizing: border-box;
  min-height: 52px;
  appearance: textfield;
  -moz-appearance: textfield;
}

.npv-input::-webkit-outer-spin-button,
.npv-input::-webkit-inner-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.feedback-screen {
  flex: none;
  align-self: center;
  justify-content: center;
  max-width: 420px;
  width: 100%;
  background: #fff;
  color: #000;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.feedback-msg {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 1.35;
}

.feedback-wrong .feedback-msg {
  color: #c00;
}

.feedback-right .feedback-msg {
  color: #080;
}

.hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
}

.hint-btn {
  font-family: "CozetteVector", system-ui, sans-serif;
  font-size: 18px;
  padding: 10px 12px;
  border: 2px solid #999;
  border-radius: 4px;
  background: #f5f5f5;
  color: #000;
  cursor: pointer;
}

.hint-btn:hover {
  background: #e0e0e0;
}

.hint-btn.active {
  background: #e30611;
  color: #fff;
  border-color: #c0050e;
  pointer-events: none;
}

.hint-text {
  font-size: 16px;
  color: #333;
  margin: 0 0 12px;
  text-align: left;
}

.hint-text:empty {
  display: none;
}

.btn-center {
  align-self: center;
}
.btn-left {
  align-self: flex-start;
  margin-top: 0;
}
