/* ===================================================================
   Contracts.styles.css — Contracts (craft) page
   Two columns: inventory panel (guest = auth gate) + craft machine.
   The machine is drawn entirely in CSS.
   =================================================================== */

.how-btn { gap: 6px; }
.how-btn svg { width: 15px; height: 15px; color: var(--text-secondary); }

/* =====================================================
   LAYOUT
   ===================================================== */
.contract {
  display: grid;
  grid-template-columns: 445px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

/* ---------- Left: inventory ---------- */
.contract__inventory {
  display: grid;
  place-items: center;
  min-height: 730px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
}

/* ---------- Right: craft column ---------- */
.contract__craft {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.craft__hint {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

/* =====================================================
   CRAFT MACHINE (pure CSS)
   ===================================================== */
.craft__machine {
  display: grid;
  place-items: center;
  padding: 18px 0 0;
}

.machine {
  --m-dark: #1a1a1d;
  --m-mid: #26262a;
  --m-light: #34343a;
  --m-edge: #45454d;
  width: min(730px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 24px 44px rgba(0, 0, 0, .6));
}

/* --- top vents --- */
.machine__top {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 90px;
  width: 78%;
  height: 20px;
}

.machine__top .machine__vent {
  width: 34px;
  height: 16px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--m-light), var(--m-mid));
}

/* --- body: arms + chamber --- */
.machine__body {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  padding: 14px 0;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, var(--m-mid), var(--m-dark));
  border: 1px solid #3a3a42;
  border-bottom: 0;
}

.machine__arm {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: none;
  width: 62px;
  margin: 0 10px;
  padding-top: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, var(--m-light), var(--m-dark));
  border: 1px solid #3f3f47;
}

.machine__lens,
.machine__grip {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #4a4a54, #1b1b1f 72%);
  border: 1px solid #4e4e58;
}

.machine__grip {
  border-radius: 5px;
  background: linear-gradient(180deg, #43434c, #222227);
}

.machine__rod {
  width: 8px;
  flex: 1;
  min-height: 60px;
  border-radius: 4px;
  background: linear-gradient(180deg, #7e2230, #4a1219);
}

/* --- chamber (the dark window) --- */
.machine__chamber {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 400px;
  min-height: 210px;
  border-radius: 10px;
  background: linear-gradient(180deg, #0e0e10, #16161a);
  border: 1px solid #3a3a42;
  box-shadow: inset 0 6px 26px rgba(0, 0, 0, .85);
  display: grid;
  place-items: center;
}

/* Inner recessed panel */
.machine__chamber::before {
  content: '';
  position: absolute;
  inset: 26px 30px;
  border-radius: 8px;
  background: linear-gradient(180deg, #1b1b20, #131317);
  border: 1px solid #2c2c33;
}

.machine__slots {
  position: relative;
  display: flex;
  align-items: center;
  gap: 30px;
}

.machine__slots span {
  width: 4px;
  height: 42px;
  border-radius: 2px;
  background: linear-gradient(180deg, #2f2f37, #202026);
}

/* --- teeth strip --- */
.machine__teeth {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 7px 0 9px;
  background: linear-gradient(180deg, #202024, #17171b);
  border-left: 1px solid #3a3a42;
  border-right: 1px solid #3a3a42;
}

.machine__teeth span {
  width: 16px;
  height: 12px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(180deg, #3c3c44, #26262c);
}

/* --- base with arrows + plate --- */
.machine__base {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px 16px;
  border-radius: 0 0 16px 16px;
  background: linear-gradient(180deg, #26262b, #191a1d);
  border: 1px solid #3a3a42;
  border-top: 0;
}

.machine__fin {
  flex: 1;
  height: 42px;
  border-radius: 8px;
  background: repeating-linear-gradient(180deg, #3a3a42 0 4px, #24242a 4px 9px);
  border: 1px solid #43434b;
}

.machine__arrow {
  display: grid;
  place-items: center;
  width: 26px;
  height: 38px;
  color: var(--brand-red);
}

.machine__arrow svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 8px rgba(236, 28, 60, .55));
}

.machine__plate {
  display: grid;
  place-items: center;
  width: 92px;
  height: 46px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2b2b31, #1c1c21);
  border: 1px solid #45454e;
  color: var(--brand-red);
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 14px rgba(236, 28, 60, .6);
}

/* =====================================================
   CRAFT TRAY (sum / slots / actions)
   ===================================================== */
.craft__tray {
  margin-top: -26px;
  padding: 34px 24px 24px;
  border-radius: var(--r-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
}

.craft__tray-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.craft__sum {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.craft__sum strong {
  color: var(--text-primary);
  font-weight: 800;
}

.craft__count {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

/* --- empty slot rail --- */
.craft__slots {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) 40px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--bg-inset);
  border: 1px solid var(--border-soft);
}

.craft-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .015);
  border: 1px dashed #2a2a31;
  transition: border-color var(--t) var(--ease), background-color var(--t) var(--ease);
}

/* plus glyph */
.craft-slot::before,
.craft-slot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: #2f2f37;
  transform: translate(-50%, -50%);
  transition: background-color var(--t) var(--ease);
}

.craft-slot::before { width: 11px; height: 1.5px; }
.craft-slot::after { width: 1.5px; height: 11px; }

.craft-slot:hover {
  border-color: #3b3b45;
  background: rgba(255, 255, 255, .035);
}

.craft-slot:hover::before,
.craft-slot:hover::after { background: #4b4b57; }

.craft__next {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--r-sm);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}

.craft__next:hover {
  background: var(--bg-surface-3);
  color: var(--text-primary);
}

.craft__next svg { width: 17px; height: 17px; }

/* --- actions --- */
.craft__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.craft__btn {
  height: 48px;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-dim);
  font-size: 14px;
}

.craft__btn svg { color: var(--text-dim); }

/* Disabled is the guest state — keep it visible but inert */
.craft__btn:disabled { opacity: .6; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1280px) {
  .contract { grid-template-columns: 380px minmax(0, 1fr); }
}

@media (max-width: 1024px) {
  .contract { grid-template-columns: minmax(0, 1fr); }
  .contract__inventory { min-height: 300px; }
}

@media (max-width: 768px) {
  .machine__arm { width: 46px; margin: 0 6px; }
  .machine__chamber { min-height: 150px; }
  .machine__chamber::before { inset: 18px 20px; }
  .machine__top { gap: 46px; }
  .machine__teeth { gap: 6px; }
  .machine__teeth span { width: 12px; }
  .machine__plate { width: 70px; height: 38px; font-size: 21px; }
  .craft__tray { padding: 28px 14px 18px; }
  .craft__slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .craft__next { grid-column: span 4; aspect-ratio: auto; height: 40px; }
  .craft__actions { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .machine__teeth span { width: 9px; height: 10px; }
  .machine__fin { height: 32px; }
  .craft__tray-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
