/* Shared from BaseGameDiscord 0.60.0. Do not edit here: change it in BaseGameDiscord and run tools/sync.mjs. */
/* The status bar: everything that lives above the puzzle, the same size in every game. A game marks its top header with class "statusbar"
   and puts in only what it has.

   PORTRAIT (two rows):
        puzzle number | time / timer (round bars under it) | Surrender  Pause
        difficulty    |                                     |      penalty
   LANDSCAPE (one row):
        puzzle number, difficulty, time / timer, penalty, Surrender, Pause

   The puzzle starts at the same height on every game: just under this bar. */
:root { --bar-h: 66px; --bar-gap: 12px; --board-drop: clamp(0px, calc(100dvh - 740px), 24px); }   /* the boards sit a little lower on a tall phone, so the puzzle, its tiles and the buttons share the height (Tile Tangle is the guide: its tiles sit just above the score and Submit) */
@media (min-aspect-ratio: 5/8) and (min-width: 99999px) { :root { --bar-h: 52px; --board-drop: 0px; } }

#game.screen { gap: var(--bar-gap); }

#game.screen[hidden] { display: none; }   /* a game's own display rules (grid in wide windows) must never un-hide it */
#game > .statusbar.statusbar {
  box-sizing: border-box; flex: none; width: 100%; max-width: none; height: var(--bar-h); min-height: var(--bar-h); margin: 0 auto var(--board-drop); padding: 0 2px;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-rows: 34px 26px; column-gap: 8px; row-gap: 6px; align-items: center; position: relative;
}
/* a window wider than the game column: the bar stays the width of the column, centred, like everything else */
.statusbar > * { margin: 0; min-width: 0; }
.statusbar .theme-line, .statusbar .hud-end { display: contents; }

/* puzzle number (and the game's own tag): top left */
.statusbar .letter-tag, .statusbar #modeText, .statusbar .hud-title, .statusbar #theme-line, .statusbar .logo, .statusbar .small-logo { grid-column: 1; grid-row: 1; justify-self: start; }
/* difficulty (and the round / count pill): under it */
.statusbar .level, .statusbar .level-pill, .statusbar .hard-tag, .statusbar .sb-diff, .statusbar .pill, .statusbar .count-pill { grid-column: 1; grid-row: 2; justify-self: start; }
/* a game with only a difficulty pill: it sits in the middle of the left side */
/* the round pill takes the puzzle-number slot (top left), so the difficulty sits right under it */
.statusbar .round-pill { grid-column: 1; grid-row: 1; justify-self: start; }
.statusbar:not(:has(.letter-tag, .hud-title, #theme-line, .logo, .round-pill)) .level { grid-row: 1 / span 2; }

/* time / timer: always on the exact centre of the bar, whatever is on its left and right */
.statusbar .timer, .statusbar #timer { grid-column: auto; grid-row: auto; position: absolute; left: 50%; top: 0; height: 34px; transform: translateX(-50%); display: flex; align-items: center; font-size: 1.5rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
/* a timer bar sits directly under the number timer (round bars, like tiles or a keypad, belong to the lower area instead) */
.statusbar .progress, .statusbar .meter { grid-column: auto; grid-row: auto; position: absolute; left: 50%; top: 49px; transform: translateX(-50%); width: min(100%, 150px); min-width: 40px; margin: 0; }
.statusbar .meter { height: 8px; }

/* right: Surrender and Pause on top, penalty / hint / count under them */
.statusbar .surrender { grid-column: 3; grid-row: 1; justify-self: end; padding: 2px 4px; font-size: 0.85rem; }
.statusbar #pause-btn, .statusbar .pause-btn, .statusbar #pauseBtn, #game > .statusbar > #pause-btn { grid-column: 4; grid-row: 1; justify-self: end; width: 34px; height: 34px; }
.statusbar .penalty, .statusbar #hintBtn, .statusbar #hud-count { grid-column: 3 / span 2; grid-row: 2; justify-self: end; }
.statusbar .penalty { white-space: nowrap; }

/* pills keep their own colours; only the size is shared */
.statusbar .level, .statusbar .level-pill, .statusbar .letter-tag, .statusbar .pill, .statusbar .hard-tag, .statusbar .count-pill, .statusbar .sb-diff {
  box-sizing: border-box; display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 900; line-height: 1; white-space: nowrap; margin: 0;
}
.statusbar #modeTag { display: contents; }
.statusbar .hud-title, .statusbar #theme-line { font-size: 0.9rem; font-weight: 800; white-space: nowrap; }
.statusbar .theme-line .level { margin: 0; }

@media (min-aspect-ratio: 5/8) and (min-width: 99999px) {
  /* landscape, one row: puzzle number, difficulty, time / timer (its bar directly under it), penalty, Surrender, Pause */
  #game > .statusbar.statusbar { width: calc(100vw - 32px); grid-column: 1 / -1; justify-self: start; align-self: flex-start; margin-left: calc(50% - (100vw - 32px) / 2); grid-template-columns: auto auto minmax(0, 1fr) auto auto auto; grid-template-rows: auto auto; row-gap: 4px; align-content: center; }
  .statusbar .letter-tag, .statusbar .hud-title, .statusbar #theme-line, .statusbar .logo, .statusbar .small-logo { grid-column: 1; grid-row: 1 / span 2; }
  .statusbar .level, .statusbar .level-pill, .statusbar .hard-tag, .statusbar .sb-diff, .statusbar .pill, .statusbar .count-pill { grid-column: 2; grid-row: 1 / span 2; }
  .statusbar .round-pill { grid-column: 1; grid-row: 1 / span 2; }
  .statusbar .timer, .statusbar #timer { top: 4px; height: auto; }
  .statusbar:not(:has(.meter)) :is(.timer, #timer) { top: 50%; transform: translate(-50%, -50%); }
  .statusbar .progress, .statusbar .meter { top: auto; bottom: 6px; }
  .statusbar .penalty, .statusbar #hintBtn, .statusbar #hud-count { grid-column: 4; grid-row: 1 / span 2; justify-self: center; }
  .statusbar .surrender { grid-column: 5; grid-row: 1 / span 2; }
  .statusbar #pause-btn, .statusbar .pause-btn, .statusbar #pauseBtn, #game > .statusbar > #pause-btn { grid-column: 6; grid-row: 1 / span 2; width: 40px; height: 40px; }
}

/* The round bars ("round 3 of 5") are part of the lower area with the tiles / keyboard / number pad, not the status bar */
#game > .progress.round-bars { flex: none; width: 100%; max-width: 440px; margin: 0 auto; align-self: center; }

/* difficulty pills: one colour code in every game (Easy green, Medium blue, Hard red) */
.statusbar :is(.level, .level-pill, .sb-diff).easy, .statusbar .level-pill.lv-easy { background: #2e9b63; color: #fff; }
.statusbar :is(.level, .level-pill, .sb-diff).medium, .statusbar .level-pill.lv-medium { background: #5b86f0; color: #fff; }
.statusbar :is(.level, .level-pill, .sb-diff).hard, .statusbar .level-pill.lv-hard { background: #e2604f; color: #fff; }
.statusbar #diffText { grid-column: 1; grid-row: 2; justify-self: start; }
.statusbar #diffText:empty { display: none; }
@media (min-aspect-ratio: 5/8) and (min-width: 99999px) { .statusbar #diffText { grid-column: 2; grid-row: 1 / span 2; } }
.statusbar:not(:has(.letter-tag, .hud-title, #theme-line, .logo, .round-pill)) #diffText { grid-row: 1 / span 2; }

/* portrait, a game with no puzzle number or round pill (so the difficulty is the only thing on the left): it sits on the top row, level with the timer and Pause */
@media not all and (min-aspect-ratio: 5/8) and (min-width: 99999px) {
  .statusbar:not(:has(.letter-tag, .hud-title, #theme-line, .logo, .round-pill)) :is(.level, .level-pill, .sb-diff, #diffText) { grid-row: 1; }
}
/* the timer changes up to 20 times a second: keep its layout and style work inside itself so the rest of the page is not recalculated each time */
.statusbar .timer, .statusbar #timer, .clock { contain: layout style; }
