/* ===== ねこカフェ物語 ===== */
:root {
  --cafe-cream: #fff7ec;
  --cafe-pink: #ffd6e0;
  --cafe-brown: #8b5a3c;
  --cafe-brown-light: #c89b7b;
  --cafe-green: #a8d5a8;
  --cafe-gold: #e6b84e;
  --cafe-red: #e57373;
  --cafe-shadow: rgba(139, 90, 60, 0.25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Zen Maru Gothic', sans-serif;
  background: linear-gradient(180deg, #ffeede 0%, #ffd6e0 100%);
  color: #4a2c17;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#game-wrapper {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  padding: 6px 8px 60px;
}

.screen { position: relative; }
.hidden { display: none !important; }

/* ===== タイトル画面 ===== */
#title-screen {
  padding: 40px 20px 20px;
  text-align: center;
  animation: fadeSlideIn 0.6s ease-out;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.title-deco {
  font-size: 3rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
  gap: 12px;
}
.title-cat { animation: bob 2s ease-in-out infinite; }
.title-cup { animation: bob 2s ease-in-out infinite 0.3s; }
.title-cake { animation: bob 2s ease-in-out infinite 0.6s; }

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

.game-title {
  font-size: 2.6rem;
  color: var(--cafe-brown);
  margin: 10px 0;
  line-height: 1.2;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 var(--cafe-shadow);
}

.game-sub {
  color: var(--cafe-brown-light);
  margin: 0 0 30px;
  font-size: 1rem;
}

.big-btn {
  display: block;
  width: 80%;
  max-width: 280px;
  margin: 12px auto;
  padding: 16px 24px;
  background: linear-gradient(180deg, #ffd17a 0%, var(--cafe-gold) 100%);
  color: #fff;
  border: 3px solid #fff;
  border-radius: 30px;
  font-family: inherit;
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--cafe-brown), 0 6px 12px var(--cafe-shadow);
  transition: transform 0.1s;
}
.big-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--cafe-brown);
}

.link-btn {
  display: block;
  margin: 16px auto 0;
  background: transparent;
  border: none;
  color: var(--cafe-brown-light);
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ===== HUD ===== */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 2px solid var(--cafe-brown);
  border-radius: 14px;
  padding: 5px 10px;
  box-shadow: 0 2px 0 var(--cafe-shadow);
  margin-bottom: 6px;
}
.hud-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--cafe-brown);
  font-size: 0.85rem;
  flex: 1;
}
.hud-item:nth-child(2) { flex: 2; }
.hud-label { font-size: 0.82rem; }
.hud-value { font-size: 0.95rem; transition: transform 0.15s; }
.hud-value.bounce {
  animation: coinBounce 0.4s ease-out;
}
@keyframes coinBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.35); color: var(--cafe-gold); }
  100% { transform: scale(1); }
}

.xp-bar-wrap {
  flex: 1;
  height: 10px;
  background: var(--cafe-pink);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--cafe-brown);
}
.xp-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fcd5ce, #ffa8b6);
  transition: width 0.4s;
}

/* ===== 営業タイマー ===== */
#day-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.timer-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--cafe-brown);
  white-space: nowrap;
  transition: color 0.3s;
}
.timer-label.urgent {
  color: var(--cafe-red);
  animation: urgentPulse 0.8s ease-in-out infinite;
}
@keyframes urgentPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.day-timer-wrap {
  flex: 1;
  height: 10px;
  background: #f0dcc8;
  border-radius: 5px;
  overflow: hidden;
  border: 2px solid var(--cafe-brown);
}
.day-timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cafe-pink), #ffb6c1);
  border-radius: 4px;
  transition: width 0.25s linear;
}
.day-timer-fill.urgent {
  animation: timerFlash 0.6s ease-in-out infinite;
}
@keyframes timerFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== カフェエリア ===== */
#cafe-area {
  position: relative;
  background: linear-gradient(180deg, #fef0e0 0%, #f5e0c8 100%);
  border: 2px solid var(--cafe-brown);
  border-radius: 14px;
  padding: 8px 6px;
  min-height: 0;
  box-shadow: inset 0 0 0 2px #fff, 0 2px 0 var(--cafe-shadow);
  overflow: hidden;
}
#cafe-bg {
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 0;
  pointer-events: none;
  font-size: 1.4rem;
  opacity: 0.5;
  transition: opacity 0.5s;
}
.bg-window { position: absolute; top: 4px; left: 14%; font-size: 1.6rem; }
.bg-plant  { position: absolute; top: 8px; right: 8%; font-size: 1.8rem; }
.bg-frame  { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 1.3rem; }
/* 購入した内装アイテム */
.bg-decor {
  position: absolute;
  font-size: 1.3rem;
  opacity: 0.7;
  animation: decorFloat 3s ease-in-out infinite;
}
.bg-decor:nth-child(4) { bottom: 8px; left: 6%; animation-delay: 0s; }
.bg-decor:nth-child(5) { bottom: 12px; right: 10%; animation-delay: 0.8s; }
.bg-decor:nth-child(6) { bottom: 4px; left: 35%; animation-delay: 1.6s; }
.bg-decor:nth-child(7) { top: 10px; left: 30%; animation-delay: 0.4s; }
.bg-decor:nth-child(8) { top: 12px; right: 25%; animation-delay: 1.2s; }
@keyframes decorFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

#tables-wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 20px 2px 2px;
}

.table-slot {
  position: relative;
  background: var(--cafe-cream);
  border: 2px dashed var(--cafe-brown-light);
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 3px 5px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}
.table-slot.occupied {
  background: #fff;
  border-style: solid;
  border-color: var(--cafe-brown);
  box-shadow: 0 2px 0 var(--cafe-shadow);
  animation: tablePopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tablePopIn {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.table-slot.locked {
  background: repeating-linear-gradient(45deg, #f0dcc8, #f0dcc8 6px, #e3cbaf 6px, #e3cbaf 12px);
  cursor: not-allowed;
  opacity: 0.7;
}
.table-slot.locked::after {
  content: '🔒';
  position: absolute;
  font-size: 1.4rem;
}
.table-slot.serving-hover {
  outline: 3px solid var(--cafe-gold);
  transform: scale(1.06);
  animation: serveGlow 0.8s ease-in-out infinite;
}
@keyframes serveGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 184, 78, 0.4); }
  50% { box-shadow: 0 0 12px 4px rgba(230, 184, 78, 0.3); }
}

.empty-table {
  font-size: 1.6rem;
  opacity: 0.35;
  text-align: center;
}

.cat-customer {
  font-size: 2rem;
  line-height: 1;
  animation: catWiggle 1.8s ease-in-out infinite;
}
@keyframes catWiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.order-bubble {
  position: absolute;
  top: -6px;
  right: -4px;
  background: #fff;
  border: 2px solid var(--cafe-brown);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px var(--cafe-shadow);
  animation: bubblePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bubblePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}
.order-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 6px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-top-color: var(--cafe-brown);
}

.patience-bar {
  width: 92%;
  height: 6px;
  background: #f0dcc8;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
  border: 1px solid var(--cafe-brown);
}
.patience-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--cafe-red), var(--cafe-gold), var(--cafe-green));
  background-size: 200% 100%;
  transition: width 0.25s linear;
}

.happy-pop, .angry-pop {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  pointer-events: none;
  animation: popUp 1s ease-out forwards;
  z-index: 5;
}
@keyframes popUp {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  30% { opacity: 1; transform: translate(-50%, -30px) scale(1.2); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}

/* コンボ表示 */
.combo-pop {
  position: absolute;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1rem;
  font-weight: 900;
  color: var(--cafe-gold);
  pointer-events: none;
  animation: comboPop 1.2s ease-out forwards;
  z-index: 6;
  text-shadow: 1px 1px 0 #fff, -1px -1px 0 #fff;
  white-space: nowrap;
}
@keyframes comboPop {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.5) rotate(-5deg); }
  20% { opacity: 1; transform: translate(-50%, -20px) scale(1.3) rotate(3deg); }
  100% { opacity: 0; transform: translate(-50%, -50px) scale(1) rotate(0deg); }
}

/* ===== キッチン ===== */
#kitchen {
  background: #fff;
  border: 2px solid var(--cafe-brown);
  border-radius: 14px;
  padding: 6px;
  margin-top: 6px;
  box-shadow: 0 2px 0 var(--cafe-shadow);
}
.kitchen-label {
  font-weight: 700;
  color: var(--cafe-brown);
  font-size: 0.78rem;
  margin-bottom: 4px;
  text-align: center;
}
#stations-wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.station {
  position: relative;
  background: var(--cafe-cream);
  border: 2px solid var(--cafe-brown-light);
  border-radius: 10px;
  padding: 4px 2px 3px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s, border-color 0.2s;
  min-height: 56px;
}
.station:active { transform: translateY(2px); }
.station .st-icon { font-size: 1.3rem; display: block; transition: transform 0.2s; }
.station .st-name { font-size: 0.62rem; color: var(--cafe-brown); font-weight: 700; margin-top: 1px; display: block; }
.station .st-price { font-size: 0.58rem; color: var(--cafe-brown-light); display: block; }

.station.cooking {
  background: #ffe9c8;
  border-color: var(--cafe-gold);
}
.station.cooking .st-icon {
  animation: cookShake 0.4s ease-in-out infinite;
}
@keyframes cookShake {
  0%, 100% { transform: rotate(0) translateY(0); }
  25% { transform: rotate(-5deg) translateY(-2px); }
  75% { transform: rotate(5deg) translateY(-2px); }
}
/* 湯気エフェクト */
.station.cooking::after {
  content: '~';
  position: absolute;
  top: -2px;
  right: 8px;
  font-size: 1rem;
  color: rgba(200, 155, 123, 0.6);
  animation: steam 1s ease-out infinite;
  pointer-events: none;
}
@keyframes steam {
  0% { opacity: 0.8; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(1.5); }
}

.station.ready {
  background: #d7f5d7;
  border-color: var(--cafe-green);
  animation: readyPulse 0.8s ease-in-out infinite;
}
.station.locked  { background: #eaeaea; border-color: #ccc; color: #999; opacity: 0.6; cursor: not-allowed; }

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(168, 213, 168, 0.7); }
  50% { box-shadow: 0 0 0 6px rgba(168, 213, 168, 0); }
}

.cook-bar {
  position: absolute;
  bottom: 2px;
  left: 4px;
  right: 4px;
  height: 5px;
  background: #f0dcc8;
  border-radius: 3px;
  overflow: hidden;
}
.cook-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--cafe-gold);
  transition: width 0.15s linear;
}

.ready-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--cafe-green);
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  animation: badgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes badgePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.station.selected {
  outline: 3px solid var(--cafe-gold);
  transform: scale(1.05);
}

/* ===== アクションバー ===== */
#action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  background: var(--cafe-cream);
  border-top: 2px solid var(--cafe-brown);
  padding: 4px 4px;
  padding-bottom: max(4px, env(safe-area-inset-bottom));
  z-index: 10;
  gap: 3px;
}
.act-btn {
  flex: 1;
  max-width: 100px;
  background: #fff;
  border: 2px solid var(--cafe-brown);
  border-radius: 12px;
  padding: 4px 3px;
  margin: 0 2px;
  font-family: inherit;
  color: var(--cafe-brown);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  box-shadow: 0 2px 0 var(--cafe-shadow);
  transition: transform 0.1s;
}
.act-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--cafe-shadow);
}
.act-icon { font-size: 1.1rem; }
.act-label { font-size: 0.65rem; }

/* 共通ボタン（音量・シェア）が下部アクションバーと重ならないよう上にオフセット */
body:has(#game-screen:not(.hidden)) .sg-sound-toggle,
body:has(#game-screen:not(.hidden)) .sg-share-btn {
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

/* ===== 開店スプラッシュ ===== */
#day-splash {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 247, 236, 0.92);
  z-index: 200;
  pointer-events: none;
  animation: splashFade 1.8s ease-out forwards;
}
@keyframes splashFade {
  0% { opacity: 1; }
  60% { opacity: 1; }
  100% { opacity: 0; }
}
.splash-text {
  font-size: 3rem;
  font-weight: 900;
  color: var(--cafe-brown);
  text-shadow: 3px 3px 0 #fff, 5px 5px 0 var(--cafe-shadow);
  animation: splashZoom 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes splashZoom {
  0% { transform: scale(0.3) rotate(-10deg); opacity: 0; }
  30% { transform: scale(1.2) rotate(3deg); opacity: 1; }
  50% { transform: scale(1) rotate(0deg); }
  100% { transform: scale(1.5) rotate(0deg); opacity: 0; }
}

/* ===== レベルアップ演出 ===== */
#levelup-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 100, 0.25);
  z-index: 200;
  pointer-events: none;
  animation: lvupFade 2.5s ease-out forwards;
}
@keyframes lvupFade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}
.lvup-star {
  font-size: 2rem;
  animation: lvupStar 2.5s ease-out forwards;
}
@keyframes lvupStar {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  20% { transform: scale(1.5) rotate(0deg); opacity: 1; }
  40% { transform: scale(1) rotate(10deg); }
  100% { transform: scale(1.5) rotate(0deg); opacity: 0; }
}
.lvup-text {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--cafe-brown);
  text-shadow: 2px 2px 0 #fff;
  margin-top: 8px;
  animation: lvupText 2.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes lvupText {
  0% { transform: translateY(30px) scale(0.5); opacity: 0; }
  25% { transform: translateY(-5px) scale(1.1); opacity: 1; }
  40% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-20px) scale(1); opacity: 0; }
}

/* パーティクル（紙吹雪） */
.confetti {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 201;
  animation: confettiFall 2s ease-in forwards;
}
@keyframes confettiFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(100vh) rotate(720deg); }
}

/* ===== モーダル画面 ===== */
#shop-screen, #menu-screen, #decor-screen, #result-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 480px;
  max-height: 85vh;
  background: var(--cafe-cream);
  border: 4px solid var(--cafe-brown);
  border-radius: 22px;
  padding: 16px;
  z-index: 50;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  overflow-y: auto;
  animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes modalSlideIn {
  0% { transform: translate(-50%, -45%) scale(0.9); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
#modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 40;
  animation: overlayFadeIn 0.2s ease-out;
}
@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.modal-head h2 {
  margin: 0;
  color: var(--cafe-brown);
  font-size: 1.2rem;
}
.modal-sub {
  margin: 0 0 8px;
  color: var(--cafe-brown-light);
  font-size: 0.85rem;
}
.close-btn {
  background: var(--cafe-red);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--cafe-shadow);
  transition: transform 0.1s;
}
.close-btn:active { transform: scale(0.9); }

.tab-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.tab-btn {
  flex: 1;
  background: #fff;
  border: 2px solid var(--cafe-brown);
  border-radius: 12px;
  padding: 8px;
  font-family: inherit;
  color: var(--cafe-brown);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab-btn.active {
  background: var(--cafe-brown);
  color: #fff;
}

.shop-coins {
  background: #fff;
  border: 2px solid var(--cafe-brown);
  border-radius: 12px;
  padding: 6px 12px;
  text-align: center;
  font-weight: 700;
  color: var(--cafe-brown);
  margin-bottom: 10px;
}

.shop-item {
  background: #fff;
  border: 2px solid var(--cafe-brown-light);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.1s;
}
.shop-item:active { transform: scale(0.98); }
.shop-item.owned {
  background: #e8f5e8;
  border-color: var(--cafe-green);
}
.shop-item.locked {
  background: #efefef;
  opacity: 0.7;
}
.shop-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.shop-info {
  flex: 1;
  min-width: 0;
}
.shop-name {
  font-weight: 700;
  color: var(--cafe-brown);
  font-size: 0.95rem;
}
.shop-desc {
  font-size: 0.75rem;
  color: var(--cafe-brown-light);
  margin-top: 2px;
}
.shop-buy {
  background: linear-gradient(180deg, #ffd17a, var(--cafe-gold));
  border: 2px solid #fff;
  border-radius: 12px;
  padding: 6px 10px;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--cafe-brown);
  white-space: nowrap;
  transition: transform 0.1s;
}
.shop-buy:active { transform: translateY(1px); }
.shop-buy:disabled {
  background: #ccc;
  box-shadow: 0 2px 0 #999;
  cursor: not-allowed;
}
.shop-buy.owned {
  background: var(--cafe-green);
  box-shadow: 0 2px 0 #5a8a5a;
}

/* メニュー一覧 */
.menu-item {
  background: #fff;
  border: 2px solid var(--cafe-brown-light);
  border-radius: 14px;
  padding: 10px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.menu-item .mi-icon { font-size: 2rem; }
.menu-item .mi-body { flex: 1; }
.menu-item .mi-name { font-weight: 700; color: var(--cafe-brown); }
.menu-item .mi-detail { font-size: 0.78rem; color: var(--cafe-brown-light); margin-top: 2px; }
.menu-item.locked { opacity: 0.5; }

/* 結果画面 */
#result-screen {
  text-align: center;
}
.result-stars {
  font-size: 2.4rem;
  margin: 8px 0 4px;
  letter-spacing: 6px;
}
.result-stars .star-on {
  animation: starSpin 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.result-stars .star-on:nth-child(2) { animation-delay: 0.15s; }
.result-stars .star-on:nth-child(3) { animation-delay: 0.3s; }
@keyframes starSpin {
  0% { transform: scale(0) rotate(-90deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.result-comment {
  font-size: 0.9rem;
  color: var(--cafe-brown-light);
  margin-bottom: 10px;
}
.result-row {
  font-size: 1.05rem;
  padding: 6px 0;
  color: var(--cafe-brown);
  font-weight: 700;
}

/* トースト */
#info-toast {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(74, 44, 23, 0.92);
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-weight: 700;
  z-index: 100;
  pointer-events: none;
  animation: toastIn 0.3s;
  max-width: 90%;
  text-align: center;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* トップに戻る（ゲーム中は非表示、タイトル画面でのみ表示） */
.back-to-top-link {
  position: fixed;
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  border: 2px solid var(--cafe-brown);
  color: var(--cafe-brown);
  padding: 4px 12px;
  border-radius: 16px;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 700;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  white-space: nowrap;
}
.back-to-top-link.game-active {
  display: none !important;
}

/* 共通ボタン（シェア・音量・言語）がアクションバーに被らないよう調整 */
.sg-share-btn {
  bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
}
.sg-sound-toggle {
  bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
}

/* リザルト画面の導線ボタン（毎日表示は邪魔なので非表示） */
#result-screen .sg-recommend {
  display: none !important;
}

/* ===== レスポンシブ ===== */
@media (min-width: 700px) {
  #game-wrapper {
    max-width: 620px;
  }

  #title-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: clamp(72px, 11vh, 108px);
  }

  .title-deco {
    font-size: 3.4rem;
    gap: 16px;
    margin-bottom: 16px;
  }

  .game-title {
    font-size: 3.3rem;
  }

  .game-sub {
    font-size: 1.08rem;
    max-width: 28ch;
    margin-bottom: 34px;
  }

  .big-btn {
    width: 72%;
    max-width: 320px;
  }

  #hud,
  #cafe-area,
  #kitchen {
    width: 100%;
  }

  #action-bar {
    left: 50%;
    right: auto;
    width: min(calc(100% - 16px), 620px);
    transform: translateX(-50%);
    border-left: 2px solid var(--cafe-brown);
    border-right: 2px solid var(--cafe-brown);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    box-shadow: 0 -4px 12px rgba(139, 90, 60, 0.14);
  }
}

@media (min-width: 600px) {
  #tables-wrap {
    grid-template-columns: repeat(3, 1fr);
  }
  #stations-wrap {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 380px) {
  .cat-customer { font-size: 1.7rem; }
  .station .st-icon { font-size: 1.1rem; }
  .station .st-name { font-size: 0.56rem; }
  .station { min-height: 48px; }
  .act-label { font-size: 0.6rem; }
  .game-title { font-size: 2.2rem; }
}
