/* GMBRICKS ON A SHEET (kit-gmsheet.js; his mock drafts/add-to-sheet-2): its lines on the ruled box, the card under a line,
   its rows and the list under a value. On the sheet's paper, in its hand. */

/* ITS LINES: one ruled line each, as written on paper, before the player's own words */
.g-csheet .cs-box:has(.g-gmb) { gap: 0; }
.g-csheet .cs-box .g-gmb { order: -1; flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.g-csheet .cs-box__t { order: -2; }
.g-gmb > li { margin: 0; padding: 0; }
.g-csheet .g-gmb li .g-gmb__line, .g-csheet .g-gmb li .g-gmb__in { display: flex; min-height: 0; border-radius: 0; box-shadow: none; line-height: 26px; align-items: center; gap: var(--g-1); width: 100%; height: 26.5px; padding: 0; border-bottom: 1.5px solid var(--g-sheet-edge); box-sizing: border-box;
  background: none; color: var(--g-ink); font: 400 16px/26px "Patrick Hand", cursive; text-align: start; cursor: pointer; white-space: nowrap; overflow: hidden; outline: none; }
.g-gmb__line:hover, .g-gmb__line.is-open { color: var(--g-sheet-gold); }
.g-gmb__line.is-open { background: var(--g-sheet); }
.g-gmb__line:focus-visible { box-shadow: inset 0 -2px 0 var(--g-sheet-gold); }
.g-gmb__t { overflow: hidden; text-overflow: ellipsis; }
.g-gmb__in { cursor: text; }
.g-gmb__in:empty::before { content: attr(aria-label); color: var(--g-ink-3); opacity: .5; }
.g-gmb__in:not(:focus):empty::before { content: ""; }

/* HOW A LINE LOOKS: one state (data-gmb-look), changed in one place. pin: the growl icon before it */
[data-gmb-look="pin"] .g-gmb__t::before { content: ""; display: inline-block; width: 17px; height: 17px; margin-inline-end: 5px; vertical-align: -3px;
  background: var(--g-sheet-gold); -webkit-mask: var(--gmb-pin) center / contain no-repeat; mask: var(--gmb-pin) center / contain no-repeat; }
[data-gmb-look="underline"] .g-gmb__t { text-decoration: underline dotted var(--g-sheet-gold); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

/* THE CARD: under its line, over the page (the page lets it out while it is open) */
.g-csheet__page { position: relative; }
.g-csheet__page.has-gmbc { overflow: visible; z-index: 3; }
.g-gmbc { position: absolute; inset-inline: 16px; z-index: 5; display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; border: 1px solid var(--g-sheet-edge); border-radius: 12px;
  background: var(--g-sheet-2); color: var(--g-ink); box-shadow: 0 10px 30px rgb(60 30 10 / .25); font: 400 18px/1.35 "Patrick Hand", cursive; text-align: start; }
.g-gmbc__corner { position: absolute; top: 6px; inset-inline-end: 6px; display: flex; }
.g-gmbc__corner .g-iconbtn { color: var(--g-ink-3); }
.g-gmbc__top { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: start; }
.g-gmbc__pic { aspect-ratio: 3 / 4; border: 1.5px solid var(--g-sheet-edge); background: var(--g-sheet) center / 52% auto no-repeat; position: relative; }
.g-gmbc__pic::after { content: ""; position: absolute; inset: 0; background: var(--g-sheet-gold); -webkit-mask: var(--gmb-pin) center / 52% auto no-repeat; mask: var(--gmb-pin) center / 52% auto no-repeat; }
.g-gmbc__words { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding-top: 40px; }
.g-gmbc:not(.is-edit) .g-gmbc__words { padding-top: 24px; }
.g-gmbc h3.g-gmbc__name { margin: 0; font: inherit; font-size: 26px; line-height: 1.2; }
.g-gmbc p.g-gmbc__desc, .g-gmbc__sum { margin: 0; }
.g-gmbc__lab { display: flex; align-items: center; gap: 6px; font: 600 11px system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--g-ink-3); }
.g-gmbc .g-gmbc__lab .g-iconbtn { width: 22px; height: 22px; min-width: 0; min-height: 0; padding: 0; color: var(--g-ink-3); }
.g-gmbc .g-gmbc__lab .g-iconbtn svg { width: 12px; height: 12px; }
.g-gmbc__name[contenteditable], .g-gmbc__desc[contenteditable], .g-gmbc__in { display: block; min-height: 30px; padding: 2px 0; border-bottom: 1.5px solid var(--g-sheet-edge); outline: none; font: 400 18px/26px "Patrick Hand", cursive; color: var(--g-ink); white-space: pre-wrap; }
.g-gmbc__desc[contenteditable] { min-height: 56px; background: linear-gradient(transparent 28px, var(--g-sheet-edge) 28px 29.5px, transparent 29.5px); }
.g-gmbc [contenteditable]:focus { border-bottom-color: var(--g-ink); }

/* its values written on as the card's own lines, never the sheet's boxes */
.g-csheet .g-gmbc [contenteditable] { width: auto; text-align: start; font-size: 18px; line-height: 26px; background: none; box-shadow: none; border-radius: 0; }
.g-csheet .g-gmbc .g-gmbc__in--set { font-size: 17px; }

/* ITS ROWS: a brick each, its settings under it */
.g-gmbc__rows { display: flex; flex-direction: column; gap: 14px; }
.g-gmbc__row { display: flex; flex-direction: column; gap: 2px; }
.g-gmbc__dd { display: flex; align-items: center; gap: 6px; }
.g-gmbc__dd .g-gmbc__in { flex: 1; min-width: 0; }
.g-gmbc .g-gmbc__dd .g-iconbtn { position: relative; width: 18px; height: 18px; min-width: 0; min-height: 0; padding: 0; border: 1px solid var(--g-sheet-edge); border-radius: 3px; background: var(--g-sheet); color: var(--g-ink-3); }
.g-gmbc__dd .g-iconbtn::after { content: ""; position: absolute; inset: -11px; }   /* its tap the size of a finger */
.g-gmbc .g-gmbc__dd .g-iconbtn svg { width: 12px; height: 12px; }
.g-gmbc__setrow { display: grid; grid-template-columns: minmax(90px, auto) 1fr; align-items: baseline; gap: 10px; padding-inline-start: 18px; }
.g-gmbc__setlab { font: 600 11px system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--g-ink-3); }
.g-gmbc__in--set { min-height: 26px; font-size: 17px; }
.g-gmbc .g-btn--link { min-height: 0; padding: 0; font-size: 16px; align-self: flex-start; font-family: "Patrick Hand", cursive; color: var(--g-sheet-gold); }
.g-gmbc__acts { position: sticky; bottom: 0; display: flex; gap: 10px; margin: 0 -18px -16px; padding: 12px 18px; border-top: 1px solid var(--g-sheet-edge); border-radius: 0 0 12px 12px; background: var(--g-sheet-2); }

/* THE LIST UNDER A VALUE: its words, what it does under them, the letters typed underlined */
.g-gmbpop { max-height: 260px; overflow-y: auto; margin-top: 4px; padding: 4px; border: 1px solid var(--g-sheet-edge); border-radius: 8px; background: var(--g-sheet); box-shadow: 0 8px 24px rgb(60 30 10 / .2); }
.g-gmbpop[hidden] { display: none; }
.g-gmbpop__o { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.g-gmbpop__o:hover, .g-gmbpop__o.is-on { background: var(--g-sheet-2); }
.g-gmbpop__t { font: 400 18px/1.25 "Patrick Hand", cursive; color: var(--g-ink); }
.g-gmbpop__t u { text-decoration-color: var(--g-sheet-gold); text-decoration-thickness: 1.5px; }
.g-gmbpop__s { font: 400 12px/1.3 system-ui, sans-serif; color: var(--g-ink-3); }
@media (max-width: 599px) { .g-gmbc { inset-inline: 8px; } .g-gmbc__top { grid-template-columns: 80px 1fr; } }
.g-gmbc__row > .g-btn--link { margin-inline-start: 18px; font-size: 14px; color: var(--g-ink-3); }   /* + Setting: quiet, under its settings */
.g-csheet.is-unsaved [data-gmb-box]::after { content: attr(data-unsaved); display: block; padding-top: 4px; font: 600 12px system-ui, sans-serif; color: var(--g-danger, #b3261e); }   /* a save that failed, said where it happened */
/* A VALUE TO CHOOSE: it reads as a list (its chevron, its own field), never as free words */
.g-gmbc .g-gmbc__in--pick { padding-inline: 8px; border: 1px solid var(--g-sheet-edge); border-radius: 6px; background: var(--g-sheet); cursor: pointer; }
.g-gmbc .g-gmbc__dd .g-gmbc__in--pick { border-inline-end: 0; border-radius: 6px 0 0 6px; }
.g-gmbc .g-gmbc__dd .g-iconbtn { width: 34px; height: 32px; border-radius: 0 6px 6px 0; }
.g-gmbc .g-gmbc__dd { gap: 0; }
.g-gmbc .g-gmbc__in:empty::before { content: attr(data-hint); color: var(--g-ink-3); opacity: .6; }
.g-gmbc .g-btn--link { background: none; box-shadow: none; border: 0; }
.g-gmbc__live { padding: 10px 12px; border-radius: 8px; background: var(--g-sheet); font-size: 17px; }
/* its maker writing on a value (kit-sheetown.js) */
.g-csheet[data-gmb-own] [data-f]:not([data-f$="1"]) { cursor: text; }
.g-gmbpop.is-over { position: absolute; z-index: 7; width: 260px; margin: 0; }   /* on the sheet itself, under its value */
/* an item reached from its attack: its line marked a moment */
.g-gmb__line.is-found { animation: g-gmb-found 1.6s var(--g-ease, ease) both; }
@keyframes g-gmb-found { 0%, 60% { background: var(--g-sheet); box-shadow: inset 0 0 0 1.5px var(--g-sheet-gold); } 100% { background: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .g-gmb__line.is-found { animation-duration: 1ms; } }
