/* SPECHT-PIEPE V2: Erzgebirgs-Braustube • Modernes Sans-Serif • Vollflächiges Spielfeld */

:root {
  --bg-deep: #15100c;
  --bg-wood: #231811;
  --bg-card: #2c1e15;
  --bg-card-soft: #36251a;
  --border-brass: #b87f35;
  --border-soft: rgba(226, 168, 75, 0.28);
  --gold: #f5b82e;
  --gold-bright: #ffe066;
  --copper: #c86d31;
  --spruce: #1e6b3d;
  --spruce-bright: #2d9658;
  --cream: #fcf3e3;
  --muted: #c9b59b;
  --danger: #ef4444;
  --success: #34d399;
  --frost: #93c5fd;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --font-sans: 'Avenir Next', 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 10%, rgba(184, 127, 53, 0.16), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(30, 107, 61, 0.18), transparent 45%),
    linear-gradient(160deg, #1b130d 0%, #120d09 100%);
  color: var(--cream);
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app-shell {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, #322217 0%, #24170f 100%);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 6px 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.specht-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.05;
  color: var(--gold-bright);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  font-family: var(--font-sans);
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.pill-btn,
.icon-btn {
  border: 1px solid var(--border-soft);
  background: #3a271b;
  color: var(--cream);
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
  font-family: var(--font-sans);
}

.pill-btn:hover,
.icon-btn:hover {
  background: #4b3323;
  border-color: var(--gold);
}

.pill-btn:active,
.icon-btn:active {
  transform: scale(0.95);
}

.icon-btn.active-toggle {
  border-color: rgba(245, 184, 46, 0.65);
  background: #48301d;
}

.icon-btn.muted-toggle {
  opacity: 0.52;
}

.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 700;
  max-width: 175px;
}

#hud-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-pen {
  opacity: 0.65;
  font-size: 0.78rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.96rem;
  padding: 0;
}

/* ===== MEISTER SPECHT BANNER ===== */
.specht-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  background: linear-gradient(90deg, rgba(46, 30, 19, 0.96), rgba(34, 24, 17, 0.92));
  border: 1.5px solid var(--border-soft);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 6px 12px;
}

.specht-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.specht-avatar.bounce {
  animation: spechtBounce 0.45s ease;
}

@keyframes spechtBounce {
  0%, 100% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(1.14) rotate(-6deg); }
  70% { transform: scale(1.06) rotate(4deg); }
}

.specht-speech {
  min-width: 0;
  flex: 1;
}

.specht-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1px;
}

.level-tag {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.beer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--cream);
}

.beer-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold);
}

#specht-quip {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.28;
  color: var(--cream);
}

/* ===== MAIN GAME LAYOUT (VOLLFLÄCHIG) ===== */
.game-layout {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}

.stat-value.gold {
  color: var(--gold-bright);
}

.stat-value.urgent {
  color: #f87171;
  animation: pulseUrgent 0.65s ease-in-out infinite alternate;
}

.mini-progress {
  margin-top: 3px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.mini-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold), #4ade80);
  border-radius: 999px;
  transition: width 0.2s ease;
}

@keyframes pulseUrgent {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.connection-pill {
  background: rgba(245, 184, 46, 0.1);
  border: 1px solid rgba(245, 184, 46, 0.3);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.79rem;
  font-weight: 700;
  color: #fde68a;
  text-align: center;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.connection-pill.connected {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.65);
  color: #a7f3d0;
}

.connection-pill.danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.effect-pill {
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}

.effect-pill.frost {
  background: rgba(59, 130, 246, 0.22);
  border: 1px solid rgba(147, 197, 253, 0.7);
  color: #dbeafe;
}

.effect-pill.double {
  background: rgba(245, 184, 46, 0.24);
  border: 1px solid rgba(250, 204, 21, 0.8);
  color: #fef08a;
}

/* ===== ROHR-SPENDER (QUEUE) ===== */
.dispenser-box {
  background: linear-gradient(180deg, #2d1e15 0%, #22160f 100%);
  border: 1.5px solid var(--border-brass);
  border-radius: var(--radius);
  padding: 10px;
}

.dispenser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.dispenser-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}

.swap-btn {
  background: #462f1e;
  border: 1px solid rgba(245, 184, 46, 0.45);
  color: var(--gold-bright);
  border-radius: 999px;
  padding: 2px 8px;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.swap-btn:hover:not(:disabled) {
  background: #5b3c25;
}

.swap-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.swap-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.next-label {
  background: var(--gold);
  color: #211206;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 900;
}

.queue-strip {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.queue-slot {
  background: #1b120c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.78;
}

.queue-slot canvas {
  width: 38px;
  height: 38px;
  display: block;
}

.queue-slot.active {
  opacity: 1;
  background: #332013;
  border: 2.5px solid var(--gold-bright);
  box-shadow: 0 0 14px rgba(245, 184, 46, 0.35);
  padding: 5px;
}

.queue-slot.active canvas {
  width: 56px;
  height: 56px;
}

/* ===== BUTTONS ===== */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.primary-btn {
  background: linear-gradient(180deg, #ffd447 0%, #e09112 100%);
  color: #221205;
  padding: 12px 16px;
  font-size: 0.96rem;
  box-shadow: 0 4px 14px rgba(224, 145, 18, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.primary-btn:hover {
  filter: brightness(1.06);
}

.primary-btn:active {
  transform: scale(0.97);
}

.primary-btn.big-btn {
  font-size: 1.02rem;
  padding: 13px 18px;
}

.fastflow-btn.ready {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  color: #052e16;
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.55);
  animation: pulseReady 1.2s ease-in-out infinite;
}

.fastflow-btn.active {
  background: linear-gradient(180deg, #fb923c 0%, #dc2626 100%);
  color: #fffbeb;
  box-shadow: 0 0 18px rgba(251, 146, 60, 0.55);
}

@keyframes pulseReady {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.025); }
}

.secondary-btn {
  background: #3b281c;
  border: 1px solid var(--border-soft);
  color: var(--cream);
  padding: 10px 14px;
  font-size: 0.88rem;
}

.secondary-btn:hover {
  background: #4b3425;
  border-color: var(--gold);
}

.small-btn {
  padding: 8px 12px;
  font-size: 0.82rem;
}

/* ===== BOARD STAGE (MAXIMAL GROSS) ===== */
.board-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.board-frame {
  position: relative;
  padding: 7px;
  background: linear-gradient(145deg, #5d3a1f 0%, #2c1a0e 50%, #4b2d17 100%);
  border: 2px solid var(--border-brass);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 0 12px rgba(0, 0, 0, 0.65);
  max-width: 100%;
}

.event-toast {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  background: rgba(24, 15, 9, 0.92);
  border: 1.5px solid var(--gold-bright);
  color: var(--gold-bright);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: toastPop 0.3s ease;
}

.event-toast.frost {
  border-color: #93c5fd;
  color: #e0f2fe;
}

@keyframes toastPop {
  from { opacity: 0; transform: translate(-50%, -8px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

#game-canvas {
  display: block;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.board-overlay {
  position: absolute;
  inset: 7px;
  border-radius: 10px;
  background: rgba(16, 10, 6, 0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 8;
}

.overlay-card {
  text-align: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-brass);
  border-radius: 14px;
  padding: 20px 24px;
  max-width: 300px;
}

.overlay-card h2 {
  margin: 0 0 8px;
  color: var(--gold-bright);
}

.overlay-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.controls-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.hint-mobile {
  display: none;
}

/* ===== MODALS ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 6, 3, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 50;
  overflow-y: auto;
}

.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, #322116 0%, #22160f 100%);
  border: 2px solid var(--border-brass);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.72);
  max-height: 92vh;
  overflow-y: auto;
}

.small-card {
  max-width: 380px;
}

/* Aufgeräumter Willkommens-Splash */
.start-card {
  max-width: 420px;
  text-align: center;
}

.start-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

.hero-specht {
  width: 72px;
  height: 72px;
  margin-bottom: 2px;
}

.kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.modal-card h2 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--gold-bright);
  font-size: 1.5rem;
  line-height: 1.15;
}

.start-tagline {
  margin: 4px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--cream);
  max-width: 340px;
}

.start-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.step-pill {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 210, 130, 0.16);
  border-radius: 12px;
  padding: 9px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--cream);
}

.step-pill span {
  font-size: 1.2rem;
  line-height: 1;
}

.modal-lead {
  margin: 10px 0 14px;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--cream);
}

.modal-sub {
  margin: 6px 0 12px;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.close-x {
  background: transparent;
  border: 1px solid var(--border-soft);
  color: var(--muted);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
}

.close-x:hover {
  color: var(--cream);
  border-color: var(--gold);
}

.name-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.name-input-row {
  display: flex;
  gap: 8px;
}

.name-input-row input {
  flex: 1;
  min-width: 0;
  background: #17100b;
  border: 1.5px solid var(--border-brass);
  border-radius: 10px;
  color: var(--cream);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 700;
  padding: 10px 12px;
  outline: none;
}

.name-input-row input:focus {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(245, 184, 46, 0.25);
}

.dice-btn {
  width: 44px;
  height: 44px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.modal-actions.split {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.danger-link {
  background: transparent;
  border: none;
  color: #fca5a5;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
}

/* ===== WIN / SPILL / GAMEOVER ===== */
.stars-row {
  font-size: 2rem;
  text-align: center;
  letter-spacing: 6px;
  margin-bottom: 6px;
}

.win-card,
.spill-card,
.gameover-card {
  text-align: center;
}

.breakdown-box {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.88rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.bd-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.bd-row.total {
  border-top: 1px solid var(--border-soft);
  padding-top: 6px;
  margin-top: 4px;
  font-weight: 800;
  color: var(--gold-bright);
  font-size: 0.96rem;
}

.bd-row.bonus {
  color: #6ee7b7;
}

.bd-row.penalty {
  color: #fca5a5;
}

.next-preview {
  background: rgba(30, 107, 61, 0.24);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.83rem;
  color: #d1fae5;
  margin-bottom: 4px;
}

.spill-badge {
  display: inline-block;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #fecaca;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.spill-reason {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 8px 12px;
  color: #fde68a;
  font-weight: 700;
  font-size: 0.92rem;
  margin: 10px 0;
}

.rank-banner {
  background: linear-gradient(90deg, rgba(245, 184, 46, 0.18), rgba(200, 109, 49, 0.22));
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-weight: 800;
  color: var(--gold-bright);
  font-size: 0.98rem;
}

.mini-scores {
  text-align: left;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

/* ===== SCORES TABLE ===== */
.scores-table-wrap {
  max-height: 52vh;
  overflow-y: auto;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.scores-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.scores-table th,
.scores-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.scores-table th {
  background: rgba(245, 184, 46, 0.12);
  color: var(--gold);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}

.scores-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.scores-table tr.highlight-row {
  background: rgba(245, 184, 46, 0.2);
}

.scores-table tr.player-row td:nth-child(2) {
  color: var(--gold-bright);
  font-weight: 800;
}

.rank-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

/* ===== HELP LIST ===== */
.help-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 8px;
}

.help-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
  padding: 9px 10px;
}

.help-icon {
  font-size: 1.2rem;
  line-height: 1.2;
}

.help-item strong {
  display: block;
  color: var(--gold-bright);
  font-size: 0.88rem;
  margin-bottom: 2px;
}

.help-item p {
  margin: 0;
  font-size: 0.81rem;
  line-height: 1.38;
  color: var(--cream);
}

/* ===== RESPONSIVE MOBILE LAYOUT ===== */
@media (max-width: 860px) {
  .app-shell {
    padding: 6px 8px 14px;
    gap: 6px;
  }

  .topbar {
    padding: 5px 8px;
  }

  .brand-emblem {
    width: 32px;
    height: 32px;
  }

  .brand-text h1 {
    font-size: 0.98rem;
  }

  .brand-sub {
    display: none;
  }

  .player-pill {
    padding: 4px 7px;
    font-size: 0.75rem;
    max-width: 96px;
  }

  .icon-btn {
    width: 30px;
    height: 30px;
    font-size: 0.86rem;
  }

  .specht-banner {
    padding: 5px 9px;
    gap: 8px;
  }

  .specht-avatar {
    width: 32px;
    height: 32px;
  }

  #specht-quip {
    font-size: 0.8rem;
  }

  .game-layout {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .side-panel {
    gap: 6px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
  }

  .stat-card {
    padding: 5px 6px;
    text-align: center;
  }

  .stat-label {
    font-size: 0.58rem;
  }

  .stat-value {
    font-size: 0.88rem;
  }

  .connection-pill {
    padding: 4px 8px;
    font-size: 0.73rem;
  }

  .dispenser-box {
    padding: 6px 8px;
  }

  .dispenser-header {
    margin-bottom: 5px;
    font-size: 0.68rem;
  }

  .queue-slot canvas {
    width: 34px;
    height: 34px;
  }

  .queue-slot.active canvas {
    width: 48px;
    height: 48px;
  }

  .action-buttons {
    flex-direction: row;
  }

  .fastflow-btn {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.86rem;
  }

  .small-btn {
    padding: 10px 10px;
    font-size: 0.78rem;
  }

  .board-frame {
    padding: 4px;
  }

  .event-toast {
    font-size: 0.74rem;
    padding: 5px 10px;
    top: 10px;
  }

  .hint-desktop {
    display: none;
  }

  .hint-mobile {
    display: inline;
  }
}
