/* =============================================================================
   Machine UI Kit — samodzielny CSS (ciemny motyw). Zero zależności.
   Wklej do projektu i użyj klas .machine / .fridge / .slot / .panel / .legend.
   Zmienne (--mk-*) możesz podmienić; można je też przenieść z :root na wrapper,
   żeby ograniczyć zasięg (np. `.machine-kit { --mk-... }`).
   ============================================================================= */

:root {
  --mk-bg:        #0e1116;   /* tło strony (referencyjne) */
  --mk-fridge-1:  #1b2331;   /* bryła: góra */
  --mk-fridge-2:  #141a24;   /* bryła: dół */
  --mk-slot-1:    #212a38;   /* slot: góra */
  --mk-slot-2:    #1a212c;   /* slot: dół */
  --mk-line:      #313c4b;   /* obramowania */
  --mk-line-soft: #2c3644;   /* obramowanie slotu */
  --mk-text:      #e6edf3;   /* tekst główny */
  --mk-title:     #dbe4ee;   /* tytuł nagłówka */
  --mk-muted:     #8b98a9;   /* tekst drugorzędny */
  --mk-track:     #0c131c;   /* tor miernika */
  --mk-slot-w:    158px;     /* szerokość slotu */

  --mk-green: #4ecb8d;
  --mk-amber: #f2c14e;
  --mk-red:   #f2685f;
  --mk-blue:  #5aa9f2;
}

/* ===== układ: [lodówka] [panel] [lodówka] ===== */
.machine {
  display: flex; gap: 18px; align-items: stretch;
  overflow-x: auto; padding: 4px 2px 12px;
}

/* ===== bryła (lodówka) ===== */
.fridge {
  border-radius: 16px; border: 1px solid var(--mk-line); overflow: hidden;
  background: linear-gradient(180deg, var(--mk-fridge-1) 0%, var(--mk-fridge-2) 100%);
  box-shadow: 0 10px 34px rgba(0,0,0,.38), inset 0 1px 0 rgba(255,255,255,.05);
}
.fridge-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid #2a3444;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0));
}
.fridge-head .ftitle { font-size: 12px; font-weight: 800; letter-spacing: .6px; color: var(--mk-title); }
.fridge-head .fsub   { font-size: 11px; color: var(--mk-muted); font-variant-numeric: tabular-nums; }

.fridge-body { padding: 14px; position: relative; }
.fridge-body::before {            /* odbicie szkła — jedna linia, duży efekt */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(118deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 24%);
}
.fridge-grid {                    /* numeracja KOLUMNAMI w dół */
  display: grid; position: relative; gap: 10px;
  grid-template-columns: repeat(2, var(--mk-slot-w));
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
}

/* ===== panel sterujący między bryłami ===== */
.panel {
  align-self: stretch; min-width: 62px; border-radius: 14px; border: 1px solid var(--mk-line);
  background: linear-gradient(180deg, #232d3c, #161d28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 8px 24px rgba(0,0,0,.3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 20px 0;
}
.panel .screen {
  width: 38px; height: 26px; border-radius: 5px; background: #0c1712;
  border: 1px solid #26402f; box-shadow: inset 0 0 10px rgba(78,203,141,.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--mk-green); font-size: 9px; font-weight: 700;
}
.panel .keys { display: flex; flex-direction: column; gap: 9px; }
.panel .key  { width: 11px; height: 11px; border-radius: 50%; background: #38445699;
  box-shadow: inset 0 1px 1px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.05); }
.panel .plabel { writing-mode: vertical-rl; text-orientation: mixed; font-size: 10px;
  letter-spacing: 3px; color: var(--mk-muted); font-weight: 700; }

/* ===== slot (okienko) ===== */
.slot {
  position: relative; overflow: hidden; border-radius: 10px; color: var(--mk-text);
  background: linear-gradient(180deg, var(--mk-slot-1), var(--mk-slot-2));
  border: 1px solid var(--mk-line-soft); padding: 20px 11px 10px;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.slot:hover { transform: translateY(-2px); border-color: #46536b; box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.slot .accent { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }  /* kolor: inline */
.slot .badge {
  position: absolute; top: 7px; left: 8px; font-size: 10px; font-weight: 700; letter-spacing: .3px;
  color: #9aa7b8; font-family: ui-monospace, Menlo, monospace;
  background: rgba(255,255,255,.05); border: 1px solid #33414f; border-radius: 6px; padding: 1px 6px;
}
.slot .sdot { position: absolute; top: 11px; right: 10px; width: 9px; height: 9px; border-radius: 50%; } /* kolor+poświata: inline */
.slot .name { font-size: 12.5px; font-weight: 600; line-height: 1.22; margin: 3px 0 9px; min-height: 30px; }
.slot .rowline { display: flex; justify-content: space-between; font-size: 11px; color: var(--mk-muted);
  font-variant-numeric: tabular-nums; }
.slot .foot { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--mk-muted);
  margin-top: 8px; font-variant-numeric: tabular-nums; }
.slot .big { font-size: 22px; font-weight: 800; margin: 2px 0 6px; letter-spacing: .3px; }  /* kolor: inline */
.slot.empty { opacity: .4; display: flex; flex-direction: column; justify-content: center; min-height: 116px; }

/* ===== miernik ===== */
.meter { height: 7px; border-radius: 5px; background: var(--mk-track); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03); }
.meter > i { display: block; height: 100%; border-radius: 5px; transition: width .3s ease; } /* width+kolor: inline */

/* ===== legenda ===== */
.legend { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--mk-muted); }
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .sw   { width: 12px; height: 12px; border-radius: 4px; }   /* kolor: inline */
.legend .dotp { width: 9px;  height: 9px;  border-radius: 50%; }   /* kolor: inline */

.mk-small { font-size: 12px; color: var(--mk-muted); }

/* =============================================================================
   DODATKI PWA „Dostawa" — telefon trzymany pionowo
   -----------------------------------------------------------------------------
   Fizyczna maszyna to dwa moduły OBOK siebie. Na telefonie nie mieszczą się
   w poziomie, więc układamy je JEDEN POD DRUGIM — metafora urządzenia zostaje,
   bo każdy moduł nadal ma własną bryłę, nagłówek i siatkę 2×7. Slot zwęża się
   do połowy ekranu, ale zostaje wysoki: przy automacie klika się go palcem,
   często w rękawiczce.
   ============================================================================= */
.machine--pionowo {
  flex-direction: column;
  gap: 14px;
  overflow-x: visible;
}
.machine--pionowo .fridge-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.machine--pionowo .slot { min-height: 104px; }

/* Slot jako element klikalny — to przycisk, nie kafelek dekoracyjny. */
.slot {
  width: 100%; text-align: left; font: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slot:focus-visible { outline: 2px solid var(--mk-blue); outline-offset: 2px; }
.slot:active { transform: translateY(0) scale(.985); }
.slot .name { overflow-wrap: anywhere; }

@media (min-width: 720px) {
  .machine--pionowo { flex-direction: row; gap: 18px; align-items: flex-start; }
  .machine--pionowo .fridge { flex: 1; }
  .machine--pionowo .fridge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .slot, .meter > i { transition: none; }
  .slot:hover { transform: none; }
}

/* =============================================================================
   OPCJONALNE dodatki realizmu (odkomentuj, jeśli chcesz)
   ============================================================================= */

/* Poziome „półki" — subtelne linie między rzędami slotów.
.fridge-grid { background-image: repeating-linear-gradient(
    180deg, transparent 0, transparent calc((100% - 60px) / 7),
    rgba(255,255,255,.04) calc((100% - 60px) / 7), rgba(255,255,255,.04) calc((100% - 60px) / 7 + 1px)); }
*/

/* Uchwyt drzwiczek na boku bryły.
.fridge { position: relative; }
.fridge::after { content:''; position:absolute; top:22%; right:6px; width:5px; height:56%;
  border-radius:4px; background:linear-gradient(180deg,#3a4657,#232d3c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
*/

/* Puls kropki dla stanów krytycznych: dodaj klasę .pulse na .sdot.
@keyframes mk-pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.5);opacity:.55} }
.slot .sdot.pulse { animation: mk-pulse 1.3s ease-in-out infinite; }
*/
