/* games.css: shared styles for the Sentinel games (builds on ../css/webprojects.css) */
.g-body{ padding:22px; }
.g-grid{ display:grid; grid-template-columns:minmax(0,auto) minmax(220px,1fr); gap:20px; align-items:start; }
@media (max-width: 860px){ .g-grid{ grid-template-columns:minmax(0,1fr); } }

.g-stage{ position:relative; width:100%; max-width:var(--stage-max,560px); margin:0 auto; }
.g-stage canvas{ display:block; width:100%; height:auto; border-radius:14px; border:1px solid var(--border); background:#070b14; touch-action:none; outline:none; }
.g-stage canvas:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }

.g-overlay{ position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; text-align:center; padding:20px; border-radius:14px; background:rgba(5,8,16,.84); backdrop-filter:blur(2px); }
.g-overlay[hidden]{ display:none; }
.g-overlay h2{ margin:0; font-size:22px; }
.g-overlay p{ margin:0; color:var(--muted); max-width:36ch; line-height:1.5; }

.g-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(96px,1fr)); gap:8px; margin-bottom:12px; }
.g-stat{ padding:8px 10px; border-radius:12px; border:1px solid var(--border); background:rgba(255,255,255,.04); }
.g-stat .k{ font-size:12px; color:var(--muted); }
.g-stat .v{ font-size:18px; font-weight:700; font-variant-numeric:tabular-nums; }

.g-panel{ border:1px solid var(--border); border-radius:14px; padding:14px; background:rgba(255,255,255,.03); margin-bottom:12px; }
.g-panel h3{ margin:0 0 8px; font-size:15px; }
.g-panel p, .g-panel li{ color:#d6e1ec; font-size:14px; line-height:1.55; }
.g-panel ul{ margin:6px 0 0; padding-left:18px; }

.g-msg{ min-height:3.2em; padding:10px 12px; border-radius:12px; border:1px solid rgba(63,209,255,.4); background:rgba(63,209,255,.07); color:#dff6ff; font-size:14px; line-height:1.5; }
.g-msg.bad{ border-color:rgba(255,107,107,.6); background:rgba(255,107,107,.09); color:#ffd2d2; }
.g-msg.good{ border-color:rgba(67,255,177,.55); background:rgba(67,255,177,.08); color:#d4ffe9; }

.g-btns{ display:flex; flex-wrap:wrap; gap:8px; margin:10px 0; }
.g-btns .btn[aria-pressed="true"]{ background:rgba(63,209,255,.25); border-color:rgba(63,209,255,.7); }
.btn:focus-visible, .g-dpad button:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.g-dpad{ display:grid; grid-template-columns:repeat(3,54px); grid-template-rows:repeat(2,54px); gap:6px; justify-content:center; margin:12px auto 0; }
.g-dpad button{ border-radius:14px; border:1px solid var(--border); background:rgba(255,255,255,.07); color:var(--text); font-size:20px; cursor:pointer; }
.g-dpad button:active{ background:rgba(63,209,255,.25); }
.g-dpad .up{ grid-column:2; grid-row:1; } .g-dpad .left{ grid-column:1; grid-row:2; } .g-dpad .down{ grid-column:2; grid-row:2; } .g-dpad .right{ grid-column:3; grid-row:2; }

.g-seq{ display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }
.g-seq span{ padding:3px 9px; border-radius:999px; border:1px solid var(--border); font-size:13px; color:var(--muted); }
.g-seq span.done{ border-color:rgba(67,255,177,.5); color:#b9ffe0; }
.g-seq span.next{ border-color:#fff; color:#fff; background:rgba(63,209,255,.25); font-weight:700; }

.g-legend{ display:flex; flex-wrap:wrap; gap:6px 14px; font-size:13px; color:var(--muted); margin-top:8px; }
.g-legend i{ display:inline-block; width:11px; height:11px; border-radius:3px; margin-right:6px; vertical-align:middle; }
.sr-only{ position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
@media (prefers-reduced-motion: reduce){ *{ animation:none !important; transition:none !important; } }

/* option row (mode, speed, sound) */
.g-opts{ display:flex; flex-wrap:wrap; gap:12px; align-items:end; margin-bottom:14px; }
.g-opts .field{ min-width:170px; flex:0 1 260px; }
select:focus-visible, input:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.btn[aria-pressed="true"]{ border-color:rgba(67,255,177,.7); }

/* the on-screen D-pad is for touch screens only */
@media (hover:hover) and (pointer:fine){ .g-dpad{ display:none; } }
