/* Sortér farverne: glas på en rolig blå hylde. Skrift, filt og bjælke kommer fra Solitaire.css og kabale-kort.css */
:root {
  --bord: #2E3B55;
  --bjaelke: #1A2236;
  --knap: #3A4A6A;
  --roed: #C63F28;
  --guld: #F0C463;
  --glas: rgba(252,247,238,.10);
  --glaskant: rgba(252,247,238,.78);
  --gw: 52px;
  --sh: 26px;
}
html.kabale-mork { --bord: #1B2333; --bjaelke: #0E131D; --knap: #2A3550; --glas: rgba(252,247,238,.07); --glaskant: rgba(252,247,238,.62); }
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; }
#info { flex: none; width: 100%; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 8px; min-height: 44px; font: 400 15px/1.3 Poppins, system-ui, sans-serif; }
#banen { flex: none; }
#taeller { flex: 1 1 auto; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#taeller b { font-weight: 600; }
#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; -webkit-user-select: none; user-select: none; }
#glasrum { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; column-gap: var(--gx, 6px); row-gap: var(--gy, 6px); max-width: var(--rumb, 100%); }
#spil button.glas {
  width: var(--gw); min-width: 0; height: calc(var(--sh) * 4.4 + 8px); padding: calc(var(--sh) * .4) 0 2px; border: 0; border-radius: 10px; background: transparent;
  display: flex; align-items: flex-end; justify-content: center; position: relative;
}
.roer {
  display: flex; flex-direction: column-reverse; width: min(100%, calc(var(--sh) * 1.25 + 8px)); height: calc(var(--sh) * 4 + 6px); box-sizing: border-box;
  border: 3px solid var(--glaskant); border-top-width: 0; border-radius: 0 0 calc(var(--sh) * .75) calc(var(--sh) * .75); background: var(--glas);
  overflow: hidden; position: relative; transition: transform .16s ease-out; box-shadow: 0 4px 10px rgba(0,0,0,.25);
}
/* Kanten foroven, så det ligner et glas */
.roer::before { content: ''; position: absolute; left: -3px; right: -3px; top: 0; height: 3px; background: var(--glaskant); border-radius: 2px; }
.lag { flex: none; height: var(--sh); background: var(--f); display: flex; align-items: center; justify-content: center; position: relative; }
.lag + .lag { box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.lag svg { width: calc(var(--sh) * .66); height: calc(var(--sh) * .66); fill: var(--blaek, #fff); stroke: var(--blaek, #fff); }
.uden-symboler .lag svg { display: none; }
.lag.ny { animation: ind .28s ease-out; }
@keyframes ind { from { transform: translateY(calc(var(--sh) * -1.2)); opacity: .2; } }
.glas[aria-pressed="true"] .roer { transform: translateY(calc(var(--sh) * -.45)); box-shadow: 0 0 0 3px var(--guld), 0 10px 14px rgba(0,0,0,.35); }
.glas.fra .roer, .glas.til .roer { box-shadow: 0 0 0 3px var(--guld), 0 4px 10px rgba(0,0,0,.25); }
.glas.til::after { content: ''; position: absolute; top: 0; left: 50%; margin-left: -9px; border: 9px solid transparent; border-top: 11px solid var(--guld); border-bottom-width: 0; }
.glas.fra .roer { animation: tipvis 1s ease-in-out infinite; }
@keyframes tipvis { 50% { transform: translateY(calc(var(--sh) * -.3)); } }
.glas.faerdig .roer { border-color: var(--guld); }
.glas.faerdig::before { content: ''; position: absolute; top: calc(var(--sh) * .5 - 18px); left: 50%; width: 14px; height: 7px; margin-left: -7px; border-left: 3px solid var(--guld); border-bottom: 3px solid var(--guld); transform: rotate(-45deg); }
.glas.ekstra .roer { border-style: dashed; border-top-style: solid; }
#spil button.glas:focus-visible { outline: 3px solid var(--creme); outline-offset: 0; }

#status { flex: none; margin: 0; min-height: 1.4em; text-align: center; font: 400 15px/1.4 Poppins, system-ui, sans-serif; }
#knapper { flex: none; display: flex; justify-content: center; gap: 6px; }
#knapper button { flex: 0 1 132px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; }
#knapper svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#knapper button.vist { background: var(--creme); color: var(--bjaelke); }
#knapper button.kald { box-shadow: 0 0 0 3px var(--guld); }

.stjerner { color: var(--guld); letter-spacing: 1px; }
.baner { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.baner button { min-height: 52px; min-width: 44px; padding: 2px; border-radius: 8px; border: 1px solid rgba(252,247,238,.3); background: var(--knap); color: var(--creme); cursor: pointer; font: 600 15px/1.1 Poppins, system-ui, sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.baner button small { font-size: 12px; color: var(--guld); min-height: 13px; }
.baner button[aria-current="true"] { background: var(--creme); color: var(--bjaelke); }
.baner button[aria-current="true"] small { color: #8A5F12; }

#kk-besked { width: max-content; max-width: min(calc(100vw - 32px), 460px); max-height: calc(100vh - 24px); overflow-y: 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); }
.sk-ugedag { background: var(--bjaelke); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 420px) { #knapper button { font-size: 14px; gap: 4px; padding: 0 4px; } #knapper svg { width: 18px; height: 18px; } }
@media (max-width: 370px) { #knapper .lang { display: none; } }
@media (max-height: 520px) { #spil { gap: 4px; padding-top: 4px; padding-bottom: 4px; } #info { min-height: 44px; } #status { font-size: 14px; min-height: 1.3em; } }
@media (prefers-reduced-motion: reduce) { .roer { transition: none; } .lag.ny, .glas.fra .roer { animation: none; } }
