* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #04143d;
  color: white;
  min-height: 100vh;
}

.game-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px 40px;
  text-align: center;
}

.title {
  margin: 0 0 20px;
  font-size: clamp(36px, 5vw, 60px);
  font-weight: 800;
}

.ring-wrapper {
  position: relative;
  width: min(80vw, 600px);
  height: min(80vw, 600px);
  margin: 0 auto 30px;
}

.letter-ring {
  position: absolute;
  inset: 0;
}

.letter-item {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1c2c4f;
  border: 2px solid #2f466e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transform: translate(-50%, -50%);
  transition: 0.2s;
  cursor: default;
  user-select: none;
}

.letter-item.active {
  background: #facc15;
  color: #111;
}

.letter-item.correct {
  background: #22c55e;
  border-color: #22c55e;
}

.letter-item.wrong {
  background: #ef4444;
  border-color: #ef4444;
}

.letter-item.passed {
  background: #eab308;
  border-color: #eab308;
  color: #111;
}

.question-box {
  position: absolute;
  width: 65%;
  height: 65%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #29436a;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 25px;
}

.timer-text {
  font-size: clamp(36px, 5vw, 60px);
  font-weight: bold;
  color: #fbbf24;
}

.timer-text.danger {
  color: #ef4444;
}

.start-btn {
  margin: 10px auto;
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #22c55e;
  color: white;
  font-weight: bold;
  cursor: pointer;
}

.start-btn.hidden {
  display: none;
}

.question-label {
  margin-top: 5px;
  opacity: 0.8;
}

.question-text {
  margin-top: 10px;
  font-size: clamp(16px, 2vw, 24px);
  line-height: 1.4;
}

.answer-area {
  max-width: 600px;
  margin: 0 auto 20px;
  text-align: left;
}

.answer-area label {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: bold;
}

.answer-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.answer-row input {
  height: 50px;
  border-radius: 20px;
  border: none;
  padding: 0 15px;
  font-size: 18px;
  outline: none;
}

.answer-row button {
  height: 50px;
  border-radius: 12px;
  border: none;
  background: #22c55e;
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.answer-row button:disabled,
.secondary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.action-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.secondary-btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  background: #31466a;
  color: white;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: 100%;
  max-width: 720px;
  background: #0b1d4d;
  border: 2px solid #29436a;
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
}

.modal-title {
  margin: 0 0 18px;
  font-size: 34px;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  background: #13285f;
  border: 1px solid #29436a;
  border-radius: 14px;
  padding: 14px 10px;
}

.stat-number {
  display: block;
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 15px;
  opacity: 0.9;
}

.modal-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 16px 0 18px;
}

.modal-letter {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  background: #1c2c4f;
  border: 2px solid #2f466e;
}

.modal-letter.correct {
  background: #22c55e;
  border-color: #22c55e;
}

.modal-letter.wrong {
  background: #ef4444;
  border-color: #ef4444;
}

.modal-letter.passed {
  background: #eab308;
  border-color: #eab308;
  color: #111;
}

.modal-detail {
  margin-top: 10px;
  padding: 16px;
  border: 2px solid #29436a;
  border-radius: 12px;
  text-align: left;
  font-size: 16px;
  line-height: 1.6;
  min-height: 150px;
}

.modal-buttons {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.modal-btn {
  min-width: 180px;
  height: 46px;
  border: none;
  border-radius: 12px;
  background: #22c55e;
  color: white;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 768px) {
  .game-container {
    padding: 20px 10px 30px;
  }

  .title {
    font-size: 34px;
    margin-bottom: 18px;
  }

  .ring-wrapper {
    width: min(92vw, 360px);
    height: min(92vw, 360px);
    margin-bottom: 20px;
  }

  .letter-item {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .question-box {
    width: 72%;
    height: 72%;
    padding: 18px;
  }

  .timer-text {
    font-size: 34px;
  }

  .question-label {
    font-size: 13px;
  }

  .question-text {
    font-size: 15px;
    line-height: 1.35;
  }

  .answer-area {
    max-width: 390px;
  }

  .answer-area label {
    font-size: 16px;
  }

  .answer-row input {
    height: 44px;
    font-size: 16px;
  }

  .answer-row button {
    height: 46px;
    font-size: 17px;
  }

  .secondary-btn {
    font-size: 15px;
    padding: 10px 18px;
  }

  .modal-content {
    padding: 20px 14px;
  }

  .modal-title {
    font-size: 28px;
  }

  .modal-stats {
    gap: 8px;
  }

  .stat-number {
    font-size: 24px;
  }

  .stat-label {
    font-size: 13px;
  }

  .modal-letter {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .modal-detail {
    font-size: 14px;
    min-height: 140px;
    padding: 14px;
  }

  .modal-btn {
    width: 100%;
  }
}