/* Sort the words — games/sort.html. 12.10.2026. Builds on site.css + games.css. Left-aligned, mobile first. */
.so-app { width: 100%; max-width: 1080px; }
.so-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.so-seg { display: inline-flex; border: 2px solid var(--ink, #000); border-radius: 999px; padding: 3px; gap: 2px; }
.so-segb { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; font: 700 15px var(--f-text); color: var(--ink, #000); cursor: pointer; }
.so-segb[aria-checked='true'] { background: var(--ink, #000); color: #fff; }
.so-segb:focus-visible { outline: 3px solid var(--blue, #143CAA); outline-offset: 2px; }
.so-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 600; cursor: pointer; }
.so-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.so-knob { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--line-c, #DADAD7); transition: background .2s; flex: none; }
.so-knob::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.so-switch input:checked + .so-knob { background: var(--green, #146E32); }
.so-switch input:checked + .so-knob::after { transform: translateX(18px); }
.so-switch input:focus-visible + .so-knob { outline: 3px solid var(--blue, #143CAA); outline-offset: 2px; }
.so-new { margin-left: auto; }
.so-how { margin: 0 0 16px; font-size: 15px; color: var(--grey, #555); }

/* board: mobile = 2×2 targets above the cards; desktop = 4 target columns + the card column on the right */
.so-board { display: flex; flex-direction: column; gap: 18px; }
.so-targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) {
  .so-board { display: grid; grid-template-columns: minmax(170px, 1.15fr) minmax(0, 4fr); gap: 16px; align-items: start; }
  .so-targets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
}

.so-tg { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 120px; padding: 10px; border-radius: 18px; text-align: left;
  border: 2px solid oklch(0.86 0.06 var(--h)); background: oklch(0.97 0.025 var(--h)); color: var(--ink, #000); font: inherit; cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s; }
@media (min-width: 760px) { .so-tg { min-height: 380px; padding: 12px; } }
.so-tg:focus-visible { outline: 3px solid var(--blue, #143CAA); outline-offset: 2px; }
.has-sel .so-tg { border-style: dashed; border-color: oklch(0.55 0.12 var(--h)); }
.so-tg.is-over { border-color: var(--ink, #000); border-style: solid; transform: scale(1.02); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); }
.so-th { display: flex; flex-direction: column; gap: 2px; }
.so-tt { font-size: 15px; font-weight: 700; line-height: 1.2; }
.so-tt[lang='ka'] { font: 800 24px/1.1 var(--f-ka); }
.so-ts { font-size: 12.5px; color: var(--grey, #555); line-height: 1.25; }
.so-ts[lang='ka'] { font-family: var(--f-ka); }
.so-dots { display: flex; gap: 4px; margin-top: 4px; }
.so-dots i { width: 8px; height: 8px; border-radius: 50%; background: oklch(0.86 0.06 var(--h)); }
.so-dots i.on { background: var(--green, #146E32); }
.so-list { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 760px) { .so-list { flex-direction: column; flex-wrap: nowrap; } }

.so-chip { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; padding: 5px 9px; border-radius: 10px;
  background: var(--spring, #F0FBEE); border: 2px solid var(--green, #146E32); }
.so-chip .so-ka { font: 600 15px/1.2 var(--f-ka); }
.so-chip .so-ka b { font-weight: 800; color: var(--green, #146E32); }
.so-hy { color: #9BB8A5; }
.so-ok { color: var(--green, #146E32); font-weight: 800; font-size: 13px; }
.so-ctr { flex-basis: 100%; font-size: 11.5px; color: var(--grey, #555); line-height: 1.2; padding-left: 17px; }
.so-chip.is-new { animation: so-in .35s cubic-bezier(.2, .9, .3, 1); }

/* source cards */
.so-src { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
@media (min-width: 760px) { .so-src { flex-direction: column; flex-wrap: nowrap; padding: 10px; border-radius: 18px; border: 2px dashed var(--line-c, #DADAD7); min-height: 380px; } }
.so-card { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; min-height: 46px; padding: 8px 12px; border-radius: 12px;
  border: 2px solid var(--line-c, #DADAD7); background: #fff; color: var(--ink, #000); font: inherit; text-align: left; cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .15s, border-color .15s, box-shadow .15s, opacity .15s; }
.so-card .so-ka { font: 600 17px/1.2 var(--f-ka); }
.so-card .so-tr { display: none; font-size: 12px; color: var(--grey, #555); line-height: 1.2; }
.show-tr .so-card .so-tr, .so-card.peek .so-tr { display: block; }
@media (hover: hover) { .so-card:hover { border-color: var(--ink, #000); } }
.so-card:focus-visible { outline: 3px solid var(--blue, #143CAA); outline-offset: 2px; }
.so-card.is-sel { border-color: var(--ink, #000); transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0, 0, 0, .14); }
.so-card.is-lifted { opacity: .3; }
.so-card.is-wrong { border-color: var(--red, #C83C1E); background: #FDECE8; animation: so-shake .4s; }
.so-ghost { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; margin: 0; rotate: -3deg; border-color: var(--ink, #000);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .22); cursor: grabbing; }
.so-tg.is-no { border-color: var(--red, #C83C1E); animation: so-shake .4s; }
.so-tg.is-hit { animation: so-pop .35s cubic-bezier(.2, .9, .3, 1); }
.so-live { min-height: 1.4em; margin: 12px 0 0; font-size: 14px; color: var(--grey, #555); }

@keyframes so-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes so-pop { 40% { transform: scale(1.03); } }
@keyframes so-in { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .so-card, .so-tg { transition: none; } .so-card.is-wrong, .so-tg.is-no, .so-tg.is-hit, .so-chip.is-new { animation: none; } }
.so-tg.is-done { box-shadow: 0 0 0 4px var(--green, #146E32); }

/* finale + summary */
.so-canvas { position: fixed; inset: 0; z-index: 90; pointer-events: none; transition: opacity .35s; }
.so-canvas.is-out { opacity: 0; }
.so-end { position: fixed; inset: 0; z-index: 95; background: rgba(0, 0, 0, .35); display: grid; place-items: center; padding: 16px; }
.so-end-in { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 26px; border: 2px solid var(--ink, #000);
  padding: 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .2); }
.so-end-in h2, .so-end-in p { margin: 0; }
.so-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.so-sg { background: oklch(0.97 0.025 var(--h)); border-radius: 14px; padding: 10px 12px; }
.so-sg h3 { margin: 0 0 6px; font-size: 14px; }
.so-sg h3[lang='ka'] { font: 800 18px var(--f-ka); }
.so-sg h3 span { font: 500 12px var(--f-text); color: var(--grey, #555); }
.so-sg ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.so-sg a { color: inherit; text-decoration: none; }
.so-sg a:hover span[lang='ka'] { text-decoration: underline; }
.so-sg span[lang='ka'] { font-family: var(--f-ka); font-weight: 600; }
.so-sg span + span { color: var(--grey, #555); font-size: 12.5px; }
.so-missdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red, #C83C1E); vertical-align: middle; }
.so-end-btns { display: flex; gap: 8px; margin-top: 6px; }
