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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

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

.screen {
  background: white;
  border-radius: 20px;
  padding: 30px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.hidden {
  display: none !important;
}

/* スタート画面 */
#start-screen h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 15px;
}

.description {
  color: #666;
  margin-bottom: 30px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.1rem;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ゲーム画面 */
.header {
  margin-bottom: 20px;
}

.timer {
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
}

.timer span:first-child {
  color: #667eea;
}

.game-container {
  position: relative;
  background: #f5f5f5;
  border-radius: 15px;
  padding: 20px 10px;
  margin-bottom: 20px;
}

.spine-guide {
  position: absolute;
  left: 50%;
  top: 20px;
  bottom: 20px;
  width: 4px;
  background: rgba(102, 126, 234, 0.3);
  transform: translateX(-50%);
  border-radius: 2px;
}

.spine-blocks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.vertebra {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.15s ease-out;
  user-select: none;
  touch-action: pan-y;
  position: relative;
}

.vertebra:active {
  cursor: grabbing;
}

.vertebra svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: filter 0.2s;
}

.vertebra.correct svg .vertebra-body {
  fill: #c8e6c9;
  stroke: #28a745;
}

.vertebra.incorrect svg .vertebra-body {
  fill: #ffcdd2;
  stroke: #dc3545;
}

.instruction {
  color: #666;
  font-size: 0.9rem;
}

/* 結果画面 */
#result-screen h2 {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 20px;
}

.result-content {
  margin-bottom: 20px;
}

.score-text {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 20px;
}

.score-text span {
  color: #667eea;
  font-weight: bold;
}

.result-message {
  color: #28a745;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.btn-close {
  margin-top: 10px;
}

/* プレイ済み画面 */
#played-screen h2 {
  color: #666;
  margin-bottom: 15px;
}

#played-screen p {
  color: #999;
}

/* アニメーション */
@keyframes shake {
  0%, 100% { transform: translateX(var(--offset)); }
  25% { transform: translateX(calc(var(--offset) - 5px)); }
  75% { transform: translateX(calc(var(--offset) + 5px)); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.timer.warning {
  animation: pulse 0.5s ease-in-out infinite;
  color: #e74c3c;
}

.timer.warning span:first-child {
  color: #e74c3c;
}
