/* ============================================================
 * overlays.css — 弹窗、制作弹窗、出杯弹窗、教程
 * v14
 * ============================================================ */

/* ============ 通用弹窗 ============ */
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(26,15,8,.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 100;
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: 100%; max-width: 350px;
  background: #F5E6D3;
  padding: 16px;
  box-shadow: inset -4px -4px 0 0 #D8C0A0, inset 4px 4px 0 0 #FFF6E8, 0 0 0 4px #8B5E3C, 0 8px 0 0 #5A3A24;
  animation: modalIn .22s cubic-bezier(.34,1.56,.64,1);
  max-height: 82vh;
  display: flex; flex-direction: column;
}
@keyframes modalIn {
  0%   { transform: scale(.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.modal-head {
  font-size: 15px; font-weight: 800;
  color: #5A3A24; margin-bottom: 12px;
  text-align: center; flex-shrink: 0;
}
.modal-body {
  font-size: 12.5px;
  color: #5A3A24;
  line-height: 1.8;
  overflow-y: auto;
  flex: 1; min-height: 0;
}
.modal-foot {
  margin-top: 14px;
  display: flex; gap: 6px;
  flex-shrink: 0;
}
.modal-foot .pixel-btn { flex: 1; flex-direction: row; }

/* ============ 保存配方弹窗 / 定价 ============ */
.price-suggest { text-align: center; font-size: 11.5px; color: #8A6A50; margin: 8px 0 4px; }
.price-suggest b { color: #C06030; }
.price-input-wrap { position: relative; display: flex; align-items: center; justify-content: center; margin: 6px 0; }
.price-prefix { position: absolute; left: 36%; font-size: 20px; font-weight: 800; color: #A88A6A; pointer-events: none; }
.price-input {
  width: 100%;
  padding: 12px 12px 12px 42px;
  font-family: inherit; font-size: 20px; font-weight: 800;
  color: #E8703A;
  background: #FFFCF6;
  border: none; outline: none;
  text-align: center;
  box-shadow: inset -3px -3px 0 0 #D8C4A8, inset 3px 3px 0 0 #FFF, 0 0 0 3px #C9A07A;
}
.price-hint { font-size: 11px; text-align: center; color: #8A6A50; min-height: 18px; font-weight: 700; }

/* ============ 制作弹窗 ============ */
.count-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 8px 0; }
.count-opt {
  border: none; background: #FFFCF6; color: #8A6A50;
  font-family: inherit; font-size: 14px; font-weight: 800;
  padding: 10px 2px;
  cursor: pointer;
  box-shadow: inset -2px -2px 0 0 #E0CBB0, inset 2px 2px 0 0 #FFF;
  transition: transform .08s;
}
.count-opt:active { transform: scale(.96); }
.count-opt.on {
  background: #FFD9A8; color: #7A4A28;
  box-shadow: inset -2px -2px 0 0 #C99050, inset 2px 2px 0 0 #FFEAC8, 0 0 0 2px #E8703A;
}
.production-info { text-align: center; font-size: 11.5px; color: #8A6A50; line-height: 1.7; padding: 6px 0; }
.production-info b { color: #C06030; font-size: 13px; }

/* ============ 出杯弹窗 ============ */
.serve-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; }
.serve-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: #FFFCF6;
  box-shadow: inset -2px -2px 0 0 #E0CBB0, inset 2px 2px 0 0 #FFF;
  cursor: pointer;
  font-family: inherit; border: none;
  text-align: left;
  transition: transform .08s;
}
.serve-item:active { transform: scale(.97); }
.serve-item .serve-img {
  width: 48px; height: 48px;
  flex-shrink: 0;
  image-rendering: pixelated;
  background: #F5E8D8;
  box-shadow: inset -1px -1px 0 0 #D8C4A8, inset 1px 1px 0 0 #FFF;
}
.serve-item .serve-info { flex: 1; min-width: 0; }
.serve-item .serve-name {
  font-size: 12.5px; font-weight: 800; color: #5A3A24;
  margin-bottom: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.serve-item .serve-tags { display: flex; flex-wrap: wrap; gap: 2px; font-size: 9.5px; }
.serve-item .serve-tags .tag { font-size: 9px; padding: 1px 4px; }
.serve-item .serve-price { font-size: 14px; font-weight: 800; color: #E8703A; flex-shrink: 0; }
.serve-item.current {
  box-shadow: inset -2px -2px 0 0 #C99050, inset 2px 2px 0 0 #FFEAC8, 0 0 0 2px #5EA83A;
}

/* ============ 新手教程 ============ */
.tutorial-layer {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 80;
}
.tut-bubble {
  position: absolute;
  max-width: 240px;
  min-width: 190px;
  background: #FFFBE8;
  padding: 10px 12px 22px 12px;
  pointer-events: auto;
  box-shadow: inset -3px -3px 0 0 #F0E0B0, inset 3px 3px 0 0 #FFFDF0, 0 0 0 4px #FFB03A, 0 0 0 8px rgba(255,176,58,.30), 0 6px 0 10px rgba(180,100,20,.35);
  animation: tutIn .35s cubic-bezier(.34,1.56,.64,1);
  transition: top .25s cubic-bezier(.34,1.56,.64,1), left .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes tutIn {
  0%   { transform: translateY(10px) scale(.9); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.tut-step {
  position: absolute;
  top: -12px; left: -12px;
  background: #FFB03A;
  color: #fff;
  font-size: 11px; font-weight: 900;
  padding: 2px 8px;
  box-shadow: 0 3px 0 rgba(160,90,20,.5);
  letter-spacing: .5px;
}
.tut-text { font-size: 12.5px; color: #5A3A24; line-height: 1.55; font-weight: 700; }
.tut-skip {
  position: absolute;
  bottom: 5px; right: 8px;
  background: transparent; border: none;
  color: #B08030;
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
  opacity: .8;
}
.tut-skip:active { opacity: 1; }
.tut-target {
  position: relative;
  z-index: 82;
  animation: tutPulse 0.9s ease-in-out infinite;
}
@keyframes tutPulse {
  0%,100% {
    box-shadow: 0 0 0 4px #FFB03A, 0 0 0 8px rgba(255,176,58,.45) !important;
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 0 4px #FFB03A, 0 0 0 16px rgba(255,176,58,.12) !important;
    filter: brightness(1.08);
  }
}