/* Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background-color: #f8f9fa;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout */
.game-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 30px;
  border-bottom: 2px solid #e9ecef;
}

.game-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #495057;
}

.score-container {
  text-align: right;
  position: relative;
}

.score-label {
  color: #6c757d;
  margin-right: 8px;
}

.score-value {
  font-size: 2rem;
  font-weight: 700;
  color: #28a745;
  min-width: 48px;
  display: inline-block;
}

.level-change {
  position: absolute;
  top: -28px;
  right: 0;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.level-change.show {
  opacity: 1;
}

.level-change.level-up {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.level-change.level-down {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Main */
.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-phase {
  width: 100%;
  max-width: 640px;
  text-align: center;
}

.phase-title {
  font-size: 1.25rem;
  color: #495057;
  margin-bottom: 16px;
  font-weight: 600;
}

/* Question */
.number-display {
  font-size: 3rem; /* Large and readable */
  font-weight: 700;
  color: #212529;
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 32px;
  margin: 12px auto 32px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 2px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
}

/* Answer */
.answer-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.answer-input {
  font-size: 1.4rem;
  padding: 12px 16px;
  width: 100%;
  max-width: 420px;
  border: 2px solid #ced4da;
  border-radius: 8px;
  text-align: center;
  letter-spacing: 1px;
  transition: border-color 0.2s ease;
}

.answer-input:focus {
  outline: none;
  border-color: #0d6efd;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

.submit-btn {
  background: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 28px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.submit-btn:hover {
  background: #0b5ed7;
}

/* Result */
.result-icon {
  font-size: 3.2rem;
  margin: 8px 0 8px;
}

.result-icon.correct {
  color: #28a745;
}

.result-icon.wrong {
  color: #dc3545;
}

.result-text {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.result-text.correct {
  color: #28a745;
}

.result-text.wrong {
  color: #dc3545;
}

.correct-answer,
.user-answer {
  font-size: 1rem;
  margin: 8px 0;
  padding: 10px;
  border-radius: 6px;
}

.correct-answer {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.user-answer {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Info */
.game-info {
  margin-top: 28px;
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.current-length {
  color: #6c757d;
}

/* Responsive */
@media (max-width: 640px) {
  .game-title {
    font-size: 1.8rem;
  }
  .number-display {
    font-size: 2.4rem;
    padding: 24px;
  }
  .answer-input {
    font-size: 1.2rem;
  }
}
