/* Sløjfe (slitherlink-typen): prikker, tal og streger på papir. Skrift, filt og bjælke kommer fra Solitaire.css og kabale-kort.css */
:root { --bord: #4A3B2A; --bjaelke: #2C2318; --knap: #634F38; --roed: #C63F28; --okker: #D69A2D; --papir: #FCF7EE; --blaek: #1E2421; --streg: #24598A; }
html.kabale-mork { --bord: #2A2118; --bjaelke: #17120D; --knap: #3F3224; --papir: #E9E2D3; }
body { background: var(--filt), var(--bord); color: var(--creme); font-variant-numeric: tabular-nums; }
button, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#kk-bar { align-items: center; }
#kk-bar select {
  font: 600 15px/1.2 Poppins, system-ui, sans-serif; min-height: 44px; padding: 0 34px 0 14px; border: 1px solid rgba(252,247,238,.22); border-radius: 8px;
  background: var(--knap) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23FCF7EE' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: var(--creme); cursor: pointer; -webkit-appearance: none; appearance: none; min-width: 0;
}
#kk-bar select option { background: #FCF7EE; color: #1E2421; }
#kk-bar button:focus-visible, #kk-bar select:focus-visible, #knapper button:focus-visible, #info button:focus-visible, #kk-besked button:focus-visible { outline: 3px solid var(--creme); outline-offset: 2px; }
@media (max-width: 460px) {
  #kk-bar { gap: 6px; padding: 6px; flex-wrap: nowrap; }
  #kk-bar button, #kk-bar select { flex: 1 1 auto; font-size: 14px; padding-left: 8px; padding-right: 8px; }
  #kk-bar select { padding-right: 24px; background-position: right 8px center; }
}
#spil { flex: 1 1 auto; min-height: 0; display: grid; gap: 8px; padding: 8px; box-sizing: border-box; position: relative;
  grid-template-columns: var(--str); grid-template-areas: "info" "braet" "knapper"; justify-content: center; align-content: center; }
#spil.side { grid-template-columns: var(--str) 240px; grid-template-rows: max-content 1fr; grid-template-areas: "braet info" "braet knapper"; gap: 12px 24px; }
#info { grid-area: info; display: flex; align-items: center; gap: 10px; min-height: 42px; font: 600 15px/1.3 Poppins, system-ui, sans-serif; }
#spil.side #info { flex-wrap: wrap; align-content: flex-start; }
#status { flex: 1 1 auto; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#spil.side #status { flex-basis: 100%; -webkit-line-clamp: 5; }
#status.taenker::after { content: ''; display: inline-block; width: 1.2em; animation: prik 1.2s steps(4) infinite; }
@keyframes prik { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
#ur { font-weight: 400; }
#pause { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(252,247,238,.22); background: var(--knap); color: var(--creme); font: 600 14px/1 Poppins, system-ui, sans-serif; cursor: pointer; }
html.sk-uden-ur #pause { display: none; }
#knapper { grid-area: knapper; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; align-content: start; }
#spil.side #knapper { grid-template-columns: 1fr 1fr; }
#knapper button { min-height: 52px; border-radius: 8px; cursor: pointer; font: 600 15px/1.1 Poppins, system-ui, sans-serif; border: 1px solid rgba(252,247,238,.22); background: var(--knap); color: var(--creme); padding: 0 4px; }
#knapper button:disabled { opacity: .45; cursor: default; }
#knapper button[aria-pressed="true"] { background: var(--creme); color: var(--bjaelke); box-shadow: inset 0 -4px 0 var(--roed); }

#braet { grid-area: braet; width: var(--str); height: var(--str); display: block; justify-self: center; touch-action: none; -webkit-user-select: none; user-select: none; border-radius: 10px; background: var(--papir); outline: none; }
#braet:focus-visible { box-shadow: 0 0 0 3px var(--creme); }
.prik { fill: var(--blaek); pointer-events: none; }
.tal { font: 600 52px/1 Poppins, system-ui, sans-serif; fill: var(--blaek); pointer-events: none; }
.tal.ok { fill: #3E7A4A; opacity: .6; }
.tal.over { fill: var(--roed); text-decoration: underline; }
.kant-hit { fill: transparent; cursor: pointer; }
.streg { stroke: var(--streg); stroke-width: 11; stroke-linecap: round; pointer-events: none; }
.kryds { stroke: #8A7A66; stroke-width: 5; stroke-linecap: round; pointer-events: none; }
.tip-kant { stroke: var(--okker); stroke-width: 12; stroke-dasharray: 12 10; stroke-linecap: round; pointer-events: none; animation: tipk 1s linear infinite; }
.tip-kant.fejl { stroke: var(--roed); }
@keyframes tipk { to { stroke-dashoffset: -44; } }
.markoer { fill: none; stroke: var(--roed); stroke-width: 5; stroke-dasharray: 8 6; pointer-events: none; }
#spil.vundet .streg { stroke: #3E7A4A; animation: lys 900ms ease-out; }
@keyframes lys { 50% { stroke-width: 17; } }
#kk-besked { width: max-content; max-width: min(calc(100vw - 32px), 460px); box-sizing: border-box; }
#kk-besked p { margin: 0 0 6px; font-size: 15px; }
#kk-besked.regler p { text-align: left; }
#kk-besked .knapper { display: flex; justify-content: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
#kk-besked .knapper button { margin: 0; }
#kk-besked button.primaer { background: var(--roed); color: var(--creme); }
.sk-ugedag { background: var(--bjaelke); }
@media (prefers-reduced-motion: reduce) { .tip-kant, #spil.vundet .streg, #status.taenker::after { animation: none; } }
