/* Game of Life Lab */
.gl-setup { display: grid; gap: 10px; }
.gl-rules { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(56, 189, 248, .08); border: 1px solid rgba(56, 189, 248, .35); font-size: 14px; }
.gl-rules > b { font-size: 15px; }
.gl-h { margin: 6px 0 0; font-size: 18px; display: flex; gap: 10px; align-items: baseline; }
.gl-h small { font-size: 14px; opacity: .85; }
.gl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.gl-card { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 10px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: inherit; font: 800 14px system-ui, sans-serif; cursor: pointer; min-height: 60px; }
.gl-card i { grid-row: span 2; font-style: normal; font-size: 24px; text-align: center; }
.gl-card small { font-weight: 600; opacity: .8; font-size: 12px; }
.gl-card:hover { border-color: #facc15; }
.gl-card:focus-visible { outline: 3px solid #ffd54a; outline-offset: 2px; }
.gl-card.is-done { border-color: rgba(74, 222, 128, .55); }
.gl-free { border-color: rgba(56, 189, 248, .5); }
#game-root .sim-controls-help { margin-top: 6px; }
.gl-wrap { display: flex; flex-direction: column; gap: 8px; }
.gl-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.gl-pill { background: var(--color-bg-alt, #1c1f27); border: 1px solid var(--color-border, #2d3240); border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: 14px; white-space: nowrap; }
.gl-goal { white-space: normal; }
.gl-sp { flex: 1; display: flex; justify-content: flex-end; }
.gl-wrap .ak-stage { position: relative; width: 100%; max-width: none; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.gl-wrap .ak-stage canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
.gl-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gl-speed, .gl-sel, .gl-chk { display: inline-flex; gap: 6px; align-items: center; font-weight: 800; font-size: 14px; }
.gl-speed input { width: 130px; accent-color: #22d3ee; }
.gl-sel select { font: inherit; padding: 5px 8px; border-radius: 8px; background: var(--color-bg-alt, #1c1f27); color: inherit; border: 1px solid var(--color-border, #2d3240); }
.gl-pats { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 5px; width: 100%; }
.gl-pats button { display: grid; justify-items: center; gap: 1px; padding: 5px 2px; border-radius: 10px; border: 2px solid var(--color-border, #2d3240); background: var(--color-bg-alt, #1c1f27); color: inherit; font: 800 19px system-ui, sans-serif; cursor: pointer; min-height: 50px; touch-action: manipulation; }
.gl-pats button i { font-style: normal; line-height: 1.1; }
.gl-pats button small { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gl-pats button:hover { border-color: #facc15; }
.gl-pats button.is-on { border-color: #22d3ee; background: rgba(34, 211, 238, .16); }
.gl-pats button:focus-visible { outline: 3px solid #ffd54a; outline-offset: 1px; }
.gl-result { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4, 10, 20, .5); }
.gl-card-r { background: rgba(14, 22, 36, .96); color: #fff; border: 1px solid rgba(255, 255, 255, .18); border-radius: 16px; padding: 18px 22px; text-align: center; max-width: 88%; }
.gl-card-r h3 { margin: 0 0 6px; font-size: 22px; } .gl-card-r p { margin: 4px 0; } .gl-card-r .gl-sub { opacity: .8; font-size: 14px; }
.gl-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 560px) {
  .gl-bar .btn { padding: 6px 9px; font-size: 13px; }
  .gl-pats { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); }
  .gl-pats button small { font-size: 9.5px; }
}
