:root {
  --amai-orange: #e8641c;
  --amai-orange-light: #ff8e3c;
  --amai-red: #c8232c;
  --amai-red-dark: #97171e;
  --amai-cream: #fff7ea;
  --amai-cream-2: #fdebd2;
  --amai-gold: #f4b93c;
  --amai-brown: #4a2b18;
  --amai-ink: #2b1a10;
  --amai-green: #229954;
  --amai-blue: #2980b9;
  --shadow: 0 12px 32px rgba(56, 24, 6, 0.28);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #23160f;
  font-family: 'Zen Maru Gothic', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--amai-ink);
  touch-action: none;
}

canvas#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.hidden {
  display: none !important;
}

/* Edge guards for mobile swipe-back prevention */
.edge-guard {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 16px;
  z-index: 40;
  pointer-events: none;
}
.edge-guard.left { left: 0; }
.edge-guard.right { right: 0; }

/* World-space overlays */
#worldLayer {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}

.world-tag {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: transform 0.12s ease;
  pointer-events: auto;
  cursor: pointer;
}
.world-tag.cooking {
  background: #2c211b;
  color: #ffe39b;
}
.world-tag.action {
  background: #ff981a;
  color: #fff;
  animation: pulseTag 0.85s ease-in-out infinite;
}
.world-tag.ready {
  background: #219653;
  color: #fff;
  animation: pulseTag 1.1s ease-in-out infinite;
}
.world-tag.burnt {
  background: #1a1414;
  color: #ff6b6b;
  border-color: #ff4d4d;
}
.world-tag.warn {
  background: #d92626;
  color: #fff;
  animation: pulseTag 0.5s ease-in-out infinite;
}
.world-tag.label-static {
  background: rgba(255, 248, 236, 0.92);
  color: var(--amai-brown);
  border: 1.5px solid rgba(155, 92, 42, 0.35);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.cust-bubble {
  position: absolute;
  transform: translate(-50%, -100%);
  background: #fffdf8;
  color: var(--amai-ink);
  border: 2.5px solid var(--amai-orange);
  border-radius: 16px;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 800;
  max-width: 210px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.cust-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  border-width: 8px 6px 0 6px;
  border-style: solid;
  border-color: var(--amai-orange) transparent transparent transparent;
}
.cust-bubble.angry {
  background: #ffe9e9;
  border-color: #d92626;
  color: #9b1212;
}
.cust-bubble.angry::after { border-top-color: #d92626; }
.cust-bubble.rumor {
  background: #fff3cd;
  border-color: #d97706;
  color: #7c2d12;
}
.cust-bubble.rumor::after { border-top-color: #d97706; }

.float-pop {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 900;
  color: #ffd54f;
  text-shadow: 0 2px 0 #5b2500, 0 0 8px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: floatUp 1.05s ease-out forwards;
}
.float-pop.neg { color: #ff6b6b; }
.float-pop.fact { color: #7ef9ff; }

@keyframes pulseTag {
  0%, 100% { transform: translate(-50%, -100%) scale(1); }
  50% { transform: translate(-50%, -100%) scale(1.07); }
}
@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.9); }
  25% { opacity: 1; transform: translate(-50%, -80%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(1); }
}

/* Drag Ghost */
#dragGhost {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  transform: translate(-50%, -50%);
  background: rgba(255, 247, 234, 0.96);
  border: 3px solid var(--amai-orange);
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 900;
  color: var(--amai-brown);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* HUD */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: calc(8px + var(--safe-top)) 12px 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(28, 15, 7, 0.72) 0%, rgba(28, 15, 7, 0) 100%);
}

.hud-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}
.hud-day {
  font-size: 13px;
  font-weight: 800;
  color: #ffd39b;
}
.hud-clock {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  line-height: 1.05;
}

.hud-center {
  text-align: center;
  background: rgba(34, 18, 8, 0.65);
  backdrop-filter: blur(6px);
  padding: 5px 14px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 198, 118, 0.45);
}
.hud-cash {
  font-size: 22px;
  font-weight: 900;
  color: #ffd54f;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}
.hud-cash.debt { color: #ff7676; }
.hud-rating {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.gg-brand b:nth-child(1) { color: #4285f4; }
.gg-brand b:nth-child(2) { color: #ea4335; }
.gg-brand b:nth-child(3) { color: #fbbc05; }
.gg-brand b:nth-child(4) { color: #4285f4; }
.gg-brand b:nth-child(5) { color: #34a853; }
.gg-brand b:nth-child(6) { color: #ea4335; }
.stars { color: #ffc107; letter-spacing: -1px; }

.hud-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}
.hud-meters {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.rage-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
}
.rage-bar {
  width: 72px;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
}
.rage-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffb74d, #e53935);
  transition: width 0.25s ease;
}
.tp-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  background: rgba(34, 18, 8, 0.65);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
}
.tp-wrap.low {
  background: #c8232c;
  animation: pulseBtn 0.7s infinite;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: rgba(40, 20, 10, 0.72);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.icon-btn:active { transform: scale(0.92); }

/* Order Tickets */
#tickets {
  position: fixed;
  top: calc(74px + var(--safe-top));
  left: 10px;
  z-index: 18;
  width: 176px;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}
#tickets::-webkit-scrollbar { display: none; }

.ticket {
  background: rgba(255, 249, 239, 0.96);
  border: 2px solid #d5b48a;
  border-radius: 10px;
  padding: 7px 9px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.ticket:hover { transform: translateX(3px); }
.ticket.ready {
  border-color: #229954;
  background: #ecfdf3;
  box-shadow: 0 0 0 2px rgba(34, 153, 84, 0.35), 0 6px 14px rgba(0, 0, 0, 0.25);
}
.ticket.rumor-alert {
  border-color: #e65100;
  background: #fff6e6;
  box-shadow: 0 0 0 2px rgba(232, 100, 28, 0.45);
}
.ticket.drop-target {
  border-color: #2563eb;
  transform: scale(1.03);
}
.ticket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 900;
  color: var(--amai-brown);
  gap: 4px;
}
.ticket-avatar {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.patience-bar {
  height: 5px;
  border-radius: 999px;
  background: #e5d4be;
  margin: 4px 0 5px;
  overflow: hidden;
}
.patience-fill {
  height: 100%;
  background: #22c55e;
  transition: width 0.2s linear, background-color 0.3s;
}
.ticket-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  font-weight: 700;
}
.ticket-items li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 2px;
  border-bottom: 1px dashed rgba(130, 88, 45, 0.22);
}
.ticket-items li:last-child { border-bottom: none; }
.ticket-items li.done {
  color: #15803d;
  text-decoration: line-through;
}
.ticket-trickle {
  font-size: 11px;
  color: #9a6d43;
  font-style: italic;
  margin-top: 2px;
}
.ticket-serve-cta {
  margin-top: 6px;
  width: 100%;
  background: #229954;
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.ticket-fact-btn {
  margin-top: 6px;
  width: 100%;
  background: linear-gradient(135deg, #f37b2b, #c8232c);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  animation: pulseBtn 0.8s infinite;
}

/* A-Mai Live Companion */
#amaiCompanion {
  position: fixed;
  right: 12px;
  bottom: calc(74px + var(--safe-bottom));
  z-index: 16;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}
#amaiCompanion img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
  transition: transform 0.2s ease;
}
#amaiCompanion.pop img {
  transform: scale(1.15) rotate(-4deg);
}
.amai-bubble {
  background: #fffaf0;
  border: 2px solid var(--amai-orange);
  color: var(--amai-brown);
  border-radius: 12px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  max-width: 170px;
  margin-bottom: 4px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

/* Tutorial Box */
#tutBox {
  position: fixed;
  top: calc(76px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  width: min(440px, calc(100vw - 24px));
  background: #fffaf2;
  border: 3px solid var(--amai-red);
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow);
}
#tutAvatar {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
}
.tut-body { flex: 1; min-width: 0; }
.tut-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
#tutStep {
  font-size: 12px;
  font-weight: 900;
  color: var(--amai-red);
}
.tut-skip {
  border: none;
  background: var(--amai-cream-2);
  color: var(--amai-brown);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.tut-text {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  color: var(--amai-ink);
}
.tut-text strong { color: var(--amai-red); }

/* Callout Tip Button */
#callBtn {
  position: fixed;
  bottom: calc(82px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 10px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: linear-gradient(135deg, #ff9924, #d92626);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(200, 35, 44, 0.5);
  cursor: pointer;
  animation: pulseBtn 0.7s infinite;
}
#callBtn img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

/* Toast */
#toast {
  position: fixed;
  top: calc(176px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 35;
  background: rgba(200, 35, 44, 0.94);
  color: #fff;
  border: 2px solid #ffd599;
  border-radius: 14px;
  padding: 9px 18px;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  max-width: min(420px, calc(100vw - 32px));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

body.easy-on #callBtn,
body.easy-on #toast {
  left: calc(50% - 125px);
}
@media (max-width: 600px) {
  body.easy-on #callBtn,
  body.easy-on #toast {
    left: 50%;
  }
}

/* Bottom Bar */
#bottomBar {
  position: fixed;
  bottom: calc(12px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-pill {
  background: rgba(42, 22, 10, 0.82);
  color: #fff7ea;
  border: 2px solid rgba(255, 200, 128, 0.65);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  gap: 5px;
}
.nav-pill:active { transform: scale(0.95); }
.nav-pill:disabled { opacity: 0.35; pointer-events: none; }

.trash-zone {
  background: rgba(34, 24, 20, 0.88);
  border: 2px dashed rgba(255, 190, 130, 0.7);
  border-radius: 14px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  transition: transform 0.12s ease, background 0.15s ease;
}
.trash-zone.hot {
  background: #c8232c;
  border-style: solid;
  transform: scale(1.12);
}
.trash-ico { font-size: 18px; line-height: 1.1; }

/* Easy Mode Panel */
#easyPanel {
  position: fixed;
  top: calc(74px + var(--safe-top));
  right: 8px;
  bottom: calc(14px + var(--safe-bottom));
  width: min(260px, 46vw);
  z-index: 22;
  background: rgba(30, 17, 10, 0.86);
  backdrop-filter: blur(8px);
  border: 2px solid var(--amai-gold);
  border-radius: 16px;
  padding: 10px;
  color: #fff8ee;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.easy-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 180, 70, 0.16);
  border-radius: 10px;
  padding: 5px 8px;
  font-weight: 900;
  font-size: 15px;
  color: #ffd57e;
}
.easy-arrow {
  background: var(--amai-orange);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}
.easy-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffc88a;
}
.easy-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.easy-empty {
  font-size: 12px;
  color: rgba(255, 240, 220, 0.55);
  padding: 6px 2px;
}
.easy-btn {
  width: 100%;
  text-align: left;
  border: 1.5px solid rgba(255, 200, 120, 0.45);
  border-radius: 10px;
  background: rgba(255, 247, 234, 0.14);
  color: #fff;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.easy-btn.action { background: #e8641c; border-color: #ffd599; }
.easy-btn.ready { background: #219653; border-color: #a7f3d0; }
.easy-btn.burnt { background: #7f1d1d; border-color: #fca5a5; }
.easy-btn:active { transform: scale(0.97); }
.easy-item-lbl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.food-thumb {
  width: 28px;
  height: 28px;
  object-fit: contain;
  vertical-align: middle;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.food-thumb.sm {
  width: 22px;
  height: 22px;
}

/* Title Menu & Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 10, 4, 0.62);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
}

.menu-card, .overlay-card {
  width: min(460px, 100%);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  background: var(--amai-cream);
  border: 4px solid var(--amai-red);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  color: var(--amai-ink);
}

.shop-sign {
  background: linear-gradient(135deg, #c8232c 0%, #e8641c 100%);
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid #ffd166;
  box-shadow: 0 4px 12px rgba(180, 40, 15, 0.35);
}
.sign-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 6px;
  gap: 8px;
}
.sign-vertical {
  writing-mode: vertical-rl;
  font-size: 13px;
  font-weight: 900;
  color: #ffe39b;
  letter-spacing: 2px;
  border-right: 1.5px solid rgba(255, 227, 155, 0.45);
  padding-right: 6px;
}
.sign-main {
  flex: 1;
  color: #fff;
}
.sign-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 2px;
  text-shadow: 0 3px 0 rgba(115, 18, 12, 0.65);
}
.sign-sub {
  font-size: 12px;
  font-weight: 800;
  color: #ffebc2;
  margin-top: 3px;
}
.sign-mascot {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}
.sign-banner {
  background: repeating-linear-gradient(
    -45deg,
    #f37b2b,
    #f37b2b 10px,
    #e56516 10px,
    #e56516 20px
  );
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  padding: 5px 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.menu-tagline {
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: #7c4d2b;
  margin: 8px 0 10px;
}

.shop-picker {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 9px;
}
.shop-opt {
  text-align: left;
  background: var(--amai-cream-2);
  border: 2px solid #e2bc8e;
  border-radius: 12px;
  padding: 9px 12px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.15s, background 0.15s;
}
.shop-opt strong { font-size: 14px; color: var(--amai-brown); }
.shop-opt span { font-size: 11.5px; color: #8c5a32; font-weight: 700; }
.shop-opt.active {
  background: #fff;
  border-color: var(--amai-red);
  box-shadow: 0 0 0 2px rgba(200, 35, 44, 0.2);
}
.shop-opt.active strong { color: var(--amai-red); }

.easy-toggle {
  width: 100%;
  background: #fff2dc;
  border: 2px solid #e2bc8e;
  border-radius: 11px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--amai-brown);
  cursor: pointer;
  margin-bottom: 10px;
}
.easy-toggle.on {
  background: #e8f8ee;
  border-color: #229954;
  color: #146c37;
}

.mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 10px;
}
.btn-primary {
  border: 2.5px solid #ffd166;
  border-radius: 14px;
  background: linear-gradient(180deg, #e53935 0%, #a9161c 100%);
  color: #fff;
  padding: 11px 8px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 4px 0 #7b0f14;
}
.btn-primary.accent {
  background: linear-gradient(180deg, #f37b2b 0%, #c83e10 100%);
  box-shadow: 0 4px 0 #8a2505;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #7b0f14; }
.btn-big { font-size: 19px; font-weight: 900; }
.btn-small { font-size: 11px; opacity: 0.92; font-weight: 700; }

.sub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}
.btn-soft {
  background: #fff1db;
  border: 1.5px solid #deb686;
  border-radius: 10px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--amai-brown);
  cursor: pointer;
}
.btn-soft:hover { background: #ffe4bc; }

.menu-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  color: #9b6c45;
  padding-top: 4px;
  border-top: 1px dashed #e0be96;
}

/* Overlay Modal Components */
.ov-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f0d2ac;
}
.ov-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--amai-red);
  margin: 0;
}
.ov-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 2px solid #f0cba0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.ov-hero img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  flex-shrink: 0;
}
.ov-hero p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}
.stat-row {
  background: #fff;
  border: 1px solid #f0d4b2;
  border-radius: 9px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 800;
}
.stat-row strong { color: var(--amai-red); }
.stat-row strong.pos { color: #1d8348; }

.reviews-box {
  background: #fff;
  border: 1.5px solid #e6cdb0;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
}
.review-item {
  border-top: 1px solid #f1e3d2;
  padding-top: 9px;
  margin-top: 9px;
}
.review-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
}
.review-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff3e0;
  border: 1.5px solid #f3b572;
  object-fit: contain;
}
.review-text {
  font-size: 13px;
  margin: 4px 0;
  line-height: 1.45;
}
.review-reply {
  background: #f8f3ec;
  border-left: 3px solid var(--amai-orange);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: #5b3b22;
}

.section-heading {
  font-size: 15px;
  font-weight: 900;
  color: var(--amai-brown);
  margin: 12px 0 8px;
}

.upgrade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.upgrade-card {
  background: #fff;
  border: 2px solid #e7c79f;
  border-radius: 12px;
  padding: 8px;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.upgrade-card.owned {
  background: #ecfdf3;
  border-color: #229954;
  cursor: default;
}
.upgrade-card:disabled:not(.owned) { opacity: 0.5; cursor: not-allowed; }
.upgrade-card strong { font-size: 13px; color: var(--amai-brown); }
.upgrade-card span { font-size: 11px; color: #7a5234; line-height: 1.3; }
.upgrade-price { font-size: 12px; font-weight: 900; color: var(--amai-red); margin-top: auto; }

.draft-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.draft-card {
  background: #fff;
  border: 2.5px solid var(--amai-orange);
  border-radius: 13px;
  padding: 10px 7px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.draft-card:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16); }
.draft-card.curse {
  border-color: #7c3aed;
  background: #f5f0ff;
}
.draft-badge {
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  background: #ffe4c4;
  color: #b4470b;
}
.draft-card.curse .draft-badge { background: #e9d5ff; color: #6b21a8; }
.draft-card img { width: 46px; height: 46px; object-fit: contain; }
.draft-card strong { font-size: 13px; color: var(--amai-ink); }
.draft-card p { margin: 0; font-size: 11px; color: #6b4c35; line-height: 1.35; }

.list-cards {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 12px;
}
.ach-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1.5px solid #e7c79f;
  border-radius: 12px;
  padding: 8px 10px;
}
.ach-card.locked { opacity: 0.55; filter: grayscale(0.75); }
.ach-card img { width: 44px; height: 44px; object-fit: contain; }
.ach-info strong { display: block; font-size: 13.5px; }
.ach-info span { font-size: 12px; color: #7a5234; }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1.5px solid #ead0b0;
  border-radius: 11px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 800;
}
.toggle-pill {
  border: none;
  border-radius: 999px;
  padding: 5px 14px;
  font-family: inherit;
  font-weight: 900;
  cursor: pointer;
  background: #d1d5db;
  color: #374151;
}
.toggle-pill.on { background: #229954; color: #fff; }

.ov-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.ov-actions button { flex: 1; padding: 11px; font-size: 15px; }

/* Loading */
#loading {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: radial-gradient(circle at center, #fff7ea 0%, #f5cfa0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: opacity 0.35s ease;
}
#loading.fade { opacity: 0; pointer-events: none; }
.loading-amai {
  width: 120px;
  height: 120px;
  object-fit: contain;
  animation: hop 0.65s ease-in-out infinite alternate;
}
.loading-text {
  font-size: 16px;
  font-weight: 900;
  color: var(--amai-brown);
}
@keyframes hop {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}
@keyframes pulseBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  #tickets { width: 150px; top: calc(68px + var(--safe-top)); }
  .hud-clock { font-size: 20px; }
  .hud-cash { font-size: 18px; }
  .sign-title { font-size: 26px; }
  .sign-mascot { width: 58px; height: 58px; }
  #amaiCompanion img { width: 62px; height: 62px; }
  .draft-grid { grid-template-columns: 1fr; }
  .upgrade-grid { grid-template-columns: 1fr; }
  #easyPanel { width: min(230px, 52vw); }
}
