/* After a game: "contribute to website" (hyd-after-game.js). One structure, a skin per game, each in that game’s own chrome. */
.ag-pop { box-sizing: border-box; text-align: left; }
.ag-pop:not(.ag-hydrushbad) { position: relative; }
.ag-pop * { box-sizing: border-box; }
.ag-pop h3 { margin: 0; }
.ag-pop .ag-sub { margin: 3px 0 0; }
.ag-list { list-style: none; margin: 0; padding: 0; }
.ag-row {
  display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center;
  width: 100%; min-height: 46px; margin: 0; padding: 6px 8px; border: 0; background: none;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.ag-ico { display: grid; place-items: center; width: 34px; height: 34px; }
.ag-ico svg, .ag-ico img { display: block; width: 34px; height: 34px; }
.ag-words b { display: block; }
.ag-words small { display: block; font-size: .92em; }
.ag-foot { display: flex; justify-content: flex-end; gap: 8px; }
/* Riyal in front of the list, bottom left, as she sits in front of the desktop’s windows: placed and sized by the code. */
.ag-riyal { position: absolute; z-index: 5; pointer-events: none; }

/* pinball and solitaire: their best-scores sheet becomes the list; flat rows like their board tables */
.ag-listing > :not(.ag-pop) { display: none !important; }
.ag-sheet { font: 12px/1.35 'Lucida Grande', Tahoma, sans-serif; color: #222; }
#hyd-pinball .ag-sheet { font-family: 'Hyd Ubuntu', Tahoma, 'Lucida Grande', Arial, sans-serif; }
.ag-sheet h3 { font-size: 12px; font-weight: 700; color: #222; }
.ag-sheet .ag-sub { font-weight: 700; margin: 4px 0 8px; }
#hyd-pinball .ag-sheet .ag-sub { color: #3a2f55; }
#hyd-solitaire .ag-sheet .ag-sub { color: #175136; }
.ag-sheet .ag-list { border: 1px solid #a9aab0; background: #fff; border-radius: 2px; }
.ag-sheet li + li { border-top: 1px solid #e1e1e5; }
.ag-sheet .ag-row, .ag-sheet .ag-row:hover, .ag-sheet .ag-row:active, .ag-sheet .ag-row:focus-visible {
  background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important;
  min-height: 44px !important; height: auto !important; padding: 5px 8px !important; margin: 0 !important; width: 100% !important;
  color: #222 !important; outline: 0;
}
.ag-sheet .ag-row:hover, .ag-sheet .ag-row:focus-visible { background: #3875d7 !important; color: #fff !important; }
.ag-sheet small { color: #5c5e66; }
.ag-sheet .ag-row:hover small, .ag-sheet .ag-row:focus-visible small { color: #e8efff; }
.ag-sheet .ag-foot { margin-top: 10px; }
/* (owner, 27 Nov 2026: "pls make button sizes properly aligned in both mobile and desktop") an end row with "contribute to
   website": the game’s own buttons share the first line in equal widths and "contribute to website" takes the whole line
   under them, so both lines start and end together, on a laptop and a phone alike (the flyovers ticket’s pair already does);
   the list’s own two buttons split their line the same way. A button whose words cannot fit takes a line of its own
   rather than breaking them */
:is(.pinball-sheet-actions, .solitaire-sheet-actions, #hyd-bookcricket .bc-end-actions):has(> .ag-trigger:not([hidden])),
#hyd-rash .rash-finish .rash-scorecard-buttons:has(> [data-rash-finish-action='leave']:not([hidden])),
.ag-pop .ag-foot {
  display: flex; flex-wrap: wrap; justify-content: stretch;
}
:is(.pinball-sheet-actions, .solitaire-sheet-actions, #hyd-bookcricket .bc-end-actions):has(> .ag-trigger:not([hidden])) > button,
#hyd-rash .rash-finish .rash-scorecard-buttons:has(> [data-rash-finish-action='leave']:not([hidden])) > button,
.ag-pop .ag-foot > button {
  flex: 1 1 0; margin: 0; white-space: nowrap; min-width: max-content;
}
/* on a phone the notebook page’s "back to the scorecard" is longer than half the line, so its two buttons stack */
@media (max-width: 599px) {
  #hyd-bookcricket .ag-bookcricket .ag-foot > button { flex-basis: 100%; }
}
/* and on the smallest phones (320 px) solitaire’s "back to the leaderboard" is too */
@media (max-width: 359px) {
  #hyd-solitaire .ag-sheet .ag-foot > button { flex-basis: 100%; }
}
:is(.pinball-sheet-actions, .solitaire-sheet-actions, #hyd-bookcricket .bc-end-actions):has(> .ag-trigger:not([hidden])) > .ag-trigger,
#hyd-rash .rash-finish .rash-scorecard-buttons:has(> [data-rash-finish-action='leave']:not([hidden])) > [data-rash-finish-action='leave'] {
  flex: 1 0 100%; order: 1;
}

/* book cricket: a page torn from the same notebook as the scorecard, over the best-shot photo */
#hyd-bookcricket .ag-bookcricket {
  grid-area: best; align-self: start; z-index: 3; font: 13px/22px var(--bc-xp); color: #2f3440;
  background: #fbfaf5; border-left: 3px solid #e2a6a6; box-shadow: 0 2px 10px #0006, 0 0 0 1px #0002;
  padding: 8px 14px 10px 16px;
}
#hyd-bookcricket .ag-bookcricket h3 { font: 700 15px/22px var(--bc-xp); color: #1d2c6b; }
#hyd-bookcricket .ag-bookcricket .ag-head { border-bottom: 1px solid #b9cde3; padding-bottom: 4px; }
#hyd-bookcricket .ag-bookcricket .ag-sub { color: #5d6170; font-size: 12px; line-height: 18px; margin: 0 0 2px; }
#hyd-bookcricket .ag-bookcricket li { border-bottom: 1px solid #b9cde3; }
#hyd-bookcricket .ag-bookcricket .ag-row { min-height: 42px; padding: 3px 2px; color: inherit; }
#hyd-bookcricket .ag-bookcricket .ag-words b { color: #1d2c6b; font-weight: 400; font-size: 14px; }
#hyd-bookcricket .ag-bookcricket .ag-words small { color: #6b5aa6; font-size: 12px; line-height: 16px; }
#hyd-bookcricket .ag-bookcricket .ag-row:hover b, #hyd-bookcricket .ag-bookcricket .ag-row:focus-visible b {
  text-decoration: underline; text-decoration-color: #b8312f;
}
#hyd-bookcricket .ag-bookcricket .ag-foot { margin-top: 8px; justify-content: flex-start; flex-wrap: wrap; }
@media (max-width: 599px) {
  #hyd-bookcricket .ag-bookcricket { padding: 10px 14px 12px 16px; }
  #hyd-bookcricket .ag-bookcricket .ag-row { min-height: 48px; padding: 5px 2px; }
  }

/* flyovers & u-turns: a second till receipt, same paper, pixel font and torn edge as the end ticket */
#hyd-flyovers .hfu-end.ag-listing > [data-flyovers-slip], #hyd-flyovers .hfu-end.ag-listing > .hfu-pair,
#hyd-flyovers .hfu-end.ag-listing > .hfu-note, #hyd-flyovers .hfu-end.ag-listing > .hfu-picker { display: none !important; }
#hyd-flyovers .hfu-pair .ag-trigger { grid-column: 1 / -1; }
#hyd-flyovers .ag-flyovers .ag-paper {
  width: 300px; max-width: 100%; margin: 6px auto 10px; padding: 14px 14px 20px; background: #fbfaf6; color: #26282d;
  box-shadow: 0 6px 14px #0006; font: 13px/1.38 var(--hfu-px); text-transform: none;
  -webkit-mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100% repeat-x;
  mask: radial-gradient(circle at 6px 100%, transparent 5px, #000 5.5px) 0 0 / 12px 100% repeat-x;
}
#hyd-flyovers .ag-flyovers h3 { text-align: center; color: #c6362f; font: 15px/1.38 var(--hfu-px); }
#hyd-flyovers .ag-flyovers .ag-sub { text-align: center; color: #5d6068; font-size: 12px; margin: 2px 0 8px; padding-bottom: 8px; border-bottom: 1.5px dashed #8a8d94; }
#hyd-flyovers .ag-flyovers li + li { border-top: 1.5px dashed #c9cbd0; }
#hyd-flyovers .ag-flyovers .ag-row, #hyd-flyovers .ag-flyovers .ag-row:hover, #hyd-flyovers .ag-flyovers .ag-row:focus-visible {
  background: none; border: 0; box-shadow: none; border-radius: 0; min-height: 44px; padding: 4px 2px; font: 13px/1.3 var(--hfu-px); color: #26282d;
}
#hyd-flyovers .ag-flyovers .ag-words b { font-weight: 400; }
#hyd-flyovers .ag-flyovers .ag-words small { color: #5d6068; font-size: 12px; }
#hyd-flyovers .ag-flyovers .ag-row:hover .ag-words b::before, #hyd-flyovers .ag-flyovers .ag-row:focus-visible .ag-words b::before { content: '› '; color: #c6362f; }

/* hydrushbad: an XP message box like its own finish box, with an XP list view inside */
@media (min-width: 601px) {
  #hyd-rash .rash-finish:has([data-rash-finish-action='leave']) { min-width: 400px; }
  #hyd-rash .ag-hydrushbad { min-width: 380px; }
}
#hyd-rash .rash-finish.ag-away { display: none !important; }
#hyd-rash .ag-hydrushbad .rash-scorecard-body { font: 11px/1.3 Tahoma, Verdana, sans-serif; color: #000; }
#hyd-rash .ag-hydrushbad .ag-sub { margin: 0 0 8px; }
#hyd-rash .ag-hydrushbad .ag-list { background: #fff; border: 1px solid #7f9db9; }
#hyd-rash .ag-hydrushbad .ag-row, #hyd-rash .ag-hydrushbad .ag-row:hover, #hyd-rash .ag-hydrushbad .ag-row:focus-visible {
  background: none; border: 0; box-shadow: none; border-radius: 0; min-height: 40px; height: auto; padding: 3px 6px;
  font: 11px/1.3 Tahoma, Verdana, sans-serif; color: #000; width: 100%; margin: 0; outline: 0;
}
#hyd-rash .ag-hydrushbad .ag-row:hover, #hyd-rash .ag-hydrushbad .ag-row:focus-visible { background: #316ac5; color: #fff; }
#hyd-rash .ag-hydrushbad small { color: #555; }
#hyd-rash .ag-hydrushbad .ag-row:hover small, #hyd-rash .ag-hydrushbad .ag-row:focus-visible small { color: #dfe8f7; }
#hyd-rash .ag-hydrushbad .ag-ico, #hyd-rash .ag-hydrushbad .ag-ico svg, #hyd-rash .ag-hydrushbad .ag-ico img { width: 32px; height: 32px; }
/* (owner, 27 Nov 2026, on a phone: "back to race and leave button seem too big") on a touch screen the finish row that has
   "contribute to website" and the list's own row are smaller than the game's 44 px answers: 30 px with 11 px words */
@media (pointer: coarse) {
  #hyd-rash .rash-finish:has([data-rash-finish-action='leave']:not([hidden])) .rash-scorecard-buttons button,
  #hyd-rash .ag-hydrushbad.rash-scorecard .rash-scorecard-buttons button {
    height: 30px; min-height: 30px; min-width: 0; padding: 0 10px; font-size: 11px;
  }
  #hyd-rash .ag-hydrushbad.rash-scorecard .rash-scorecard-buttons { padding-top: 12px; }
}
