/* 500: grøn filt som kabalerne (kortspil, se docs/DESIGNMANUAL-SPIL.md). Bord, bjælke, skrift og kort kommer fra Solitaire.css og kabale-kort.css */
:root {
  --roed: #C63F28;
  --kul: #1E2421;
  --guld: #E2B54A;
}
body { background: var(--filt), var(--bord); color: var(--creme); font-variant-numeric: tabular-nums; }
button, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Bjælken: samme knapper som kabalerne, vælgerne ligner knapper (som sudoku) */
#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;
}
#kk-bar select option { background: #FCF7EE; color: #1E2421; }
button:focus-visible, select:focus-visible { outline: 3px solid var(--creme); outline-offset: 2px; }
@media (max-width: 440px) {
  #kk-bar { gap: 5px; padding: 6px; flex-wrap: nowrap; }
  #kk-bar button, #kk-bar select { flex: 1 1 auto; min-width: 0; font-size: 14px; padding-left: 7px; padding-right: 7px; }
  #kk-bar select { padding-right: 22px; background-position: right 7px center; }
}

/* Infolinjen: runde og mål, og knappen til at sortere hånden */
#info { flex: none; display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 10px 0; font: 600 14px/1.3 Poppins, system-ui, sans-serif; }
#stilling { flex: 1 1 auto; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#info button {
  flex: none; font: 600 14px/1.2 Poppins, system-ui, sans-serif; min-height: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  color: var(--creme); background: transparent; border: 1px solid rgba(252,247,238,.35); position: relative;
}
#info button::after { content: ''; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }

/* Bordet */
#baize { touch-action: none; }
#baize g[data-k] { cursor: default; outline: none; }
#baize g.min { cursor: pointer; }
#baize g.valgt > rect:first-child { stroke: var(--guld); stroke-width: 4; }
#baize g.stikvalgt > rect:first-child { stroke: var(--guld); stroke-width: 5; }
#baize g.tip > rect:first-child { stroke: var(--roed); stroke-width: 5; }
#baize g.trukket > rect:first-child { stroke: var(--guld); stroke-width: 3; stroke-dasharray: 6 4; }
#baize g.loeftet { filter: url(#skygge); }
#baize g.min:focus-visible > rect:first-child, #baize .knap:focus-visible > rect { stroke: var(--creme); stroke-width: 5; }
#baize .knap { cursor: pointer; outline: none; }
#baize .knap.slukket { cursor: default; }
.tekst { font-family: Poppins, system-ui, sans-serif; fill: var(--creme); pointer-events: none; }
.navn { font-size: 15px; font-weight: 600; }
.lille { font-size: 14px; font-weight: 400; }
.status { font-size: 16px; font-weight: 600; }
.pladsmaerke { fill: var(--plads); stroke: var(--kant); stroke-width: 1; stroke-dasharray: 5 4; }
.saede { fill: transparent; stroke: transparent; stroke-width: 2; }
.saede.tur { fill: rgba(252,247,238,.08); stroke: var(--guld); stroke-width: 3; animation: puls5 1.1s ease-in-out infinite; }
@keyframes puls5 { 50% { stroke-opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .saede.tur { animation: none; } }
.stikfelt { fill: transparent; stroke: transparent; stroke-width: 3; }
.stikfelt.mulig { stroke: var(--guld); stroke-dasharray: 7 4; fill: rgba(226,181,74,.12); cursor: pointer; }
.stikfelt.tip { stroke: var(--roed); stroke-dasharray: none; }
.stoktal { font: 600 18px Poppins, system-ui, sans-serif; fill: #FCF7EE; paint-order: stroke; stroke: #1E2421; stroke-width: 3px; pointer-events: none; }
.spielkarte.joker-flade { fill: #FBEFD3; }
.joker-stjerne { font: 400 44px Acme, sans-serif; fill: #B3141C; pointer-events: none; }
.joker-tekst { font: 600 10px Poppins, system-ui, sans-serif; fill: #1E2421; letter-spacing: .5px; pointer-events: none; }

/* Knapperne under hånden, inden for tommelfingerens rækkevidde */
#knapper { flex: none; display: flex; gap: 6px; padding: 6px 8px 8px; background: var(--bjaelke); }
#knapper button {
  flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 6px; border-radius: 8px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 600 15px/1.2 Poppins, system-ui, sans-serif; border: 1px solid rgba(252,247,238,.22); background: var(--knap); color: var(--creme);
}
#knapper button.primaer { background: var(--roed); border-color: var(--roed); }
#knapper button:disabled { opacity: .45; cursor: default; }
#knapper #tip, #knapper #fortryd { flex: 0.7 1 0; }
@media (max-width: 440px) { #knapper { gap: 5px; padding: 6px; } #knapper button { font-size: 14px; padding: 0 3px; } }

/* Beskeden: flere linjer til reglerne og pointtavlen, rød primærknap (som sudoku) */
#kk-besked { width: max-content; max-width: min(calc(100vw - 24px), 460px); box-sizing: border-box; max-height: calc(100vh - 24px); overflow: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); }
#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; }
#kk-besked .knapper button { margin: 0; }
#kk-besked button.primaer { background: var(--roed); color: var(--creme); }
#kk-besked table { border-collapse: collapse; margin: 6px auto 4px; font-size: 14px; }
#kk-besked th, #kk-besked td { padding: 3px 8px; text-align: right; }
#kk-besked th:first-child, #kk-besked td:first-child { text-align: left; }
#kk-besked thead th { font-weight: 400; opacity: .85; border-bottom: 1px solid rgba(252,247,238,.3); }
#kk-besked tr.foer td { font-weight: 600; }
#kk-besked.lille-besked { top: auto; bottom: 4%; transform: translateX(-50%); }
.skjult { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* To vælgere deler én linje, når bjælken bryder om */
body #kk-bar.sk-taet > select { flex: 1 1 40%; }
