/* Dapur Kilat — warm kitchen theme, built for readable screenshots. */
:root {
  --cream: #fff6e5;
  --wood: #b4713b;
  --wood-dark: #8a4f24;
  --ink: #2e2118;
  --red: #d94f30;
  --green: #3f9d4e;
  --gold: #f2b705;
  --card: #fffdf7;
  --line: #e8d5b5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #f7e8cf;
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

#app {
  max-width: 1240px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  box-shadow: 0 0 40px rgba(90, 50, 10, 0.25);
  display: flex;
  flex-direction: column;
  padding: 0 18px 12px;
}

/* ---- top bar ---- */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 4px 10px;
  border-bottom: 3px solid var(--wood);
}

#brand { display: flex; align-items: center; gap: 12px; }
#brand-mark {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--red);
  display: inline-flex; align-items: center; justify-content: center;
}
#brand-mark svg { width: 36px; height: 36px; }
#brand h1 { margin: 0; font-size: 30px; letter-spacing: 0.5px; color: var(--red); }
#subtitle { margin: 0; font-size: 13px; color: #7a5a3a; }

#hud { display: flex; gap: 10px; align-items: stretch; }
.hud-box {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 6px 14px;
  text-align: center;
  min-width: 84px;
}
.hud-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #9a7a55; }
#day-timer, #coins, #combo { font-size: 26px; font-weight: 800; line-height: 1.1; }
#timer-box.low #day-timer { color: var(--red); animation: pulse 0.8s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
#hearts-box { font-size: 24px; display: flex; align-items: center; color: var(--red); letter-spacing: 2px; }

/* ---- order board ---- */
#order-board { padding: 12px 4px 4px; }
#board-title { margin: 0 0 8px; font-size: 16px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--wood-dark); }
#orders { display: flex; gap: 12px; min-height: 118px; }
.order-ticket {
  flex: 1;
  background: var(--card);
  border: 2px solid var(--line);
  border-left: 8px solid var(--gold);
  border-radius: 12px;
  padding: 10px 12px;
  position: relative;
  animation: slide-in 0.25s ease-out;
}
@keyframes slide-in { from { transform: translateY(-8px); opacity: 0; } }
.order-ticket.urgent { border-left-color: var(--red); }
.order-ticket .dish-name { font-size: 20px; font-weight: 800; }
.order-ticket .dish-need { font-size: 14px; color: #6d5138; margin-top: 2px; }
.order-ticket .patience {
  height: 10px; background: #f0dfc2; border-radius: 6px; margin-top: 10px; overflow: hidden;
}
.order-ticket .patience > i {
  display: block; height: 100%; background: var(--green); border-radius: 6px;
  transition: width 0.2s linear;
}
.order-ticket.urgent .patience > i { background: var(--red); }
.order-ticket .tip { font-size: 12px; color: #9a7a55; margin-top: 6px; }
.order-slot-empty {
  flex: 1; border: 2px dashed var(--line); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #b59a72; font-size: 14px;
}

/* ---- kitchen ---- */
#kitchen { display: flex; gap: 16px; padding: 12px 4px; flex: 1; }
#counter { flex: 1.5; }
#assembly { flex: 1; }
#kitchen h2 { margin: 0 0 10px; font-size: 16px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--wood-dark); }
#counter-hint { font-size: 12px; color: #9a7a55; text-transform: none; letter-spacing: 0; }

#bins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bin {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 6px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  position: relative;
}
.bin:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(90, 50, 10, 0.2); }
.bin:active { transform: scale(0.96); }
.bin .bin-icon { height: 56px; display: flex; align-items: center; justify-content: center; }
.bin .bin-icon svg { width: 52px; height: 52px; }
.bin .bin-name { font-weight: 700; font-size: 15px; margin-top: 4px; }
.bin .bin-key {
  position: absolute; top: 6px; left: 8px;
  background: #f0dfc2; border-radius: 6px; padding: 1px 7px;
  font-size: 12px; font-weight: 700; color: #7a5a3a;
}
.bin.fly { animation: fly-pop 0.3s ease; }
@keyframes fly-pop { 40% { transform: scale(1.12); } }

/* ---- assembly / plate ---- */
#assembly {
  background: #fbeed3;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
#plate {
  min-height: 150px;
  background: #fff;
  border: 3px solid var(--wood);
  border-radius: 50%;
  width: 230px; height: 150px;
  margin: 6px auto 10px;
  border-radius: 50% / 50%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  flex-wrap: wrap;
  padding: 12px 18px;
  box-shadow: inset 0 0 0 8px #fdf3dd, inset 0 0 0 10px var(--line);
}
#plate .plate-item { animation: drop-in 0.25s ease-out; cursor: pointer; }
#plate .plate-item svg { width: 58px; height: 58px; }
@keyframes drop-in { from { transform: translateY(-16px) scale(0.6); opacity: 0; } }
#plate.ready { border-color: var(--green); box-shadow: inset 0 0 0 8px #e8f7e4, inset 0 0 0 10px var(--green), 0 0 18px rgba(63, 157, 78, 0.45); }
#plate-status { text-align: center; min-height: 22px; font-size: 14px; color: #6d5138; }
#serve-btn, #clear-btn, #overlay-btn {
  font-family: inherit; font-weight: 800; cursor: pointer; border: none; border-radius: 12px;
}
#serve-btn {
  background: var(--green); color: #fff; font-size: 20px; padding: 12px; margin-top: 8px;
}
#serve-btn:disabled { background: #c9b18f; cursor: not-allowed; }
#serve-btn:not(:disabled) { animation: glow 1s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 16px rgba(63, 157, 78, 0.8); } }
#serve-btn span { font-size: 13px; opacity: 0.85; }
#clear-btn { background: transparent; color: #8a6a45; font-size: 13px; padding: 8px; margin-top: 6px; }
#clear-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- footer / overlay / toast ---- */
#helpbar {
  display: flex; gap: 18px; flex-wrap: wrap;
  border-top: 2px solid var(--line);
  padding-top: 10px; font-size: 13px; color: #8a6a45;
}
#helpbar b { color: var(--ink); }
#day-progress { margin-left: auto; }

#overlay {
  position: fixed; inset: 0; background: rgba(46, 33, 24, 0.6);
  display: flex; align-items: center; justify-content: center; z-index: 10;
}
#overlay[hidden] { display: none; }
#overlay-card {
  background: var(--cream); border-radius: 18px; padding: 28px 36px; text-align: center;
  border: 3px solid var(--wood); max-width: 420px;
}
#overlay-card h2 { margin: 0 0 8px; color: var(--red); font-size: 28px; }
#overlay-stats { font-size: 17px; line-height: 1.7; margin: 12px 0; }
#overlay-btn { background: var(--red); color: #fff; font-size: 18px; padding: 12px 28px; }

#toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 20px;
  font-size: 15px; font-weight: 700; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
#toast.show { opacity: 1; }

/* Narrow screens: stack the kitchen instead of squeezing it. */
@media (max-width: 820px) {
  #topbar { flex-wrap: wrap; }
  #kitchen { flex-direction: column; }
  #bins { grid-template-columns: repeat(4, 1fr); }
  #orders { flex-wrap: wrap; }
  .order-ticket { flex: 1 1 200px; }
}
body.shake #app { animation: shake 0.3s ease; }
@keyframes shake {
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
