* { box-sizing: border-box; }

:root {
  --bg: #14131a;
  --panel: #211f2b;
  --panel-2: #2c2937;
  --ink: #f2eee6;
  --muted: #9b95a8;
  --accent: #e0a458;
  --accent-2: #6cc4a1;
  --danger: #e0615a;
  --line: #3a3647;
}

body {
  margin: 0;
  background: radial-gradient(circle at 50% 0%, #1f1b2e 0%, var(--bg) 70%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

#app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
}

/* Two columns: the bar + instructions on the left stay put while you
   work the mixing station on the right, so you never scroll away from
   the order or the method. */
#game {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.col-left {
  position: sticky;
  top: 12px;
  align-self: start;
}
.col-right { min-width: 0; }

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
header h1 { margin: 0; font-size: 26px; letter-spacing: 0.5px; }

#hud { display: flex; gap: 14px; font-size: 15px; }
.hud-item b { color: var(--accent); }

#scene {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #0e0d14;
  border: 1px solid var(--line);
}

#guide { margin-top: 14px; }

#ticket {
  position: relative;
  background: #f7f1df;
  color: #2a2620;
  border-radius: 6px;
  padding: 14px 18px;
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}
.ticket-pin {
  position: absolute; top: -7px; left: 50%; transform: translateX(-50%);
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
#ticket b { color: #7a4d12; }
#ticket .spec { color: #5a5650; font-size: 13px; }
#ticket .speech { font-size: 17px; line-height: 1.45; font-style: italic; color: #3a352c; }
#ticket .patron-tag { margin-top: 6px; font-size: 14px; color: #6a655c; }
#ticket .order-line {
  margin-top: 10px; padding-top: 8px; font-size: 13px;
  border-top: 1px dashed #d8cfb2; color: #5a5650;
}
.mood { font-style: normal; font-size: 12px; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
.mood.tipsy { background: #f3e2c2; color: #8a5a12; }
.mood.cut { background: #f3cfc9; color: #a3352c; }

.process-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 12px 0 6px;
}
.process-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
button.ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  font-size: 12px; padding: 5px 10px; border-radius: 8px;
}
button.ghost:hover { color: var(--ink); border-color: #524c63; background: #26232f; }
button.ghost.active { color: var(--accent); border-color: var(--accent); background: #3a3320; }

#process {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 0;
  font-size: 14px;
  min-height: 20px;
  max-height: 34vh;
  overflow-y: auto;
}
#process .hidden-steps { color: var(--muted); font-size: 13px; line-height: 1.5; }
#process .hidden-steps b { color: var(--accent); }

/* Mastery Board — list of drinks achieved from memory. */
#achievements { margin-top: 12px; }
#achieveList { display: flex; flex-direction: column; gap: 6px; max-height: 30vh; overflow-y: auto; }
.achieve-empty { color: var(--muted); font-size: 13px; line-height: 1.5; }
.achieve-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 10px;
}
.achieve-badge { font-size: 18px; line-height: 1; }
.achieve-name { flex: 1; font-size: 14px; color: var(--ink); }
.achieve-count {
  font-size: 13px; font-weight: 700; color: var(--accent);
  background: #3a3320; border-radius: 20px; padding: 2px 9px;
}
.achieve-row.earned { border-color: var(--accent); animation: badgePop 0.65s ease; }
@keyframes badgePop {
  0%   { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(224,164,88,0.55); }
  45%  { transform: scale(1.05); box-shadow: 0 0 0 7px rgba(224,164,88,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(224,164,88,0); }
}
#process .phead { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
#process ol { margin: 0; padding-left: 22px; }
#process li { margin: 2px 0; line-height: 1.4; }
#process li.done { color: var(--accent-2); }
#process li.wrong { color: var(--danger); }
#process li.pending { color: var(--muted); }
#process li .did { color: var(--danger); font-size: 12px; }

#station { display: flex; flex-direction: column; gap: 10px; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.panel h3 { margin: 0 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.panel h3 small { color: #6f6a7c; font-weight: 400; }

/* Setup + service kept compact at the top of the station. */
.panel.setup { margin-bottom: 10px; }
.setup-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.setup-block { flex: 1; min-width: 0; }
.setup-row .action.start { flex: 0 0 auto; padding: 10px 16px; }
.service-row .action { flex: 1; text-align: center; }

.btn-row { display: flex; flex-wrap: wrap; gap: 7px; }
.btn-row + .btn-row { margin-top: 7px; }

button {
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
button:hover { background: #36323f; border-color: #524c63; }
button:active { transform: translateY(1px); }
button.selected { border-color: var(--accent); background: #3a3320; color: var(--accent); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.ingredient .meas { color: var(--muted); font-size: 12px; }
.added-badge {
  margin-left: 6px; font-size: 12px; color: var(--accent-2);
}

.action.serve { background: var(--accent); color: #221a0c; border-color: var(--accent); font-weight: 700; }
.action.serve:hover { background: #eeb877; }
.action.id { background: #3a3560; border-color: #4a4480; color: #d9d4f5; font-weight: 700; }
.action.id:hover { background: #4a4378; }
.action.id.done { background: #2a3a2c; border-color: #3a5a3e; color: var(--accent-2); }
.action.refuse { background: #4a2a2a; border-color: #653; }
.action.water { background: #2a4a55; border-color: #356; }
.action.clear { background: #3a2630; border-color: #543; }
.action.start { background: var(--accent-2); color: #0e2a20; border-color: var(--accent-2); font-weight: 700; }

#overlay {
  position: fixed; inset: 0;
  background: rgba(8,7,12,0.78);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 10;
}
#overlay.hidden { display: none; }
#card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  max-width: 460px;
  width: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
#cardBody h2 { margin: 0 0 6px; }
#cardBody .grade { font-size: 40px; font-weight: 800; margin: 4px 0; }

.drink-shot-wrap { text-align: center; margin: 4px 0 6px; }
.drink-shot { width: 150px; height: auto; filter: drop-shadow(0 10px 16px rgba(0,0,0,0.45)); }
.drink-shot-wrap.perfect .drink-shot { animation: shotPop 0.55s ease; }
.perfect-tag { margin-top: 2px; color: var(--accent); font-weight: 800; letter-spacing: 0.5px; }
@keyframes shotPop {
  0% { transform: scale(0.8); opacity: 0.4; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}
#cardBody .recipe {
  background: var(--panel-2); border-radius: 8px; padding: 12px;
  margin: 12px 0; font-size: 14px; line-height: 1.7;
}
#cardBody .recipe li { margin: 0; }
#cardBody .note { color: var(--muted); font-size: 14px; margin: 8px 0; }
#cardBody .good { color: var(--accent-2); }
#cardBody .bad { color: var(--danger); }
#cardBody .mastered {
  margin: 12px 0; padding: 10px 12px; border-radius: 8px;
  background: linear-gradient(90deg, #3a3320, #2c2937);
  border: 1px solid var(--accent); color: var(--accent);
  font-weight: 700; text-align: center; font-size: 15px;
}
#cardNext { width: 100%; margin-top: 8px; }

/* Refuse-reason chooser — a small centered modal. */
.mini-modal {
  position: fixed; inset: 0; z-index: 15;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(8,7,12,0.7);
}
.mini-modal.hidden { display: none; }
.mini-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 20px; width: 100%; max-width: 380px;
  text-align: center; box-shadow: 0 18px 44px rgba(0,0,0,0.5);
}
.mini-card h3 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.mini-note { margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.refuse-reasons { margin-bottom: 12px; }
.refuse-reasons .action { flex: 1; }

/* Login screen — clock in before the bar opens. */
#login {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 30%, #221b33 0%, #0e0d14 75%);
}
#login.hidden { display: none; }
#loginCard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 28px;
  width: 100%; max-width: 380px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
#loginCard h2 { margin: 0 0 4px; font-size: 30px; letter-spacing: 0.5px; }
.login-sub { margin: 0 0 20px; color: var(--muted); font-size: 15px; }
#playerName {
  width: 100%; font-family: inherit; font-size: 16px;
  color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 14px; text-align: center;
}
#playerName:focus { outline: none; border-color: var(--accent); }
#btnLogin { width: 100%; }

/* Narrow screens: single column. The order + method guide sticks to the
   top so you still see what to make while you scroll the station. */
@media (max-width: 900px) {
  #game { grid-template-columns: 1fr; }
  .col-left { position: static; }
  #guide {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 8px 0;
    background: linear-gradient(180deg, var(--bg) 82%, rgba(20,19,26,0));
  }
  #process { max-height: 26vh; }
}
