/* Klodser: skifer-bordet (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,.08);
  --plade: rgba(20,24,30,.32);
  --k1: #3E6FA3;
  --k2: #D69A2D;
  --k3: #3F8A5A;
  --k4: #C63F28;
  --k5: #FCF7EE;
  --c: 30px;
  --g: 2px;
}
html.kabale-mork {
  --bord: #272D37;
  --bjaelke: #111315;
  --knap: #343B47;
  --tom: rgba(252,247,238,.06);
  --plade: rgba(0,0,0,.3);
  --k5: #E6DFD2;
}
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:focus-visible, #kk-bar select:focus-visible, #info button:focus-visible, #kk-besked button:focus-visible, .plads: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; }
#info { flex: none; width: 100%; max-width: var(--bredde, 100%); margin: 0 auto; box-sizing: border-box; display: flex; align-items: center; gap: 8px; min-height: 44px; font: 600 15px/1.3 Poppins, system-ui, sans-serif; }
#point { white-space: nowrap; }
#rekord { font-weight: 400; opacity: .85; flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#info button {
  position: relative; flex: none; 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);
}
#info button:disabled { opacity: .45; cursor: default; }

#ramme { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#braet { display: grid; grid-template-columns: repeat(var(--n, 10), var(--c)); grid-auto-rows: var(--c); gap: var(--g); padding: 5px; border-radius: 10px; background: var(--plade); box-shadow: 0 4px 14px rgba(0,0,0,.28); }
#braet:focus { outline: none; }
#braet:focus-visible { outline: 3px solid var(--creme); outline-offset: 3px; }
.f { border-radius: 4px; background: var(--tom); }
.f[data-k] { border: 1px solid rgba(30,36,33,.35); box-sizing: border-box; }
.f[data-k="1"], .b[data-k="1"] { background: var(--k1); }
.f[data-k="2"], .b[data-k="2"] { background: var(--k2); }
.f[data-k="3"], .b[data-k="3"] { background: var(--k3); }
.f[data-k="4"], .b[data-k="4"] { background: var(--k4); }
.f[data-k="5"], .b[data-k="5"] { background: var(--k5); }
.f.lys { background: rgba(252,247,238,.16); }
.f.skygge { opacity: .5; }
.f.ryd { box-shadow: inset 0 0 0 2px var(--creme); }
.f.vaek { animation: vaek .25s ease-out; }
@keyframes vaek { 0% { transform: scale(1); background: var(--creme); } 100% { transform: scale(.4); } }
.f.ny { animation: ny .2s ease-out; }
@keyframes ny { 0% { transform: scale(.7); } 100% { transform: none; } }

/* Bakken med de tre brikker */
#bakke { display: flex; justify-content: space-between; gap: 6px; }
.plads { position: relative; display: flex; align-items: center; justify-content: center; border-radius: 10px; cursor: grab; touch-action: none; }
.plads.valgt { background: rgba(252,247,238,.12); box-shadow: inset 0 0 0 2px var(--creme); }
.plads.tom { cursor: default; }
.plads.kan-ikke .brik { opacity: .35; }
.brik { display: grid; gap: 2px; pointer-events: none; }
.b { border-radius: 3px; border: 1px solid rgba(30,36,33,.35); box-sizing: border-box; }
.brik i { display: block; }
#flyver { position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; display: grid; gap: var(--g); filter: drop-shadow(0 6px 10px rgba(0,0,0,.35)); }
#flyver[hidden] { display: none; }

#kk-besked { width: max-content; max-width: min(calc(100vw - 32px), 440px); 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; 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); }
#flash { position: absolute; left: 50%; top: 40%; 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,.88); padding: 8px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; white-space: nowrap; }
#flash.vis { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .f.vaek, .f.ny { animation: none; } #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); }
