/* Røvhul: grøn filt som spades. 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; }
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%; }

/* Linjen over bordet: runde, dine point og din titel */
#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: manipulation; }
#baize .kort { transition: transform var(--flyt, 260ms) ease-out, opacity 240ms ease-out; cursor: default; }
#baize .kort.mulig { cursor: pointer; }
#baize .kort.mulig > rect.spielkarte { stroke: var(--guld); stroke-width: 2.5; }
#baize .kort.valgt > rect.spielkarte { stroke: var(--roed); stroke-width: 5; }
#baize .kort.ny > rect.spielkarte { stroke: #8FC3E8; stroke-width: 5; }
#baize .kort.fokus > rect.spielkarte { stroke: var(--creme); stroke-width: 5; }
#baize .kort .daek { fill: rgba(30,36,33,.32); pointer-events: none; display: none; }
#baize .kort.mat .daek { display: inline; }
#baize .kort.gammel { opacity: .5; }
#baize text { pointer-events: none; }
.saede { font: 600 14px Poppins, system-ui, sans-serif; fill: var(--creme); }
.saede.lille { font-weight: 400; }
.saede.tur { fill: var(--guld); }
.saede.pas { fill: #F4B3A6; font-weight: 600; }
.saede.ude { fill: #CDE6F7; font-weight: 600; }
.saede.titel { font-weight: 600; fill: #F5D88E; }
.saede.titel.R, .saede.titel.VR { fill: #F4B3A6; }
.saedeboks { fill: rgba(13,21,16,.38); stroke: rgba(252,247,238,.16); stroke-width: 1; }
.saedeboks.ude { fill: rgba(13,21,16,.18); }
.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; } }
.bunketekst { font: 600 14px Poppins, system-ui, sans-serif; fill: var(--creme); }
.bunketekst.ryd { fill: var(--guld); }

#status {
  position: absolute; left: 50%; transform: translateX(-50%); top: var(--status-y, 8px); width: max-content; max-width: calc(100% - 16px); box-sizing: border-box;
  padding: 4px 12px; 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, Pas og Læg lige over hånden */
#knapper { position: absolute; left: 8px; right: 8px; bottom: var(--over-haand, 140px); display: flex; gap: 8px; justify-content: space-between; z-index: 2; pointer-events: none; }
#knapper button {
  pointer-events: auto; min-height: 44px; min-width: 44px; padding: 0 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
  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:disabled { opacity: .45; cursor: default; }
#knapper .hoejre { display: flex; gap: 8px; min-width: 0; }
#knapper #laeg:not(:disabled) { background: var(--creme); color: #1E2421; border-color: var(--roed); box-shadow: inset 0 -4px 0 var(--roed); }
#knapper button.tip { outline: 3px dashed var(--guld); outline-offset: 1px; }
@media (max-width: 380px) { #knapper button { padding: 0 10px; font-size: 14px; } #knapper, #knapper .hoejre { gap: 6px; } }

/* Kortbyttet før runden */
#bytte {
  position: absolute; left: 50%; top: var(--bytte-y, 30%); transform: translateX(-50%); z-index: 3; box-sizing: border-box; width: max-content; max-width: calc(100% - 16px);
  max-height: var(--bytte-h, 60%); overflow-y: auto; padding: 8px 12px; border-radius: 12px; background: rgba(13,21,16,.95); box-shadow: 0 4px 14px rgba(0,0,0,.35);
  font: 400 14px/1.45 Poppins, system-ui, sans-serif; text-align: center;
}
#bytte[hidden], #knapper[hidden] { display: none; }
#bytte h2 { margin: 0 0 4px; font: 600 15px Poppins, system-ui, sans-serif; }
#bytte p { margin: 0 0 4px; }
#bytte .knapper { display: flex; justify-content: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
#bytte button {
  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,.25); background: var(--knap); color: var(--creme);
}
#bytte button.primaer { background: var(--creme); color: #1E2421; border-color: var(--roed); box-shadow: inset 0 -4px 0 var(--roed); }
#bytte button:disabled { opacity: .45; cursor: default; }
.mk { display: inline-block; min-width: 1.9em; padding: 0 3px; margin: 0 1px; border-radius: 4px; background: #FCF7EE; color: #1E2421; font-weight: 700; text-align: center; line-height: 1.5; }
.mk.roed { color: #C4121B; }

#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 .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); }
table.res { border-collapse: collapse; font-size: 14px; margin: 6px auto 2px; }
table.res td, table.res th { padding: 2px 6px; text-align: right; }
table.res td:first-child, table.res th:first-child, table.res td.t { text-align: left; }
table.res tr:first-child th { font-weight: 400; }
table.res tr.mig td { color: #F5D88E; font-weight: 600; }
table.res td.plus { color: #F1CF7A; font-weight: 600; }
.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; }
.sk-krop table.res { color: inherit; }

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