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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #F0F8FF;
  color: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  -webkit-font-smoothing: antialiased;
}

#app {
  width: 100%;
  max-width: 460px;
}

#game {
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
  border: 2px solid #e6f0ff;
}

.game-header h1 {
  font-size: 28px;
  color: #FF6B6B;
  margin-bottom: 6px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.05);
}

.game-desc {
  font-size: 15px;
  color: #666;
  line-height: 1.4;
}

.stage-area {
  background: #f8fafc;
  border-radius: 16px;
  padding: 20px;
  border: 2px dashed #cbd5e1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.turn-label {
  font-size: 18px;
  font-weight: 700;
  color: #475569;
  min-height: 24px;
}

.slot-window {
  width: 100%;
  background: #ffffff;
  border: 3px solid #FF6B6B;
  border-radius: 14px;
  padding: 28px 16px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.04), 0 4px 12px rgba(255, 107, 107, 0.15);
  overflow: hidden;
  position: relative;
}

.day-display {
  font-size: 52px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.1;
  transition: transform 0.1s ease;
}

.day-display.rolling {
  animation: slotBounce 0.12s infinite alternate;
  color: #FF6B6B;
}

@keyframes slotBounce {
  0% { transform: translateY(-5px) scale(1.02); }
  100% { transform: translateY(5px) scale(0.98); }
}

.result-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.player-slot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f1f5f9;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  transition: background 0.2s;
}

.player-slot.active {
  background: #fff0f0;
  border-color: #FF6B6B;
}

.player-name {
  font-size: 18px;
  font-weight: 700;
  color: #334155;
}

.player-day {
  font-size: 22px;
  font-weight: 800;
  color: #FF6B6B;
  min-width: 70px;
  text-align: right;
}

.final-msg {
  font-size: 19px;
  font-weight: 700;
  color: #854d0e;
  margin-top: 6px;
  padding: 12px;
  border-radius: 10px;
  background: #fef3c7;
  border: 2px solid #fde68a;
  display: none;
}

.final-msg.show {
  display: block;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.control-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.btn {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 5px 0 rgba(0,0,0,0.12);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.5px;
}

.btn:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 0 0 rgba(0,0,0,0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background-color: #10b981;
  color: #ffffff;
}

.btn-action {
  background-color: #FF6B6B;
  color: #ffffff;
}

.btn-secondary {
  background-color: #64748b;
  color: #ffffff;
}

@media (max-width: 420px) {
  body { padding: 12px; }
  #game { padding: 18px; gap: 16px; }
  .game-header h1 { font-size: 24px; }
  .day-display { font-size: 44px; }
  .btn { padding: 14px; font-size: 16px; }
  .player-name, .player-day { font-size: 16px; }
}