/* Games on the teacher site: lesson game cards, the library, "My games" and the editor. */
.gtabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 0 0 22px; flex-wrap: wrap; }
.gtabs a { padding: 10px 16px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.gtabs a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--cobalt); }
.gfilters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; align-items: center; }
.gfilters button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; }
.gfilters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.gfilters .sep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; }
.glesson { margin: 0 0 30px; }
.glesson-head { display: flex; gap: 14px; align-items: center; margin: 0 0 12px; }
.glesson-head .thumb { width: 64px; height: 44px; border-radius: 8px; background: var(--surface-2) center / cover; flex: none; }
.glesson-head b { display: block; font-family: var(--serif); font-size: 19px; }
.glesson-head small { color: var(--muted); }
.ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.gcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px 18px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); min-height: 190px; }
.gcard .gtop { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.gcard .gtop svg { width: 26px; height: 26px; color: var(--cobalt); flex: none; }
.gcard h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.gcard p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gcard .gact { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }
.gcard .gmeta { font-size: 13px; color: var(--muted); }
.gcard.new { align-items: center; justify-content: center; text-align: center; border-style: dashed; border-width: 2px; cursor: pointer; color: var(--cobalt); font-weight: 600; background: transparent; font-size: 16px; }
.gcard.new svg { width: 34px; height: 34px; }
.gempty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.gmodal { position: fixed; inset: 0; z-index: 90; background: rgba(20, 32, 46, .5); display: grid; place-items: center; padding: 20px; }
.gmodal-in { width: min(1040px, 100%); max-height: 90vh; overflow: auto; background: var(--paper); border-radius: var(--r-lg); padding: 26px; }
.gmodal-in h2 { margin: 0 0 4px; }
.gmodal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.gmods { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.gmods button { text-align: left; display: grid; gap: 6px; padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; align-content: start; }
.gmods button:hover { border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.gmods svg { width: 28px; height: 28px; color: var(--cobalt); }
.gmods b { font-size: 16px; }
.gmods span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.gmods h4 { grid-column: 1 / -1; margin: 12px 0 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-family: var(--sans); }

.ged { margin: 8px 0 60px; }
.ged-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; padding: 12px 0; background: var(--paper); border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.ged-back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--muted); font-weight: 600; margin-right: auto; }
.ged-back svg { width: 18px; height: 18px; }
.ged-status { color: var(--muted); font-size: 14px; }
.ged-status.dirty { color: var(--sand); font-weight: 600; }
.ged-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.ged-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 18px; }
.ged-sec > h2 { font-size: 22px; margin: 0 0 14px; }
.ged-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 16px; }
.ged-field { display: grid; gap: 6px; margin-bottom: 16px; border-radius: 8px; transition: background .3s; }
.ged-field.flash { background: var(--sand-soft); }
.ged-label { font-weight: 600; font-size: 14px; }
.ged-label i { color: var(--madder); font-style: normal; }
.ged-help { color: var(--muted); font-size: 13px; line-height: 1.4; }
.ged-in { width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; font: inherit; resize: vertical; }
.ged-in:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.ged-in.big { font-size: 20px; font-family: var(--serif); font-weight: 600; }
.ged-in.short { max-width: 140px; }
.ged-in.mono { font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.ged-field.bad .ged-in, .ged-field.bad .ged-radios, .ged-field.bad .ged-image { border-color: var(--madder); box-shadow: 0 0 0 3px var(--madder-soft); }
.ged-radios { display: grid; gap: 6px; border: 1px solid transparent; border-radius: var(--r-sm); }
.ged-radios label { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; }
.ged-radios label:has(input:checked) { background: var(--ok-soft); outline: 2px solid var(--ok); }
.ged-radios em { font-style: normal; }
.ged-image { display: flex; gap: 12px; align-items: center; border: 1px solid transparent; border-radius: var(--r-sm); }
.ged-image img, .ged-image .ged-noimg { width: 120px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.ged-image .ged-noimg svg { width: 30px; height: 30px; }
.ged-image > div { display: flex; gap: 8px; flex-wrap: wrap; }
.ged-point { position: relative; display: inline-block; max-width: 560px; cursor: crosshair; border-radius: 8px; overflow: hidden; }
.ged-point img { display: block; width: 100%; user-select: none; }
.ged-point i { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; background: var(--madder); box-shadow: 0 0 0 2px var(--madder), 0 4px 10px rgba(0, 0, 0, .4); pointer-events: none; }
.ged-switch { position: relative; display: inline-block; width: 48px; height: 28px; }
.ged-switch input { opacity: 0; width: 0; height: 0; }
.ged-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: .2s; cursor: pointer; }
.ged-switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.ged-switch input:checked + span { background: var(--ok); }
.ged-switch input:checked + span::before { transform: translateX(20px); }
.ged-prims { display: grid; gap: 6px; }
.ged-prim { display: flex; gap: 8px; align-items: center; }
.ged-prim > b { width: 22px; color: var(--muted); font-size: 13px; }
.ged-ic { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; color: var(--ink-2); flex: none; }
.ged-ic svg { width: 16px; height: 16px; }
.ged-ic:disabled { opacity: .3; cursor: default; }
.ged-ic:hover:not(:disabled) { border-color: var(--ink-2); }
.ged-list { margin: 4px 0 18px; }
.ged-list-head h3 { margin: 0 0 4px; font-size: 18px; }
.ged-list-head small { color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: 14px; }
.ged-item { border: 1px solid var(--line); border-radius: var(--r-md); margin: 8px 0; background: var(--surface); }
.ged-item.bad { border-color: var(--madder); }
.ged-item-head { display: flex; gap: 12px; align-items: center; padding: 10px 12px; cursor: pointer; }
.ged-item-head > b { white-space: nowrap; font-size: 14px; color: var(--muted); }
.ged-item-head > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ged-item-head > span em { color: var(--muted); }
.ged-tools { display: flex; gap: 4px; }
.ged-item.open > .ged-item-head { border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-md) var(--r-md) 0 0; }
.ged-item-body { padding: 14px 14px 2px; }
.ged-item-body .ged-list { padding-left: 10px; border-left: 3px solid var(--line); }
.ged-add { margin-top: 4px; }
.ged-side { position: sticky; top: 80px; display: grid; gap: 12px; }
.ged-card { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.ged-mod svg { width: 34px; height: 34px; color: var(--cobalt); }
.ged-card small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.ged-desc, .ged-src { font-size: 14px; color: var(--ink-2); margin: 0; }
.ged-side h3 { margin: 6px 0 0; font-size: 16px; }
.ged-problems ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--madder); display: grid; gap: 4px; }
.ged-problems a { color: inherit; font-weight: 600; }
.ged-ok { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 600; margin: 0; }
.ged-ok svg { width: 20px; height: 20px; }
.ged-modal { position: fixed; inset: 0; z-index: 95; background: rgba(20, 32, 46, .55); display: grid; place-items: center; padding: 20px; }
.ged-modal-in { width: min(1080px, 100%); max-height: 88vh; overflow: auto; background: var(--paper); border-radius: var(--r-lg); padding: 22px; }
.ged-modal-head { display: flex; justify-content: space-between; align-items: center; }
.ged-modal-head h2 { margin: 0; }
.ged-tabs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.ged-tabs select { max-width: 460px; width: auto; }
.ged-upload { cursor: pointer; }
.ged-msg { color: var(--muted); font-size: 14px; }
.ged-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ged-thumb { border: 2px solid transparent; border-radius: 10px; padding: 0; background: var(--surface); cursor: pointer; overflow: hidden; text-align: left; }
.ged-thumb:hover { border-color: var(--cobalt); }
.ged-thumb img { width: 100%; height: 110px; object-fit: cover; }
.ged-thumb span { display: block; padding: 6px 8px; font-size: 12px; color: var(--ink-2); line-height: 1.3; }
@media (max-width: 900px) { .ged-grid { grid-template-columns: 1fr; } .ged-side { position: static; } }
.ged-group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 14px 2px; margin: 0 0 16px; }
.ged-group legend { font-weight: 700; padding: 0 6px; }
