/* TrigammonX Beta v5.9.1 — gameplay control bar and Point Compass (presentation only). */

.tx591-retired{display:none!important}

/* ---------- The bar ---------- */
#tx591-controls{width:100%;box-sizing:border-box;margin:8px 0 0;padding:10px 12px;border:1px solid var(--tx-line);border-top-color:rgba(255,255,255,.07);
  border-radius:var(--tx-radius);background:linear-gradient(180deg,rgba(216,180,106,.05),transparent 35%),var(--tx-bg-panel);box-shadow:var(--tx-raised)}
.tx591-bar{display:grid;gap:8px 10px;align-items:center;
  grid-template-columns:auto auto auto auto auto auto auto minmax(0,1fr) auto;
  grid-template-areas:"turn roll rolled undo end combo compass . flow" ". . avail avail avail avail avail avail new"}
.tx591-cell{display:flex;align-items:center;min-width:0}
.tx591-turn{grid-area:turn}.tx591-roll{grid-area:roll}.tx591-rolled{grid-area:rolled}.tx591-undo{grid-area:undo}.tx591-end{grid-area:end}
.tx591-combo{grid-area:combo}.tx591-compass{grid-area:compass}.tx591-flow{grid-area:flow;justify-content:flex-end}.tx591-avail{grid-area:avail}.tx591-new{grid-area:new;justify-content:flex-end}
.tx591-cell>.udp-col{flex:1 1 auto;min-width:0;border:0;padding:0}
.tx591-rolled .udp-col-rolled{min-width:96px}
.tx591-avail .udp-col-available{flex-direction:row;flex-wrap:wrap;align-items:center;gap:4px 10px}
.tx591-avail .udp-col-available>.dice-label{margin:0}
.tx591-avail #dice-exp-row{min-height:0}
.tx591-avail #roll-type-label:empty{display:none}

/* Buttons keep the engine's own colours and states; the bar gives them one size */
#tx591-controls .tx591-bar button{min-height:44px;padding:9px 14px;font-size:13px;line-height:1.2;white-space:nowrap;border-radius:var(--tx-radius-sm);width:100%;box-sizing:border-box;min-width:0}
#tx591-controls .tx591-bar .btn-roll-dice{font-size:14px!important}
@media (pointer:coarse){#tx591-controls .tx591-bar button{min-height:46px}#tx591-controls .tx591-bar button:active{filter:brightness(1.15)}}
#tx591-controls #tgx-combo-toggle{display:inline-flex;align-items:center;justify-content:center;gap:2px;border-radius:999px;font:700 13px/1.2 system-ui,-apple-system,'Segoe UI',sans-serif}
#tx591-controls #tgx-combo-toggle::before{content:none}            /* no hit-slop over neighbouring controls */
#tx591-controls #classic-human-game{border-color:#8a6d45;color:#e0c48f;background:#221a13}
#tx591-controls #classic-human-game:hover{background:#8a6d45;color:#140f08}

/* The opening roll has its own panel: as the engine did for the old dice panel, hide turn and dice until it is decided */
body.orp-pending #tx591-controls .tx591-turn,body.orp-pending #tx591-controls .tx591-rolled,body.orp-pending #tx591-controls .tx591-avail{display:none}

/* Point Compass button */
#tx591-compass-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;border-color:#c9a468;color:#f0d594}
#tx591-compass-btn:hover,#tx591-compass-btn.tx591-on{background:#5b4420;color:#fff3d6;border-color:#e8c47b}
#tx591-compass-btn:focus-visible,.tx591-compass-close:focus-visible,.tx591-strip-more:focus-visible{outline:3px solid #f6cd65;outline-offset:2px}
.tx591-compass-alert{position:absolute;top:-7px;right:-7px;min-width:20px;height:20px;padding:0 5px;box-sizing:border-box;border-radius:10px;
  background:#f3c64e;color:#1a1204;font:800 12px/20px system-ui,-apple-system,'Segoe UI',sans-serif;text-align:center;box-shadow:0 0 0 2px #1b1510}
#tx591-compass-btn.tx591-alert{border-color:#f3c64e;box-shadow:0 0 0 2px rgba(243,198,78,.35),0 0 14px rgba(243,198,78,.45)}
@media (prefers-reduced-motion:no-preference){#tx591-compass-btn.tx591-alert{animation:tx591-pulse 1.8s ease-in-out infinite}}
@keyframes tx591-pulse{50%{box-shadow:0 0 0 4px rgba(243,198,78,.22),0 0 20px rgba(243,198,78,.6)}}

/* Help below the primary row */
.tx591-help{margin:10px 0 0;padding-top:6px;border-top:1px solid var(--tx-line-soft)}
.tx591-help>summary{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 4px;cursor:pointer;font-size:12.5px;font-weight:700;color:#e0c48f;list-style:none}
.tx591-help>summary::-webkit-details-marker{display:none}
.tx591-help>summary::before{content:'▸';font-size:12px;transition:transform .15s ease}
.tx591-help[open]>summary::before{transform:rotate(90deg)}
.tx591-help>summary:focus-visible{outline:3px solid #f6cd65;outline-offset:2px;border-radius:6px}
.tx591-help #classic-combo-help{margin:2px 4px 2px;font-size:12px;line-height:1.5;color:#dcc8aa}

/* ---------- Bar re-entry strip (player to move has checkers on the bar) ---------- */
#tx591-bar-strip{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-top:10px;padding:10px 12px;border:1px solid #c99a3e;border-radius:10px;
  background:linear-gradient(180deg,rgba(243,198,78,.14),rgba(243,198,78,.05));color:#f4e6c4}
#tx591-bar-strip[hidden]{display:none}
.tx591-strip-lead{flex:1 1 260px;margin:0;font-size:13px;line-height:1.45}
.tx591-strip-lead strong{color:#ffe08a}
.tx591-strip-more{min-height:40px;padding:6px 12px;border:1px solid #c9a468;border-radius:8px;background:#251b16;color:#f0d594;font:inherit;font-size:13px;font-weight:700;cursor:pointer}
#tx591-bar-strip[data-c=blue]{border-left:4px solid #74b9ff}#tx591-bar-strip[data-c=red]{border-left:4px solid #ff7675}#tx591-bar-strip[data-c=green]{border-left:4px solid #55efc4}

/* ---------- Point Compass panel ---------- */
#tx591-compass{margin-top:10px;padding:12px;border:1px solid #6b5333;border-radius:12px;background:#151a26;color:#ecdcb8}
#tx591-compass[hidden]{display:none}
.tx591-compass-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.tx591-compass-head h3{margin:0;font-size:16px;letter-spacing:.04em;color:#e8c47b}
.tx591-compass-close{min-height:40px;padding:6px 14px;border:1px solid #705434;border-radius:8px;background:#251b16;color:#dec092;font:inherit;font-size:13px;cursor:pointer}
.tx591-compass-intro{margin:6px 0 10px;font-size:13px;line-height:1.5;color:#cdbf9f}
.tx591-compass-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tx591-compass-card{min-width:0;padding:10px 12px;border:1px solid #3f3526;border-radius:10px;background:#1b2030}
.tx591-compass-card[data-current]{border-color:#e8c47b;background:linear-gradient(160deg,#2a2416,#1b2030);box-shadow:0 0 0 1px rgba(232,196,123,.35)}
.tx591-compass-card header{display:flex;align-items:center;gap:8px;font-size:15px}
.tx591-dot{width:14px;height:14px;border-radius:50%;flex:none;box-shadow:inset 0 -2px 2px rgba(0,0,0,.3),0 0 0 1px rgba(255,255,255,.4)}
.tx591-dot.blue{background:#4a90d9}.tx591-dot.red{background:#d64b40}.tx591-dot.green{background:#16b48c}
.tx591-now{display:none;margin-left:auto;padding:2px 8px;border-radius:99px;background:#e8c47b;color:#1a1204;font-size:11px;font-weight:800;letter-spacing:.03em}
.tx591-compass-card[data-current] .tx591-now{display:inline-block}
.tx591-compass-card dl{margin:8px 0 0;display:grid;gap:4px}
.tx591-compass-card dl>div{display:grid;grid-template-columns:7.2em 1fr;gap:6px;font-size:13px;line-height:1.4}
.tx591-compass-card dt{color:#b9ab8c}
.tx591-compass-card dd{margin:0;color:#f1e4c6}
.tx591-bar-note{margin:8px 0 0;font-size:12.5px;font-weight:700;color:#ffd77a}
.tx591-bar-note:empty{display:none}

/* Entry chips: die value → board point, with the engine's open / hit / blocked answer while that colour is on the bar */
ol.tx591-entry{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px;margin:10px 0 0;padding:0;list-style:none}
ol.tx591-entry li{display:flex;flex-direction:column;align-items:center;gap:1px;min-width:0;padding:5px 2px 4px;border:1px solid #3d3527;border-radius:8px;background:#121722;font-size:12px;line-height:1.15}
.tx591-die{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:5px;background:#f4ead2;color:#1a1204;font-weight:800;font-size:12px;box-shadow:inset 0 -2px 0 rgba(0,0,0,.25)}
.tx591-arrow{font-size:10px;color:#9d927b;line-height:1}
.tx591-pt{font-weight:800;font-size:14px;color:#fff3d6}
.tx591-state{font-size:10.5px;font-weight:700;letter-spacing:0;white-space:nowrap}
ol.tx591-entry li[data-state=open],ol.tx591-entry li[data-state=own]{border-color:#3f7a4c}
ol.tx591-entry li[data-state=open] .tx591-state,ol.tx591-entry li[data-state=own] .tx591-state{color:#8be39a}
ol.tx591-entry li[data-state=hit]{border-color:#b9822f}
ol.tx591-entry li[data-state=hit] .tx591-state{color:#ffc46b}
ol.tx591-entry li[data-state=blocked]{border-color:#7c3a33;background:#1d1416}
ol.tx591-entry li[data-state=blocked] .tx591-pt{color:#c99;text-decoration:line-through}
ol.tx591-entry li[data-state=blocked] .tx591-state{color:#ff8f86}
ol.tx591-entry li[data-rolled]{border-color:#f3c64e;box-shadow:0 0 0 2px rgba(243,198,78,.55),0 0 10px rgba(243,198,78,.35);background:#2a2214}
ol.tx591-entry li[data-rolled] .tx591-die{background:#f3c64e}
ol.tx591-entry-compact{flex:2 1 300px;margin:0}

/* ---------- Narrower screens: the same order, wrapped ---------- */
/* Tablets and small laptops: three rows on a 12-column grid, so every control keeps a fair share of the width */
@media (max-width:1199px){
  .tx591-bar{gap:8px;grid-template-columns:repeat(12,minmax(0,1fr));
    grid-template-areas:"turn turn roll roll rolled rolled rolled rolled undo undo end end"
                        ". . . . avail avail avail avail avail avail avail avail"
                        "combo combo combo compass compass compass . new new flow flow flow"}
  #tx591-controls .tx591-bar button{padding:9px 8px}
}
@media (max-width:699px){
  #tx591-controls{padding:10px}
  .tx591-bar{gap:8px;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-areas:"turn roll" "rolled rolled" "avail avail" "undo end" "combo compass" "flow new"}
  .tx591-flow,.tx591-new{justify-content:stretch}
  #tx591-controls .tx591-bar button{padding:9px 8px}
  .tx591-compass-grid{grid-template-columns:1fr}
  .tx591-compass-card dl>div{grid-template-columns:6.4em 1fr}
}
@media (max-width:420px){ol.tx591-entry{gap:3px}.tx591-pt{font-size:13px}.tx591-state{font-size:9.5px}}

/* ---------- Sound & Music: the sound-effects switch sits under the music controls ---------- */
.tx591-sfx-row{display:flex;justify-content:center;margin:10px auto 0}
.tx591-sfx-row>#btn-sound-toggle{min-height:40px;padding:7px 16px;border-radius:999px;font-size:13px;background:rgba(8,12,22,.82)}
.tx591-sfx-row>#btn-sound-toggle[aria-pressed=true]{border-color:#c9a468!important;color:#f0d594!important}
.tx591-sfx-row>#btn-sound-toggle:focus-visible{outline:3px solid #f6cd65;outline-offset:2px}
