body {
  margin: 0;
  min-height: 100dvh;
  background: #0b37a8;
  color: #ffffff;
  color-scheme: dark;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

main {
  position: relative;
  width: min(100vw, 402px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: #0b37a8;
}

main [hidden] {
  display: none !important;
}

.join--screen,
.waiting--screen,
.game--screen,
.end--screen {
  min-height: 100dvh;
  padding: 0 32px 124px;
  box-sizing: border-box;
}

.join--screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: url("../assets/images/fondo-asistente-bievenidos.jpg") center center / cover no-repeat;
}

.waiting--screen,
.game--screen,
.end--screen {
  background: url("../assets/images/fondo-asistente.jpg") center center / cover no-repeat;
}

.join--screen h1 {
  margin: 218px 0 0;
  font-size: 54px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  color: #ffffff;
}

.join--screen h1::after {
  content: "";
  display: block;
  width: 196px;
  height: 2px;
  margin: 8px auto 0;
  background: #ffffff;
}

.join--screen > p {
  width: 278px;
  margin: 24px 0 0;
  font-size: 20px;
  line-height: 1.15;
  text-align: center;
  color: #ffffff;
}

.join--screen > p strong {
  font-weight: 500;
}

.join--screen > p em {
  font-style: normal;
}

.register--form {
  width: 100%;
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.assistant-notice {
  width: 272px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
}

.assistant-notice--info {
  border-color: rgba(134, 255, 202, 0.7);
  background: rgba(6, 119, 0, 0.28);
}

.assistant-notice--error {
  border-color: rgba(255, 128, 143, 0.75);
  background: rgba(161, 17, 17, 0.35);
}

.input-group {
  width: 272px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.register--form input {
  width: 272px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  color: #1b233f;
  font-size: 14px;
  line-height: 1;
}

.register--form input::placeholder {
  color: #8f8f8f;
}

.register--form input:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 1px;
}

.register--form input.invalid,
.register--form input:invalid {
  border-color: #ff7b9d;
}

.char-counter {
  padding-left: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
}

.error-message {
  width: 272px;
  font-size: 12px;
  color: #ffc2cf;
}

.register--form button,
.leaveGame--container button {
  width: 203px;
  padding: 8px 18px;
  border: 0;
  border-radius: 28px;
  background: #b62561;
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 4px 6.7px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: filter 0.2s ease;
}

.register--form button:hover,
.leaveGame--container button:hover {
  filter: brightness(1.06);
}

.register--form button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.register--form button:focus-visible,
.leaveGame--container button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.waiting--screen {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  text-align: center;
}

.waiting--screen h1 {
  width: min(280px, 100%);
  margin: 0;
  font-size: 48px;
  font-weight: 400;
  line-height: 1.08;
  color: #ffffff;
}

.assistant-loader {
  position: relative;
  width: 82px;
  height: 82px;
  margin-top: 0;
}

.assistant-loader span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 16px;
  margin: -8px 0 0 -1px;
  border-radius: 1px;
  background: #ffffff;
  transform-origin: 1px 28px;
  animation: assistant-loader-fade 1s linear infinite;
}

.assistant-loader span:nth-child(1) {
  transform: rotate(0deg);
  animation-delay: 0s;
}

.assistant-loader span:nth-child(2) {
  transform: rotate(45deg);
  animation-delay: 0.125s;
}

.assistant-loader span:nth-child(3) {
  transform: rotate(90deg);
  animation-delay: 0.25s;
}

.assistant-loader span:nth-child(4) {
  transform: rotate(135deg);
  animation-delay: 0.375s;
}

.assistant-loader span:nth-child(5) {
  transform: rotate(180deg);
  animation-delay: 0.5s;
}

.assistant-loader span:nth-child(6) {
  transform: rotate(225deg);
  animation-delay: 0.625s;
}

.assistant-loader span:nth-child(7) {
  transform: rotate(270deg);
  animation-delay: 0.75s;
}

.assistant-loader span:nth-child(8) {
  transform: rotate(315deg);
  animation-delay: 0.875s;
}

@keyframes assistant-loader-fade {
  0%,
  100% {
    opacity: 0.15;
  }
  50% {
    opacity: 1;
  }
}

.game--screen {
  padding-top: 118px;
}

.game--screen header {
  display: none;
}

.game-user-container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.game--nickname {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.game--id-user {
  min-width: 70px;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 1px solid #ffffff;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  color: #ffffff;
  white-space: nowrap;
}

.game-info {
  min-width: 77px;
  padding: 2px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #b62561;
}

.game--score {
  margin: 0;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.game--score-label {
  display: none;
}

.waiting-question,
.question-container {
  width: 340px;
  margin: 18px auto 0;
  border: 1px solid #ffffff;
  border-radius: 19px;
  background: #ffffff;
  color: #050505;
}

.waiting-question {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 20px;
}

.waiting-question p {
  margin: 0;
  font-size: 45px;
  font-weight: 400;
  line-height: 1.15;
  text-align: center;
  color: #050505;
  text-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}

.waiting-question p strong {
  display: block;
  font-weight: 500;
}

.assistant-loader--card {
  width: 59px;
  height: 59px;
  margin-top: 8px;
}

.assistant-loader--card span {
  height: 12px;
  margin-top: -6px;
  transform-origin: 1px 20px;
  background: #b62561;
}

.question-container {
  display: flex;
  flex-direction: column;
  padding: 20px 16px 14px;
  gap: 12px;
}

.question-text {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: #050505;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-button {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.option-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.letter-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #b62561;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
}

.respuesta-label {
  flex: 1;
  padding: 4px 10px;
  border-radius: 999px;
  background: #d7e3fb;
  color: #1f3778;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.option-arrow {
  font-size: 12px;
  color: #1f3778;
}

.option-content {
  border-radius: 10px;
  background: #edf2ff;
  padding: 10px 12px;
  border: 1px solid #d5def8;
}

.option-text {
  font-size: 14px;
  line-height: 1.25;
  color: #17213f;
}

.option-button.selected-option .option-content {
  border-color: #b62561;
  background: #fce8f1;
}

.option-button.correct-answer .option-content {
  background: #d8f7e1;
  border-color: #2e9d57;
}

.option-button.user-incorrect-answer .option-content {
  background: #ffe3ea;
  border-color: #d04b70;
}

.option-button.disabled:not(.correct-answer):not(.user-incorrect-answer) {
  opacity: 0.72;
}

.option-button:disabled {
  cursor: not-allowed;
}

.result-correct,
.result-incorrect {
  margin-top: 4px;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.result-correct {
  background: #d8f7e1;
  color: #0f5a2e;
}

.result-incorrect {
  background: #ffe3ea;
  color: #8c1d41;
}

.end--screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.end--screen h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1;
  text-align: center;
  color: #ffffff;
}

.end--screen .game-user-container {
  grid-template-columns: auto auto;
}

.final--message {
  margin: 0;
  max-width: 300px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f1f45;
  font-size: 16px;
  text-align: center;
}

.leaveGame--container {
  position: fixed;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  width: min(100vw, 402px);
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.leaveGame--container button {
  pointer-events: auto;
}

@media (max-height: 860px) {
  .join--screen h1 {
    margin-top: 174px;
  }

  .waiting--screen h1 {
    font-size: 42px;
  }

  .game--screen {
    padding-top: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-loader span,
  .game--score.score-updated {
    animation: none !important;
  }
}
