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

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: #ffffff;
  color: #222;
  overflow: hidden;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-container {
  width: 100%;
  max-width: 480px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 20px;
}

#score-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

#score, #combo {
  font-size: 28px;
  font-weight: 700;
}

#customer-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 20px;
}

#customer-image {
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.speech-bubble {
  background: #f5f5f5;
  border-radius: 16px;
  padding: 16px 20px;
  max-width: 90%;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin: 0 auto;
}

.speech-bubble.hidden {
  display: none;
}

#customer-bubble::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #f5f5f5;
}

#clerk-area {
  margin-bottom: 20px;
}

#clerk-bubble {
  background: #e3f2fd;
}

#clerk-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #e3f2fd;
}

#customer-speech, #clerk-speech {
  font-size: 16px;
  text-align: center;
  line-height: 1.5;
}

#timing-bar-container {
  margin-bottom: 20px;
}

#timing-bar {
  width: 100%;
  height: 60px;
  background: #f0f0f0;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

#perfect-zone {
  position: absolute;
  left: 40%;
  width: 20%;
  height: 100%;
  background: rgba(76, 175, 80, 0.3);
  border-left: 3px solid #4CAF50;
  border-right: 3px solid #4CAF50;
}

#cursor {
  position: absolute;
  left: 0;
  width: 4px;
  height: 100%;
  background: #222;
  transition: left 0.05s linear;
}

#action-button-container {
  margin-bottom: 20px;
}

#action-button {
  width: 100%;
  padding: 18px;
  font-size: 18px;
  font-weight: 700;
  background: #222;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: transform 0.1s;
}

#action-button:active:not(:disabled) {
  transform: scale(0.98);
}

#action-button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#feedback {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  min-height: 40px;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.perfect { color: #4CAF50; }
.good { color: #FF9800; }
.miss { color: #f44336; }

#game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  text-align: center;
  z-index: 100;
}

#game-over.hidden {
  display: none;
}

#game-over h2 {
  font-size: 28px;
  margin-bottom: 20px;
}

#game-over p {
  font-size: 18px;
  margin-bottom: 12px;
}

#restart-button {
  margin-top: 20px;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 700;
  background: #222;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
}

#restart-button:active {
  transform: scale(0.98);
}