/* Nim (tændstikspillet): tændstikker på et grønt filtbord. Skrift, filt og bjælke kommer fra Solitaire.css og kabale-kort.css */
:root { --bord: #2D5A3F; --bjaelke: #17301F; --knap: #3A6B4D; --roed: #C63F28; --okker: #D69A2D; --trae: #E9C98B; --trae-kant: #9C7A3C; --hoved: #B8322A; }
html.kabale-mork { --bord: #173323; --bjaelke: #0B1A11; --knap: #24442F; }
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; min-width: 0;
}
#kk-bar select option { background: #FCF7EE; color: #1E2421; }
#kk-bar button:focus-visible, #kk-bar select:focus-visible, #knapper button:focus-visible, #kk-besked button:focus-visible { outline: 3px solid var(--creme); outline-offset: 2px; }
@media (max-width: 460px) {
  #kk-bar { gap: 6px; padding: 6px; flex-wrap: nowrap; }
  #kk-bar button, #kk-bar select { flex: 1 1 auto; 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; align-items: center; justify-content: safe center; gap: 12px; padding: 10px; box-sizing: border-box; overflow-y: auto; position: relative; }
#info { width: min(100%, 560px); display: flex; flex-direction: column; gap: 4px; text-align: center; }
#status { font: 600 17px/1.35 Poppins, system-ui, sans-serif; min-height: 2.7em; margin: 0; }
#status.taenker::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: prik 1.2s steps(4) infinite; }
@keyframes prik { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
#regelinfo { font-size: 14px; opacity: .9; margin: 0; }
#braet { display: flex; flex-direction: column; gap: 6px; align-items: center; width: min(100%, 560px); flex: 0 1 auto; min-height: 0; }
.raekke { display: flex; justify-content: center; align-items: stretch; gap: 2px; height: 80px; flex: 0 1 auto; min-height: 44px; box-sizing: border-box; padding: 2px 8px; border-radius: 12px; position: relative; }
.raekke.aktiv { background: rgba(252,247,238,.07); }
.raekke-tal { position: absolute; left: -2px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .8; width: 24px; text-align: center; }
.stik { width: var(--sb, 40px); height: auto; padding: 0; border: 0; background: transparent; cursor: pointer; position: relative; border-radius: 8px; transition: transform .25s ease-out, opacity .25s; }
.stik::before { content: ''; position: absolute; left: 50%; top: 12px; bottom: 6px; width: 8px; margin-left: -4px; border-radius: 2px; background: var(--trae); box-shadow: inset -2px 0 0 var(--trae-kant); }
.stik::after { content: ''; position: absolute; left: 50%; top: 4px; width: 13px; height: 17px; margin-left: -6.5px; border-radius: 50% 50% 45% 45%; background: var(--hoved); box-shadow: inset -2px -2px 0 rgba(0,0,0,.25); }
.stik.valgt { transform: translateY(-10px) rotate(-6deg); }
.stik.valgt::before { background: #FFE7A3; box-shadow: 0 0 0 3px var(--okker); }
.stik.tip { animation: tippuls 900ms ease-in-out infinite; }
.stik.tip::before { box-shadow: 0 0 0 3px var(--okker); }
.stik.computer { transform: translateY(-10px) rotate(6deg); }
.stik.computer::before { background: #F6C7BE; box-shadow: 0 0 0 3px var(--roed); }
.stik.vaek { opacity: 0; transform: translateY(-30px) rotate(30deg); }
.stik:focus-visible { outline: 3px solid var(--creme); outline-offset: 1px; }
@keyframes tippuls { 50% { transform: translateY(-6px); } }
#knapper { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; width: min(100%, 560px); }
#knapper button { min-height: 52px; border-radius: 8px; cursor: pointer; font: 600 16px/1.1 Poppins, system-ui, sans-serif; border: 1px solid rgba(252,247,238,.22); background: var(--knap); color: var(--creme); }
#knapper button.primaer { background: var(--roed); border-color: var(--roed); color: #fff; }
#knapper button:disabled { opacity: .45; cursor: default; }
#kk-besked { width: max-content; max-width: min(calc(100vw - 32px), 460px); 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; 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); }
.sk-ugedag { background: var(--bjaelke); }
@media (max-height: 560px) { .raekke { height: 60px; } #status { min-height: 1.35em; } }
/* Meget lav skærm: tættere, mindre statustekst og lavere rækker, så alle fem rækker og knapperne er synlige */
@media (max-height: 470px) { #spil { gap: 6px; padding: 8px; } #status { font-size: 15px; } #braet { gap: 2px; } .raekke { min-height: 28px; } #knapper button { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .stik { transition: none; } .stik.tip, #status.taenker::after { animation: none; } }
