/* ===== Kachelwerk ===== */

.k-market {
  background: radial-gradient(circle at 50% 0%, #1f3550 0%, #18213d 85%);
}

/* Glasuren */
.k-t {
  --k-s: 26px;
  width: var(--k-s);
  height: var(--k-s);
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: calc(var(--k-s) * 0.5);
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.k-t i {
  font-style: normal;
}
.k-t.empty {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.k-c0 { background: linear-gradient(145deg, #4a86e8, #1f4fa8); }
.k-c1 { background: linear-gradient(145deg, #f2c14e, #c98a12); color: rgba(60, 35, 0, 0.75); }
.k-c2 { background: linear-gradient(145deg, #e0674a, #a3301b); }
.k-c3 { background: linear-gradient(145deg, #4b4b5c, #1c1c26); }
.k-c4 { background: linear-gradient(145deg, #3fc2b0, #17806f); }
.k-m {
  background: linear-gradient(145deg, #ffffff, #cfd3e6);
  color: #1f2240;
  font-weight: 800;
}

.k-t.hint {
  opacity: 0.18;
  box-shadow: none;
}
.k-t.hint i {
  opacity: 0.9;
}
.k-t.can {
  cursor: pointer;
}
.k-market .k-t.can:hover,
.k-t.chosen {
  transform: translateY(-3px) scale(1.08);
}
.k-t.chosen {
  box-shadow: 0 0 0 3px var(--accent), 0 4px 10px rgba(0, 0, 0, 0.4);
}
.k-wall-row .k-t.hint.can {
  opacity: 0.8;
  box-shadow: 0 0 0 3px var(--accent);
  animation: k-pulse 1.2s ease-in-out infinite;
}
.k-t:focus-visible,
.k-line:focus-visible,
.k-floor:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Manufakturen und Mitte */
.k-factories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  gap: 10px;
}
.k-fac {
  max-width: 92px;
  width: 100%;
  justify-self: center;
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #3b3f6e 0%, #2a2d52 70%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.k-fac.empty {
  opacity: 0.35;
}
.k-fac small {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--text-dim);
}
.k-fac-tiles {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px;
}
.k-center {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
}
.k-center-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  flex: none;
}
.k-center-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 26px;
  align-items: center;
}
.k-bag {
  margin: 8px 0 0;
  font-size: 0.75rem;
  text-align: right;
}

/* Bretter */
.k-board {
  --k-s: min(calc((100vw - 110px) / 11), 30px);
  padding: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.2s ease;
}
.k-board.active {
  box-shadow: 0 0 0 2px rgba(255, 184, 48, 0.55);
}
.k-board .k-t {
  --k-s: inherit;
  width: var(--k-s);
  height: var(--k-s);
}
.k-board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.k-rows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.k-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.k-line {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  width: calc(var(--k-s) * 5 + 8px);
  padding: 1px;
  border-radius: 6px;
}
.k-line.can,
.k-floor.can {
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--accent);
  background: rgba(255, 184, 48, 0.12);
}
.k-line.can:hover,
.k-floor.can:hover {
  background: rgba(255, 184, 48, 0.25);
}
.k-arrow {
  color: var(--text-dim);
  font-size: 0.8rem;
}
.k-wall-row {
  display: flex;
  gap: 2px;
}
.k-floor {
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 3px;
  border-radius: 8px;
  flex-wrap: wrap;
}
.k-floor-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  align-self: center;
  margin-right: 4px;
}
.k-fslot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.k-fslot small {
  font-size: 0.6rem;
  color: var(--bad);
}
.k-fresh {
  animation: k-flash 0.8s ease-out;
}
.k-hint {
  margin: 8px 0 0;
}

/* Die anderen: kleinere Bretter nebeneinander */
.k-others {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.k-others .k-board {
  --k-s: 20px;
}
.k-others .k-t {
  font-size: 0.6rem;
  border-radius: 4px;
}

@keyframes k-flash {
  0% { background: rgba(255, 184, 48, 0.45); }
  100% { background: transparent; }
}
@keyframes k-pulse {
  50% { opacity: 1; transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  .k-fresh,
  .k-wall-row .k-t.hint.can {
    animation: none;
  }
}
