:root {
  --bg: #2b211a;
  --wood: #7a4a2b;
  --wood-dark: #5c3620;
  --paper: #fff7e8;
  --accent: #c0392b;
  --accent-dark: #922b21;
  --noren-blue: #2f5d6b;
  --text: #3a2c20;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #3a2d22, var(--bg));
  font-family: "Hiragino Maru Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app {
  width: 100%;
  max-width: 420px;
}

.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.screen.is-active {
  display: flex;
}

.title {
  color: var(--paper);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* --- IDLE: 店構え --- */
.shopfront {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  border: 4px solid var(--wood-dark);
  line-height: 0;
}

.shopfront-svg {
  display: block;
  width: 100%;
  height: auto;
}

.noren-panel {
  animation: sway 3.5s ease-in-out infinite;
  transform-origin: top center;
}

.noren-panel:nth-of-type(2) {
  animation-delay: 0.4s;
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(0.8deg); }
}

/* --- 共通ボタン --- */
.btn {
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary {
  background: var(--accent);
  color: var(--paper);
}

.btn-secondary {
  background: var(--paper);
  color: var(--text);
}

.btn-reset {
  background: transparent;
  color: var(--paper);
  border: 2px solid var(--paper);
}

/* --- 店内ステージ --- */
.stage {
  position: relative;
  width: 100%;
  height: 380px;
  background: linear-gradient(180deg, #3f2f22, var(--wood));
  border-radius: 16px;
  border: 4px solid var(--wood-dark);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.shopkeeper-frame {
  position: relative;
  width: 240px;
  height: 307px;
  overflow: hidden;
  margin-bottom: -8px;
  transform-origin: bottom center;
}

.shopkeeper {
  position: absolute;
  left: -117px;
  top: -10px;
  width: 440px;
  max-width: none;
  height: auto;
}

.shopkeeper-frame.is-busy {
  animation: chop 0.4s ease-in-out infinite;
}

@keyframes chop {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-3deg); }
}

.steam {
  position: absolute;
  left: 50%;
  bottom: 230px;
  transform: translateX(-50%);
  display: none;
  gap: 6px;
}

.steam.is-visible {
  display: flex;
}

.steam span {
  display: block;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  animation: rise 1.4s ease-in infinite;
  opacity: 0;
}

.steam span:nth-child(2) { animation-delay: 0.3s; }
.steam span:nth-child(3) { animation-delay: 0.6s; }

@keyframes rise {
  0% { opacity: 0; transform: translateY(0) scale(0.8); }
  30% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-40px) scale(1.4); }
}

.plate {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translate(-50%, 40px);
  min-width: 220px;
  max-width: calc(100% - 24px);
  width: max-content;
  min-height: 64px;
  background: radial-gradient(ellipse at center, #ffffff 55%, #d8d2c6 100%);
  border-radius: 50px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.35);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 30px;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.plate.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dish-name {
  font-weight: bold;
  font-size: clamp(1.1rem, 4.5vw, 1.4rem);
  color: var(--text);
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}

.dish-name.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- セリフ --- */
.speech {
  min-height: 1.4em;
  color: var(--paper);
  font-size: 1rem;
  font-weight: bold;
  text-align: center;
  margin: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.speech.is-visible {
  opacity: 1;
}

/* --- アクション --- */
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 48px;
}
