/* Kasino – stiler for spillet. Alle selektorer ligger under #kasino-app. */
#kasino-app {
  --cw: 64px; --ch: 90px; --bw: 46px; --bh: 64px;
  font-family: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink, #1c1915);
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.45;
}
#kasino-app *, #kasino-app *::before, #kasino-app *::after { box-sizing: border-box; }
#kasino-app .k-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .2rem 1rem; margin: 0 0 .6rem; }
#kasino-app .k-title, #kasino-app .k-h3, #kasino-app .k-h4 { font-family: "Young Serif", Georgia, serif; font-weight: 400; color: var(--ink, #1c1915); }
#kasino-app .k-title { font-size: 1.7rem; margin: 0; line-height: 1.1; }
#kasino-app .k-score { margin: 0; font-size: 1rem; color: var(--ink2, #4a443b); }
#kasino-app .k-score b { font-family: "Young Serif", Georgia, serif; font-weight: 400; font-size: 1.25rem; color: var(--ink, #1c1915); }
#kasino-app .k-sub { font-size: .88rem; }

/* Filtbordet */
#kasino-app .k-felt {
  position: relative;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, .14) 0, rgba(255, 255, 255, .04) 45%, rgba(0, 0, 0, .22) 100%), var(--navy, #1d2c4c);
  border-radius: 18px;
  padding: 12px 14px 10px;
  color: var(--card, #fffdf8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 0 50px rgba(0, 0, 0, .35), 0 6px 18px rgba(28, 25, 21, .18);
}
#kasino-app .k-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#kasino-app .k-lab { margin: 0; font-size: .85rem; font-weight: 600; letter-spacing: .02em; color: var(--card, #fffdf8); }
#kasino-app .k-meta { font-weight: 400; }
#kasino-app .k-lab-me { margin-top: 8px; text-align: center; }
#kasino-app .k-deck { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
#kasino-app .k-deck b { font-family: "Young Serif", Georgia, serif; font-weight: 400; font-size: 1.05rem; }
#kasino-app .k-deck .k-card { --cw: 22px; --ch: 31px; border-width: 2px; border-radius: 4px; box-shadow: 2px 2px 0 rgba(255, 253, 248, .55), 0 1px 2px rgba(0, 0, 0, .4); }

#kasino-app .k-hand { display: flex; justify-content: center; gap: 8px; min-height: var(--ch); }
#kasino-app .k-hand-opp { --cw: var(--bw); --ch: var(--bh); margin: 6px 0 0; }
#kasino-app .k-hand-me { margin-top: 4px; padding-top: 10px; }
#kasino-app .k-table {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
  min-height: calc(var(--ch) * 1.45 + 24px);
  margin: 12px 0 6px; padding: 14px 4px;
  border-top: 1px solid rgba(255, 253, 248, .14); border-bottom: 1px solid rgba(255, 253, 248, .14);
}
#kasino-app .k-empty { margin: 0; font-size: .9rem; font-style: italic; color: var(--card, #fffdf8); }

/* Kort */
#kasino-app .k-card {
  position: relative; display: block; flex: 0 0 auto;
  width: var(--cw); height: var(--ch); padding: 0; margin: 0;
  border-radius: 7px; border: 1px solid var(--line, #d9cfbc);
  background: var(--card, #fffdf8); color: var(--ink, #1c1915);
  font: inherit; text-align: left; cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .35);
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
#kasino-app .k-red { color: var(--red, #b3222b); }
#kasino-app .k-ix {
  position: absolute; top: 4px; left: 5px;
  font-family: "Young Serif", Georgia, serif; font-size: calc(var(--cw) * .25); line-height: 1; text-align: center;
}
#kasino-app .k-ix span { display: block; font-family: "Segoe UI Symbol", "DejaVu Sans", sans-serif; font-size: .92em; margin-top: 1px; }
#kasino-app .k-pip {
  position: absolute; inset: 22% 14% 10%; display: flex; align-items: center; justify-content: center;
  font-family: "Segoe UI Symbol", "DejaVu Sans", sans-serif; font-size: calc(var(--cw) * .54); line-height: 1;
  font-variant-emoji: text;
}
#kasino-app .k-face .k-pip { border: 1px solid var(--gold, #c99a2e); border-radius: 4px; inset: 36% 12% 8% 34%; font-size: calc(var(--cw) * .36); }
#kasino-app .k-hv {
  position: absolute; right: 3px; bottom: 3px;
  min-width: 18px; padding: 0 4px; border-radius: 8px;
  background: var(--gold, #c99a2e); color: var(--ink, #1c1915);
  font: 700 10px/15px Figtree, system-ui, sans-serif; text-align: center;
}
#kasino-app .k-back {
  cursor: default;
  border: 3px solid var(--card, #fffdf8);
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, .22) 0 3px, rgba(0, 0, 0, 0) 3px 7px), var(--red, #b3222b);
}
#kasino-app button.k-card:hover:not([aria-disabled="true"]) { transform: translateY(-3px); }
#kasino-app .k-card.is-sel, #kasino-app .k-build.is-sel { transform: translateY(-8px); box-shadow: 0 0 0 3px var(--gold, #c99a2e), 0 8px 12px rgba(0, 0, 0, .45); }
#kasino-app .k-card[aria-disabled="true"], #kasino-app .k-build[aria-disabled="true"] { cursor: default; }
#kasino-app .k-played { transform: translateY(10px); box-shadow: 0 0 0 3px var(--gold, #c99a2e), 0 6px 12px rgba(0, 0, 0, .45); animation: k-flip .35s ease-out; }
#kasino-app .k-hl { box-shadow: 0 0 0 3px var(--gold, #c99a2e), 0 0 18px rgba(201, 154, 46, .8); animation: k-pulse .8s ease-in-out infinite alternate; }
#kasino-app .k-new { animation: k-in .4s ease-out; }

/* Bygg */
#kasino-app .k-build {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 6px 7px 5px; border-radius: 10px;
  border: 1px dashed rgba(255, 253, 248, .45); background: rgba(255, 253, 248, .07);
  color: var(--card, #fffdf8); font: inherit; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
#kasino-app .k-stack { display: flex; }
#kasino-app .k-stack .k-card { cursor: inherit; }
#kasino-app .k-stack .k-card + .k-card { margin-left: calc(var(--cw) * -.62); }
#kasino-app .k-btag {
  border-radius: 999px; padding: 1px 9px;
  background: var(--card, #fffdf8); color: var(--navy, #1d2c4c);
  font-size: .75rem; font-weight: 700; white-space: nowrap;
}
#kasino-app .k-btag.k-mine { background: var(--gold, #c99a2e); color: var(--ink, #1c1915); }

/* Fokus */
#kasino-app button:focus { outline: none; }
#kasino-app button:focus-visible, #kasino-app summary:focus-visible, #kasino-app input:focus-visible, #kasino-app select:focus-visible {
  outline: 3px solid var(--gold, #c99a2e); outline-offset: 3px;
}
#kasino-app .k-felt button:focus-visible { outline-color: var(--card, #fffdf8); box-shadow: 0 0 0 6px var(--gold, #c99a2e); }

/* Melding og knapper */
#kasino-app .k-msg { min-height: 3em; margin: .75rem 0 .55rem; font-size: .95rem; color: var(--ink2, #4a443b); }
#kasino-app .k-msg.is-err { color: var(--red, #b3222b); font-weight: 600; }
#kasino-app .k-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#kasino-app .k-btn {
  min-height: 44px; padding: .55rem 1.05rem; border-radius: 999px;
  border: 1.5px solid var(--navy, #1d2c4c); background: var(--navy, #1d2c4c); color: var(--card, #fffdf8);
  font: 600 .95rem/1.2 Figtree, system-ui, sans-serif; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
#kasino-app .k-btn:hover:not(:disabled) { background: var(--ink, #1c1915); border-color: var(--ink, #1c1915); }
#kasino-app .k-btn.k-ghost { background: transparent; color: var(--navy, #1d2c4c); }
#kasino-app .k-btn.k-ghost:hover:not(:disabled) { background: var(--card, #fffdf8); color: var(--ink, #1c1915); }
#kasino-app .k-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Resultat */
#kasino-app .k-result {
  margin: 14px 0 0; padding: 14px 16px 16px;
  background: var(--card, #fffdf8); border: 1px solid var(--line, #d9cfbc); border-top: 4px solid var(--gold, #c99a2e); border-radius: 12px;
}
#kasino-app .k-result[hidden] { display: none; }
#kasino-app .k-h3 { font-size: 1.2rem; margin: 0 0 .5rem; }
#kasino-app .k-h4 { font-size: 1rem; margin: 1rem 0 .4rem; }
#kasino-app .k-tab { width: 100%; max-width: 420px; border-collapse: collapse; font-size: .92rem; margin: 0 0 12px; }
#kasino-app .k-tab th, #kasino-app .k-tab td { padding: 5px 8px; border-bottom: 1px solid var(--line, #d9cfbc); text-align: right; }
#kasino-app .k-tab th[scope="row"], #kasino-app .k-tab thead th:first-child { text-align: left; font-weight: 500; }
#kasino-app .k-tab thead th { font-weight: 700; }
#kasino-app .k-count th, #kasino-app .k-count td { color: var(--ink2, #4a443b); font-size: .86rem; }
#kasino-app .k-sum th, #kasino-app .k-sum td { font-weight: 700; }

/* Logg og husregler */
#kasino-app .k-lower { display: grid; gap: 14px; margin-top: 16px; }
#kasino-app .k-logbox, #kasino-app .k-rules { background: var(--card, #fffdf8); border: 1px solid var(--line, #d9cfbc); border-radius: 12px; padding: 12px 14px; }
#kasino-app .k-log { list-style: none; margin: 0; padding: 0; max-height: 9.6em; overflow-y: auto; font-size: .9rem; color: var(--ink2, #4a443b); }
#kasino-app .k-log li { padding: 2px 0; border-bottom: 1px dotted var(--line, #d9cfbc); }
#kasino-app .k-log li:first-child { color: var(--ink, #1c1915); font-weight: 600; }
#kasino-app .k-log li:last-child { border-bottom: 0; }
#kasino-app .k-rules summary { cursor: pointer; font-family: "Young Serif", Georgia, serif; font-size: 1.05rem; padding: 2px 0; }
#kasino-app .k-rules-body { padding-top: 6px; }
#kasino-app .k-small { font-size: .85rem; color: var(--ink2, #4a443b); margin: .3rem 0 .5rem; }
#kasino-app .k-tog { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: .93rem; cursor: pointer; }
#kasino-app .k-tog input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy, #1d2c4c); flex: 0 0 auto; }
#kasino-app .k-tog small { display: block; color: var(--ink2, #4a443b); font-size: .83rem; }
#kasino-app .k-pick { align-items: center; justify-content: space-between; max-width: 320px; }
#kasino-app .k-pick select { font: inherit; padding: 6px 8px; border: 1px solid var(--line, #d9cfbc); border-radius: 8px; background: var(--card, #fffdf8); color: var(--ink, #1c1915); }
#kasino-app .k-pt { max-width: 320px; }
#kasino-app .k-pt td.k-small { text-align: left; border-bottom: 0; }
#kasino-app .k-how { margin: 0; padding-left: 1.1rem; font-size: .9rem; color: var(--ink2, #4a443b); }
#kasino-app .k-how li { margin: .2rem 0; }
#kasino-app .k-how b { color: var(--ink, #1c1915); }

@keyframes k-pulse { from { box-shadow: 0 0 0 3px var(--gold, #c99a2e), 0 0 6px rgba(201, 154, 46, .5); } to { box-shadow: 0 0 0 3px var(--gold, #c99a2e), 0 0 20px rgba(201, 154, 46, .9); } }
@keyframes k-in { from { opacity: 0; transform: translateY(-14px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes k-flip { from { opacity: 0; transform: translateY(0) rotateY(90deg); } to { opacity: 1; transform: translateY(10px); } }

@media (min-width: 700px) {
  #kasino-app .k-lower { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 560px) {
  #kasino-app { --cw: 46px; --ch: 66px; --bw: 34px; --bh: 48px; }
  #kasino-app .k-felt { padding: 10px 8px 8px; border-radius: 14px; }
  #kasino-app .k-hand { gap: 6px; }
  #kasino-app .k-table { gap: 7px; padding: 10px 0; min-height: calc(var(--ch) * 1.5 + 20px); }
  #kasino-app .k-ix { top: 3px; left: 4px; font-size: 12px; }
  #kasino-app .k-hv { font-size: 9px; line-height: 13px; min-width: 15px; padding: 0 3px; right: 2px; bottom: 2px; }
  #kasino-app .k-btn { flex: 1 1 auto; padding: .5rem .8rem; font-size: .9rem; }
  #kasino-app .k-btag { font-size: .7rem; padding: 0 6px; }
  #kasino-app .k-title { font-size: 1.45rem; }
}
@media (prefers-reduced-motion: reduce) {
  #kasino-app *, #kasino-app *::before, #kasino-app *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
