/* Faldende klodser: skifer-bordet fra Klodser (puslespil, se docs/DESIGNMANUAL-SPIL.md). Skrift, filt og bjælke kommer fra Solitaire.css og kabale-kort.css */
:root {
  --bord: #434D5D;
  --bjaelke: #252930;
  --knap: #464F5D;
  --kul: #1E2421;
  --roed: #C63F28;
  --tom: rgba(252,247,238,.07);
  --plade: rgba(20,24,30,.38);
}
html.kabale-mork {
  --bord: #272D37;
  --bjaelke: #111315;
  --knap: #343B47;
  --tom: rgba(252,247,238,.05);
  --plade: rgba(0,0,0,.34);
}
body { background: var(--filt), var(--bord); color: var(--creme); font-variant-numeric: tabular-nums; }
svg { background: none; width: auto; height: auto; }
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; }
#kk-bar button[aria-pressed="true"] { background: var(--creme); color: var(--bjaelke); }
#kk-bar button:focus-visible, #kk-bar select:focus-visible, #spil button:focus-visible, #kk-besked button:focus-visible { outline: 3px solid var(--creme); outline-offset: 2px; }
@media (max-width: 420px) {
  #kk-bar { gap: 6px; padding: 6px; flex-wrap: nowrap; }
  #kk-bar button, #kk-bar select { flex: 1 1 auto; min-width: 0; 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: flex; flex-direction: column; gap: 6px; padding: 6px 6px 8px; box-sizing: border-box; }
#spil button {
  font: 600 14px/1.2 Poppins, system-ui, sans-serif; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  color: var(--creme); background: transparent; border: 1px solid rgba(252,247,238,.35); white-space: nowrap;
}
#spil button:disabled { opacity: .45; cursor: default; }

#ramme { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#laerred { display: block; flex: none; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.28); }
#laerred:not([data-klar]) { visibility: hidden; }
#laerred:focus { outline: none; }
#laerred:focus-visible { outline: 3px solid var(--creme); outline-offset: 3px; }

/* Sidepanelet: gemt brik, de næste brikker, point og pause */
#side { flex: none; align-self: center; display: flex; flex-direction: column; gap: 6px; box-sizing: border-box; font: 400 14px/1.2 Poppins, system-ui, sans-serif; }
#side .boks { background: var(--plade); border-radius: 10px; padding: 4px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#side .lbl { font-size: 14px; opacity: .9; }
#side canvas { display: block; }
#tal { margin: 0; display: grid; gap: 2px; background: var(--plade); border-radius: 10px; padding: 6px 8px; }
#tal div { display: flex; flex-direction: column; }
#tal dt { font-size: 14px; opacity: .9; }
#tal dd { margin: 0; font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#side #pause { width: 100%; }
#side.lav .boks.gemt-boks { padding-bottom: 4px; }
#side.lav #tal { padding: 4px 8px; }
#side.lav #tal dd { font-size: 15px; }

#flash { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); pointer-events: none; font: 600 22px/1.2 Poppins, system-ui, sans-serif; color: var(--creme);
  background: rgba(37,41,48,.9); padding: 8px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; white-space: nowrap; z-index: 2; }
#flash.vis { opacity: 1; }

/* Knapperne til berøringsskærme */
#styr { flex: none; display: none; gap: 6px; justify-content: center; width: 100%; max-width: 520px; margin: 0 auto; }
html.beroering #styr { display: flex; }
#spil #styr button { flex: 1 1 0; min-width: 0; min-height: 54px; padding: 0 2px; font-size: 14px; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: rgba(252,247,238,.06); touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#spil #styr button.trykket { background: rgba(252,247,238,.26); }
#styr svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#spil #styr #k-slip { background: rgba(198,63,40,.35); border-color: rgba(198,63,40,.85); }
#spil #styr #k-slip.trykket { background: rgba(198,63,40,.7); }
@media (max-height: 470px) { #spil #styr button { min-height: 48px; } #styr svg { width: 20px; height: 20px; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#kk-besked { width: max-content; max-width: min(calc(100vw - 32px), 460px); max-height: calc(100vh - 24px); overflow: auto; box-sizing: border-box; }
#kk-besked p { margin: 0 0 6px; font-size: 15px; text-align: left; }
#kk-besked .knapper { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
#kk-besked .knapper button { margin: 0; }
#kk-besked button.primaer { background: var(--roed); color: var(--creme); }
@media (prefers-reduced-motion: reduce) { #flash { transition: none; } }
/* Ugedagene i arkivet får dialogens baggrund, så kontrasten måles mod den og ikke mod brættet bag dialogen */
.sk-ugedag { background: var(--bjaelke); }
