:root {
  color-scheme: light;
  --gsh-bg: #f5f0e8;
  --gsh-paper: #fff;
  --gsh-ink: #1c1c1c;
  --gsh-muted: #7b6c55;
  --gsh-gold: #c8973a;
  --gsh-gold-dark: #8b6310;
  --gsh-gold-light: #efd9aa;
  --gsh-cream: #faf4e8;
  --gsh-orange: #e8a020;
  --gsh-red: #d85a30;
  --gsh-green: #5b8f45;
  --gsh-nav-height: 60px;
  --gsh-page-strip-height: 44px;
  --gsh-focus: rgba(87, 137, 190, .55);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--gsh-ink);
  background: var(--gsh-bg);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--gsh-bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding-top: var(--gsh-nav-height);
  background: var(--gsh-bg);
}
button { font: inherit; }
button:focus-visible,
details:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gsh-focus);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: .5; }
#app { width: 100%; min-height: 100vh; min-height: 100dvh; }

.site-nav {
  position: fixed;
  z-index: 999;
  inset: 0 0 auto;
  height: var(--gsh-nav-height);
  padding: 0 clamp(16px, 3vw, 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(200, 151, 58, .2);
  background: rgba(17, 17, 17, .97);
  backdrop-filter: blur(8px);
}
.nav-logo {
  flex-shrink: 0;
  font-family: "Noto Serif TC", serif;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 1px;
}
.logo-main { color: #fff; }
.logo-accent,
.logo-dim { color: var(--gsh-gold); }
.nav-links {
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: clamp(2px, .6vw, 4px);
  list-style: none;
}
.nav-links li > span {
  padding: 6px clamp(6px, 1vw, 10px);
  display: block;
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .5px;
  white-space: nowrap;
}
.nav-links .has-drop::after { content: "▾"; margin-left: 4px; font-size: 9px; opacity: .5; }
.nav-links .nav-cta-secondary {
  padding: 6px clamp(8px, 1.3vw, 14px);
  border: 1px solid var(--gsh-gold);
  border-radius: 4px;
  color: var(--gsh-gold);
  font-weight: 700;
}
.nav-links .nav-cta {
  padding: 8px clamp(10px, 1.6vw, 18px);
  color: var(--gsh-ink);
  background: var(--gsh-gold);
  font-weight: 700;
}
.nav-mobile-actions,
.hamburger { display: none; }
.nav-mobile-game,
.nav-mobile-cta {
  width: 72px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gsh-gold);
  color: var(--gsh-gold);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.nav-mobile-cta { color: var(--gsh-ink); background: var(--gsh-gold); }
.hamburger { padding: 4px; flex-direction: column; gap: 5px; }
.hamburger span { width: 22px; height: 2px; display: block; background: rgba(255, 255, 255, .8); }

.gsh-shell {
  width: min(100%, 688px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 8px 24px calc(112px + env(safe-area-inset-bottom, 0px));
}
.gsh-page-header { width: 100%; max-width: 640px; margin: 0 auto 10px; text-align: center; }
.gsh-page-title {
  margin: 0;
  color: var(--gsh-gold-dark);
  font-family: "Noto Serif TC", "Songti TC", Georgia, serif;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 900;
  letter-spacing: 2px;
}
.gsh-page-hint { margin: 3px 0 0; color: #b08040; font-size: 12px; }
.gsh-player-row {
  margin-bottom: 12px;
  padding-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}
.gsh-player-status {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  min-height: 57px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  border: 2px solid var(--gsh-gold);
  border-radius: 26px;
  color: #786d58;
  background: var(--gsh-cream);
  font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(139, 99, 16, .1);
}
#rg-login-slot { display: flex; align-items: center; }
.mrt-login-button {
  min-height: 31px;
  padding: 6px 16px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--gsh-gold-dark), var(--gsh-gold));
  box-shadow: 0 2px 8px rgba(139, 99, 16, .28);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.mrt-login-howto {
  min-height: 31px;
  padding: 5px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 151, 58, .48);
  border-radius: 999px;
  color: #7a5510;
  background: rgba(255, 255, 255, .72);
  font: 700 12px/1.15 "Noto Sans TC", sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.mrt-login-button:focus-visible,
.mrt-login-howto:focus-visible { outline: 3px solid #155eef; outline-offset: 3px; }
.gsh-access-state { color: #633806; font-weight: 800; }
.gsh-help-chip {
  min-height: 32px;
  padding: 5px 8px;
  border: 0;
  border-radius: 999px;
  color: var(--gsh-gold-dark);
  background: rgba(139, 99, 16, .09);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.gsh-learning-control[aria-pressed="true"] {
  border-color: var(--gsh-gold) !important;
  color: #6f4d0d !important;
  background: #fff3d8 !important;
  box-shadow: 0 0 0 2px rgba(200, 151, 58, .12);
}
.gsh-learning-control:focus-visible { outline: 3px solid #155eef; outline-offset: 2px; }
.gsh-access-copy { flex: 1; min-width: 170px; color: #633806; font-size: 14px; font-weight: 700; }
.gsh-account-cta {
  padding: 6px 16px;
  border-radius: 8px;
  color: #fff;
  background: #ba7517;
  font-size: 13px;
  font-weight: 700;
}

.gsh-item-score {
  width: calc(100% + 40px);
  margin: -22px -20px 12px;
  padding: 14px 20px 12px;
  border-bottom: 2px solid rgba(184, 134, 40, .5);
  background: linear-gradient(180deg, #efddb4 0%, #f8f0de 100%);
}
.gsh-item-score-wrap { display: flex; width: 100%; flex-direction: column; gap: 6px; }
.gsh-item-score-row { display: flex; align-items: center; gap: 8px; color: #a08050; font: 400 12px/1.4 "Noto Sans TC", sans-serif; }
.gsh-item-score-track { height: 7px; flex: 1; overflow: hidden; border-radius: 4px; background: #ede0c8; }
.gsh-item-score-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg,#66bb6a,#43a047); transition: width .4s ease; }
.gsh-score-0{width:0}.gsh-score-10{width:10%}.gsh-score-20{width:20%}.gsh-score-30{width:30%}.gsh-score-40{width:40%}.gsh-score-50{width:50%}.gsh-score-60{width:60%}.gsh-score-70{width:70%}.gsh-score-80{width:80%}.gsh-score-90{width:90%}.gsh-score-100{width:100%}
.gsh-item-score.is-unscored .gsh-item-score-fill { background: transparent; }
.gsh-item-score-label { min-width: 52px; text-align: right; font-size: 11px; }
.gsh-item-score-value { color: inherit; font-size: inherit; }

.gsh-session-header {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-flow: column nowrap;
  gap: 10px;
  text-align: center;
}
.gsh-level-selector {
  width: min(100%, 300px);
  max-width: 300px;
  display: grid;
  grid-template-columns: repeat(3, minmax(70px, 1fr));
  gap: 8px;
}
.gsh-level-option {
  min-height: 36px;
  padding: 7px 12px;
  border: 2px solid #d4b87a;
  border-radius: 999px;
  color: #806d4c;
  background: #fffdf8;
  font-size: 13px;
  font-weight: 800;
}
.gsh-level-option.active,
.gsh-level-option[aria-current="true"] {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--gsh-orange), var(--gsh-red));
  box-shadow: 0 3px 8px rgba(216, 90, 48, .2);
}
.gsh-level-option.active:disabled,
.gsh-level-option[aria-current="true"]:disabled { cursor: default; opacity: 1; }
.gsh-session-counter {
  min-height: 0;
  margin: 0;
  color: var(--gsh-gold-dark);
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}
.gsh-session-counter:empty { display: none; }
.gsh-score-hud,
.gsh-combo-hud,
.gsh-golden-hud {
  margin-left: 6px;
  padding: 1px 9px;
  display: inline-flex;
  border: 0;
  border-radius: 999px;
  color: var(--gsh-gold-dark);
  background: rgba(139, 99, 16, .12);
  font-size: 12px;
  font-weight: 800;
}
.gsh-combo-hud {
  color: #e0552f;
  background: rgba(255, 124, 124, .16);
  animation: gsh-combo-pulse .6s ease infinite alternate;
}
.gsh-golden-hud { color: #704c00; background: #f8e19b; }
.gsh-landscape-help { display: none; }

.gsh-card,
.gsh-gameplay,
.gsh-status-panel {
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(139, 99, 16, .15);
  border-radius: 20px;
  background: var(--gsh-paper);
  box-shadow: 0 4px 24px rgba(90, 62, 10, .1);
}
.gsh-panel-body { padding: 20px; }
.gsh-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.gsh-button,
.gsh-status-action,
.gsh-dialog-primary {
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid #d5b670;
  border-radius: 999px;
  color: var(--gsh-gold-dark);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}
.gsh-button-primary,
.gsh-status-action,
.gsh-dialog-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--gsh-orange), var(--gsh-red));
  box-shadow: 0 3px 8px rgba(216, 90, 48, .2);
}
.gsh-status-action,
.gsh-dialog-primary { width: 100%; }

.gsh-status-screen { width: 100%; }
.gsh-status-panel { padding: 24px 20px; text-align: center; }
.gsh-status-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--gsh-gold-dark);
  background: #f8edd5;
  font-size: 24px;
}
.gsh-status-eyebrow { margin: 0 0 5px; color: var(--gsh-gold-dark); font-size: 11px; font-weight: 900; }
.gsh-status-panel h2 {
  margin: 0;
  color: #4b3716;
  font-family: "Noto Serif TC", serif;
  font-size: 22px;
}
.gsh-status-message {
  margin: 12px 0 16px;
  padding: 11px;
  border-radius: 10px;
  color: var(--gsh-muted);
  background: var(--gsh-cream);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}
.gsh-loading-panel {
  min-height: 55vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
}
.gsh-loading-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--gsh-orange), var(--gsh-red));
  font-size: 28px;
}
.gsh-loading-panel p { margin: 0; color: var(--gsh-gold-dark); font-size: 12px; font-weight: 800; }
.gsh-busy-toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: calc(15px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(65, 46, 17, .92);
  font-size: 11px;
  font-weight: 800;
}
.gsh-busy-toast span {
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gsh-spin .8s linear infinite;
}

.gsh-dialog-backdrop {
  position: fixed;
  z-index: 30;
  inset: 0;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(54, 39, 17, .45);
}
.gsh-dialog {
  position: relative;
  width: min(100%, 620px);
  max-height: 90vh;
  max-height: 90dvh;
  padding: 28px 24px;
  overflow: auto;
  border: 0;
  border-radius: 16px;
  background: #fff;
}
.gsh-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gsh-dialog-head h2 {
  margin: 0 0 4px;
  color: var(--gsh-gold-dark);
  font-family: "Noto Sans TC", sans-serif;
  font-size: 22px;
  font-weight: 900;
}
.gsh-dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid #d8bd85;
  border-radius: 50%;
  color: var(--gsh-gold-dark);
  background: #fffaf0;
  font-size: 18px;
  cursor: pointer;
}

.page-strip {
  position: fixed;
  z-index: 990;
  inset: auto 0 0;
  height: var(--gsh-page-strip-height);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-top: 1px solid rgba(200, 151, 58, .3);
  background: rgba(17, 17, 17, .97);
}
.page-strip-label { margin-right: 16px; color: rgba(255, 255, 255, .4); font-size: 11px; letter-spacing: 2px; }
.page-strip > span:not(.page-strip-label) {
  padding: 6px 18px;
  border: 1px solid rgba(255, 255, 255, .3);
  color: rgba(255, 255, 255, .7);
  font-size: 12px;
  white-space: nowrap;
}
.rg-ctl-wrap {
  position: fixed;
  z-index: 100000;
  right: 12px;
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
.rg-ctl-wrap.is-dialog-isolated { display: none !important; }
.rg-ctl-fab {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(200, 151, 58, .5);
  border-radius: 50%;
  color: var(--gsh-gold);
  background: rgba(17, 17, 17, .9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
  font-size: 18px;
  cursor: pointer;
  user-select: none;
}
.rg-ctl-fab:active { transform: scale(.92); }
#game-switcher {
  position: static;
  width: auto;
  min-width: 150px;
  max-width: none;
  max-height: 60vh;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  border: 1.5px solid rgba(139, 99, 16, .25);
  border-radius: 14px;
  background: var(--gsh-cream);
  box-shadow: 0 6px 24px rgba(90, 62, 10, .22);
  font-family: "Noto Sans TC", sans-serif;
}
#game-switcher.gs-open { display: flex; }
.grw-menu {
  width: auto;
  min-width: 190px;
  max-height: 60vh;
  padding: 8px;
  overflow: auto;
  display: none;
  flex-direction: column;
  gap: 6px;
  border: 1.5px solid rgba(139, 99, 16, .25);
  border-radius: 14px;
  background: var(--gsh-cream);
  box-shadow: 0 6px 24px rgba(90, 62, 10, .22);
}
.grw-menu.gs-open { display: flex; }
.grw-item {
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  color: #5a3e0a;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.grw-item:hover { background: rgba(139, 99, 16, .10); }
.grw-item .ico {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--gsh-gold), var(--gsh-gold-dark));
  font-size: 13px;
}
.gsh-focus-mode .site-nav,
.gsh-focus-mode #bottom-nav,
.gsh-focus-mode .page-strip,
.gsh-focus-mode footer { display: none !important; }
.gsh-focus-mode { padding-block: 0 !important; }
.gs-tab {
  min-height: 38px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  color: #5a3e0a;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.gs-destination-item { display: block; }
button.gs-tab[data-local-game-destination] {
  width: 100%;
  margin: 0;
  border: 0;
  font-family: inherit;
  line-height: inherit;
}
button.gs-tab[data-local-game-destination]:not(.gs-active) { background: transparent; }
.gs-tab.gs-active { color: var(--gsh-gold-dark); background: rgba(200, 151, 58, .18); }
.gs-tab[aria-disabled="true"] { opacity: .72; }
.gs-tab .ico {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--gsh-gold), var(--gsh-gold-dark));
  font-size: 13px;
}
.gs-tab .gs-lbl { display: inline; }
#bottom-nav { display: none; }

@keyframes gsh-spin { to { transform: rotate(360deg); } }
@keyframes gsh-combo-pulse { from { transform: scale(1); } to { transform: scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  .gsh-busy-toast span,
  .gsh-combo-hud,
  .gsh-golden-hud { animation: none; }
}

@media (hover: hover) {
  .gsh-help-chip:hover,
  .gsh-button:hover,
  .gsh-status-action:hover,
  .gsh-dialog-primary:hover { border-color: var(--gsh-gold); filter: brightness(.98); }
}

@media (min-width: 769px) and (min-height: 601px) {
  .gsh-level-selector { width: 100% !important; max-width: 640px !important; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gsh-session-counter { min-height: 24px; line-height: 24px; }
}

@media (max-width: 1050px) {
  .nav-links { display: none; }
  .nav-mobile-actions { margin-left: auto; display: flex; align-items: center; gap: 5px; }
  .nav-mobile-game,
  .nav-mobile-cta { display: inline-flex; }
  .hamburger { display: flex; }
  .site-nav { padding-inline: 12px; gap: 6px; }
  .nav-logo { font-size: 13px; letter-spacing: .4px; }
}

@media (max-width: 768px) and (orientation: portrait) {
  .gsh-shell { padding: 10px 10px calc(154px + env(safe-area-inset-bottom, 0px)); }
  .gsh-page-header { margin-bottom: 7px; }
  .gsh-page-title { font-size: 21px; line-height: 1.25; letter-spacing: 1px; }
  .gsh-page-hint { display: none; }
  .gsh-player-row { margin-bottom: 7px; flex-wrap: nowrap; gap: 6px; }
  .gsh-player-status { min-width: 0; min-height: 0; padding: 7px 8px; gap: 5px; border-radius: 18px; }
  .mrt-login-button,.mrt-login-howto { min-height: 29px; padding: 5px 9px; font-size: 11px; }
  .gsh-access-state { flex: 0 0 auto; }
  .gsh-access-copy { min-width: 0; font-size: 11px; }
  .gsh-account-cta { padding: 5px 8px; font-size: 10px; white-space: nowrap; }
  .gsh-session-header { padding-bottom: 10px; gap: 10px; }
  .gsh-level-selector { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .gsh-level-option { min-height: 40px; padding: 6px 4px; border-width: 1.5px; font-size: 13px; }
  .gsh-level-option--compact { padding-inline: 3px; font-size: 11.5px; line-height: 1.1; white-space: nowrap; }
  .gsh-level-option--compact span { display: none; }
  .page-strip { display: none; }
  .rg-ctl-wrap { bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  #bottom-nav {
    position: fixed;
    z-index: 998;
    inset: auto 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    border-top: 1px solid rgba(200, 151, 58, .3);
    background: rgba(17, 17, 17, .97);
  }
  #bottom-nav .bn-item {
    flex: 1;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: rgba(255, 255, 255, .6);
  }
  #bottom-nav .bn-item.bn-cta { color: var(--gsh-gold); }
  #bottom-nav .bn-icon { font-size: 20px; line-height: 1; }
  #bottom-nav .bn-label { font-size: 10px; letter-spacing: .5px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  html,
  body { width: 100%; height: 100%; overflow: hidden; }
  body { padding-top: 0; }
  .site-nav,
  .page-strip,
  #bottom-nav { display: none; }
  .rg-ctl-wrap {
    top: max(8px, env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: auto;
    height: 42px;
    flex-direction: row;
    align-items: center;
  }
  .rg-ctl-wrap #game-switcher,
  .rg-ctl-wrap .grw-menu {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    width: min(240px, 42vw);
    min-width: min(220px, 42vw);
    max-height: calc(100dvh - 68px - env(safe-area-inset-bottom, 0px));
  }
  .rg-focus-fab { display: none; }
  .rg-ctl-fab { width: 42px; height: 42px; }
  .gsh-shell {
    width: 100%;
    max-width: none;
    min-height: 0;
    height: 100dvh;
    padding: max(8px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  .gsh-page-header,
  .gsh-player-row { display: none; }
  .gsh-session-header {
    width: 100%;
    max-width: none;
    height: clamp(40px, 11dvh, 52px);
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 30fr) minmax(0, 40fr) minmax(0, 30fr);
    align-items: center;
    gap: clamp(4px, 1.3dvh, 10px);
  }
  .gsh-level-selector {
    grid-column: 1;
    width: 100%;
    max-width: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }
  .gsh-level-option { min-height: 18px; padding: 2px 4px; border-width: 1px; font-size: 9px; line-height: 1; }
  .gsh-session-counter {
    grid-column: 2;
    margin: 0;
    white-space: nowrap;
    font-size: clamp(10px, 2.7dvh, 13px);
  }
  .gsh-landscape-help {
    grid-column: 3;
    justify-self: start;
    min-height: clamp(34px, 10dvh, 48px);
    padding: 4px 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(139, 99, 16, .35);
    border-radius: 999px;
    color: var(--gsh-gold-dark);
    background: #fffaf0;
    font-size: clamp(10px, 2.7dvh, 13px);
    font-weight: 800;
  }
  .gsh-dialog-backdrop {
    padding: max(6px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
      max(6px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  .gsh-dialog { width: min(72vw, 640px); max-height: calc(100dvh - 16px); padding: 18px 20px; }
}

@media (orientation: landscape) and (max-height: 240px) {
  html,
  body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .gsh-shell { height: auto; min-height: 100dvh; }
  .gsh-session-header {
    height: auto;
    grid-template-rows: minmax(42px, auto) auto;
  }
  .gsh-landscape-help { grid-column: 1 / -1; grid-row: 2; }
}
