/* كلمات مترابطة — chain chips, pulsing turn, shake-out */

.game-kalimat .kalimat-setup-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.game-kalimat .kalimat-setup-row input {
  flex: 1;
}

.game-kalimat .kalimat-setup-row .btn {
  flex: 0 0 auto;
  min-width: 4.5rem;
  min-height: 3rem;
}

.game-kalimat .kalimat-name-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.game-kalimat .kalimat-name-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
  font-weight: 600;
}

.game-kalimat .kalimat-name-list button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
}

.game-kalimat .kalimat-error {
  margin: 0.65rem 0 0;
  color: #e4572e;
  font-size: 0.95rem;
}

.game-kalimat .kalimat-play-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.game-kalimat .kalimat-turn-label {
  margin: 0.85rem 0 0;
  text-align: center;
  font-size: 1.05rem;
  color: var(--muted);
}

.game-kalimat .kalimat-turn-label strong {
  color: var(--ink);
  font-size: 1.2rem;
}

.game-kalimat .kalimat-sudden {
  background: color-mix(in srgb, var(--game-warn) 22%, var(--surface));
  border: 2px solid var(--game-warn);
  color: var(--ink);
  animation: kalimat-sudden-pulse 1.1s ease infinite;
}

.game-kalimat .kalimat-flash {
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  background: var(--hit);
  font-weight: 700;
  text-align: center;
  animation: kalimat-flash-in 0.35s ease;
}

.game-kalimat .kalimat-seats .game-player {
  min-height: 3.5rem;
  cursor: default;
  pointer-events: none;
}

.game-kalimat .kalimat-seat.is-now {
  background: var(--ink);
  color: var(--accent-ink);
  animation: kalimat-seat-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 35%, transparent);
}

.game-kalimat .kalimat-seat.is-out {
  opacity: 0.38;
  text-decoration: line-through;
  background: color-mix(in srgb, var(--line) 40%, var(--surface));
  animation: none;
  box-shadow: none;
}

.game-kalimat .kalimat-seat.is-bursting {
  opacity: 1;
  position: relative;
  animation: kalimat-out-shake 0.55s ease;
}

.game-kalimat .kalimat-chain-wrap {
  display: grid;
  gap: 0.45rem;
}

.game-kalimat .kalimat-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2.2rem;
}

.game-kalimat .kalimat-chain-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.game-kalimat .kalimat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--chip);
  font-weight: 650;
  font-size: 0.95rem;
  animation: kalimat-chip-in 0.28s ease;
}

.game-kalimat .kalimat-chip.is-current {
  background: var(--ink);
  color: var(--accent-ink);
  border-color: var(--ink);
}

.game-kalimat .kalimat-judge {
  padding: 1rem 1.1rem;
}

.game-kalimat .kalimat-judge .game-field input.is-shake {
  animation: kalimat-out-shake 0.4s ease;
  border-color: var(--game-warn);
}

.game-kalimat #wordCard.is-accept {
  animation: kalimat-accept-flash 0.35s ease;
}

.game-kalimat #wordCard.is-shake {
  animation: kalimat-out-shake 0.55s ease;
}

.game-kalimat .kalimat-end {
  text-align: center;
  position: relative;
  padding-block: 2rem 1.6rem;
}

.game-kalimat .kalimat-end-sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.game-kalimat .game-big-word {
  animation: kalimat-word-in 0.4s ease both;
}

@keyframes kalimat-seat-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

@keyframes kalimat-sudden-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.82;
  }
}

@keyframes kalimat-flash-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes kalimat-chip-in {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes kalimat-word-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes kalimat-accept-flash {
  0% {
    box-shadow: var(--shadow);
  }
  40% {
    box-shadow: 0 0 0 3px #2a9d8f;
    background: color-mix(in srgb, #2a9d8f 16%, var(--surface));
  }
  100% {
    box-shadow: var(--shadow);
  }
}

@keyframes kalimat-out-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px) rotate(-1deg);
  }
  40% {
    transform: translateX(8px) rotate(1deg);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(5px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-kalimat .kalimat-seat.is-now,
  .game-kalimat .kalimat-sudden,
  .game-kalimat .kalimat-flash,
  .game-kalimat .kalimat-chip,
  .game-kalimat .game-big-word,
  .game-kalimat #wordCard.is-accept,
  .game-kalimat #wordCard.is-shake,
  .game-kalimat .kalimat-seat.is-bursting,
  .game-kalimat .kalimat-judge .game-field input.is-shake {
    animation: none;
  }
}
