/* games/sentence_builder/sentence_builder.css */

.sb-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  min-height: 100%;
  box-sizing: border-box;
  color: #1c2342;
  padding-bottom: 96px;
}

.sb-footer-row {
  --gm-dock-height: 84px;
  --gm-dock-bg: #1c2342;
}

.sb-feedback {
  min-height: 1.5em;
  font-size: 0.88rem;
  color: #1c2342;
  padding: 0 2px;
}

.sb-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: #6b6f76;
}

.sb-topic {
  font-weight: 600;
}

.sb-counter {
  opacity: 0.8;
}

.sb-question-box {
  font-size: 0.97rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1c2342;
  text-align: center;
  background: linear-gradient(135deg, #f7f7fb, #eef0f7);
  border: 1px solid rgba(28, 35, 66, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.65);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sb-question {
  margin: 0;
}

.sb-instruction {
  font-size: 0.78rem;
  font-weight: 400;
  color: #6b7280;
  line-height: 1.4;
}

.sb-audio-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8f5ee 0%, #f1ebdf 100%);
  border: 1px solid rgba(232, 189, 79, 0.28);
  box-shadow: 0 2px 8px rgba(84, 56, 10, 0.06);
}

.sb-audio-wrapper.hidden {
  display: none;
}

.sb-audio-wrapper--disabled {
  opacity: 0.38;
  pointer-events: none;
}

.sb-audio-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #8b6c29;
  text-align: center;
}

.sb-audio-controls {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.sb-audio-btn,
.sb-silent-btn {
  flex: 1;
  min-height: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
  border-radius: 8px;
}

.sb-audio-btn {
  border: 1px solid rgba(28, 35, 66, 0.08);
  background: linear-gradient(180deg, #ffffff 0%, #f5f1e8 100%);
  color: #1c2342;
}

.sb-audio-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.sb-audio-btn.is-playing {
  background: linear-gradient(180deg, #1c2342 0%, #2b355f 100%);
  color: #ffffff;
}

.sb-silent-btn {
  border: 1.5px solid rgba(28, 35, 66, 0.15);
  background: rgba(28, 35, 66, 0.05);
  color: #555c6c;
}

.sb-silent-btn:hover {
  background: rgba(28, 35, 66, 0.09);
}

.sb-silent-btn.is-active {
  background: linear-gradient(135deg, #1c2342, #2b355f);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(28, 35, 66, 0.25);
}

.sb-joker-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sb-joker-overlay.is-visible {
  opacity: 1;
}

.sb-joker-float {
  position: fixed;
  top: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateY(-50%);
  pointer-events: auto;
}

.sb-joker-float--left {
  left: 8px;
}

.sb-joker-float--right {
  right: 8px;
  flex-direction: row-reverse;
}

.sb-joker-float-trigger {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e8bd4f, #f0ca6a);
  color: #1c2342;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(232, 189, 79, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.sb-joker-float-trigger-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.sb-joker-float-action {
  border: none;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7efe0 100%);
  color: #1c2342;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(28, 35, 66, 0.12);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px) scale(0.94);
  transition: opacity 0.18s ease, transform 0.22s ease;
}

.sb-joker-float--right .sb-joker-float-action {
  transform: translateX(-8px) scale(0.94);
}

.sb-joker-float.is-open .sb-joker-float-action {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.sb-joker-float-trigger:hover:not(:disabled),
.sb-joker-float-action:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(28, 35, 66, 0.16);
}

.sb-joker-float.is-open .sb-joker-float-action:hover:not(:disabled) {
  transform: translateX(0) scale(1);
}

.sb-joker-float.is-disabled .sb-joker-float-trigger,
.sb-joker-float-trigger:disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}

.sb-joker-float.is-disabled .sb-joker-float-action,
.sb-joker-float-action:disabled {
  opacity: 0;
  pointer-events: none;
  cursor: default;
  box-shadow: none;
}

.sb-joker-float.is-consumed {
  display: none;
}

.sb-jf-label {
  font-size: 0.76rem;
}

.sb-jf-cost {
  font-size: 0.72rem;
  color: #8b6c29;
}

.sb-answer-area {
  border-radius: 13px;
  background: linear-gradient(180deg, #f5f7fb 0%, #eceff6 100%);
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid rgba(28, 35, 66, 0.09);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.sb-answer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sb-answer-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6b6f76;
}

.sb-reset-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.sb-reset-btn:hover {
  color: #6b6f76;
}

.sb-answer-slots {
  min-height: 104px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: flex-start;
  gap: 2px 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px dashed rgba(28, 35, 66, 0.18);
  line-height: 1.6;
  font-size: 0.82rem;
}

.sb-placed-word {
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(28, 35, 66, 0.5);
  border-radius: 0;
  padding: 0 1px 1px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  color: #1c2342;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1.45;
  transition: border-color 0.12s ease, color 0.12s ease;
  animation: sb-chip-in 0.14s ease-out;
}

.sb-placed-word:hover {
  border-color: #dc2626;
  color: #dc2626;
}

.sb-placed-word::after {
  content: "\00D7";
  font-size: 0.56rem;
  font-weight: 700;
  opacity: 0.35;
  margin-left: 1px;
  vertical-align: super;
  transition: opacity 0.12s ease;
}

.sb-placed-word:hover::after {
  opacity: 0.75;
}

.sb-word-bank {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(28, 35, 66, 0.09);
  margin-top: 12px;
}

.sb-word-bank-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9ca3af;
}

.sb-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 34px;
}

.sb-word {
  border: 1px solid #d6c89a;
  border-radius: 9px;
  padding: 5px 8px;
  font-size: var(--sb-word-font-size, 0.72rem);
  font-weight: 600;
  font-family: inherit;
  background: linear-gradient(180deg, #fffaf3 0%, #f3e6cb 100%);
  color: #1c2342;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.06s ease;
}

.sb-word:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  background: #eef0f7;
  border-color: #b0b4c8;
}

.sb-word:active {
  transform: translateY(0);
}

.sb-word--used {
  visibility: hidden;
}

.sb-word--hidden-distractor {
  display: none;
}

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

.sb-card.sb-correct {
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25), 0 10px 24px rgba(0, 0, 0, 0.06);
}

.sb-card.sb-wrong {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2), 0 10px 24px rgba(0, 0, 0, 0.06);
}

.sb-joker-no-energy {
  color: #dc2626;
  font-size: 0.88rem;
  animation: sb-chip-in 0.17s ease-out;
}

.sb-card .game-footer-row {
  display: none; /* Footer ist jetzt extern (gm-docked-footer) */
}

.sb-test-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 16px 40px;
}

.sb-test-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sb-test-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sb-test-close {
  align-self: flex-end;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1c2342;
  border: none;
  font-weight: 700;
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.1s ease;
}

.sb-test-close:hover {
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .sb-card {
    max-width: 100%;
    gap: 8px;
    padding-top: 18px;
    padding-bottom: 100px;
  }

  .sb-meta-row {
    font-size: 0.9rem;
    flex-wrap: wrap;
  }

  .sb-question-box {
    font-size: 1rem;
    padding: 14px 12px;
    margin-top: 16px;
  }

  .sb-audio-btn,
  .sb-silent-btn {
    font-size: 0.68rem;
  }

  .sb-word {
    padding: 7px 9px;
    font-size: var(--sb-word-font-size, 0.74rem);
  }

  .sb-placed-word {
    font-size: 0.72rem;
  }

  .sb-joker-float--left {
    left: 6px;
  }

  .sb-joker-float--right {
    right: 6px;
  }

  .sb-joker-float-trigger {
    width: 44px;
    height: 44px;
  }

  .sb-joker-float-action {
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.72rem;
  }

}

@media (hover: none) {
  .sb-word:hover,
  .sb-placed-word:hover,
  .sb-joker-float-trigger:hover:not(:disabled),
  .sb-joker-float-action:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
  }
}
