:root {
  --bg: #16181c;
  --surface: #1f2228;
  --surface-2: #262a31;
  --border: #343a42;
  --ink: #f2f0eb;
  --ink-dim: #9aa1ab;

  --alcohol: #d98e3f;
  --alcohol-ink: #1c1408;
  --soft: #4fb3a9;
  --soft-dim: #2f5c58;
  --soft-ink: #06201d;
  --danger: #e5484d;

  --display-font: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body-font: "IBM Plex Sans", -apple-system, sans-serif;
}

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

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body-font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 132px; /* keep content clear of the fixed total bar */
}

.head {
  padding: 22px 20px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.btn-new-list {
  flex: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-dim);
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 10px;
  padding: 9px 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-new-list:active { background: var(--surface-2); }

/* Only shown once there is more than one tab running. */
.list-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 16px 0;
  overflow-x: auto;
}

.list-tabs[hidden] { display: none; }

.list-tab {
  flex: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink-dim);
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 14px;
  border-radius: 10px;
  padding: 9px 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.list-tab.on {
  background: var(--alcohol);
  border-color: var(--alcohol);
  color: var(--alcohol-ink);
}

.list-tab .tab-sum {
  font-family: var(--display-font);
  font-weight: 700;
  margin-left: 7px;
  opacity: 0.75;
}

.head h1 {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 40px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

main {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.buttons {
  padding: 8px 16px 0;
}



.grid {
  display: flex;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.grid > .btn,
.grid > .cell {
  flex: 0 0 calc((100% - 20px) / 3);
  width: calc((100% - 20px) / 3);
}

.btn {
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 14px;
  padding: 20px 8px;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.96);
  filter: brightness(0.92);
}

.btn-alcohol {
  background: var(--alcohol);
  color: var(--alcohol-ink);
}

/* Row 1: mixers. Solid teal when an alcohol is armed, dimmed and inert
   otherwise, so the two identical-looking soft-drink rows never get confused. */
.btn-mix {
  background: var(--soft);
  color: var(--soft-ink);
}

.grid-mix.inactive .btn-mix {
  background: var(--soft-dim);
  color: rgba(255, 255, 255, 0.35);
  cursor: default;
}

.grid-mix.inactive .btn-mix:active {
  transform: none;
  filter: none;
}

/* Row 2: singles. Outlined so it reads as the standalone version. */
.btn-single {
  background: transparent;
  border: 1.5px solid var(--soft);
  color: var(--soft);
}

/* --- Alcohol cell: plain button, or a 50/50 split once armed --- */

.cell {
  position: relative;
  display: flex;
}

.cell .cell-main {
  width: 100%;
}

.cell.armed .cell-main {
  visibility: hidden;
}

.split {
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 14px;
  overflow: hidden;
}

.cell.armed .split {
  display: flex;
}

.half {
  flex: 1 1 50%;
  border: none;
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.half:active {
  filter: brightness(0.88);
}

.half-del {
  background: var(--danger);
  color: #fff;
}

.half-add {
  background: var(--alcohol);
  color: var(--alcohol-ink);
}

.shots-badge:not(:empty) {
  position: absolute;
  top: -7px;
  right: -6px;
  min-width: 26px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 15px;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
}

/* --- Armed-drink banner: names what the split button is holding --- */

.pending-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 16px -10px;
  padding: 11px 14px;
  background: var(--surface-2);
  border: 1px solid var(--alcohol);
  border-radius: 12px;
}

.pending-bar[hidden] {
  display: none;
}

.pending-text {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--alcohol);
}

.pending-neat {
  flex: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink-dim);
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 13px;
  border-radius: 8px;
  padding: 7px 11px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.tab {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px 6px;
  min-height: 64px;
}

.tab-list {
  list-style: none;
}

.tab-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}

.tab-list li:last-child {
  border-bottom: none;
}

.tab-item-name {
  font-size: 16px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-item-name::before {
  content: "•";
  color: var(--ink-dim);
}

.tab-item-count {
  font-family: var(--display-font);
  font-weight: 700;
  color: var(--ink-dim);
}

.tab-item-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tab-item-price {
  font-family: var(--display-font);
  font-weight: 700;
  font-size: 16px;
  color: var(--ink-dim);
}

.remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.remove-btn:active {
  background: rgba(229, 72, 77, 0.15);
}

.empty-msg {
  padding: 22px 14px;
  color: var(--ink-dim);
  font-size: 14.5px;
  text-align: center;
}

.total-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
}

.total-row {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.total-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.total-amount {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 34px;
}

.btn-clear-all {
  display: block;
  max-width: 640px;
  width: 100%;
  margin: 10px auto 0;
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  font-family: var(--body-font);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.03em;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.btn-clear-all:active {
  background: rgba(229, 72, 77, 0.1);
}
