/* AZ-kvíz: the players' plates, the status line, the pyramid of hexagonal
   fields in the room that is left, the question card at the foot. A field is
   a button clipped to a hexagon with a point up (its rim is the button, the
   face an inner hexagon); azkviz.js places them and sets their size (--hw,
   --hh). Orange and blue are the players', black the missed fields. With the
   keyboard of a phone up (.kb) the card takes the room and the pyramid shrinks
   or steps aside (.noboard). */
.az{
  --az-o:#f28c28;--az-o2:#b85d0c;--az-b:#2f80ed;--az-b2:#174f9e;--az-k:#3a3a40;--az-k2:#17171b;
  --az-free:#f4ecd9;--az-free2:#c9bc9c;--az-ink:#241a2d;
  position:absolute;inset:0;margin:0 auto;max-width:620px;
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;
  padding:0 8px;overflow:hidden;
}
.az [hidden]{display:none!important}
.az.still .az-hex,.az.still .az-in{transition:none!important;animation:none!important}

/* ── plates ──────────────────────────────────────────────────────────── */
.az-plates{display:flex;justify-content:center;gap:6px;padding:6px 0 2px}
.az-plate{
  --pc:var(--az-o);
  display:flex;align-items:center;gap:6px;
  flex:0 1 220px;min-width:0;min-height:44px;padding:3px 6px 3px 4px;
  border:1.5px solid var(--line);border-radius:999px;background:rgba(13,18,10,.3);
  transition:border-color .2s,background-color .2s;
}
.az-plate.b{--pc:var(--az-b)}
.az-plate .ava{width:32px;height:32px;font-size:.95rem;flex:none}
.az-who{display:grid;line-height:1.15;min-width:0;flex:1}
.az-who .nm{font-weight:600;font-size:.88rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.az-who .sub{font-size:.7rem;color:var(--mist);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.az-count{
  flex:none;min-width:2em;height:2em;padding:0 .3em;
  display:grid;place-items:center;font-size:.95rem;font-variant-numeric:tabular-nums;color:#fff;
  background:var(--pc);clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.az-plate.turn{border-color:var(--pc);background:rgba(255,255,255,.08)}
.az-plate.turn .ava{box-shadow:0 0 0 2.5px var(--pc)}
.az-plate.best{border-color:var(--gold)}

.az-status{justify-self:center;max-width:100%;margin:4px 0 2px;padding:.35em .9em;font-size:.92rem;text-align:center}

/* ── the pyramid ─────────────────────────────────────────────────────── */
.az-main{display:grid;place-items:center;min-width:0;min-height:0;overflow:hidden;padding:2px 0}
.az.noboard .az-main{display:none}
.az-board{--hw:44px;--hh:51px;--fs:15px;position:relative}
/* the three sides to join: a pale triangle behind the fields */
.az-tri{
  position:absolute;left:-5%;right:-5%;top:-4%;bottom:-3%;
  background:linear-gradient(180deg,rgba(255,255,255,.10),rgba(255,255,255,.04));
  clip-path:polygon(50% 0,100% 100%,0 100%);pointer-events:none;
}
.az-hex{
  position:absolute;left:0;top:0;width:var(--hw);height:var(--hh);padding:0;border:0;margin:0;
  background:var(--az-free2);cursor:default;
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
  -webkit-tap-highlight-color:transparent;
  transition:background-color .25s,filter .2s;
}
.az-in{
  position:absolute;inset:3px;display:grid;place-items:center;
  background:var(--az-free);color:var(--az-ink);
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
  font:700 var(--fs)/1 var(--ui);font-variant-numeric:tabular-nums;
  transition:background-color .25s,color .25s;
}
.az-hex.o{background:var(--az-o2)}.az-hex.o .az-in{background:var(--az-o);color:#fff}
.az-hex.b{background:var(--az-b2)}.az-hex.b .az-in{background:var(--az-b);color:#fff}
.az-hex.blk{background:var(--az-k2)}.az-hex.blk .az-in{background:var(--az-k);color:rgba(255,255,255,.82)}
.az-hex.can{cursor:pointer}
@media (hover:hover){.az-hex.can:hover{filter:brightness(1.08)}}
.az-hex.sel{background:var(--gold)}
.az-hex.sel .az-in{inset:5px;background:#fff8e4}
/* the field being asked about pulses */
.az-hex.now{background:var(--gold);animation:az-pulse 1.1s ease-in-out infinite}
.az-hex.now .az-in{inset:4px}
@keyframes az-pulse{50%{filter:brightness(1.25);transform-origin:center}}
.az-hex.fresh .az-in{box-shadow:inset 0 0 0 3px rgba(255,255,255,.55)}
/* the winning chain */
.az-hex.chain{background:var(--gold)}
.az-hex.chain .az-in{inset:4px}
/* the hint: the field to choose, my shortest way (gold), the opponent's (dotted) */
.az-hex.hn-best{background:var(--medal,#ffc65c);animation:az-pulse 1.4s ease-in-out infinite}
.az-hex.hn-best .az-in{inset:5px}
.az-hex.hn-path .az-in::after,.az-hex.hn-fpath .az-in::after{
  content:"";position:absolute;bottom:16%;left:50%;width:7px;height:7px;margin-left:-3.5px;border-radius:50%;
}
.az-hex.hn-path .az-in::after{background:var(--medal,#ffc65c);box-shadow:0 0 0 1.5px rgba(0,0,0,.35)}
.az-hex.hn-fpath .az-in::after{border:1.5px dashed rgba(36,26,45,.7);background:transparent}
.az-hex.hn-path.hn-fpath .az-in::after{border:1.5px dashed rgba(36,26,45,.8)}

/* ── the question card ───────────────────────────────────────────────── */
.az-card{
  /* a light surface on the dark cloth: the shell's buttons and fields take their light-ground colours here */
  --fg:var(--az-ink);--fg2:#6b6470;--edge:rgba(36,26,45,.22);--edge2:rgba(36,26,45,.3);--field:#fff;--btn:#fff;
  display:grid;grid-template-columns:minmax(0,1fr);gap:7px;margin:4px 0 8px;padding:10px 12px 12px;
  border-radius:18px;background:var(--ivory);color:var(--az-ink);
  box-shadow:0 14px 28px -18px rgba(0,0,0,.85);
}
.az-card.mine{box-shadow:0 0 0 3px var(--gold),0 14px 28px -18px rgba(0,0,0,.85)}
.az-head{display:flex;align-items:flex-start;gap:10px}
.az-fnum{
  flex:none;display:grid;place-items:center;width:38px;height:44px;
  font:700 1rem/1 var(--ui);color:var(--az-ink);background:var(--gold);
  clip-path:polygon(50% 0,100% 25%,100% 75%,50% 100%,0 75%,0 25%);
}
.az-fnum.blk{background:var(--az-k);color:#fff}
.az-qtext{flex:1;min-width:0;margin:0;align-self:center;font:600 1.08rem/1.3 var(--ui);overflow-wrap:anywhere}
.az-card.idle .az-qtext{font-weight:400;font-size:.95rem;color:#5a5560}
.az-letters{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.az-letters i{
  display:grid;place-items:center;min-width:34px;height:38px;padding:0 6px;
  font:700 1.25rem/1 var(--display,serif);font-style:normal;color:#fff;background:var(--az-b);border-radius:9px;
}
.az-yn{font-size:.78rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase;color:#6b6470}
.az-clock{display:flex;align-items:center;gap:8px}
.az-bar{flex:1;height:8px;border-radius:999px;background:rgba(36,26,45,.14);overflow:hidden}
.az-bar i{display:block;height:100%;border-radius:inherit;background:var(--az-o);transform-origin:0 50%;transition:transform .1s linear,background-color .2s}
.az-clock b{flex:none;min-width:2ch;font:700 .95rem/1 var(--ui);font-variant-numeric:tabular-nums;text-align:right}
.az-clock.low .az-bar i{background:#d42a4c}
.az-clock.low b{color:#d42a4c}
.az-res{display:grid;gap:3px;font-size:.92rem;line-height:1.3;text-align:center}
.az-out{font-weight:700}
.az-out.mine,.az-out.stolen{color:#2c7a3f}
.az-out.black,.az-out.foe{color:#8a2340}
.az-ans b{font-size:1.08rem}
.az-try{font-size:.84rem;color:#6b6470}
.az-opts{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.az-card .btn.az-opt{
  min-width:0;min-height:46px;padding:6px 8px;font-size:.9rem;letter-spacing:.02em;text-transform:none;line-height:1.2;
  white-space:normal;overflow-wrap:anywhere;color:var(--az-ink);background:#fff;border-color:rgba(36,26,45,.25);
}
.az-card .btn.az-pass{color:var(--az-ink);background:#fff;border-color:rgba(36,26,45,.3)}
.az-opt[data-tried]{text-decoration:line-through;opacity:.5}
.az-card .btn.az-opt.yes{background:#2c7a3f;color:#fff;border-color:#2c7a3f;font-size:1.05rem;text-transform:uppercase}
.az-card .btn.az-opt.no{background:#a3263f;color:#fff;border-color:#a3263f;font-size:1.05rem;text-transform:uppercase}
span.az-opt.done{
  display:grid;place-items:center;min-height:34px;border-radius:12px;font-size:.86rem;
  border:1.5px solid rgba(36,26,45,.18);color:#6b6470;
}
span.az-opt.done.ok{border-color:#2c7a3f;color:#2c7a3f;font-weight:700}
.az-form{display:flex;gap:8px}
.az-card .az-input{
  flex:1;min-width:0;width:auto;min-height:46px;height:46px;padding:0 12px;border:1.5px solid rgba(36,26,45,.25);border-radius:12px;
  font:500 1.05rem/1 var(--ui);color:var(--az-ink);background:#fff;
}
.az-card .az-input:focus{outline:none;border-color:var(--az-b);box-shadow:0 0 0 3px rgba(47,128,237,.25)}
.az-send{flex:none;min-height:46px}
.az-acts{display:flex;justify-content:center;gap:8px}
.az-acts .btn{min-height:44px}

/* a short room (the keyboard is up, or a small phone): the card gets tighter */
.az.short .az-card{gap:5px;padding:8px 10px 9px;margin-bottom:6px}
.az.short .az-qtext{font-size:1rem}
.az.short .az-letters i{min-width:28px;height:30px;font-size:1.05rem}
.az.short .az-fnum{width:32px;height:37px}
.az.kb .az-plates{display:none}
.az.kb .az-status{margin:2px 0 0;font-size:.85rem}
.az-sum{margin:.2em 0 .6em;font-size:.9rem;opacity:.75;text-align:center}

@media (min-width:760px){
  .az-card{padding:14px 18px 16px}
  .az-qtext{font-size:1.2rem}
}
@media (prefers-reduced-motion:reduce){.az-hex.now,.az-hex.hn-best{animation:none}}
