/* Story Order (sequence) game: assets/play/sequence.js */
.sq-loading { text-align: center; color: var(--navy); padding: 40px 0; }
.sq { max-width: 900px; margin: 0 auto; }
.sq-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1.6vw, 14px); }
.sq-n4 .sq-slots { grid-template-columns: repeat(4, 1fr); }
.sq-slot, .sq-spot { min-width: 0; }
.sq-slot { background: var(--soft); border-radius: 16px; padding: 6px 6px 8px; transition: transform .2s, box-shadow .2s; }
.sq-tag { display: flex; align-items: center; gap: 6px; font: 800 clamp(.85rem, 2.4vw, 1.1rem)/1 var(--display); color: var(--navy); margin: 0 0 6px 2px; }
.sq-tag b { display: inline-flex; align-items: center; justify-content: center; width: 1.7em; height: 1.7em; border-radius: 50%;
  background: var(--navy); color: #fff; font-weight: 800; }
.sq-s0 .sq-tag b { background: #2e9e47; } .sq-s1 .sq-tag b { background: #3f70d9; }
.sq-s2 .sq-tag b { background: #ed8c00; } .sq-s3 .sq-tag b { background: #d93836; }
.sq-n3 .sq-s2 .sq-tag b { background: #d93836; }
.sq-frame { aspect-ratio: 4 / 3; border-radius: 12px; border: 3px dashed var(--line); background: #fff; position: relative; }
.sq-slot.sq-want .sq-frame { border-color: var(--blue); animation: sq-pulse 1.2s ease-in-out infinite; }
.sq-slot.sq-done .sq-frame { border: 0; }
.sq-slot.sq-done .sq-tag::after { content: "\2713"; color: var(--green); font-size: 1.2em; margin-left: auto; padding-right: 4px; }
.sq-slot.sq-bad .sq-frame { border-color: var(--red); animation: none; }
.sq-slot.sq-lit { transform: scale(1.04); box-shadow: 0 0 0 4px var(--yellow); }
.sq-tip { text-align: center; margin: 12px 0 6px; font: 700 .95rem var(--body); color: var(--navy); opacity: .7; }
.sq-tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(6px, 1.6vw, 14px); padding: 10px; border-radius: 18px;
  background: #f4f6fa; }
.sq-n4 .sq-tray { grid-template-columns: repeat(4, 1fr); }
.sq-spot { aspect-ratio: 4 / 3; border-radius: 12px; box-shadow: inset 0 0 0 2px #e1e6ee; }
.sq-card { display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 3px solid #d4dce8; border-radius: 12px; overflow: hidden;
  background: #fff; cursor: pointer; box-shadow: 0 5px 0 #c9d3e2; position: relative; z-index: 1; }
.sq-card svg { display: block; width: 100%; height: 100%; }
.sq-card:focus-visible { outline: 4px solid var(--blue); outline-offset: 2px; }
@media (hover: hover) { .sq-spot .sq-card:hover, .sq-card.sq-wrong:hover { border-color: var(--blue); } }
.sq-frame .sq-card { box-shadow: none; }
.sq-card.sq-ok { border-color: var(--green); cursor: default; }
.sq-card.sq-wrong { border-color: var(--red); filter: saturate(.6); }
.sq-card.sq-hint { animation: sq-bob 1s ease-in-out infinite; border-color: var(--green); box-shadow: 0 5px 0 #168a56; }
.sq-tray.sq-in .sq-spot { animation: sq-in .4s ease-out both; }
.sq-tray.sq-in .sq-spot:nth-child(2) { animation-delay: .08s; }
.sq-tray.sq-in .sq-spot:nth-child(3) { animation-delay: .16s; }
.sq-tray.sq-in .sq-spot:nth-child(4) { animation-delay: .24s; }
@keyframes sq-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(18, 161, 220, .35); } 50% { box-shadow: 0 0 0 6px rgba(18, 161, 220, 0); } }
@keyframes sq-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes sq-in { 0% { opacity: 0; transform: translateY(16px) scale(.9); } 100% { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .sq-n4 .sq-slots { grid-template-columns: repeat(2, 1fr); }
  .sq-slot { padding: 4px 4px 6px; border-radius: 12px; }
  .sq-tray { padding: 6px; }
}
@media (prefers-reduced-motion: reduce) { .sq-card, .sq-frame, .sq-spot { animation: none !important; } }
