/* Štyri v rade (public/js/hry/styri-v-rade.js): ovládanie, doska v SVG, kamene, rada, výsledok a diagramy stratégie.
   Rám hry a spoločné prvky (.g-btn, .g-seg, .g-stats, .g-result) sú v public/css/hry.css. */

/* ---------- ovládanie ---------- */
.sr{display:flex;flex-direction:column}
.sr-bar{gap:8px;margin-bottom:10px}
.sr-seg{display:flex;flex:1 1 100%}
.sr-seg .g-btn{flex:1 1 auto;padding:0 6px;font-size:13px}
.sr-first{flex:1 1 auto;min-width:0;font-size:14px}
.sr-new{flex:0 0 auto}
@media(min-width:700px){
  .sr-seg{flex:0 0 auto}
  .sr-seg .g-btn{padding:0 12px;font-size:14px}
  .sr-first{flex:0 0 auto}
  .sr-new{margin-left:auto}
}

/* ---------- doska ---------- */
/* na mobile siaha doska až do okraja karty (asi 330 px pri šírke 375 px) */
.sr-board{position:relative;margin:0 -12px;touch-action:pan-y;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}
@media(min-width:700px){.sr-board{width:100%;max-width:520px;margin:0 auto}}
.sr-svg{display:block;width:100%;height:auto;overflow:visible}
.sr-back{fill:#E8EEF6}
.sr-frame{fill:#101F38}
.sr-rims{fill:none;stroke:#0A1527;stroke-width:4}
.sr-d-body{stroke:rgba(16,31,56,.18);stroke-width:2}
.sr-d-rim{fill:none;stroke-width:4}
.sr-y .sr-d-body{fill:#FFD54A}
.sr-y .sr-d-rim{stroke:#E5B737}
.sr-r .sr-d-body{fill:#C53030}
.sr-r .sr-d-rim{stroke:#A42727}
.sr-r .sr-d-mark{fill:none;stroke:#F6C8C8;stroke-width:4}
.sr-slot{transition:opacity .25s ease}
.sr-svg.is-won .sr-slot{opacity:.42}
.sr-svg.is-won .sr-slot.sr-win{opacity:1}
.sr-winring{fill:none;stroke:#FFFFFF;stroke-width:7}
.sr-last{stroke:none}
.sr-last-y{fill:#101F38}
.sr-last-r{fill:#FFFFFF}
.sr-preview{fill:transparent;opacity:0}
.sr-preview.is-on{opacity:.34}
.sr-preview.sr-y{fill:#FFD54A}
.sr-preview.sr-r{fill:#C53030}
.sr-colnum{font-family:Montserrat,sans-serif;font-weight:700;font-size:30px;fill:#9AA6BA;text-anchor:middle;dominant-baseline:central}
.sr-ghost{opacity:0;transition:opacity .12s ease}
.sr-ghost.is-on{opacity:1}
.sr-think{animation:sr-sweep 1.3s ease-in-out infinite alternate}
@keyframes sr-sweep{from{transform:translateX(-150px)}to{transform:translateX(150px)}}

/* Džonova rada: stĺpec, cieľové pole a otrávené pole */
.sr-hint-col{fill:rgba(255,213,74,.16);stroke:#FFD54A;stroke-width:5}
.sr-hint-ring{fill:none;stroke:#FFD54A;stroke-width:8}
.sr-avoid-ring{fill:none;stroke:#FF8C8C;stroke-width:6;stroke-dasharray:11 8}
.sr-avoid-x{fill:none;stroke:#FF8C8C;stroke-width:7;stroke-linecap:round}
.sr-pulse{transform-box:fill-box;transform-origin:center;animation:sr-pulse 1.1s ease-in-out 3}
@keyframes sr-pulse{50%{transform:scale(1.1)}}

/* stĺpce ako tlačidlá (myš, dotyk aj klávesnica) */
.sr-cols{position:absolute;inset:0}
.sr-col{position:absolute;top:0;bottom:0;margin:0;padding:0;border:0;border-radius:14px;background:transparent;cursor:pointer;touch-action:pan-y}
.sr-col:focus{outline:none}
.sr-col:focus-visible{box-shadow:inset 0 0 0 3px #FFD54A,inset 0 0 0 5px #101F38}
.sr-col[aria-disabled="true"]{cursor:default}
.sr.is-busy .sr-col{cursor:progress}
.is-locked .sr-col{cursor:default}

/* ---------- stav, skóre, výsledok ---------- */
.sr-foot{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0 0}
.sr-status{display:flex;align-items:center;gap:8px;margin:0;min-width:0}
.sr-dot{flex:none;width:14px;height:14px;border-radius:50%;background:#FFD54A;box-shadow:inset 0 0 0 1.5px rgba(16,31,56,.25)}
.sr-dot.sr-r{background:#C53030;box-shadow:inset 0 0 0 3px #C53030,inset 0 0 0 4.5px #F6C8C8}
.sr-dot.is-none{display:none}
.sr-status.is-wait .sr-status-t::after{content:'';display:inline-block;width:1.2em;text-align:left;animation:sr-dots 1.2s steps(4,end) infinite}
@keyframes sr-dots{0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'...'}}
.sr-undo{flex:none}
.sr-stats{margin:10px 0 0}
.sr-result-slot:empty{display:none}
.sr-result-slot .g-result{margin-top:12px}
.g-result.sr-draw{background:#F3F6FA}
.sr-facts{font-size:15px;color:#3D4A60;font-variant-numeric:tabular-nums}
.sr-record{font-size:14px;font-weight:600;color:#1B5E36}
.g-result.is-lose .sr-record{color:#3D4A60}

@media(prefers-reduced-motion:reduce){
  .sr-think,.sr-pulse{animation:none}
  .sr-status.is-wait .sr-status-t::after{animation:none;content:'...'}
  .sr-ghost,.sr-slot{transition:none}
}

/* ---------- diagramy v stratégii (resources/views/hry/styri-v-rade.blade.php) ---------- */
.strat-fig .sr-fig{display:block;width:100%;max-width:236px;height:auto;flex:none}
.sr-fig-frame{fill:#101F38}
.sr-fig-hole{fill:#EEF3FA}
.sr-fig-y{fill:#FFD54A}
.sr-fig-r{fill:#C53030}
.sr-fig-mark{fill:none;stroke:#F6C8C8;stroke-width:2}
.sr-fig-win{fill:none;stroke:#FFFFFF;stroke-width:2.5}
.sr-fig-goal{fill:none;stroke:#FFD54A;stroke-width:3;stroke-dasharray:4 3}
.sr-fig-threat{fill:none;stroke:#FF6B6B;stroke-width:3.5;stroke-dasharray:4 3}
.sr-fig-no{fill:none;stroke:#FF6B6B;stroke-width:3.5;stroke-linecap:round}
.sr-fig-num{font-family:Montserrat,sans-serif;font-weight:800;font-size:11px;text-anchor:middle;dominant-baseline:central;fill:#101F38}
.sr-fig-num-on{fill:#FFFFFF}
.sr-fig-hot{fill:#FFD54A}
.sr-fig-label{font-family:Montserrat,sans-serif;font-weight:700;font-size:10px;text-anchor:middle;dominant-baseline:central;fill:#56627A}
.sr-fig-step{font-family:Montserrat,sans-serif;font-weight:800;font-size:12px;text-anchor:middle;dominant-baseline:central;fill:#101F38}
.sr-fig-step-r{fill:#FFFFFF}
.sr-fig-ghost{opacity:.9}
.sr-fig-plan{fill:none;stroke:#FFFFFF;stroke-width:2;stroke-dasharray:3 2.5}
.sr-fig-win-dot{fill:#1B7F47}
.sr-fig-draw-dot{fill:#8C96A8}
.sr-fig-lose-dot{fill:#C53030}
.sr-mistakes{max-width:820px}
.sr-mistakes ul{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px;font-size:16px;line-height:1.6;color:#26324A}
