/* Rebus: blåt bord med lyse kort til billeder og bogstaver. Skrift, filt og bjælke kommer fra Solitaire.css og kabale-kort.css */
:root { --bord: #1F4E79; --bjaelke: #0F2A44; --knap: #23588A; --ark: #FCF7EE; --kul: #1E2421; --roed: #C63F28; --rigtig: #3F8A5A; --guld: #E2B54A; }
html.kabale-mork { --bord: #112B44; --bjaelke: #08172A; --knap: #1A3F63; }
body { background: var(--filt), var(--bord); color: var(--creme); }
button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; font-family: Poppins, system-ui, sans-serif; }
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 { flex: 1 1 auto; font-size: 14px; padding-left: 8px; padding-right: 8px; } }

#spil { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; padding: 8px; box-sizing: border-box; }
#venstre, #hoejre { display: contents; }
#spil.side { flex-direction: row; align-items: center; justify-content: center; gap: 28px; }
#spil.side #venstre { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; max-width: 640px; height: 100%; justify-content: center; }
#spil.side #hoejre { display: flex; flex-direction: column; gap: 8px; width: 380px; flex: none; }
#info { width: 100%; max-width: 640px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 600 15px/1.3 Poppins, system-ui, sans-serif; }
#info #stjerner { letter-spacing: 2px; color: var(--guld); font-size: 18px; }

/* Gåden: kort med billeder og bogstaver, plus imellem */
#gaade { flex: 1 1 auto; min-height: 0; width: 100%; max-width: 640px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 6px; }
.led { background: var(--ark); color: var(--kul); border-radius: 14px; box-shadow: 0 3px 0 rgba(0,0,0,.22), 0 6px 14px rgba(0,0,0,.18); padding: calc(var(--bs, 90px) * .1); box-sizing: border-box;
  min-width: var(--bs, 90px); min-height: var(--bs, 90px); display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; animation: ind .4s ease-out backwards; }
.led img { width: calc(var(--bs, 90px) * .78); height: calc(var(--bs, 90px) * .78); display: block; }
.led.bogstaver { font: 700 calc(var(--bs, 90px) * .42)/1 Poppins, system-ui, sans-serif; letter-spacing: .04em; padding-left: calc(var(--bs, 90px) * .16); padding-right: calc(var(--bs, 90px) * .16); }
.led .maerke { position: absolute; top: -10px; right: -10px; min-width: 30px; height: 30px; padding: 0 6px; box-sizing: border-box; border-radius: 15px; background: var(--roed); color: #fff;
  font: 700 15px/30px Poppins, system-ui, sans-serif; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,.3); white-space: nowrap; }
.led .maerke s { text-decoration-thickness: 2px; }
.led .navn { font: 600 14px/1.2 Poppins, system-ui, sans-serif; color: var(--kul); margin-top: 2px; }
.grp { display: flex; align-items: center; gap: 6px; }
.plus { font: 700 26px/1 Poppins, system-ui, sans-serif; opacity: .85; }
#gaade.loest .led { animation: hop .5s ease-out; }
#gaade.loest .grp:nth-child(2) .led { animation-delay: .08s; } #gaade.loest .grp:nth-child(3) .led { animation-delay: .16s; } #gaade.loest .grp:nth-child(4) .led { animation-delay: .24s; }
@keyframes ind { from { opacity: 0; transform: translateY(10px) scale(.92); } }
@keyframes hop { 40% { transform: translateY(-10px) rotate(-2deg); } }

/* Svaret: et felt pr. bogstav */
#svar { display: flex; justify-content: center; gap: 4px; width: 100%; max-width: 640px; flex-wrap: nowrap; }
.felt { width: var(--fb, 40px); height: var(--fb, 40px); display: flex; align-items: center; justify-content: center; border-radius: 6px; box-sizing: border-box;
  font: 600 max(13px, calc(var(--fb, 40px) * .5))/1 Poppins, system-ui, sans-serif; text-transform: uppercase; background: rgba(0,0,0,.2); border: 2px solid rgba(252,247,238,.4); color: var(--creme); }
.felt.vist { background: var(--ark); color: var(--kul); border-color: var(--ark); }
.felt.skrevet { border-color: var(--creme); background: rgba(252,247,238,.14); }
.felt.naeste { border-color: var(--guld); }
#svar.loest .felt { background: var(--rigtig); border-color: var(--rigtig); color: #FCF7EE; animation: hop .45s ease-out; }
#svar.ryst { animation: ryst .35s; }
@keyframes ryst { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
#status { min-height: 1.35em; width: 100%; max-width: 640px; text-align: center; font: 600 16px/1.35 Poppins, system-ui, sans-serif; margin: 0; }

#knapper { display: flex; gap: 8px; width: 100%; max-width: 560px; }
#knapper button { flex: 1 1 0; min-height: 44px; border-radius: 8px; border: 1px solid rgba(252,247,238,.22); background: var(--knap); color: var(--creme); font: 600 15px/1.2 Poppins, system-ui, sans-serif; cursor: pointer; }
#knapper button:disabled { opacity: .45; cursor: default; }
#tast { width: 100%; max-width: 560px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px 3px; }
#tast button { min-height: var(--th, 46px); border-radius: 6px; border: 0; background: #D7DEDC; color: var(--kul); font: 600 19px/1 Poppins, system-ui, sans-serif; text-transform: uppercase; cursor: pointer; }
#tast button.bred { grid-column: span 2; font-size: 15px; text-transform: none; background: var(--ark); }
#tast button.slet { background: #B9C4C1; }
#tast button:active { transform: translateY(1px); }
#tast .kun-lav { display: none; }
.regel-tekst p, .regel-tekst li { font-size: 15px; }
.regel-tekst ul { margin: 0 0 8px; padding-left: 20px; }
.regel-tekst .lille { font-size: 14px; opacity: .85; }

/* Lav ramme (sidens mobil-iframe): alt tættere, Tip og Navne som taster */
#spil.lav { gap: 4px; padding: 4px 8px; }
#spil.lav #info, #spil.lav #knapper { display: none; }
#spil.lav #tast .kun-lav { display: block; font-size: 14px; text-transform: none; }
#spil.lav #tast button.bred { grid-column: span 1; font-size: 13px; }
#spil.lav #tast { gap: 3px; grid-template-columns: repeat(11, minmax(0, 1fr)); }
#spil.lav #tast button { padding: 0; }
#spil.lav #status { font-size: 14px; }
#spil.lav .led { border-radius: 10px; }
#spil.lav .led .maerke { top: -6px; right: -6px; }
#spil.side #gaade { flex: none; }

@media (prefers-reduced-motion: reduce) { .led, #gaade.loest .led, #svar.loest .felt, #svar.ryst { animation: none; } }
html.kabale-hk .felt { border-width: 3px; }
html.kabale-hk .led { outline: 3px solid var(--creme); }
html.kabale-hk #knapper button { border: 2px solid var(--creme) !important; }
