/* Spades: grøn filt som spar dame og whist. Bord, bjælke, knap og mørk tilstand kommer fra Solitaire.css; bjælke og beskeder fra kabale-kort.css */
:root { --roed: #C63F28; --kul: #1E2421; --guld: #E2B54A; --blaa: #8FC3E8; }
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;
}
#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: 460px) {
  #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; white-space: nowrap; }
  #kk-bar select { padding-right: 22px; background-position: right 7px center; }
}
body #kk-bar.sk-taet > select { flex: 1 1 40%; }

/* Stillingen over bordet: jeres og deres point og poser */
#info { flex: none; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0 12px; padding: 4px 10px; font: 600 14px/1.6 Poppins, system-ui, sans-serif; }
#info span { white-space: nowrap; }
#info .vi { color: #F5D88E; }
@media (max-width: 460px) { #info { padding: 4px 8px; gap: 0 8px; } #info .lang { display: none; } }

#bord { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
#bord > #baize { position: absolute; left: 0; top: 0; width: 100%; height: 100%; touch-action: none; }
#baize .kort { transition: transform var(--flyt, 260ms) ease-out, opacity 220ms ease-out; cursor: default; }
#baize .kort.traek { transition: none; }
#baize .kort.lovlig { cursor: pointer; }
#baize .kort.lovlig > rect.spielkarte { stroke: var(--guld); stroke-width: 3; }
#baize .kort .daek { fill: rgba(30,36,33,.32); pointer-events: none; display: none; }
#baize .kort.ulovlig .daek { display: inline; }
#baize .kort.fokus > rect.spielkarte, #baize .kort.tip > rect.spielkarte { stroke: var(--roed); stroke-width: 5; }
#baize .kort.vinder > rect.spielkarte { stroke: var(--guld); stroke-width: 5; }
#baize .kort.vinder { filter: url(#skygge); }
#baize text { pointer-events: none; }
.saede { font: 600 15px Poppins, system-ui, sans-serif; fill: var(--creme); }
.saede.lille { font-weight: 400; }
.saede.tur { fill: var(--guld); text-decoration: underline; }
.saede.makker { fill: #F5D88E; }
.saede.nul { fill: #CDE6F7; }
.saede.nyt { fill: var(--guld); font-weight: 600; }
.saedeboks { fill: rgba(13,21,16,.38); stroke: rgba(252,247,238,.16); stroke-width: 1; }
.saedeboks.makker { stroke: rgba(245,216,142,.55); }
.turring { fill: none; stroke: var(--guld); stroke-width: 3; animation: pulsS 1.1s ease-in-out infinite; pointer-events: none; }
@keyframes pulsS { 50% { stroke-opacity: .25; } }
.boble rect { fill: #FCF7EE; stroke: var(--guld); stroke-width: 2.5; }
.boble text { font: 600 15px Poppins, system-ui, sans-serif; fill: #1E2421; }

#status {
  position: absolute; left: 50%; transform: translateX(-50%); top: var(--status-y, 8px); width: max-content; max-width: calc(100% - 24px); box-sizing: border-box;
  padding: 4px 14px; border-radius: 16px; background: rgba(13,21,16,.6); font: 600 14px/1.35 Poppins, system-ui, sans-serif; text-align: center; pointer-events: none; z-index: 1;
}
#status:empty { display: none; }
#status.taenker::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: prikker 1.2s steps(4) infinite; }
@keyframes prikker { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

/* Tip og Fortryd lige over hånden */
.rund {
  position: absolute; bottom: var(--over-haand, 140px); min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  font: 600 15px/1.2 Poppins, system-ui, sans-serif; border: 1px solid rgba(252,247,238,.22); background: var(--knap); color: var(--creme); z-index: 2;
}
.rund:disabled { opacity: .45; cursor: default; }
#tip { left: 8px; }
#fortryd { right: 8px; }

/* Budpanelet midt på bordet */
#bud {
  position: absolute; left: 50%; top: var(--bud-y, 40%); transform: translateX(-50%); z-index: 2; box-sizing: border-box; max-width: calc(100% - 16px);
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 5px 10px 6px; border-radius: 12px; background: rgba(13,21,16,.72);
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
#bud[hidden] { display: none; }
#bud .lbl { font: 600 14px/1.3 Poppins, system-ui, sans-serif; margin: 0; text-align: center; }
#bud .raekke { display: flex; gap: 6px; align-items: center; }
#bud button {
  min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer; font: 600 16px/1.2 Poppins, system-ui, sans-serif;
  border: 1px solid rgba(252,247,238,.25); background: var(--knap); color: var(--creme); white-space: nowrap;
}
#bud button:disabled { opacity: .45; cursor: default; }
#bud #budTal { min-width: 2.4em; text-align: center; font: 700 22px/1 Poppins, system-ui, sans-serif; }
#bud #byd { background: var(--creme); color: #1E2421; border-color: var(--roed); box-shadow: inset 0 -4px 0 var(--roed); }
#bud #nulBud.valgt, #bud button.tip { outline: 3px dashed var(--guld); outline-offset: 1px; }
@media (max-width: 380px) { #bud { padding: 6px; } #bud button { padding: 0 9px; font-size: 15px; } #bud .raekke { gap: 4px; } }

#kk-besked { width: max-content; max-width: min(calc(100vw - 24px), 480px); box-sizing: border-box; max-height: calc(100% - 24px); overflow-y: auto; }
#kk-besked p { margin: 0 0 6px; font-size: 15px; }
#kk-besked table.res { border-collapse: collapse; font-size: 14px; margin: 6px auto 2px; }
#kk-besked table.res td, #kk-besked table.res th { padding: 2px 7px; text-align: right; }
#kk-besked table.res th:first-child { text-align: left; }
#kk-besked table.res tr:first-child th { font-weight: 400; font-size: 14px; }
#kk-besked td.plus { color: #F1CF7A; font-weight: 600; }
#kk-besked td.minus { color: #F4B3A6; font-weight: 600; }
#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); }
.regel-tekst h3 { margin: 12px 0 4px; font: 600 16px Poppins, system-ui, sans-serif; }
.regel-tekst p, .regel-tekst li { font-size: 15px; }
.regel-tekst ul { margin: 0 0 8px; padding-left: 20px; }

@media (prefers-reduced-motion: reduce) { #baize .kort { transition: none; } .turring { animation: none; } #status.taenker::after { animation: none; content: '...'; } }
html.kabale-hk .rund, html.kabale-hk #bud button { border: 2px solid var(--creme) !important; }
