/* Souk — the stall, the price ticket, and the haggle. */

/* ---- the stall ----------------------------------------------------------- */

.scene {
  position: relative;
  border: var(--edge);
  background: linear-gradient(var(--wall) 62%, var(--terracotta-dark) 62%);
  overflow: hidden;
}

.awning {
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    var(--terracotta) 0 12px,
    var(--sand) 12px 24px
  );
  border-bottom: var(--edge);
}

.seller {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0.4rem auto -18px;
}

.counter {
  position: relative;
  padding: 0.6rem 0 0.9rem;
  background: var(--terracotta);
  border-top: var(--edge);
}

.counter .art {
  display: block;
  width: 112px;
  height: 112px;
  margin: 0 auto;
}

.band {
  height: 12px;
  background-image: var(--stars);
  background-size: 12px 12px;
  border-top: var(--edge);
}

/* ---- the price ticket ---------------------------------------------------- */

.ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  flex-wrap: wrap;
  margin-top: var(--gap);
  padding: 0.6rem 0.8rem;
  background: var(--sand);
  color: var(--night);
  border: var(--edge);
}

.money {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.price {
  font: 700 2.4rem/1 var(--mono);
  letter-spacing: -0.02em;
}

.price.moved {
  animation: knock 0.4s ease-out;
  color: var(--terracotta-dark);
}

@keyframes knock {
  0% { transform: translateY(-6px) scale(1.08); }
  100% { transform: none; }
}

.unit {
  font: 700 0.9rem var(--mono);
  color: var(--terracotta-dark);
}

.facts {
  display: flex;
  gap: 1rem;
  margin: 0;
  font-size: 0.75rem;
}

.facts dt {
  color: var(--terracotta-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.facts dd {
  margin: 0;
  font: 700 1rem var(--mono);
}

.story {
  margin: var(--gap) 0 0;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--sand-dim);
}

/* ---- the haggle ---------------------------------------------------------- */

.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: var(--gap);
}

.line {
  max-width: 88%;
  padding: 0.5rem 0.7rem;
  border: 2px solid var(--night);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.line.salah {
  align-self: flex-start;
  background: var(--sand);
  color: var(--night);
}

.line.you {
  align-self: flex-end;
  background: var(--indigo);
  color: var(--paper);
  border-color: var(--indigo-light);
}

.line.aside {
  align-self: center;
  max-width: 100%;
  text-align: center;
  background: transparent;
  border: 0;
  border-top: 2px dashed var(--sand-dim);
  border-bottom: 2px dashed var(--sand-dim);
  color: var(--brass);
  font-size: 0.85rem;
}

.line.deal {
  align-self: center;
  background: var(--brass);
  color: var(--night);
  font-weight: 700;
}

/*
 * The composer sits at the bottom of the conversation column and never floats
 * over it. The log scrolls behind it, so the newest line of the seller stays
 * readable, and the safe area keeps it clear of the home bar of a phone.
 */
.composer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem var(--gap) calc(0.5rem + env(safe-area-inset-bottom));
  background: var(--wall);
  border-top: var(--edge);
}

input,
textarea {
  width: 100%;
  font: inherit;
  color: var(--night);
  background: var(--paper);
  border: var(--edge);
  padding: 0.45rem 0.55rem;
  resize: none;
}

.tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.count {
  font: 0.75rem var(--mono);
  color: var(--sand-dim);
  margin-inline-end: auto;
}

.count.full {
  color: var(--terracotta);
}

.send,
.take {
  font: 700 0.9rem var(--sans);
  padding: 0.5rem 1rem;
  color: var(--night);
  background: var(--brass);
  border: var(--edge);
  cursor: pointer;
}

.take {
  background: var(--sand);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.turnstile:empty {
  display: none;
}
