/* ═══════════════════════════════════════════════════════════
   The Perfect Cup — dark coffee theme
   ═══════════════════════════════════════════════════════════ */
:root {
  --bg:        #17110c;
  --surface:   #1f1710;
  --surface-2: #271d14;
  --surface-3: #322619;
  --border:    #3d2f1f;
  --text:      #efe4d4;
  --muted:     #9c8a72;

  --amber:     #e08c00;
  --amber-l:   #ffb340;
  --red:       #b3402e;
  --red-l:     #ff7a5c;
  --green:     #4d8f4d;
  --green-l:   #7fd67f;
  --teal:      #2e8f83;
  --teal-l:    #5cd6c6;
  --blue-l:    #7ab8ff;

  /* card palettes */
  --ingr-bg:   #23303d;
  --ingr-bd:   #3c586f;
  --ingr-tx:   #a9d1f5;
  --rec-bg:    #3a2a10;
  --rec-bd:    #7a5a1e;
  --rec-tx:    #ffcf7d;
  --act-bg:    #3a1c16;
  --act-bd:    #7a3a2a;
  --act-tx:    #ff9d85;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

a { color: var(--amber-l); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Form elements ── */
label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 4px;
}
input, select {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
}
input:focus, select:focus { border-color: var(--amber); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #1a1208;
  background: var(--amber);
  transition: filter .12s, transform .06s;
  user-select: none;
}
.btn:hover:not(:disabled)  { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }

.btn-primary { background: var(--amber); }
.btn-green   { background: var(--green); color: #eafce9; }
.btn-teal    { background: var(--teal);  color: #e9fcf9; }
.btn-red     { background: var(--red);   color: #ffeae5; }
.btn-ghost   {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--amber); color: var(--amber-l); filter: none; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
}
.badge-wait { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }
.badge-live { background: rgba(77,143,77,.18);  color: var(--green-l); border: 1px solid var(--green); }
.badge-turn { background: rgba(224,140,0,.18);  color: var(--amber-l); border: 1px solid var(--amber); }
.badge-end  { background: rgba(179,64,46,.18);  color: var(--red-l);   border: 1px solid var(--red); }

/* ── Panels ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.ph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--amber-l);
}
.pb { padding: 12px; }

/* ── Cards ── */
.card {
  position: relative;
  width: 84px;
  height: 118px;
  border-radius: 9px;
  border: 2px solid var(--border);
  background: var(--surface-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 6px 4px;
  text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.card:hover { transform: translateY(-5px); box-shadow: 0 8px 18px rgba(0,0,0,.45); }
.card.selected {
  border-color: var(--amber-l);
  box-shadow: 0 0 0 2px rgba(255,179,64,.35), 0 8px 18px rgba(0,0,0,.45);
  transform: translateY(-7px);
}
.card .c-icon { font-size: 26px; line-height: 1; }
.card .c-name { font-size: 11px; font-weight: 800; line-height: 1.15; }
.card .c-sub  { font-size: 9px; color: var(--muted); line-height: 1.2; }

.card.ingredient { background: var(--ingr-bg); border-color: var(--ingr-bd); }
.card.ingredient .c-name { color: var(--ingr-tx); }
.card.recipe     { background: var(--rec-bg);  border-color: var(--rec-bd); }
.card.recipe .c-name { color: var(--rec-tx); }
.card.action     { background: var(--act-bg);  border-color: var(--act-bd); }
.card.action .c-name { color: var(--act-tx); }

.card-n { cursor: default; }
.card-n:hover { transform: none; box-shadow: none; }

/* mini card (admin hand view) */
.card-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-3);
}
.card-mini.ingredient { background: var(--ingr-bg); border-color: var(--ingr-bd); color: var(--ingr-tx); }
.card-mini.recipe     { background: var(--rec-bg);  border-color: var(--rec-bd);  color: var(--rec-tx); }
.card-mini.action     { background: var(--act-bg);  border-color: var(--act-bd);  color: var(--act-tx); }
.card-mini .rm {
  cursor: pointer;
  color: var(--muted);
  font-weight: 900;
  margin-left: 3px;
}
.card-mini .rm:hover { color: var(--red-l); }

/* ── Piles (admin board) ── */
.pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
}
.pile-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
}
.pile-count { font-size: 26px; font-weight: 900; color: var(--amber-l); }
.deck-stack { filter: drop-shadow(3px 3px 0 rgba(0,0,0,.4)); }

/* ── Turn banner (player) ── */
.turn-banner {
  border-radius: 10px;
  padding: 13px 16px;
  font-weight: 800;
  font-size: 15px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.turn-banner.waiting  { }
.turn-banner.your-turn {
  background: rgba(224,140,0,.14);
  border-color: var(--amber);
  color: var(--amber-l);
  animation: pulse 1.6s ease-in-out infinite;
}
.turn-banner.other-turn { color: var(--text); }
.turn-banner.win  { background: rgba(77,143,77,.15); border-color: var(--green); color: var(--green-l); }
.turn-banner.lose { background: rgba(179,64,46,.12); border-color: var(--red); color: var(--red-l); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224,140,0,.25); }
  50%       { box-shadow: 0 0 0 7px rgba(224,140,0,0); }
}

/* ── Completed recipe slots ── */
.slots { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Log ── */
.log { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.log li {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 5px;
  background: var(--surface-2);
  border-left: 3px solid var(--border);
  color: var(--muted);
}
.log li .t { color: #6d5c46; font-size: 10px; margin-right: 6px; }
.log li.turn    { border-left-color: var(--amber);  color: var(--amber-l); }
.log li.recipe  { border-left-color: var(--green);  color: var(--green-l); }
.log li.penalty { border-left-color: var(--red);    color: var(--red-l); }
.log li.win     { border-left-color: var(--amber-l); color: var(--amber-l); font-weight: 800; }
.log li.join    { border-left-color: var(--teal);   color: var(--teal-l); }
.log li.system  { border-left-color: var(--border); }
.log li.action  { color: var(--text); }

/* ── Utilities ── */
.hidden     { display: none !important; }
.w100       { width: 100%; }
.mt-4       { margin-top: 4px; }
.mt-8       { margin-top: 8px; }
.flex       { display: flex; }
.gap-8      { gap: 8px; }
.text-muted { color: var(--muted); }
.text-sm    { font-size: 12px; }
.ovf-y      { overflow-y: auto; }
.sep        { height: 1px; background: var(--border); margin: 10px 0; }

/* scrollbars */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }
