/* End Game: Rated. Builds on daily-mate.css (same board, pieces and Caveman Circus look). */
.egr-wrap { container-type: inline-size; }
.egr-root .egr-loading { margin: 16px 0 0; color: var(--dm-muted); }

.egr-tag {
  position: relative; z-index: 1; flex: none;
  height: 22px; padding: 0 7px; display: inline-flex; align-items: center;
  border: 1px solid #1A1814; background: #F5E04A; color: #1A1814;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.egr-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.egr-title-row .dm-title { margin: 0; }
@container (max-width: 559px) { .egr-title-row { flex-direction: column; align-items: flex-start; gap: 6px; } }
.egr-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--dm-muted); }
.egr-muted { color: var(--dm-muted); font-size: 13px; }
.egr-small { font-size: 12px; margin: 0; }
.egr-num { font-variant-numeric: tabular-nums; }
.egr-big { font-weight: 800; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Phones first: one column, board edge to edge ---------- */
.egr-play { display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.egr-panel { display: contents; }
.egr-rating { order: 1; }
.egr-root .dm-prompt { order: 2; }
.egr-root .dm-board-wrap { order: 3; }
.egr-root .dm-msg { order: 4; }
.egr-session { order: 5; }
.egr-controls { order: 6; }
.egr-foot { order: 7; }

.egr-root .dm-board-wrap { margin: 0 -16px; width: calc(100% + 32px); }
.egr-root .dm-board { border-left: 0; border-right: 0; box-shadow: none; }

.egr-rating {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: #FFFFFF; border: 1px solid #1A1814;
}
.egr-rating-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.egr-rating-nums { display: flex; align-items: baseline; gap: 8px; }
.egr-rating-old { font-size: 15px; font-weight: 600; color: var(--dm-muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.egr-rating-old:empty { display: none; }
.egr-rating-num { font-weight: 800; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.egr-rating-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.egr-stakes { font-size: 12px; font-weight: 600; color: var(--dm-muted); }
.egr-stakes strong { color: #1A1814; }
.egr-delta {
  height: 38px; padding: 0 12px; display: flex; align-items: center;
  border: 1px solid #1A1814; box-shadow: 3px 3px 0 #1A1814;
  font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums;
}
.egr-delta-up { background: #F5E04A; color: #1A1814; }
.egr-delta-down { background: #FFFFFF; color: #A8432E; }

.egr-chip {
  height: 28px; padding: 0 10px; display: flex; align-items: center; white-space: nowrap;
  border: 1px dashed #1A1814; font-size: 13px; font-weight: 700; color: var(--dm-muted);
}
.egr-chip-on { border-style: solid; background: #F5E04A; color: #1A1814; }

.egr-session { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.egr-session-l { display: flex; flex-direction: column; gap: 5px; }
.egr-session-r { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.egr-strip { display: flex; gap: 4px; flex-wrap: wrap; }
.egr-pip {
  width: 18px; height: 18px; flex: none; border: 1px solid #1A1814; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; line-height: 1;
}
.egr-pip-win { background: #F5E04A; }
.egr-pip-miss { background: #FFFFFF; color: #A8432E; }
.egr-pip-next { border-style: dashed; background: transparent; }

.egr-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.egr-controls .dm-btn { height: 48px; font-size: 15px; font-weight: 700; }
.egr-controls-done { grid-template-columns: minmax(0, 1fr); }
.egr-controls .egr-next { height: 52px; font-size: 16px; font-weight: 800; }
.egr-root .egr-confirm { background: #FDF0E4; }
.egr-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.egr-root .dm-msg-main { font-weight: 700; }

.egr-promo { display: flex; align-items: center; gap: 8px; }
.egr-promo-btn {
  width: 48px; height: 48px; padding: 4px; border: 1px solid #1A1814; background: #F3E3C3;
  box-shadow: 2px 2px 0 #1A1814; cursor: pointer;
}
.egr-promo-btn .dm-piece { width: 100%; height: 100%; }
.egr-promo-btn:focus-visible { outline: 3px solid var(--dm-accent); outline-offset: 2px; }

/* ---------- Solved / Missed ---------- */
.egr-root .egr-result {
  display: flex; align-items: center; gap: 12px; min-height: 0; padding: 12px 14px;
  border: 2px solid #1A1814; box-shadow: 4px 4px 0 #1A1814; animation: egr-in .35s cubic-bezier(.2,1.4,.4,1);
}
.egr-root .egr-result-win { background: #F5E04A; }
.egr-root .egr-result-miss { background: #FFFFFF; }
.egr-result-icon {
  flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 2px solid #1A1814; background: #1A1814; color: #F5E04A;
}
.egr-result-miss .egr-result-icon { background: #A8432E; color: #FFFFFF; }
.egr-result-icon svg { stroke-width: 3.2; }
.egr-result-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.egr-result-title { font-weight: 900; font-size: 26px; line-height: 1; text-transform: uppercase; letter-spacing: .01em; }
.egr-result-miss .egr-result-title { color: #A8432E; }
.egr-result-sub { font-size: 13px; line-height: 1.35; color: #1A1814; }
.egr-result-miss .egr-result-sub { color: var(--dm-muted); }
.egr-result-r { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.egr-result-delta { font-weight: 900; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.egr-result-miss .egr-result-delta { color: #A8432E; }
.egr-result-from { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
@keyframes egr-in { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* Check badge on the winning square, and a quick flash around the board. */
.egr-root .dm-sq { position: relative; }
.egr-badge {
  position: absolute; top: 3%; right: 3%; z-index: 3; width: 44%; max-width: 32px; aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: #F5E04A; color: #1A1814; border: 2px solid #1A1814; box-sizing: border-box;
  animation: egr-badge .4s cubic-bezier(.2,1.6,.4,1);
}
.egr-badge svg { width: 70%; height: 70%; stroke-width: 3.6; }
@keyframes egr-badge { from { transform: scale(0); } to { transform: scale(1); } }
.egr-root .dm-board.egr-solved { animation: egr-glow 1.1s ease-out; }
@keyframes egr-glow { 0% { outline: 0 solid #F5E04A; } 30% { outline: 8px solid #F5E04A; } 100% { outline: 0 solid rgba(245,224,74,0); } }

/* ---------- Rating page ---------- */
.egr-stats { display: flex; flex-direction: column; gap: 12px; margin-top: 2px; }
.egr-stats-top { display: flex; align-items: center; gap: 10px; }
.egr-back {
  width: 40px; height: 40px; padding: 0; border: 1px solid #1A1814; background: #FFFFFF; color: #1A1814;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.egr-back:focus-visible { outline: 3px solid var(--dm-accent); outline-offset: 2px; }
.egr-stats-title { font-weight: 800; font-size: 18px; }
.egr-stats-body { display: flex; flex-direction: column; gap: 12px; }
.egr-card { background: #FFFFFF; border: 1px solid #1A1814; }
.egr-chart-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.egr-chart-l { display: flex; flex-direction: column; gap: 4px; }
.egr-rating-xl { font-size: 44px; }
.egr-chart { display: block; width: 100%; height: auto; }
.egr-grid { stroke: #E3D6BC; stroke-width: 1; }
.egr-axis { font-size: 10px; font-weight: 600; fill: #5C554B; font-family: inherit; }
.egr-area { fill: #F5E04A; fill-opacity: .35; }
.egr-line { fill: none; stroke: #8B5A2B; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.egr-peak { fill: #FFFFFF; stroke: #1A1814; stroke-width: 1.5; }
.egr-end { fill: #F5E04A; stroke: #1A1814; stroke-width: 1.5; }
.egr-list-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 9px 12px; border-bottom: 1px solid #1A1814; background: #FBF6EA; font-weight: 800; font-size: 14px;
}
.egr-bars { display: flex; flex-direction: column; gap: 9px; padding: 12px; }
.egr-bar-row { display: grid; grid-template-columns: minmax(0, 8em) minmax(0, 1fr) 3em; align-items: center; gap: 10px; }
.egr-bar-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.egr-bar-track { display: block; height: 12px; border: 1px solid #1A1814; background: #F3EBD8; }
.egr-bar-fill { display: block; height: 100%; background: #8B5A2B; }
.egr-bar-low { background: #E57361; }
.egr-bar-pct { font-size: 13px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.egr-weak { margin: 0; padding: 0 12px 12px; font-size: 13px; color: var(--dm-muted); }
.egr-recent-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #E3D6BC; }
.egr-recent-row:last-child { border-bottom: 0; }
.egr-recent-theme { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; }
.egr-recent-delta { width: 3em; text-align: right; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.egr-down { color: #A8432E; }
.egr-note {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: #E6ECF7; border: 1px solid #1A1814; color: #22324F; font-size: 13px;
}
.egr-note svg { flex: none; }
.egr-note a { color: #22324F; font-weight: 700; }

/* ---------- Sign-in card ---------- */
.egr-gate { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.egr-gate-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px;
  background: #FFFFFF; border: 2px solid #1A1814; box-shadow: 4px 4px 0 #1A1814;
}
.egr-gate-lock {
  width: 52px; height: 52px; border: 2px solid #1A1814; background: #F5E04A; box-shadow: 3px 3px 0 #1A1814;
  display: flex; align-items: center; justify-content: center; color: #1A1814;
}
.egr-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--dm-muted); }
.egr-gate-title { font-weight: 900; font-size: 26px; line-height: 1.05; text-transform: uppercase; text-wrap: balance; }
.egr-gate-title .cgh-b-like { color: #9D5314; }
.egr-gate-lede { margin: 0; font-size: 15px; line-height: 1.45; }
.egr-perks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.egr-perks li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.35; margin: 0; }
.egr-check {
  flex: none; width: 18px; height: 18px; margin-top: 1px; border: 1px solid #1A1814; background: #F5E04A;
  display: flex; align-items: center; justify-content: center; color: #1A1814;
}
.egr-root a.egr-signin { text-decoration: none; height: 50px; font-size: 16px; font-weight: 800; }
.egr-gate-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Wide screens: board on the left, everything else beside it (desktop layout 1) ---------- */
@container (min-width: 760px) {
  .egr-wrap .egr-root { display: block; max-width: none; padding: 0 24px 24px; }
  /* 1.15.9: a bigger board. The board column takes everything the 340px panel doesn't, up to the
     screen's height (so the whole board stays in view), and the pair is centred. */
  .egr-wrap .egr-play {
    display: grid; grid-template-columns: minmax(0, max(520px, calc(100vh - 150px))) minmax(300px, 340px);
    column-gap: 26px; align-items: start; justify-content: center; margin-top: 24px;
  }
  .egr-wrap .egr-panel { display: flex; flex-direction: column; gap: 12px; }
  .egr-wrap .egr-root .dm-board-wrap { grid-area: auto; order: 0; margin: 0; width: 100%; }
  .egr-wrap .egr-panel { order: 1; }
  .egr-wrap .egr-root .dm-board { border: 2px solid #1A1814; box-shadow: none; }
  .egr-wrap .egr-root .dm-prompt { margin-top: 0; }
  .egr-wrap .egr-root .dm-msg { min-height: 72px; }
  .egr-wrap .egr-rating { padding: 14px 16px; }
  .egr-wrap .egr-rating-num { font-size: 40px; }
  .egr-wrap .egr-session { background: #FFFFFF; border: 1px solid #1A1814; padding: 12px 14px; }
  .egr-wrap .egr-gate { max-width: 560px; margin: 24px auto 0; }
  .egr-wrap .egr-stats { margin-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .egr-root .dm-pop, .egr-root .dm-shake, .egr-root .egr-result, .egr-badge, .egr-root .dm-board.egr-solved { animation: none; }
}

/* ================= 1.15.0: tabs, titles, goals, Rush, leagues, boards ================= */

/* Tabs */
.egr-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 12px 0 2px; border: 1px solid #1A1814; background: #FFFFFF; }
.egr-tab {
  height: 40px; padding: 0 4px; border: 0; border-right: 1px solid #1A1814; background: transparent; color: #1A1814;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.egr-tab:last-child { border-right: 0; }
.egr-tab:hover { background: #FBF6EA; }
.egr-tab-on, .egr-tab-on:hover { background: #1A1814; color: #F5E04A; }
.egr-tab:focus-visible { outline: 3px solid var(--dm-accent); outline-offset: -3px; }
.egr-nav-locked { opacity: .45; pointer-events: none; }
.egr-view { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.egr-view[hidden], .egr-stats[hidden], .egr-gate[hidden] { display: none; }
.egr-pad { padding: 12px; margin: 0; }

/* Title bar inside the rating card */
.egr-rating { flex-wrap: wrap; }
.egr-titlebar { flex: 1 0 100%; }
.egr-titlebar:empty { display: none; }
.egr-tb { display: flex; flex-direction: column; gap: 5px; }
.egr-tb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.egr-tb-name { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.egr-tb-name svg { color: #9D5314; fill: #F5E04A; }
.egr-tb-next { font-size: 12px; font-weight: 700; color: var(--dm-muted); font-variant-numeric: tabular-nums; }
.egr-tb-track { height: 10px; border: 1px solid #1A1814; background: #F3EBD8; }
.egr-tb-fill { height: 100%; background: #F5E04A; border-right: 1px solid #1A1814; transition: width .6s cubic-bezier(.2,1,.3,1); }
.egr-tb-peak { font-size: 11px; font-weight: 700; color: var(--dm-muted); letter-spacing: .04em; text-transform: uppercase; }
.egr-tb-big .egr-tb-name { font-size: 16px; }
.egr-tb-big .egr-tb-track { height: 12px; }

/* Rival and training strips */
.egr-rival, .egr-train {
  order: 1; display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid #1A1814; background: #FBF6EA; font-size: 13px;
}
.egr-train { order: 2; background: #E6ECF7; }
.egr-rival[hidden], .egr-train[hidden], .egr-rushbar[hidden] { display: none; }
.egr-rival-ic { flex: none; display: flex; color: #9D5314; }
.egr-train .egr-rival-ic { color: #22324F; }
.egr-rival-t { flex: 1; min-width: 0; }
.egr-rival-link { flex: none; font-size: 13px; }

/* Daily goal and day streak in the session box */
.egr-session { flex-direction: column; align-items: stretch; gap: 10px; }
.egr-session-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.egr-goal { display: flex; align-items: center; gap: 10px; }
.egr-goal-l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.egr-segs { display: flex; gap: 3px; }
.egr-seg { flex: 1; height: 10px; border: 1px solid #1A1814; background: #FFFFFF; }
.egr-seg-on { background: #F5E04A; }
.egr-goal-done .egr-seg-on { background: #1E6B3A; }
.egr-goal-n { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.egr-flame {
  flex: none; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 9px;
  border: 1px solid #1A1814; background: #FFFFFF; color: var(--dm-muted); font-size: 12px; font-weight: 700;
}
.egr-flame svg { stroke: none; fill: currentColor; }
.egr-flame-on { color: #1A1814; background: #FDF0E4; }
.egr-flame-on svg { fill: #D9480F; }
.egr-flame-n { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* Result card extras */
.egr-root .egr-result { flex-wrap: wrap; }
.egr-result-xp { font-size: 11px; font-weight: 800; padding: 1px 5px; background: #1A1814; color: #F5E04A; letter-spacing: .04em; }
.egr-crowd { flex: 1 0 100%; padding-top: 8px; margin-top: 2px; border-top: 1px dashed rgba(26,24,20,.35); font-size: 13px; line-height: 1.35; }
.egr-peak-chip { display: inline-block; margin-left: 8px; padding: 1px 6px; border: 1px solid #1A1814; background: #FFFFFF; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }

/* Toasts */
.egr-toasts {
  position: fixed; left: 50%; bottom: 16px; z-index: 99999; transform: translateX(-50%);
  width: min(380px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.egr-toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  background: #FFFFFF; color: #1A1814; border: 2px solid #1A1814; box-shadow: 4px 4px 0 #1A1814;
  font-family: Rubik, Arial, sans-serif; animation: egr-toast-in .35s cubic-bezier(.2,1.4,.4,1);
}
.egr-toast-ach, .egr-toast-title { background: #F5E04A; }
.egr-toast-goal { background: #FDF0E4; }
.egr-toast-ic { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; background: #1A1814; color: #F5E04A; }
.egr-toast-goal .egr-toast-ic svg { stroke: none; fill: #F28C38; }
.egr-toast-mid { min-width: 0; }
.egr-toast-t { font-weight: 800; font-size: 15px; line-height: 1.2; }
.egr-toast-s { font-size: 13px; line-height: 1.3; margin-top: 2px; }
.egr-toast-out { opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; }
@keyframes egr-toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }

/* Me page */
.egr-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.egr-today { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.egr-today-l { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.egr-today-line { font-size: 15px; }
.egr-share-btn { flex: none; height: 42px; padding: 0 14px; }
.egr-bar-train { grid-template-columns: minmax(0, 8em) minmax(0, 1fr) 3em auto; }
.egr-train-btn {
  height: 26px; padding: 0 8px; border: 1px solid #1A1814; background: #FFFFFF; color: #1A1814;
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
.egr-train-btn:hover { background: #F5E04A; }
.egr-weakbox { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 12px 0; padding: 10px 12px; border: 1px solid #1A1814; background: #FDF0E4; }
.egr-weak-t { font-size: 14px; line-height: 1.35; }
.egr-root .egr-weakbox .egr-fix { flex: none; width: auto; height: 38px; padding: 0 14px; }
.egr-weak-t { flex: 1; min-width: 0; }
.egr-pick { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.egr-pick-row { display: flex; gap: 8px; }
.egr-select { flex: 1; min-width: 0; height: 42px; padding: 0 10px; border: 1px solid #1A1814; background: #FFFFFF; font: inherit; font-size: 14px; color: #1A1814; border-radius: 0; }
.egr-pick-row .dm-btn { flex: none; height: 42px; padding: 0 14px; }
.egr-achs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.egr-ach { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px dashed #B8AD98; color: var(--dm-muted); }
.egr-ach-on { border: 1px solid #1A1814; background: #FBF6EA; color: #1A1814; }
.egr-ach-ic { flex: none; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: #EDE5D3; }
.egr-ach-on .egr-ach-ic { background: #F5E04A; border: 1px solid #1A1814; }
.egr-ach-tx { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.egr-ach-n { font-size: 13px; font-weight: 800; line-height: 1.2; }
.egr-ach-d { font-size: 12px; line-height: 1.3; }

/* Rows: board, league, Rush */
.egr-rows { display: flex; flex-direction: column; }
.egr-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid #E3D6BC; min-height: 44px; }
.egr-row:last-child { border-bottom: 0; }
.egr-row-me { background: #FFF6BF; box-shadow: inset 4px 0 0 #1A1814; }
.egr-row-up { box-shadow: inset 4px 0 0 #1E6B3A; }
.egr-row-down { box-shadow: inset 4px 0 0 #A8432E; }
.egr-row-me.egr-row-up { box-shadow: inset 4px 0 0 #1E6B3A; }
.egr-row-me.egr-row-down { box-shadow: inset 4px 0 0 #A8432E; }
.egr-row-rank { flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.egr-row-top { background: #F5E04A; border: 1px solid #1A1814; }
.egr-row-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.egr-row-who .egr-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; }
.egr-row-title { font-size: 11px; font-weight: 700; color: var(--dm-muted); text-transform: uppercase; letter-spacing: .05em; }
.egr-row-v { flex: none; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.egr-seg-tabs { display: flex; border: 1px solid #1A1814; background: #FFFFFF; }
.egr-seg-tab { flex: 1; height: 36px; border: 0; border-right: 1px solid #1A1814; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: #1A1814; cursor: pointer; }
.egr-seg-tab:last-child { border-right: 0; }
.egr-seg-on { background: #F5E04A; }
.egr-board-foot:empty { display: none; }
.egr-board-foot p { margin: 0; }

/* League */
.egr-league-head { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.egr-ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
.egr-rung { height: 26px; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; border: 1px solid #1A1814; background: #F3EBD8; color: var(--dm-muted); overflow: hidden; }
.egr-rung-past { background: #E3D6BC; color: #1A1814; }
.egr-rung-on { background: #1A1814; color: #F5E04A; }
.egr-league-t { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.egr-league-t .egr-gate-title { font-size: 24px; }
.egr-league-head p { margin: 0; }
.egr-league-last { padding: 10px 12px; border: 2px solid #1A1814; background: #FFFFFF; font-size: 14px; }
.egr-last-up { background: #F5E04A; }
.egr-last-down { background: #FDF0E4; }
.egr-league-join { margin: 0 0 10px; font-size: 15px; }
.egr-zones { display: flex; gap: 14px; font-size: 12px; color: var(--dm-muted); }
.egr-zone::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }
.egr-zone-up::before { background: #1E6B3A; }
.egr-zone-down::before { background: #A8432E; }

/* Puzzle Rush */
.egr-rush-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px 16px;
  background: #FFFFFF; border: 2px solid #1A1814; box-shadow: 4px 4px 0 #1A1814;
}
.egr-rush-badge { width: 52px; height: 52px; border: 2px solid #1A1814; background: #F5E04A; box-shadow: 3px 3px 0 #1A1814; display: flex; align-items: center; justify-content: center; }
.egr-rush-badge svg { fill: #1A1814; }
.egr-rush-over { align-items: center; text-align: center; }
.egr-rush-score { font-weight: 900; font-size: 96px; line-height: .9; font-variant-numeric: tabular-nums; }
.egr-rush-sub { margin: 0; font-size: 15px; }
.egr-rush-best { margin: 0; font-weight: 700; }
.egr-rush-btns { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; width: 100%; }
.egr-rush-btns .dm-btn, .egr-rush-card > .egr-rush-go { height: 50px; font-size: 16px; font-weight: 800; }
.egr-rushbar {
  order: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; background: #1A1814; color: #F5E04A; border: 1px solid #1A1814;
}
.egr-rush-time { font-weight: 900; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; min-width: 3.2ch; }
.egr-rush-low { color: #FF7A5C; animation: egr-pulse 1s steps(2) infinite; }
@keyframes egr-pulse { 50% { opacity: .55; } }
.egr-rush-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.egr-rush-mid .egr-label { color: #CFC8BC; }
.egr-rush-n { font-weight: 900; font-size: 30px; line-height: 1; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.egr-strikes { display: flex; gap: 4px; }
.egr-strike { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 1px solid #5C554B; color: #5C554B; }
.egr-strike-on { background: #A8432E; border-color: #FFFFFF; color: #FFFFFF; }

/* [end_game_rated_board] on any page */
.egr-board-root { display: flex; flex-direction: column; gap: 10px; font-family: Rubik, Arial, sans-serif; color: #1A1814; }
.egr-bw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.egr-bw-title { font-weight: 900; font-size: 18px; text-transform: uppercase; }
.egr-board-root .egr-card { background: #FFFFFF; border: 1px solid #1A1814; }
.egr-bw-play { text-decoration: none; height: 44px; font-weight: 800; }
.egr-board-mini .egr-row { padding: 6px 10px; min-height: 38px; }
.egr-board-mini .egr-row-title { display: none; }

@container (min-width: 760px) {
  .egr-wrap .egr-nav { margin-top: 18px; }
  .egr-wrap .egr-tab { height: 44px; font-size: 14px; }
  .egr-wrap .egr-view { margin-top: 20px; }
  /* Two columns that fill the game's width, like the board and panel on Puzzles. */
  .egr-wrap .egr-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .egr-wrap .egr-cols-board { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
  .egr-wrap .egr-cols-lead { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); }
  .egr-wrap .egr-cols-rush { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .egr-wrap .egr-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .egr-wrap .egr-achs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .egr-wrap .egr-rush-card { min-height: 100%; padding: 26px 24px; }
  .egr-wrap .egr-rush-over .egr-rush-score { font-size: 120px; }
  .egr-wrap .egr-you-btn { margin-top: 4px; }
  .egr-wrap .egr-ladder { display: none; }
  .egr-wrap .egr-tier-card { display: block; }
}
@container (max-width: 380px) {
  .egr-tab { font-size: 12px; }
  .egr-bar-train { grid-template-columns: minmax(0, 6.5em) minmax(0, 1fr) 2.6em auto; gap: 6px; }
  .egr-rush-time { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .egr-toast, .egr-rush-low { animation: none; }
  .egr-tb-fill { transition: none; }
}

/* Columns: stacked on phones, side by side on wide screens (see the container query). */
.egr-cols { display: flex; flex-direction: column; gap: 12px; }
.egr-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.egr-howto { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.egr-howlist { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.45; display: flex; flex-direction: column; gap: 4px; }
.egr-you { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.egr-you-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.egr-you-num { font-weight: 900; font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.egr-you-line { margin: 0; font-size: 14px; line-height: 1.4; }
.egr-you .egr-note { margin: 0; }
.egr-you-btn { height: 46px; font-weight: 800; }
.egr-tier-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid #E3D6BC; }
.egr-tier-row:last-child { border-bottom: 0; }
.egr-tier-row .egr-rung { width: 26px; height: 26px; flex: none; font-size: 12px; }
.egr-tier-name { flex: 1; font-weight: 700; font-size: 14px; }
.egr-tier-note { font-size: 12px; }
.egr-tier-on { background: #FFF6BF; }
/* Phones use the compact strip; wide screens the full ladder card. */
.egr-tier-card { display: none; }

/* ================= League (1.15.2) ================= */
.egr-tc-0 { --tc: #B8AD98; --tc-ink: #1A1814; }
.egr-tc-1 { --tc: #C07A3E; --tc-ink: #FFFFFF; }
.egr-tc-2 { --tc: #7B8794; --tc-ink: #FFFFFF; }
.egr-tc-3 { --tc: #D5D9DE; --tc-ink: #1A1814; }
.egr-tc-4 { --tc: #F5E04A; --tc-ink: #1A1814; }
.egr-tc-5 { --tc: #3A2E4A; --tc-ink: #F5E04A; }

.egr-badge-hex {
  flex: none; width: 40px; height: 46px; display: inline-flex; align-items: center; justify-content: center;
  background: #1A1814; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.egr-badge-in {
  width: calc(100% - 6px); height: calc(100% - 7px); display: flex; align-items: center; justify-content: center;
  background: var(--tc); color: var(--tc-ink); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  font-weight: 900; font-size: 17px; line-height: 1;
}
.egr-badge-sm { width: 30px; height: 34px; }
.egr-badge-sm .egr-badge-in { font-size: 13px; width: calc(100% - 5px); height: calc(100% - 6px); }
.egr-badge-lg { width: 58px; height: 66px; }
.egr-badge-lg .egr-badge-in { font-size: 24px; width: calc(100% - 8px); height: calc(100% - 9px); }
.egr-badge-xl { width: 64px; height: 74px; }
.egr-badge-xl .egr-badge-in { font-size: 28px; width: calc(100% - 8px); height: calc(100% - 9px); }

/* Hero */
.egr-lg-hero {
  display: flex; align-items: center; gap: 16px; padding: 16px 18px;
  background: #1A1814; color: #FFFFFF; border: 1px solid #1A1814; box-shadow: inset 6px 0 0 var(--tc);
}
.egr-lg-hero .egr-badge-hex { background: #FFFFFF; }
.egr-lg-hero-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.egr-lg-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #CFC8BC; }
.egr-lg-name { font-weight: 900; font-size: 28px; line-height: 1.05; text-transform: uppercase; color: #F5E04A; }
.egr-lg-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.egr-lg-chip { font-size: 12px; font-weight: 800; padding: 3px 8px; border: 1px solid #5C554B; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.egr-lg-chip-up { background: #1E6B3A; border-color: #1E6B3A; }
.egr-lg-chip-down { background: #A8432E; border-color: #A8432E; }
.egr-lg-clock { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.egr-lg-clock-n { font-weight: 900; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.egr-lg-clock-l { font-size: 11px; font-weight: 700; color: #CFC8BC; text-transform: uppercase; letter-spacing: .06em; }

/* Ladder track */
.egr-lg-ladder { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 14px 6px 10px; background: #FFFFFF; border: 1px solid #1A1814; }
.egr-lg-ladder::before { content: ''; position: absolute; left: 8%; right: 8%; top: 31px; height: 3px; background: #E3D6BC; }
.egr-lg-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: .45; filter: grayscale(.6); }
.egr-lg-step-done, .egr-lg-step-on { opacity: 1; filter: none; }
.egr-lg-step .egr-badge-sm { margin-top: 6px; }
.egr-lg-step-n { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.egr-lg-step-on .egr-lg-step-n { padding: 1px 6px; background: #1A1814; color: #F5E04A; }

/* Group table */
.egr-lg-table { display: flex; flex-direction: column; }
.egr-lg-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) minmax(0, 110px) 68px; align-items: center; gap: 10px; padding: 7px 12px; border-bottom: 1px solid #EDE5D3; min-height: 46px; }
.egr-lg-up { background: #F1F7F2; }
.egr-lg-down { background: #FBEFEC; }
.egr-lg-me { background: #FFF6BF; box-shadow: inset 4px 0 0 #1A1814; }
.egr-lg-me .egr-name { font-weight: 900; }
.egr-lg-rank { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; }
.egr-lg-up .egr-lg-rank { background: #1E6B3A; color: #FFFFFF; }
.egr-lg-down .egr-lg-rank { color: #A8432E; }
.egr-lg-bar { height: 6px; background: #EDE5D3; }
.egr-lg-bar-fill { display: block; height: 100%; background: #1A1814; }
.egr-lg-up .egr-lg-bar-fill { background: #1E6B3A; }
.egr-lg-down .egr-lg-bar-fill { background: #A8432E; }
.egr-lg-xp { text-align: right; font-weight: 800; font-size: 14px; font-variant-numeric: tabular-nums; }
.egr-lg-zone { display: flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.egr-lg-zone-up { background: #1E6B3A; color: #FFFFFF; }
.egr-lg-zone-down { background: #A8432E; color: #FFFFFF; }
.egr-lg-zone-safe { color: var(--dm-muted); border-top: 2px dashed #1E6B3A; background: #FBF6EA; }

/* Side cards */
.egr-lg-last { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid #1A1814; background: #FFFFFF; box-shadow: 4px 4px 0 #1A1814; animation: egr-toast-in .45s cubic-bezier(.2,1.4,.4,1); }
.egr-lg-last-up { background: #F5E04A; }
.egr-lg-last-down { background: #FDF0E4; }
.egr-lg-last-t { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.egr-lg-last-t strong { font-size: 17px; }
.egr-lg-week { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.egr-lg-week-big { display: flex; align-items: baseline; gap: 8px; }
.egr-lg-goal { margin: 0; font-size: 14px; line-height: 1.45; }
.egr-lg-cta { height: 46px; font-weight: 800; }
.egr-lg-how { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.egr-lg-how-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.egr-lg-how-n { flex: none; min-width: 52px; padding: 3px 6px; text-align: center; font-weight: 900; font-size: 15px; background: #F5E04A; border: 1px solid #1A1814; }
.egr-lg-how p { margin: 0; }
.egr-lg-empty { padding: 26px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.egr-lg-empty-t { font-weight: 900; font-size: 20px; line-height: 1.2; }
.egr-lg-empty p { margin: 0; max-width: 44ch; font-size: 14px; line-height: 1.45; }
.egr-lg-empty .egr-lg-cta { align-self: stretch; max-width: 360px; width: 100%; margin: 6px auto 0; }

@container (min-width: 760px) {
  .egr-wrap .egr-cols-league { grid-template-columns: minmax(0, 1fr) minmax(0, 330px); }
  .egr-wrap .egr-lg-hero { padding: 18px 22px; }
  .egr-wrap .egr-lg-name { font-size: 34px; }
  .egr-wrap .egr-lg-clock-n { font-size: 32px; }
}
@container (max-width: 560px) {
  .egr-lg-row { grid-template-columns: 28px minmax(0, 1fr) 62px; }
  .egr-lg-bar { display: none; }
  .egr-lg-hero { flex-wrap: wrap; gap: 12px; padding: 14px; }
  .egr-lg-clock { flex: 1 0 100%; flex-direction: row; align-items: baseline; gap: 8px; padding-top: 10px; border-top: 1px solid #3A352E; }
  .egr-lg-clock-n { font-size: 20px; }
  .egr-lg-name { font-size: 24px; }
  .egr-lg-step-n { font-size: 9px; letter-spacing: 0; overflow: visible; }
  .egr-lg-step-on .egr-lg-step-n { padding: 1px 3px; }
}
/* Phones: your week first, then the group, then how it works. */
@container (max-width: 759px) {
  .egr-cols-league > .egr-col { display: contents; }
  .egr-lg-week, .egr-cols-league .egr-lg-empty { order: 1; }
  .egr-lg-table, .egr-cols-league .egr-note { order: 2; }
  .egr-lg-how { order: 3; }
}
@media (prefers-reduced-motion: reduce) { .egr-lg-last { animation: none; } }

/* ================= 1.15.3: Rated header art and a warmer, on-brand League ================= */

/* Header (1.15.4, "Classic stone"): paper, black title, the knight and rook in front of a yellow sun,
   poking up out of the box like the other game headers. Beats the shared game-header styles. */
.egr-root { margin-top: 42px !important; overflow: visible !important; }
.egr-root .dm-head.egr-head {
  position: relative !important; overflow: visible !important; background: #F7EFDF !important;
  border-bottom: 2px solid #1A1814 !important; min-height: 134px !important; padding: 0 28px !important;
}
.egr-root .dm-head.egr-head::after {
  content: ""; position: absolute; right: 26px; bottom: 0; top: auto; left: auto;
  height: 128% !important; max-width: none !important; aspect-ratio: 1563 / 933;
  /* The rubble hangs below the sun's flat edge (10% of the art): drop it so the sun sits on top of the border line. */
  transform: translateY(calc(9.97% - 1px)); /* sun stops just above the border, which stays black */
  background-color: transparent; -webkit-mask-image: none; mask-image: none;
  background-image: url(../../../assets/headers/end-game-rated-440.webp) !important;
  background-image: image-set(url(../../../assets/headers/end-game-rated-440.webp) 1x, url(../../../assets/headers/end-game-rated.webp) 2x) !important;
  background-size: contain !important; background-position: right bottom !important; background-repeat: no-repeat;
}
.egr-head .dm-title, .egr-head .dm-title span, .egr-head .dm-title .cgh-b { color: #0C0C0B !important; }
.egr-head .dm-title { font-size: 40px !important; }
.egr-head .egr-tag { background: #F5E04A; color: #0C0C0B; border: 2px solid #0C0C0B; font-size: 15px; padding: 3px 9px; }
.egr-head .dm-sub { color: #4A4238 !important; font-weight: 700 !important; font-size: 15px !important; }
@container (max-width: 600px) {
  /* Phones: title on one line so the knight and rook have room to poke up out of the box. */
  .egr-root { margin-top: 44px !important; }
  .egr-root .dm-head.egr-head { min-height: 78px !important; padding: 10px 14px !important; justify-content: center !important; }
  .egr-root .dm-head.egr-head::after { right: 6px; height: 150% !important; max-width: none !important; }
  .egr-head .dm-title { font-size: 22px !important; white-space: nowrap; }
  .egr-head .dm-title span { display: inline !important; }
  .egr-head .dm-title .cgh-a { margin-right: .22em !important; }
  .egr-head .egr-tag { font-size: 11px; padding: 2px 6px; border-width: 1px; }
}


/* League tiers: stone and metal, warm like the header art. */
.egr-tc-0 { --tc: #B9AE9C; --tc-ink: #1A1814; }
.egr-tc-1 { --tc: #C58A4A; --tc-ink: #1A1814; }
.egr-tc-2 { --tc: #77706A; --tc-ink: #FFFFFF; }
.egr-tc-3 { --tc: #DCD8D0; --tc-ink: #1A1814; }
.egr-tc-4 { --tc: #E8B53A; --tc-ink: #1A1814; }
.egr-tc-5 { --tc: #2A2421; --tc-ink: #F5E04A; }

/* Hero: yellow card, ink type, so it doesn't stack a second black block under the header. */
.egr-lg-hero { background: #F5E04A; color: #1A1814; border: 2px solid #1A1814; box-shadow: 4px 4px 0 #1A1814; }
.egr-lg-hero .egr-badge-hex { background: #1A1814; }
.egr-lg-eyebrow { color: #5C5011; }
.egr-lg-name { color: #1A1814; }
.egr-lg-chip { border-color: #1A1814; color: #1A1814; background: #FFF6CC; }
.egr-lg-chip-up { background: #1A1814; border-color: #1A1814; color: #F5E04A; }
.egr-lg-chip-down { background: #A8432E; border-color: #1A1814; color: #FFFFFF; }
.egr-lg-clock-l { color: #5C5011; }
@container (max-width: 560px) { .egr-lg-clock { border-top-color: rgba(26,24,20,.25); } }

/* Ladder: ink line, current league underlined in yellow. */
.egr-lg-ladder::before { background: #1A1814; height: 2px; }
.egr-lg-step { opacity: 1; filter: grayscale(1) brightness(1.18); }
.egr-lg-step .egr-lg-step-n { color: #8C8478; }
.egr-lg-step-done, .egr-lg-step-on { filter: none; }
.egr-lg-step-done .egr-lg-step-n { color: #1A1814; }
.egr-lg-step-on .egr-lg-step-n { background: #F5E04A; color: #1A1814; border: 1px solid #1A1814; }

/* Zones: yellow means moving up, brick means dropping. No greens. */
.egr-lg-up { background: #FFF8D9; }
.egr-lg-up .egr-lg-rank { background: #1A1814; color: #F5E04A; }
.egr-lg-up .egr-lg-bar-fill { background: #1A1814; }
.egr-lg-bar-fill { background: #8C8478; }
.egr-lg-down { background: #F6EEE6; }
.egr-lg-down .egr-lg-bar-fill { background: #A8432E; }
.egr-lg-me, .egr-lg-me.egr-lg-up, .egr-lg-me.egr-lg-down { background: #F5E04A; box-shadow: inset 4px 0 0 #1A1814; }
.egr-lg-me .egr-lg-rank { background: #1A1814; color: #F5E04A; }
.egr-lg-me .egr-lg-bar { background: rgba(26,24,20,.15); }
.egr-lg-me .egr-lg-bar-fill { background: #1A1814; }
.egr-lg-me .egr-row-title { color: #1A1814; }
.egr-lg-zone-up { background: #1A1814; color: #F5E04A; }
.egr-lg-zone-down { background: #A8432E; color: #FFFFFF; }
.egr-lg-zone-safe { border-top: 2px dashed #1A1814; background: #FBF6EA; }
.egr-lg-last-up { background: #F5E04A; }
.egr-lg-how-n { background: #F5E04A; }

/* Premove (Puzzle Rush): the queued move's two squares, tinted red like chess.com. */
.egr-root .dm-sq.egr-pre { box-shadow: inset 0 0 0 999px rgba(201, 72, 44, .5); }

/* 1.15.9: on big screens the game breaks out of a narrow theme column (the Rated page has no sidebar),
   up to 1240px wide, centred on the page. */
@media (min-width: 1100px) {
  html body .egr-wrap.egr-wrap:not(.egr-board-wrap) {
    width: min(1240px, calc(100vw - 48px)) !important; max-width: none !important; box-sizing: border-box;
    margin-left: calc((100% - min(1240px, calc(100vw - 48px))) / 2) !important;
    margin-right: calc((100% - min(1240px, calc(100vw - 48px))) / 2) !important;
  }
}

/* 1.15.11: no drop shadow on the board, in rated puzzles or Rush (the solve glow still plays). */

/* 1.15.12: phones and narrow screens. The board runs edge to edge there, so the game box's drop shadow
   read as a shadow on the board. Flat box on small screens; the shadow stays on desktop. */
@container (max-width: 759px) {
  .egr-wrap .egr-root.dm-root { box-shadow: none !important; }
}
/* Very narrow phones (360px and under): a little less art and a smaller title so they don't touch. */
@container (max-width: 320px) {
  .egr-root .dm-head.egr-head::after { height: 128% !important; right: 4px; }
  .egr-head .dm-title { font-size: 20px !important; }
  .egr-root .egr-tab { font-size: 11px; padding: 0 2px; text-overflow: clip; }
}
@container (max-width: 270px) {
  .egr-root .dm-head.egr-head::after { height: 112% !important; }
  .egr-head .dm-title { font-size: 18px !important; }
}

/* 1.15.14: the game header already says END GAME RATED, so the theme's own page title is hidden on this page
   (Caveman Circus theme, block themes and classic themes), along with the gap it left. */
body.egr-page .cc-post__head,
body.egr-page .wp-block-post-title,
body.egr-page .entry-header > .entry-title,
body.egr-page .page-header > .page-title { display: none !important; }
body.egr-page .cc-layout { margin-top: 0; }

/* ================= 1.15.15: a calmer phone layout =================
   Above the board: just what to do ("White to play"). Below it: the move message, Hint and Give up,
   then one compact strip with your rating, title and daily goal. The rival line, session squares,
   win streak, peak and stats link are left to the Me and Board tabs. Desktop is unchanged. */
.egr-free-mini { display: none; }
@container (max-width: 759px) {
  .egr-rushbar { order: 0; }
  .egr-root .dm-prompt { order: 1; }
  .egr-train { order: 2; }
  .egr-root .dm-board-wrap { order: 3; }
  .egr-root .dm-msg { order: 4; min-height: 0; padding: 10px 14px; }
  .egr-controls { order: 5; }
  .egr-rating { order: 6; padding: 10px 12px; gap: 8px; }
  .egr-session { order: 7; }
  .egr-foot { order: 8; }

  .egr-rival, .egr-tb-peak, .egr-session-row { display: none !important; }
  .egr-foot > .dm-link:first-child { display: none; }
  .egr-foot { justify-content: center; }

  .egr-rating .egr-rating-num { font-size: 26px; }
  .egr-rating .egr-label { font-size: 10px; }
  .egr-tb-track { height: 6px; }
  .egr-tb-name { font-size: 12px; }
  .egr-goal { gap: 8px; }
  .egr-free-mini { display: inline-block; flex: none; font-size: 12px; font-weight: 800; padding: 3px 7px; background: #F5E04A; border: 1px solid #1A1814; }
}

/* ================= 1.16.0: the scoreboard strip, and chess.com-style badges ================= */
/* The strip replaces the rating card and the "to play" box. */
.egr-root .egr-rating, .egr-root .dm-prompt, .egr-root .egr-chip { display: none !important; }
.egr-score {
  order: 1; display: flex; align-items: stretch; min-height: 58px;
  background: #FFFFFF; border: 1px solid #1A1814; color: #1A1814;
}
.egr-score-l { flex: none; display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 8px 14px; border-right: 1px solid #1A1814; }
.egr-score-label { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5C554B; line-height: 1; }
.egr-score-nums { display: flex; align-items: center; gap: 7px; }
.egr-score-num { font-size: 22px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.egr-score-delta { font-size: 12px; font-weight: 900; line-height: 1; padding: 3px 6px; border: 1px solid #1A1814; font-variant-numeric: tabular-nums; animation: egr-badge .35s cubic-bezier(.2,1.6,.4,1); }
.egr-score-up { background: #F5E04A; color: #1A1814; box-shadow: 2px 2px 0 #1A1814; }
.egr-score-down { background: #A8432E; color: #FFFFFF; box-shadow: 2px 2px 0 #1A1814; }
.egr-score-r { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 8px 10px; }
.egr-score-r b { font-size: 19px; font-weight: 900; line-height: 1; white-space: nowrap; }
.egr-score-sw { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #1A1814; box-sizing: border-box; }
.egr-score-sw-w { background: #FFFFFF; }
.egr-score-sw-b { background: #1A1814; }
.egr-score-ic { flex: none; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 2px solid #1A1814; box-sizing: border-box; }
.egr-score-ic svg { width: 66%; height: 66%; stroke-width: 3.6; }
.egr-score-win { background: #F5E04A; }
.egr-score-win .egr-score-ic { background: #FFFFFF; }
.egr-score-miss { background: #FBEFEC; color: #A8432E; }
.egr-score-miss .egr-score-ic { background: #A8432E; color: #FFFFFF; border-color: #A8432E; }
.egr-score-rush .egr-score-l { display: none; }
.egr-root .dm-msg[hidden] { display: none !important; }
@container (min-width: 760px) {
  .egr-wrap .egr-score { min-height: 66px; }
  .egr-wrap .egr-score-num { font-size: 26px; }
  .egr-wrap .egr-score-r b { font-size: 21px; }
}

/* Badges on the piece, like chess.com: yellow check for the right move, red X for the wrong one.
   They sit on the square's top-right corner and may hang over the edge. */
.egr-root .dm-board { overflow: visible; }
.egr-root .dm-sq.egr-badge-sq { z-index: 5; overflow: visible; }
.egr-root .egr-badge {
  top: -18%; right: -18%; width: 56%; max-width: 40px; z-index: 6;
  background: #F5E04A; color: #1A1814; border: 2px solid #1A1814; box-shadow: 0 2px 0 rgba(26,24,20,.35);
}
.egr-root .egr-badge svg { width: 62%; height: 62%; stroke-width: 3.8; }
.egr-root .egr-badge-bad { background: #C9482C; color: #FFFFFF; border-color: #1A1814; }
