﻿/* games/order_steps/order_steps.css */

:root {
  --os-anim-fast: 140ms;
  --os-anim-base: 220ms;
  --os-anim-slow: 420ms;
}

.os-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  color: #1c2342;
  padding-bottom: 96px;
}

.os-card--auto-advance {
  padding-bottom: 96px;
}

.os-card--compact {
  gap: 7px;
}

.os-card--auto-advance > .game-footer-row {
  display: none;
}

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

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

.os-counter {
  opacity: 0.8;
}

.os-prompt {
  font-size: 1.1rem;
  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: 16px;
  padding: 16px;
  margin-top: 24px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.os-card--compact .os-prompt {
  margin-top: 10px;
  padding: 11px 10px;
  line-height: 1.3;
}

.os-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.os-card--compact .os-slots {
  gap: 7px;
}

.os-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px dashed #cdd0de;
  background: linear-gradient(180deg, #f8f8fc 0%, #f1f2f8 100%);
  cursor: pointer;
  transition:
    background var(--os-anim-fast) ease,
    border-color var(--os-anim-fast) ease,
    box-shadow var(--os-anim-fast) ease,
    transform var(--os-anim-fast) ease;
}

.os-slot:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.os-slot--hidden {
  display: none;
}

.os-slot--reveal {
  animation: os-slot-reveal var(--os-anim-base) ease-out;
}

.os-slot-index {
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #1c2342;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(28, 35, 66, 0.18);
}

.os-slot-label {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.3;
  color: #6b6f76;
}

.os-slot--filled {
  border-style: solid;
  background: #ffffff;
  color: #1c2342;
}

.os-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding-bottom: 8px;
}

.os-card--compact .os-options {
  gap: 7px;
}

.os-card--two-col-options .os-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.os-options-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.os-card--compact .os-options-col {
  gap: 7px;
}

.os-option {
  width: 100%;
  text-align: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d6d8e0;
  background: linear-gradient(180deg, #fffaf3 0%, #f3e6cb 100%);
  color: #1c2342;
  font-size: var(--os-option-font-size, 0.95rem);
  line-height: 1.35;
  cursor: pointer;
  max-height: 160px;
  overflow: hidden;
  transition:
    background var(--os-anim-fast) ease,
    border-color var(--os-anim-fast) ease,
    box-shadow var(--os-anim-fast) ease,
    transform calc(var(--os-anim-slow) * 2.85) cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity calc(var(--os-anim-slow) * 2.85) ease,
    max-height calc(var(--os-anim-slow) * 2.85) ease,
    padding calc(var(--os-anim-slow) * 2.85) ease,
    margin calc(var(--os-anim-slow) * 2.85) ease,
    border-width calc(var(--os-anim-slow) * 2.85) ease;
}

.os-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.os-option--used {
  cursor: default;
  opacity: 0.5;
  transform: scale(0.96);
  box-shadow: none;
}

.os-option--picked-anim {
  animation: os-option-gummizug-out 0.45s cubic-bezier(0.4, 0, 0.8, 1) forwards;
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-width: 0;
  transition:
    max-height 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
    padding    0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
    margin     0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.3s,
    border-width 0.5s ease 0.3s;
}

@keyframes os-option-gummizug-out {
  0%   { transform: scale(1);    opacity: 1; }
  20%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(0);    opacity: 0; }
}

.os-option--picked {
  display: none;
  pointer-events: none;
}

.os-chip-ghost {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #d6d8e0;
  background: #f7f7fb;
  color: #1c2342;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  transition:
    left var(--os-anim-slow) ease,
    top var(--os-anim-slow) ease,
    width var(--os-anim-slow) ease,
    height var(--os-anim-slow) ease,
    transform var(--os-anim-slow) ease,
    opacity var(--os-anim-slow) ease;
  overflow: hidden;
}

.os-slot--correct {
  border-color: #2e7d32;
  background: #e8f5e9;
  animation: os-slot-pop var(--os-anim-slow) ease-out;
}

.os-slot--wrong {
  border-color: #c62828;
  background: #ffebee;
  animation: os-slot-shake var(--os-anim-base) ease-out;
}

.os-card--reviewing .os-slots,
.os-card--reviewing .os-options {
  opacity: 0;
}

.os-review {
  opacity: 1 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.os-review-row {
  opacity: 0;
  transform: translateX(-48px);
  transition:
    opacity 620ms ease,
    transform 620ms ease;
}

.os-review-row--in {
  opacity: 1;
  transform: translateX(0);
}

.os-review-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(28, 35, 66, 0.12);
  background: #ffffff;
}

.os-review-index {
  min-width: 26px;
  height: 26px;
  border-radius: 999px;
  background: #1c2342;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.os-review-user {
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.3;
  color: #1c2342;
}

.os-review-mark {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.os-review-mark--ok {
  background: linear-gradient(180deg, #f7d97b 0%, #d8a32f 100%);
  color: #54380a;
}

.os-review-mark--bad {
  background: linear-gradient(180deg, #ff998f 0%, #db4437 100%);
  color: #ffffff;
}

.os-review-correct {
  margin-top: 6px;
  margin-left: 36px;
  padding: 6px 9px;
  border-radius: 10px;
  border: 1px solid rgba(46, 125, 50, 0.2);
  background: #e8f5e9;
  color: #1f5f23;
  font-size: 0.84rem;
  line-height: 1.3;
}

.os-review-countdown {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  color: #54380a;
  background: linear-gradient(180deg, #f7d97b 0%, #d8a32f 100%);
  box-shadow: 0 8px 18px rgba(216, 163, 47, 0.28);
  z-index: 10;
}

@keyframes os-slot-pop {
  0% { transform: scale(0.96); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes os-slot-shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

@keyframes os-slot-reveal {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  .os-card {
    gap: 8px;
  }

  .os-meta-row {
    font-size: 0.9rem;
  }

  .os-prompt {
    font-size: 1rem;
    padding: 14px 12px;
  }

  .os-slot {
    padding: 9px 10px;
  }

  .os-slot-label {
    font-size: 0.9rem;
  }

  .os-slot-index {
    min-width: 26px;
    height: 26px;
    font-size: 0.78rem;
  }

  .os-options {
    gap: 8px;
  }

  .os-card {
    padding-bottom: 100px;
  }

  .os-card--two-col-options .os-options {
    gap: 6px;
  }

  .os-options-col {
    gap: 6px;
  }

  .os-option {
    padding: 10px 12px;
    font-size: 0.9rem;
    min-height: 0;
  }

  .os-card--compact .os-option {
    font-size: 0.78rem;
    padding: 7px 8px;
  }

  .os-review-countdown {
    bottom: 8px;
    min-width: 30px;
    height: 30px;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .os-option,
  .os-slot,
  .os-card,
  .os-chip-ghost {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .os-option--picked-anim {
    animation: none !important;
    transform: none;
    opacity: 0;
  }
}
