:root {
  --site-service-bronze: #b99255;
  --site-service-bronze-bright: #e5c78e;
  --site-service-panel: rgba(10, 8, 7, .95);
  --site-service-scale: 1;
}

.global-service-menu,
.global-service-drawer,
.site-guide-button,
.site-guide-panel {
  font-family: Georgia, "Times New Roman", serif;
}

.global-service-menu {
  position: fixed;
  z-index: 12000;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  gap: calc(7px * var(--site-service-scale));
  padding: calc(7px * var(--site-service-scale));
  border: 1px solid rgba(172, 128, 70, .2);
  border-radius: calc(21px * var(--site-service-scale));
  background: rgba(4, 4, 4, .5);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 157, .025), 0 10px 24px rgba(0, 0, 0, .36);
  backdrop-filter: blur(4px);
  max-height: calc(100vh - 28px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.global-service-button {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(48px * var(--site-service-scale));
  height: calc(48px * var(--site-service-scale));
  padding: 0;
  color: var(--site-service-bronze);
  opacity: .58;
  border: 1px solid rgba(181, 137, 75, .35);
  border-radius: 50%;
  background: radial-gradient(circle at 42% 35%, rgba(103, 74, 39, .28), rgba(10, 8, 7, .9) 72%);
  box-shadow: inset 0 0 10px rgba(190, 139, 67, .07), 0 4px 10px rgba(0, 0, 0, .42);
  cursor: pointer !important;
  transition: opacity .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.global-service-button.is-shell-controlled {
  visibility: hidden;
  pointer-events: none;
}

.global-service-button:hover,
.global-service-button:focus-visible,
.global-service-button.is-active {
  color: var(--site-service-bronze-bright);
  opacity: 1;
  border-color: rgba(220, 174, 104, .82);
  outline: none;
  transform: translateX(-2px);
}

.global-service-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.global-service-button[data-state="off"] {
  color: #756a5d;
  opacity: .3;
}

.global-service-button[data-state="off"]::after {
  content: "";
  position: absolute;
  width: 29px;
  height: 1px;
  background: currentColor;
  transform: rotate(-45deg);
}

.global-service-button:disabled,
.global-setting-row.is-unavailable {
  opacity: .22;
  filter: grayscale(1);
  cursor: not-allowed !important;
}

.global-service-drawer {
  position: fixed;
  z-index: 11990;
  right: calc(78px * var(--site-service-scale));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: min(390px, calc(100vw - 98px));
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 20px;
  color: #d0ba93;
  opacity: 0;
  visibility: hidden;
  transform: translateX(18px);
  border: 1px solid rgba(183, 139, 76, .43);
  border-radius: 9px;
  background:
    linear-gradient(150deg, rgba(75, 50, 26, .16), transparent 42%),
    var(--site-service-panel);
  box-shadow: inset 0 0 28px rgba(173, 119, 55, .05), 0 18px 44px rgba(0, 0, 0, .65);
  backdrop-filter: blur(9px);
  transition: opacity .2s ease, transform .23s ease, visibility 0s linear .23s;
}

.global-service-drawer.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition-delay: 0s;
}

.global-service-drawer h2 {
  margin: 0 0 12px;
  color: #ddbe84;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .08em;
}

.global-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 9px 0;
  border-top: 1px solid rgba(177, 132, 72, .17);
}

.global-setting-row.is-wide {
  grid-template-columns: 1fr;
  gap: 6px;
}

.global-setting-label {
  display: grid;
  gap: 3px;
  font: 14px/1.25 Arial, "Segoe UI", sans-serif;
}

.global-setting-state {
  color: rgba(202, 178, 137, .58);
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.global-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(182, 138, 78, .42);
  border-radius: 20px;
  background: rgba(55, 47, 39, .84);
  cursor: pointer;
}

.global-toggle::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #776b5c;
  transition: transform .18s ease, background .18s ease;
}

.global-toggle[aria-checked="true"] {
  background: rgba(107, 72, 33, .76);
}

.global-toggle[aria-checked="true"]::after {
  background: #d4aa68;
  box-shadow: 0 0 7px rgba(202, 147, 70, .38);
  transform: translateX(21px);
}

.global-range {
  width: 100%;
  accent-color: #b8894d;
}

.global-select,
.global-reset,
.global-action {
  min-height: 34px;
  border: 1px solid rgba(181, 135, 73, .38);
  border-radius: 4px;
  background: rgba(0, 0, 0, .36);
  color: #d4b985;
  padding: 6px 9px;
  font: 13px Arial, sans-serif;
  cursor: pointer;
}

.global-reset {
  width: 100%;
  margin-top: 12px;
}

.global-help-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.global-help-list li {
  padding-left: 12px;
  color: rgba(224, 205, 170, .82);
  border-left: 1px solid rgba(190, 143, 76, .4);
  font: 13px/1.5 Arial, sans-serif;
}

.site-accessibility-mode {
  --site-service-bronze: #ffe29a;
  --site-service-bronze-bright: #fff4c7;
}

.site-accessibility-mode .global-service-button,
.site-accessibility-mode .global-service-drawer {
  border-color: rgba(255, 224, 154, .72);
}

.site-quality-light * {
  text-shadow: none !important;
}

.site-quality-light .global-service-drawer,
.site-quality-light .global-service-menu {
  backdrop-filter: none !important;
}

.site-cursor-standard *,
.site-cursor-standard a,
.site-cursor-standard button {
  cursor: auto !important;
}

.site-cursor-standard #batCursor,
.site-cursor-standard .bat-cursor {
  display: none !important;
}

.site-service-pointer #batCursor,
.site-service-pointer .bat-cursor {
  display: none !important;
}

.site-service-pointer .global-service-menu,
.site-service-pointer .global-service-menu *,
.site-service-pointer .global-service-drawer,
.site-service-pointer .global-service-drawer *,
.site-service-pointer .site-guide-button,
.site-service-pointer .site-guide-button *,
.site-service-pointer .site-guide-panel,
.site-service-pointer .site-guide-panel * {
  cursor: auto !important;
}

.site-service-pointer .global-service-button:not(:disabled),
.site-service-pointer .global-service-drawer button:not(:disabled),
.site-service-pointer .global-service-drawer select,
.site-service-pointer .global-service-drawer input,
.site-service-pointer .site-guide-button:not(:disabled),
.site-service-pointer .site-guide-panel button:not(:disabled) {
  cursor: pointer !important;
}

.site-animations-off *,
.site-animations-off *::before,
.site-animations-off *::after {
  animation-play-state: paused !important;
  transition-duration: .001ms !important;
}

.site-animations-off .war-projection-hitbox,
.site-animations-off .lyric-projection-hitbox,
.site-animations-off .tales-projection-hitbox,
.site-animations-off .city-projection-hitbox,
.site-animations-off .misc-projection-hitbox {
  pointer-events: none !important;
}

.site-animations-off .war-projection-system,
.site-animations-off .lyric-projection-system,
.site-animations-off .tales-projection-system,
.site-animations-off .city-projection-system,
.site-animations-off .misc-projection-system {
  opacity: 0 !important;
  visibility: hidden !important;
}

.site-guide-button {
  position: fixed;
  z-index: 11800;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid rgba(190, 145, 82, .46);
  border-radius: 24px;
  background: rgba(7, 6, 5, .76);
  color: #d7b77e;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  cursor: pointer;
}

.site-guide-button span:first-child {
  font-size: 22px;
}

.site-guide-panel {
  position: fixed;
  z-index: 12100;
  left: max(18px, env(safe-area-inset-left));
  bottom: 72px;
  width: min(410px, calc(100vw - 36px));
  padding: 22px;
  border: 1px solid rgba(192, 145, 80, .58);
  border-radius: 8px;
  background: rgba(9, 7, 6, .96);
  color: #dbc297;
  box-shadow: 0 18px 45px rgba(0, 0, 0, .68);
}

.site-guide-panel[hidden] {
  display: none;
}

.site-guide-panel h2 {
  margin: 0 0 9px;
  color: #e0c18a;
  font-size: 24px;
  font-weight: 400;
}

.site-guide-panel p,
.site-guide-panel li {
  font: 14px/1.5 Arial, sans-serif;
}

.site-guide-panel ol {
  padding-left: 21px;
}

.site-guide-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

@media (max-width: 700px), (max-height: 580px) {
  :root { --site-service-scale: .86; }
  .global-service-menu { right: 7px; bottom: 7px; gap: 4px; padding: 5px; }
  .global-service-drawer {
    right: 62px;
    bottom: 7px;
    width: min(345px, calc(100vw - 74px));
    max-height: calc(100vh - 14px);
  }
  .site-guide-button { left: 8px; bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .global-service-button,
  .global-service-drawer,
  .global-toggle::after {
    transition: none;
  }
}
