/* Člověče, nezlob se!: status and news on top, the players' plates, the
   square board in the room that is left, the die and its button at the
   bottom. The board is ivory paper with ink fields; the colours of the four
   seats are red, blue, green and yellow (by seat, not by place on the board). */
.clov{
  --clov-c0:#d8433b;--clov-c1:#2f6fd6;--clov-c2:#2e9b52;--clov-c3:#f0c419;
  --clov-paper:#f7f1e3;--clov-ink:#2a2420;
  position:absolute;inset:0;
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;
  overflow:hidden;
}
.clov .c0{--pc:var(--clov-c0)}
.clov .c1{--pc:var(--clov-c1)}
.clov .c2{--pc:var(--clov-c2)}
.clov .c3{--pc:var(--clov-c3)}

.clov-top{display:grid;justify-items:center;gap:2px;padding:6px 10px 0}
.clov-status{padding:.4em .9em;font-size:.93rem}
.clov-news{
  margin:0;min-height:1.3em;max-width:26rem;
  font-size:.86rem;line-height:1.3;text-align:center;color:var(--mist);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* ── plates ──────────────────────────────────────────────────────────── */
.clov-plates{
  display:grid;grid-template-columns:repeat(var(--clov-n,4),minmax(0,1fr));gap:5px;
  padding:5px 8px;max-width:34rem;width:100%;justify-self:center;box-sizing:border-box;
}
.clov-plate{
  display:flex;align-items:center;gap:5px;min-width:0;min-height:44px;padding:3px 6px 3px 3px;
  border:1.5px solid var(--line);border-left:5px solid var(--pc);border-radius:12px;
  background:rgba(0,0,0,.22);
  transition:border-color .2s,background-color .2s;
}
.clov-plate .ava{width:30px;height:30px;font-size:.9rem;flex:none}
.clov-who{display:grid;line-height:1.15;min-width:0;flex:1}
.clov-who .nm{font-weight:600;font-size:.82rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.clov-who .sub{font-size:.68rem;color:var(--mist);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.clov-plate.turn{border-color:var(--pc);background:rgba(255,255,255,.1);box-shadow:0 0 0 1px var(--pc)}
.clov-plate.turn .ava{box-shadow:0 0 0 2.5px var(--pc)}
.clov-plate.best{border-color:var(--gold)}
/* pieces home: one dot each */
.clov-pips{display:flex;gap:3px;margin-top:3px}
.clov-pips i{width:7px;height:7px;border-radius:50%;border:1.5px solid var(--pc);opacity:.75}
.clov-pips i.on{background:var(--pc);opacity:1}

/* ── the board ───────────────────────────────────────────────────────── */
.clov-main{display:grid;place-items:center;min-width:0;min-height:0;overflow:hidden;padding:2px 8px}
.clov-board{position:relative;width:300px;height:300px;flex:none}
.clov-svg{position:absolute;inset:0;width:100%;height:100%;display:block;overflow:visible}
.clov-paper{fill:var(--clov-paper);filter:drop-shadow(0 .12px .2px rgba(0,0,0,.6))}
.clov-line{fill:none;stroke:var(--clov-ink);stroke-opacity:.45;stroke-width:.07}
.clov-f{fill:#fffdf7;stroke:var(--clov-ink);stroke-width:.06}
.clov-f.c0{--pc:var(--clov-c0)}
.clov-f.c1{--pc:var(--clov-c1)}
.clov-f.c2{--pc:var(--clov-c2)}
.clov-f.c3{--pc:var(--clov-c3)}
.clov-f.st{fill:var(--pc,#fffdf7);fill-opacity:.85;stroke-width:.09}
.clov-f.hm{fill:var(--pc,#ddd5c4);fill-opacity:.55}
.clov-f.yd{fill:var(--pc,#ddd5c4);fill-opacity:.25}
.clov-f.n{--pc:#d9d1c0}
.clov-arrow{fill:var(--clov-ink);fill-opacity:.7}
.clov-mid{fill:var(--clov-ink);fill-opacity:.55}

.clov-layer{position:absolute;inset:0}
/* a piece: a round pawn of its colour, one field (1/11 of the board) in size */
.clov-pc,.clov-dest{
  position:absolute;width:calc(100% / 11);height:calc(100% / 11);
  margin:0;padding:0;border:0;background:none;
  -webkit-tap-highlight-color:transparent;
}
.clov-pc{z-index:2;pointer-events:none;cursor:default}
.clov-pc::before{
  content:"";position:absolute;inset:13%;border-radius:50%;
  background:radial-gradient(circle at 36% 30%,rgba(255,255,255,.75) 0 12%,transparent 34%),var(--pc);
  box-shadow:inset 0 -2px 3px rgba(0,0,0,.35),0 2px 3px rgba(0,0,0,.45);
  border:1.5px solid rgba(0,0,0,.5);box-sizing:border-box;
}
.clov-pc::after{ /* the knob of the pawn */
  content:"";position:absolute;left:36%;top:30%;width:28%;height:28%;border-radius:50%;
  background:radial-gradient(circle at 40% 35%,rgba(255,255,255,.6),transparent 60%),var(--pc);
  box-shadow:0 1px 2px rgba(0,0,0,.4);
}
.clov-pc.walk{z-index:5}
/* a piece that can move: it rises and breathes, and takes taps beyond its edge */
.clov-pc.can{z-index:4;pointer-events:auto;cursor:pointer}
.clov-pc.can::before{box-shadow:0 0 0 2.5px var(--gold),0 0 12px 2px var(--gold),0 3px 4px rgba(0,0,0,.45);animation:clovPulse 1.1s ease-in-out infinite alternate}
.clov-pc.can:focus-visible{outline:2px solid var(--clov-ink);outline-offset:1px;border-radius:50%}
.clov-pc.hn-pick::before{box-shadow:0 0 0 3.5px var(--gold),0 0 18px 6px var(--gold)}
@keyframes clovPulse{from{transform:scale(1)}to{transform:scale(1.12)}}
/* where a move would land */
.clov-dest{z-index:3;cursor:pointer;border-radius:50%}
.clov-dest::before{
  content:"";position:absolute;inset:14%;border-radius:50%;
  border:2.5px dashed var(--clov-ink);background:rgba(255,255,255,.45);box-sizing:border-box;
  box-shadow:0 0 0 2px var(--pc),0 0 8px 1px var(--gold);
}
/* landing on an opponent: a solid ring around the piece that will be sent home */
.clov-dest.hit::before{border-style:solid;background:none;inset:4%}
/* while the die still rolls, nothing lights up yet */
.clov.rolling .clov-dest{opacity:0;pointer-events:none}
.clov.rolling .clov-pc.can::before{animation:none;box-shadow:0 2px 3px rgba(0,0,0,.45)}

/* ── the die and its button ──────────────────────────────────────────── */
/* the tray must be a die and a half high at least, or a thrown die never comes to rest inside it */
.clov-bar{display:flex;align-items:center;justify-content:center;gap:12px;padding:2px 10px 8px}
.clov-tray.tray{width:160px;max-width:44vw;height:104px;flex:none;border-radius:18px}
.clov-roll{min-height:48px;min-width:9rem}

.clov-sum{margin:0;text-align:center;color:var(--mist);font-size:.88rem}

@media (prefers-reduced-motion:reduce){
  .clov-pc.can::before{animation:none}
}
/* a desktop: the plates and the bar stay narrow, the board grows */
@media (min-width:700px) and (min-height:700px){
  .clov-tray.tray{height:120px;width:190px}
}
