/* Juvelbyt: aubergine-bordet (juveler, se docs/DESIGNMANUAL-SPIL.md). Skrift, filt og bjælke kommer fra Solitaire.css og kabale-kort.css */
:root {
  --bord: #5E3D6D;
  --bjaelke: #312337;
  --knap: #5D4269;
  --roed: #C63F28;
  --plade: rgba(20,12,24,.30);
  --felt: rgba(252,247,238,.07);
  --felt2: rgba(252,247,238,.12);
  --is: rgba(214,232,240,.55);
  --c: 44px;
}
html.kabale-mork {
  --bord: #372440;
  --bjaelke: #151118;
  --knap: #4A3554;
  --plade: rgba(0,0,0,.30);
  --felt: rgba(252,247,238,.05);
  --felt2: rgba(252,247,238,.09);
  --is: rgba(214,232,240,.45);
}
body { background: var(--filt), var(--bord); color: var(--creme); font-variant-numeric: tabular-nums; }
svg { background: none; }
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; max-width: 52vw;
}
#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 { 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; }
#maal, #info { flex: none; width: 100%; max-width: var(--bredde, 100%); margin: 0 auto; box-sizing: border-box; display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 Poppins, system-ui, sans-serif; }
#maal { justify-content: center; flex-wrap: wrap; gap: 6px 12px; min-height: 30px; }
#maal .m { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
#maal .m svg { width: 22px; height: 22px; display: block; }
#maal .m.ok { opacity: .55; }
#maal .m.ok::after { content: '✓'; margin-left: 2px; }
#maal .isikon { width: 20px; height: 20px; border-radius: 4px; background: var(--is); box-shadow: inset 0 0 0 2px rgba(252,247,238,.7); }
#info { min-height: 36px; }
#status { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#traek { white-space: nowrap; padding: 2px 10px; border-radius: 8px; background: rgba(252,247,238,.12); }
#traek.faa { background: var(--roed); }
#info button {
  position: relative; flex: none; font: 600 14px/1.2 Poppins, system-ui, sans-serif; min-height: 36px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  color: var(--creme); background: transparent; border: 1px solid rgba(252,247,238,.35);
}
#info button::after { content: ''; position: absolute; left: 0; right: 0; top: -4px; bottom: -4px; }
#info button:disabled { opacity: .45; cursor: default; }

#ramme { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#braet { position: relative; width: calc(var(--c) * 8); height: calc(var(--c) * 8); padding: 4px; border-radius: 12px; background: var(--plade);
  box-shadow: 0 4px 14px rgba(0,0,0,.28); overflow: hidden; touch-action: none; }
#braet:focus { outline: none; }
#braet:focus-visible { outline: 3px solid var(--creme); outline-offset: 3px; }
#felter, #juveler { position: absolute; left: 4px; top: 4px; width: calc(var(--c) * 8); height: calc(var(--c) * 8); }
.felt { position: absolute; width: var(--c); height: var(--c); box-sizing: border-box; border: 1px solid rgba(0,0,0,.08); background: var(--felt); }
.felt.lys { background: var(--felt2); }
.felt[data-is="1"]::after, .felt[data-is="2"]::after { content: ''; position: absolute; inset: 1px; border-radius: 5px; background: var(--is); box-shadow: inset 0 0 0 3px rgba(252,247,238,.85); }
.felt[data-is="2"]::after { box-shadow: inset 0 0 0 2px rgba(252,247,238,.9), inset 0 0 0 5px rgba(214,232,240,.5); background:
  linear-gradient(135deg, transparent 46%, rgba(252,247,238,.8) 47%, rgba(252,247,238,.8) 53%, transparent 54%), var(--is); }
.felt.markoer { box-shadow: inset 0 0 0 3px var(--creme); }

.j { position: absolute; left: 0; top: 0; width: var(--c); height: var(--c); transition: transform .18s ease-out; will-change: transform; pointer-events: none; }
.j svg { width: 100%; height: 100%; display: block; }
.j.valgt svg { transform: scale(1.12); filter: drop-shadow(0 0 3px rgba(252,247,238,.9)); }
.j.tip svg { animation: tip 1s ease-in-out infinite; }
@keyframes tip { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.j.vaek { transition: transform .18s ease-out, opacity .18s ease-out; opacity: 0; }
.j.vaek svg { transform: scale(.3); transition: transform .18s ease-out; }
.j.ingen { transition: none; }
.j.fald { transition: transform .22s cubic-bezier(.45,.05,.75,.6); }

#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 p.stjerner { font-size: 26px; letter-spacing: 4px; color: #D69A2D; }
#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: 45%; transform: translate(-50%, -50%); pointer-events: none; font: 600 20px/1.25 Poppins, system-ui, sans-serif; color: var(--creme);
  background: rgba(37,24,42,.9); padding: 8px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s; text-align: center; max-width: 90%; z-index: 3; }
#flash.vis { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .j, .j.vaek, .j.vaek svg, .j.fald { transition: none; } .j.tip svg { animation: none; outline: 3px solid var(--creme); } #flash { transition: none; } }

/* Spilkit, værktøjer under brættet og målbjælken (21.10) */
#maalbar { flex: none; width: 100%; max-width: min(var(--bredde, 100%), 420px); margin: -2px auto 0; height: 8px; border-radius: 4px; background: rgba(252,247,238,.16); overflow: hidden; }
#maalbar span { display: block; height: 100%; background: #D69A2D; transform-origin: left center; transform: scaleX(0); transition: transform .3s ease-out; }
#maalbar.ok span { background: #3F8A5A; }
#panel { flex: none; width: 100%; max-width: var(--bredde, 100%); margin: 0 auto; box-sizing: border-box; display: flex; gap: 6px; }
#panel button {
  flex: 1 1 0; min-width: 0; min-height: 48px; padding: 0 10px; border-radius: 8px; cursor: pointer; font: 600 15px/1.1 Poppins, system-ui, sans-serif;
  border: 1px solid rgba(252,247,238,.22); background: var(--knap); color: var(--creme);
}
#panel button:disabled { opacity: .45; cursor: default; }
#panel button[aria-pressed="true"] { background: var(--creme); color: #1E2421; }
#panel button:focus-visible { outline: 3px solid var(--creme); outline-offset: 2px; }
#braet.hamrer { cursor: crosshair; box-shadow: 0 0 0 3px #D69A2D, 0 4px 14px rgba(0,0,0,.28); }
html.kabale-hk #panel button { border: 2px solid var(--creme) !important; }
html.kabale-hk #panel button:disabled { opacity: .6; border-style: dashed !important; }
html.kabale-hk #maalbar { outline: 2px solid var(--creme); }
@media (prefers-reduced-motion: reduce) { #maalbar span { transition: none; } }
.sk-baner-gitter button:not(.klaret):not(:disabled) span { color: inherit; opacity: .75; }
