/* ============ Backgammon — board, points, checkers ============ */

.kn-bg { display: flex; flex-direction: column; gap: var(--kn-gap); }

.kn-bg-opp {
  display: flex; align-items: center; gap: 12px; padding: 8px 14px;
  border-radius: var(--kn-radius); background: linear-gradient(#6c4427, #4a2c19);
  border: 1px solid #34200f; color: #f6ead8; box-shadow: var(--kn-shadow-sm), inset 0 1px 0 rgba(255,255,255,0.08);
}
.kn-bg-opp .kn-voxhead { width: 40px; height: 40px; flex: none; }
.kn-bg-opp-info { flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.kn-bg-opp-name { font-family: var(--kn-font-head); font-size: 1.05rem; }
.kn-bg-opp-status { color: #ead2ac; font-size: 0.84rem; min-height: 1.1em; }
.kn-bg-off-count { font-family: var(--kn-font-head); color: #f3d28a; }

/* the wooden board */
.kn-bg-board {
  border-radius: var(--kn-radius); overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.05) 0 70px, rgba(255,255,255,0.02) 70px 73px),
    linear-gradient(#5d3a22, #3c2415);
  box-shadow: var(--kn-shadow), inset 0 0 0 4px #2a1a0e;
  padding: 6px;
}
.kn-bg-row { display: flex; align-items: stretch; height: clamp(120px, 26vw, 168px); }
.kn-bg-quad { flex: 1; display: flex; align-items: stretch; }
.kn-bg-bar {
  width: clamp(20px, 4vw, 30px); margin: 0 2px; border-radius: 4px;
  background: linear-gradient(#3c2415, #2a1a0e);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.kn-bg-off {
  width: clamp(26px, 5vw, 38px); margin-left: 4px; border-radius: 4px;
  background: rgba(0,0,0,0.25); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 3px 0;
}

/* a point (triangle + checker stack) */
.kn-pt { flex: 1; height: 100%; position: relative; cursor: default; }
.kn-tri { position: absolute; inset: 0; }
.kn-bg-top .kn-tri { clip-path: polygon(0 0, 100% 0, 50% 92%); }
.kn-bg-bottom .kn-tri { clip-path: polygon(50% 8%, 0 100%, 100% 100%); }
.kn-pt:nth-child(odd) .kn-tri { background: linear-gradient(#caa274, #a8814f); }
.kn-pt:nth-child(even) .kn-tri { background: linear-gradient(#7a4f31, #5d3a22); }
.kn-pt.kn-pt-src .kn-tri { filter: brightness(1.15); }
.kn-pt.kn-pt-dest .kn-tri { background: linear-gradient(var(--kn-good), #1f7a44) !important; animation: kn-point 0.9s ease-in-out infinite; }
.kn-pt.kn-pt-tut .kn-tri,
.kn-pt.kn-pt-tip .kn-tri { box-shadow: inset 0 0 0 3px var(--kn-gold); animation: kn-point 0.9s ease-in-out infinite; }

.kn-stack { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; }
.kn-bg-top .kn-stack { top: 2px; }
.kn-bg-bottom .kn-stack { bottom: 2px; flex-direction: column-reverse; }

.kn-chk {
  --d: clamp(16px, 3.4vw, 24px);
  width: var(--d); height: var(--d); border-radius: 50%; flex: none;
  margin-top: -3px; box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 2px 2px rgba(255,255,255,0.3);
}
.kn-bg-top .kn-stack .kn-chk:first-child, .kn-bg-bottom .kn-stack .kn-chk:first-child { margin-top: 0; }
.kn-chk-0 { background: radial-gradient(circle at 38% 32%, #fdf6e6, #d9c8a0); border: 1px solid #b7a374; }
.kn-chk-1 { background: radial-gradient(circle at 38% 32%, #4a352a, #241712); border: 1px solid #15100c; }
.kn-chk-more { font-size: 0.7rem; color: #2a2317; display: grid; place-items: center; font-weight: 700; }
.kn-chk-1.kn-chk-more { color: #f6ead8; }
.kn-bg-bar .kn-chk, .kn-bg-off .kn-chk { --d: clamp(15px, 3vw, 20px); margin-top: 1px; }

/* dice + controls */
.kn-bg-controls { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.kn-bg-dice { display: flex; gap: 10px; }
.kn-bg-die {
  --s: clamp(34px, 7vw, 44px); width: var(--s); height: var(--s); border-radius: 18%;
  background: linear-gradient(150deg, #fffdf6, #efe5d0); position: relative;
  box-shadow: inset 0 -3px 5px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.35);
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 16%; gap: 6%;
}
.kn-bg-die.kn-die-used { opacity: 0.4; }
.kn-bg-die i { border-radius: 50%; }
.kn-bg-die i.on { background: radial-gradient(circle at 38% 32%, #43321f, #190f07); }
.kn-bg-hint { flex-basis: 100%; text-align: center; color: var(--kn-muted); font-size: 0.86rem; min-height: 1.1em; }
