* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  user-select: none;
}

body {
  min-height: 100vh;
  background: linear-gradient(145deg, #2b3a4d, #1d2b38);
  padding: 16px;
  color: #2c2c1e;
}

.topbar {
  max-width: 1200px;
  margin: 0 auto 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #f0e9d8;
  padding: 0 8px;
}

.topbar h1 {
  font-size: 1.6rem;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.4);
}

.player-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.name-input {
  padding: 8px 14px;
  border-radius: 30px;
  border: 2px solid #cbb994;
  background: #f5f1e7;
  font-size: 1rem;
  width: 160px;
  outline: none;
  transition: all 0.2s;
}

.name-input:focus {
  border-color: #ffd966;
  box-shadow: 0 0 0 3px rgba(255, 217, 102, 0.3);
}

.game-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .game-wrap {
    grid-template-columns: 1fr;
  }
}

.game-container {
  width: 100%;
}

.game-panel {
  background: #f5f1e7;
  border-radius: 32px;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.05), 0 12px 20px rgba(0, 0, 0, 0.3);
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #d9d0bd;
  padding: 16px 24px;
  border-radius: 80px;
  box-shadow: inset 0 2px 5px rgba(88, 65, 45, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
  font-weight: 600;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2e3b2e;
  font-size: 1rem;
}

.stat-value {
  background: #2c3e2c;
  color: #f0e9d8;
  padding: 6px 16px;
  border-radius: 40px;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 #0f1a0f, 0 3px 0 #0f1a0f;
  min-width: 48px;
  text-align: center;
}

.weather-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.weather-icon {
  font-size: 5.5rem;
  line-height: 1;
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.2));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.weather-label {
  background: #c9bc9e;
  padding: 6px 32px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 1.5rem;
  color: #2c2c1e;
  box-shadow: inset 0 2px 4px #a59478, 0 4px 6px rgba(0, 0, 0, 0.2);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.field {
  background: #9e8f78;
  padding: 16px 12px;
  border-radius: 50px;
  display: flex;
  justify-content: center;
  gap: 24px;
  box-shadow: inset 0 0 0 3px #5e4e3a, inset 0 0 15px #3f321f;
  min-height: 90px;
  align-items: center;
  transition: background 0.3s;
}

.field-trainees {
  display: flex;
  gap: 16px;
  font-size: 2.8rem;
  filter: drop-shadow(0 8px 6px rgba(0, 0, 0, 0.2));
}

.trainee {
  animation: march 0.8s infinite alternate ease-in-out;
}

@keyframes march {
  from { transform: translateX(-3px) rotate(-1deg); }
  to { transform: translateX(3px) rotate(1deg); }
}

.field.resting .trainee {
  animation: none;
  opacity: 0.5;
  filter: grayscale(0.7);
  transform: translateY(4px);
}

.field.raining .trainee {
  animation: splash 0.4s infinite alternate;
}

@keyframes splash {
  from { transform: translateY(0px); }
  to { transform: translateY(-6px); }
}

.choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 4px;
}

.choice-btn {
  background: #e2d6bd;
  border: none;
  padding: 18px 22px;
  border-radius: 60px;
  font-size: 1.4rem;
  font-weight: 600;
  color: #2d2d15;
  cursor: pointer;
  box-shadow: 0 7px 0 #a08f70, 0 10px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.08s ease-in;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  flex: 1 0 140px;
  border: 2px solid #cbb994;
}

.choice-btn:hover {
  background: #efe3cd;
  transform: translateY(-2px);
  box-shadow: 0 9px 0 #a08f70, 0 12px 18px rgba(0, 0, 0, 0.2);
}

.choice-btn:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #a08f70, 0 5px 12px rgba(0, 0, 0, 0.2);
}

.choice-btn:disabled {
  opacity: 0.5;
  transform: translateY(4px);
  box-shadow: 0 3px 0 #8b7b60;
  pointer-events: none;
  filter: grayscale(0.6);
}

.choice-emoji { font-size: 2rem; line-height: 1; }
.choice-text { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }

.hint {
  text-align: center;
  font-size: 0.85rem;
  color: #565b4b;
  font-weight: 500;
  padding: 6px;
  background: #d9d0bd;
  border-radius: 50px;
  letter-spacing: 1px;
}

.footnote {
  text-align: center;
  font-size: 0.8rem;
  color: #aaa89c;
  margin-top: 12px;
  letter-spacing: 1px;
}

.leaderboard {
  background: #f5f1e7;
  border-radius: 32px;
  padding: 24px 20px;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.leaderboard h2 {
  font-size: 1.2rem;
  color: #3a2e1e;
  text-align: center;
  letter-spacing: 1px;
}

.lb-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.lb-list li {
  background: #e8dfcb;
  padding: 10px 12px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  color: #2e3b2e;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.lb-list li.lb-empty {
  justify-content: center;
  color: #7a7565;
  font-style: italic;
  background: transparent;
  box-shadow: none;
}

.lb-rank {
  font-weight: 800;
  color: #8a6d3b;
  min-width: 26px;
}

.lb-name {
  flex: 1;
  margin: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-score {
  font-weight: 700;
  color: #b45309;
}

.refresh-btn {
  background: #c9b382;
  border: none;
  padding: 10px;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 #8f7a56;
  transition: all 0.08s;
  color: #1f2a1f;
}

.refresh-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #8f7a56;
}

.overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.gameover-card {
  background: #efe6d7;
  width: 420px;
  max-width: 100%;
  padding: 32px 24px;
  border-radius: 40px;
  box-shadow: 0 25px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 5px #cbb994;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.overlay.active .gameover-card {
  transform: scale(1);
}

.gameover-title {
  font-size: 2.4rem;
  font-weight: 900;
  color: #3a2e1e;
  text-shadow: 3px 3px 0 #cbb994;
  letter-spacing: 3px;
}

.gameover-score {
  font-size: 1.4rem;
  background: #2d3e2d;
  color: #f0e9d8;
  padding: 16px;
  border-radius: 50px;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: inset 0 -5px 0 #0f1a0f;
}

.gameover-score span {
  font-size: 2.4rem;
  color: #ffd966;
}

.gameover-detail {
  font-weight: 500;
  color: #364236;
  background: #e0d6c0;
  padding: 10px 14px;
  border-radius: 40px;
  font-size: 0.95rem;
}

.gameover-actions {
  display: flex;
  gap: 12px;
}

.gameover-btn {
  flex: 1;
  background: #c9b382;
  border: none;
  padding: 14px;
  border-radius: 60px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #1f2a1f;
  cursor: pointer;
  box-shadow: 0 7px 0 #8f7a56, 0 8px 16px rgba(0,0,0,0.3);
  transition: all 0.08s;
  letter-spacing: 2px;
}

.gameover-btn.secondary {
  background: #a3b8a3;
  box-shadow: 0 7px 0 #6e826e, 0 8px 16px rgba(0,0,0,0.3);
}

.gameover-btn:active {
  transform: translateY(5px);
  box-shadow: 0 2px 0 #8f7a56;
}

.gameover-btn.secondary:active {
  box-shadow: 0 2px 0 #6e826e;
}

.gameover-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.submit-tip {
  font-size: 0.85rem;
  min-height: 18px;
  color: #6b7a5a;
  font-weight: 600;
}

.submit-tip.error { color: #b91c1c; }
.submit-tip.success { color: #15803d; }