:root {
  --base-color: 216, 216, 216;
  --alt-color: 255, 255, 157;
  --base-bg-color: 45, 17, 23;
  --shadow-color: black;
  --base-gradient: linear-gradient(to bottom, rgb(216, 216, 216) 0% 100%);
  --alt-gradient: linear-gradient(to bottom, rgb(216, 173, 173) 0% 100%);
  --base-gradient-b: linear-gradient(to bottom, rgb(216, 216, 216) 0% 100%);
  --alt-gradient-b: linear-gradient(to bottom, rgb(216, 173, 173) 0% 100%);
  --svg-base-gradient: url(#baseGradient);
  --svg-alt-gradient: url(#altGradient);
  --svg-shadow: url(#dropShadow);
  --base-color-image-url: url('images/ui/2kki/system1/font1.png');
  --container-bg-image-url: url('images/ui/2kki/system1/containerbg.png');
  --border-image-url: url('images/ui/2kki/system1/border.png');

  --modal-base-color: var(--base-color);
  --modal-alt-color: var(--alt-color);
  --modal-base-bg-color: var(--base-bg-color);
  --modal-shadow-color: var(--shadow-color);
  --modal-base-gradient: var(--base-gradient);
  --modal-alt-gradient: var(--alt-gradient);
  --modal-base-gradient-b: var(--base-gradient-b);
  --modal-alt-gradient-b: var(--alt-gradient-b);
  --modal-svg-base-gradient: var(--base-svg-gradient);
  --modal-svg-alt-gradient: var(--alt-svg-gradient);
  --modal-svg-shadow: var(--svg-shadow);
  --modal-base-color-image-url: var(--base-color-image-url);
  --modal-container-bg-image-url: var(--container-bg-image-url);
  --modal-border-image-url: var(--border-image-url);

  --party-base-color: var(--base-color);
  --party-alt-color: var(--alt-color);
  --party-base-bg-color: var(--base-bg-color);
  --party-shadow-color: var(--shadow-color);
  --party-base-gradient: var(--base-gradient);
  --party-alt-gradient: var(--alt-gradient);
  --party-svg-base-gradient: var(--base-svg-gradient);
  --party-svg-alt-gradient: var(--alt-svg-gradient);
  --party-svg-shadow: var(--svg-shadow);
  --party-container-bg-image-url: var(--container-bg-image-url);
  --party-border-image-url: var(--border-image-url);

  --rank-exp: 0;
  --rank-total-exp: 100;
  --week-exp: 0;

  --row-level-bp: 0;
  --row-level-total-bp: 1000;
  --col-level-bc: 0;
  --col-level-total-bc: 50;
  --screenshot-slot-level-bp: 0;
  --screenshot-slot-level-total-bp: 100;

  --location-width: 0;

  --content-height: 0;
  --content-scroll: 0;

  --canvas-scale: 1;

  --toast-offset: 0;
}

@font-face {
  font-family: 'PGothic';
  src: local('MS PGothic'),
       local('ＭＳ Ｐゴシック'),
       url('fonts/ms-pgothic.woff2') format('woff2'),
       url('fonts/ms-pgothic.woff') format('woff');
}

@font-face {
  font-family: 'Verdana-Cyrillic';
  src: local('Verdana');
  size-adjust: 84%;
  unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}

@font-face {
  font-family: 'JF-Dot-Shinonome12';
  src: url('fonts/JF-Dot-Shinonome12.ttf');
}

html, input, textarea, select, .checkbox, button.checkboxButton, button[type="button"], button[type="submit"] {
  font-family: 'Verdana-Cyrillic', 'PGothic', 'sans-serif';
  font-size: 16px;
}

html, input, textarea, select, .checkbox, button.checkboxButton, button[type="button"], button[type="submit"] {
  color: rgb(var(--base-color)) !important;
  background-color: black;
}

html {
  overflow-y: hidden;
}


#chatBorder, .toast, input, textarea, select, .checkbox, button.checkboxButton, button[type="button"], button[type="submit"] {
  border: 12px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
}

#crashFix {
  position: fixed;
  z-index: 100;
  display: none;
}

textarea {
  height: 38px;
  resize: none;
}

svg {
  overflow: visible;
}

label {
  font-weight: bold;
}

input, textarea, select, .checkbox, button.checkboxButton, button[type="button"], button[type="submit"] {
  background-color: rgb(var(--base-bg-color)) !important;
  text-shadow: 1.5px 1.5px rgb(var(--shadow-color));
}

input, select {
  position: relative;
}

input[type='number'] {
  width: 64px;
}

select {
  overflow-y: auto;
}

select option:checked {
  background: rgba(var(--alt-color), 0.5) !important;
}

input.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 128px;
  height: 2px;
  padding: 0 0px;
  outline: none;
}

input.slider::-webkit-slider-runnable-track {
  margin: 0 -8px;
}

input.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 8px solid transparent;
  border-image: var(--border-image-url) 6 round !important;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  cursor: pointer;
}

input.slider::-moz-range-thumb {
  width: 0;
  height: 0;
  background: transparent;
  border: 8px solid transparent;
  border-image: var(--border-image-url) 6 round !important;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  cursor: pointer;
}

button.checkboxButton, button[type="button"], button[type="submit"] {
  cursor: pointer;
  -webkit-appearance: button;
  appearance: button;
}

button[type="button"]:disabled {
  cursor: not-allowed;
  opacity: 0.625;
}

.checkbox, button.checkboxButton {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  width: 38px;
  height: 38px;
  font-size: 18px;
  padding: 4px;
}

.checkbox {
  width: 6px;
  height: 6px;
}

.checkbox > span:after, button.checkboxButton > span:after {
  content: "";
}

.checkbox.toggled > span:after, button.checkboxButton:not(.inverseToggle).toggled > span:after, button.checkboxButton.inverseToggle:not(.toggled) > span:after {
  content: "✔";
}

body, .container, div, input, .checkbox, button.checkboxButton, button[type="button"], button[type="submit"] {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

body {
  margin: 0;
}

.modal form {
  text-align: center;
  padding-bottom: 8px;
}

.hidden {
  display: none !important;
  content-visibility: hidden;
}

.unselectable {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.nowrap {
  white-space: nowrap;
}

.emoji {
  -webkit-text-fill-color: white;
}

.spoiler:not(.show) .emoji {
  -webkit-text-fill-color: transparent;
}

.spoiler:not(.show):not(.screenshotItem:hover) a {
  opacity: 0;
  pointer-events: none;
}

.nofilter, .spoiler.show {
  filter: none !important;
}

.altText, .subTab.active .subTabLabel, .messageContainer.global .message .nameMarker, .notificationCount, a:not(.modalClose):not(.listEntryAction) {
  background-image: var(--alt-gradient) !important;
}

.messageContainer.party .message .nameMarker {
  color: rgb(var(--party-alt-color)) !important;
  filter: drop-shadow(1.5px 1.5px rgb(var(--party-shadow-color)));
  background-image: var(--party-alt-gradient) !important;
}

.baseColorBg {
  background-color: rgb(var(--base-color)) !important;
}

.baseColorFill {
  fill: rgb(var(--base-color)) !important;
}

.pointer {
  cursor: pointer;
}

.container.fullBg {
  background-size: 674px;
}

.scrollableContainer {
  height: 100%;
  overflow-y: auto;
}

.infiniteScrollContainer {
  transition: padding 0.5s ease-in-out;
  padding-top: 0px;
  scrollbar-gutter: stable;
}

.infiniteScrollContainer.scrollToRefresh {
  padding-top: 16px;
}

.infiniteScrollContainer:not(.end) {
  padding-bottom: 32px;
}

.infiniteScrollRefreshIndicator {
  position: sticky;
  background-color: rgba(var(--modal-shadow-color), 0.5);
  margin-inline-end: 16px;
  margin-bottom: -32px;
  padding: 8px;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
  z-index: 1;
}

.infiniteScrollRefreshIndicator.transparent {
  opacity: 0;
}

.infiniteScrollRefreshIndicator label {
  padding: 4px;
}

.uiControls {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.uiControls.wrap {
  flex-wrap: wrap;
}

.uiControl {
  text-align: center;
}

.uiControls .uiControl {
  margin: 0 8px;
}

.uiControls.wrap .uiControl {
  margin-top: 4px;
  margin-bottom: 4px;
}

.info {
  display: flex;
  padding-bottom: 8px;
}

.infoMessage {
  background-color: rgb(var(--base-bg-color));
}

@media (hover: hover) {
  .iconButton, a.fillIcon, .chatboxTabLabel, .item:not(.disabled), a.listEntryAction .icon, .modalTabLabel, a.rankingPageLink, button.checkboxButton, button[type="button"]:not(:disabled), button[type="submit"], .ynomojiButton, .iconLink {
    transition: transform 0.125s cubic-bezier(0.7, 0, 0.7, 1.5);
  }

  .iconButton:hover, a.fillIcon:hover, a.listEntryAction:hover .icon, a.rankingPageLink:hover, .ynomojiButton:hover, .iconLink:hover {
    transform: scale(1.25);
  }

  #nexusButton:hover, .chatboxTab:hover .chatboxTabLabel, .item:not(.disabled):hover, .modalTab:hover .modalTabLabel, button.checkboxButton:hover, button[type="button"]:not(:disabled):hover, button[type="submit"]:hover {
    transform: scale(1.1);
  }
}

.iconButton, .iconLink {
  background: transparent;
  border: none;
  cursor: pointer;
  -webkit-appearance: button;
  appearance: button;
}

.iconButton path, .icon path, .icon circle {
  stroke: var(--svg-base-gradient);
  filter: var(--svg-shadow);
}

.iconButton.altIcon path, .icon.altIcon path, .iconButton:not(.toggleButton).toggled path, .iconButton.altToggleButton.toggled path, .iconButton button:not(.toggleButton).preToggled path, .iconButton.offToggleButton.toggled path:last-child, .iconButton.offToggleButton.preToggled path:last-child, .iconButton.onToggleButton:not(.toggled):not(.preToggled) path:last-child {
  stroke: var(--svg-alt-gradient);
}

.iconButton.transparentToggleButton.toggled path:first-child, .iconButton.fadeToggleButton:not(.toggled) path:first-child {
  opacity: 0.5;
}

.iconLink {
  display: inline-block;
  filter: none !important;
}

.iconLink svg {
  width: 12px;
  height: 12px;
}

.iconButton.fadeToggle:not(.toggled) path {
  opacity: 0.5;
}

.iconButton.toggleButton:not(.transparentToggleButton):not(.fadeToggleButton) path:last-child {
  stroke-width: 1.5;
}

.iconButton.offToggleButton:not(.toggled):not(.preToggled) path:last-child, .iconButton.onToggleButton.toggled path:last-child, .iconButton.onToggleButton.preToggled path:last-child, #globalMessageButton.toggled path:last-child {
  display: none;
}

.icon path {
  fill: none;
}

.fillIcon path {
  stroke: none;
  fill: var(--svg-base-gradient);
}

.fillIcon.altIcon path, .iconButton.fillIcon.altToggleButton.toggled path {
  fill: var(--svg-alt-gradient);
}

.fillIcon.invertFillIcon {
  fill-rule: evenodd;
}

.notice, .instruction {
  text-align: center;
  width: fit-content;
  margin: auto;
}

.notice {
  display: block;
  font-weight: bold;
}

.infoText {
  width: 100%;
  word-break: keep-all;
}

.infoContainer .infoText {
  width: unset;
}

.imageThumbnail {
  width: 160px;
  height: 120px;
  cursor: pointer;
}

.toastMessage > .imageThumbnail {
  display: block;
  margin: 0 auto 8px auto;
}

.imageItem {
  width: 176px;
  margin-bottom: 0 !important;
  opacity: 1;
  transition: opacity 0.325s ease-in-out, transform 0.125s cubic-bezier(0.7, 0, 0.7, 1.5) !important;
}

.imageItem.hideContents {
  opacity: 0;
  content-visibility: hidden;
}

.imageControls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 152px;
  margin-top: -8px;
  padding: 8px 4px 4px 4px;
}

.imageItem .imageThumbnailContainer {
  display: inline-block;
  height: 120px;
}

.imageItem.spoiler .imageThumbnail {
  filter: blur(8px);
  transition: filter 0.125s cubic-bezier(0.7, 0, 0.7, 1.5);
}

.imageItem.spoiler:hover .imageThumbnail {
  filter: blur(2px);
}

.imageItem .spoilerLabel {
  display: block;
  margin: -69px 0 50px 0;
  pointer-events: none;
}

.imageItem:not(.spoiler) .spoilerLabel {
  display: none;
  content-visibility: hidden;
}

.imageItem .imageThumbnailContainer, .imageItem > .imageControls {
  border: 8px solid transparent !important;
  border-image: var(--border-image-url) 4 repeat !important;
}

.imageItem > .imageControls {
  background-color: rgb(var(--base-bg-color));
  border-top: none !important;
}

.screenshot + .imageControls {
  justify-content: space-around;
  width: 240px;
  padding: 0 32px;
  background: linear-gradient(90deg, rgba(var(--modal-shadow-color), 0) 0%, rgba(var(--modal-shadow-color), 0.325) 12.5%, 87.5%, rgba(var(--modal-shadow-color), 0) 100%);
  margin-top: -64px;
}

.imageControls .icon {
  width: 24px;
  margin: 2px 0 -2px 0;
}

.screenshot + .imageControls .icon {
  width: 36px;
}

.imageControls .publicToggle:not(.toggled) {
  opacity: 0.5;
}

.imageControls .publicToggle:not(.toggled) + .likeContainer, .imageControls .publicToggle:not(.toggled) + .likeContainer + .spoilerToggle {
  display: none;
  content-visibility: hidden;
}

.imageControls .likeContainer, .imageControls .imageCountContainer {
  display: flex;
  align-items: center;
}

.imageControls .playerCountContainer:first-child {
  width: 100%;
    justify-content: right;
}

.imageControls .likeContainer > .likeCount, .imageControls .imageCountContainer > .imageCount {
  margin-inline-start: 8px;
  font-size: large;
  font-weight: bold;
}

.imageControls .playerCountContainer > .playerCount {
  margin-inline-start: 0;
}

.screenshot + .imageControls .likeContainer > .likeCount, .screenshot + .imageControls .imageCountContainer > .imageCount {
  font-size: x-large;
}

.imageItem > .imageItemLocation {
  display: block;
  margin: auto;
  width: fit-content;
}

.imageItem.spoiler > .imageLocation {
  border: 1px solid rgb(var(--base-color));
  pointer-events: all;
  cursor: pointer;
}

.imageItem.spoiler > .imageItemLocation {
  background: transparent !important;
  transition: background-color 0.125s cubic-bezier(0.7, 0, 0.7, 1.5);
}

.imageItem.spoiler:not(:hover) > .imageItemLocation {
  background: rgb(var(--shadow-color)) !important;
}

.imageItem.spoiler > .imageItemLocation > * {
  transition: opacity 0.125s cubic-bezier(0.7, 0, 0.7, 1.5);
}

.imageItem.spoiler:not(:hover) > .imageItemLocation > * {
  opacity: 0;
}

.imageItem > .nameTextContainer, .imageItem > .imageControls + .imageItemLocation {
  padding-top: 4px;
}

#fontStyle {
  color: rgb(var(--base-color)) !important;
}

#fontStyle > option {
  color: rgb(var(--modal-base-color));
}

.eventListEntry {
  min-width: fit-content;
}

#messages {
  overscroll-behavior: none;
}

#chatbox.partyChat #messages::-webkit-scrollbar-track, #chatbox.partyPlayers #partyPlayerList::-webkit-scrollbar-track {
  border-image-source: var(--party-border-image-url) !important;
  background-color: rgb(var(--party-base-bg-color));
}

#chatbox.partyChat #messages::-webkit-scrollbar-thumb, #chatbox.partyPlayers #partyPlayerList::-webkit-scrollbar-thumb {
  border-image-source: var(--party-border-image-url) !important;
}

#chatbox.partyChat #messages, #chatbox.partyPlayers #partyPlayerList {
  scrollbar-color: rgb(var(--party-base-color)) rgb(var(--party-base-bg-color));
}

#chatbox.partyChat #messages.fullBg, #chatbox.partyPlayers #partyPlayerList.fullBg {
  background-size: auto calc(100% + 6px) !important;
  background-position: 0 -6px !important;
}

#chatbox.partyChat #messages .iconButton path, #chatbox.partyChat #chatInput .icon circle {
  stroke: var(--party-svg-base-gradient);
  filter: var(--party-svg-shadow);
}

#chatbox.partyChat #messages .iconButton.altIcon path {
  stroke: var(--party-svg-alt-gradient);
}

#chatbox.partyChat #messages .infoLabel, #chatbox.partyChat #messages .messageContents {
  background-image: var(--party-base-gradient) !important;
  filter: drop-shadow(1.5px 1.5px rgb(var(--party-shadow-color)));
}

#chatbox.partyChat #messages .messageContainer, #chatbox.partyChat #chatBorder {
  border-image-source: var(--party-border-image-url) !important;
}

#chatbox.partyChat #messages .messageContainer.highlight {
  background: rgba(var(--party-alt-color), 0.5);
}

#chatbox.partyChat #messages .messageContainer .playerLocation a {
  background-image: var(--party-alt-gradient) !important;
}

#chatbox.partyChat #chatInput {
  color: rgb(var(--party-base-color)) !important;
  background-color: rgb(var(--party-base-bg-color)) !important;
  text-shadow: 1.5px 1.5px rgb(var(--party-shadow-color));
}

#background {
  position: fixed;
  width: 100%;
  height: 100%;
  background-size: 210px;
  background-position-y: calc(-16px - var(--content-scroll) * 0.25);
  background-image: var(--container-bg-image-url) !important;
  z-index: -1;
}

body.fullBg #background {
  background-size: 100%;
}

#backgroundOverlay {
  position: fixed;
  background-color: black;
  width: 100%;
  height: 100%;
  opacity: 0.325;
  z-index: -1;
}

#backgroundTransition {
  background: linear-gradient(0deg, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
  height: 150px;
  margin: -128px -8px -16px -8px;
  scroll-snap-align: end;
}

#layoutEnd {
  width: 100%;
  height: 8px;
  scroll-snap-align: end;
}

#loadingOverlay {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: black;
  opacity: 1;
  z-index: 20;
  -webkit-transition: opacity 0.5s cubic-bezier(0.33, 1, 0.68, 1);
  -moz-transition: opacity 0.5s cubic-bezier(0.33, 1, 0.68, 1);
  -o-transition: opacity 0.5s cubic-bezier(0.33, 1, 0.68, 1);
  transition: opacity 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}

#loadingOverlay.loaded {
  opacity: 0;
  pointer-events: none;
}

.versionDisplay {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
}

.versionDisplay.transparent {
  opacity: 0;
}

.versionDisplay .versionDisplaySuffix {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}

.versionDisplay .versionDisplaySuffix > span:first-child {
  padding-bottom: 4px;
  transition: margin 0.625s cubic-bezier(0.7, 0, 0.7, 1.5);
}

.versionDisplayZoom {
  margin-top: -100vh;
  transition: opacity 1s cubic-bezier(0.33, 1, 0.68, 1), transform 1s cubic-bezier(0.33, 1, 0.68, 1);
  transform: scale(1);
  opacity: 0.625;
}

.versionDisplayZoom.zoom {
  transform: scale(1.25);
}

#content {
  height: 100vh;
  padding: 0 8px 8px 8px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
}

#top {
  height: 8px;
  scroll-snap-align: start;
}

#bottom {
  position: relative;
  height: calc(100vh - var(--content-height));
  background-color: black;
  margin: 0 -8px;
}

#header, #layout {
  display: flex;
  margin: 0 auto;
  max-width: 1036px;
}

#header, .container, .modal {
  background-size: 70px;
  background-position-y: -16px;
  background-image: var(--container-bg-image-url) !important;
  border-image: var(--border-image-url) 10 repeat !important;
  border: 24px solid transparent;
}

.container {
  border-top: none;
  padding-top: 16px;
}

#header {
  position: relative;
  flex-wrap: wrap;
  justify-content: space-between;
  min-height: 48px;
  max-width: 980px;
  border: 12px solid transparent;
  border-image-width: 2 !important;
  padding: 12px 16px 0px 16px;
}

#headerLogoContainer, #headerIconContainer {
  padding-bottom: 12px;
}

#headerLogoContainer {
  display: flex;
}

#nexusButton {
  display: inline-flex;
  padding: 0 4px;
  z-index: 1;
}

#content:not(.downscale) #nexusButton {
  margin-inline-end: 8px;
}

#content.downscale #nexusButton {
  margin-inline-start: -6px;
}

#content.downscale #nexusButton svg:first-child, #content.downscale #nexusButton svg:nth-child(2), #content:not(.downscale) #nexusButton svg:last-child {
  display: none;
}

#content #nexusButton svg:nth-child(2) {
  position: relative;
  left: 7px;
}

#nexusButton:not(:hover) svg:not(:first-child) path:last-child, #nexusButton:hover svg:not(:first-child) path:first-child {
  display: none;
}

#nexusButton path {
  stroke-width: 0.5;
}

#gameLogoContainer {
  display: inline-flex;
  flex-direction: column;
  margin: auto 0;
  padding-inline-start: 8px;
}

#gameLogo {
  position: relative;
  -webkit-transition: opacity 0.15s ease-in-out;
  -moz-transition: opacity 0.15s ease-in-out;
  -o-transition: opacity 0.15s ease-in-out;
  transition: opacity 0.15s ease-in-out;
  background-size: cover;
  image-rendering: pixelated;
}

#gameLogo.transparent {
  opacity: 0;
}

#gameLogoOverlay {
  width: 100%;
  height: 100%;
  background-image: var(--base-gradient-b) !important;
  -webkit-mask-size: cover;
  mask-size: cover;
}

#headerIconContainer, #footerIconContainer {
  display: flex;
  align-items: center;
}

#headerIconContainer .iconButton {
  margin-inline-end: 8px;
}

#footerIconContainer {
  justify-content: center;
  margin-top: 16px;
  margin-inline-start: 8px;
}

#footerIconContainer .icon {
  padding: 0 4px;
}

#layout {
  width: 100%;
  overflow: hidden;
  scroll-snap-align: start;
}

#layout::-webkit-scrollbar, .scrollableContainer::-webkit-scrollbar, .modalContent::-webkit-scrollbar, select::-webkit-scrollbar {
  width: 18px;
}

#layout::-webkit-scrollbar-track, .scrollableContainer::-webkit-scrollbar-track, .modalContent::-webkit-scrollbar-track, select::-webkit-scrollbar-track {
  border: 8px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
  background-color: rgb(var(--base-bg-color));
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

#layout::-webkit-scrollbar-thumb, .scrollableContainer::-webkit-scrollbar-thumb, .modalContent::-webkit-scrollbar-thumb, select::-webkit-scrollbar-thumb {
  border: 8px solid transparent;
  border-image: var(--border-image-url) 6 round !important;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

#layout, .scrollableContainer, .modalContent, select {
  scrollbar-color: rgb(var(--base-color)) rgb(var(--base-bg-color));
  scrollbar-width: 18px;
}

#content.downscale .container.fullBg {
  background-size: 530px;
}

#content.downscale2 .container.fullBg {
  background-size: 410px;
}

#mainContainer {
  display: flex;
  flex-direction: column;
  width: calc(100% - 48px);
  z-index: 2;
}

/* Fix for a fullscreen bug that shifts the game canvas when focus is changed */
#layout:fullscreen #mainContainer {
  padding-top: 0px;
}

#content.noSideBorders #header, #content.noSideBorders #mainContainer {
  border-inline-start-width: 0;
  border-inline-end-width: 0;
  width: 100%;
}

#content.noSideBorders #header {
  width: calc(100% - 32px);
}

#content.noSideBorders #layout:not(:fullscreen) #chatboxContainer {
  border-inline-start-width: 0;
  border-inline-end-width: 0;
  width: 100%;
}

/* Ignore :fullscreen on iOS since it's not supported */
@supports (-webkit-touch-callout: none) {
  #content.noSideBorders #chatboxContainer {
    border-inline-start-width: 0;
    border-inline-end-width: 0;
    width: 100%;
  }
}

#controls, #leftControls {
  width: 100%;
}

#controls, #rightControls {
  display: flex;
  justify-content: right;
}

#controls {
  z-index: 10;
  opacity: 1;
}

#layout:fullscreen #controls.fshidden {
  -webkit-transition: opacity 0.5s ease-in-out;
  -moz-transition: opacity 0.5s ease-in-out;
  -o-transition: opacity 0.5s ease-in-out;
  transition: opacity 0.5s ease-in-out;
  opacity: 0;
}

#explorerControls, #mapControls {
  display: flex;
}

#controls-fullscreen {
  margin-bottom: 8px;
}

#leftControls button, #rightControls > div > button {
  margin-inline-end: 8px;
  margin-bottom: 8px;
}

#layout:not(:fullscreen) #controls {
  height: 24px;
  margin-bottom: -24px;
  position: relative;
}

/* Ignore :fullscreen on iOS since it's not supported */
@supports (-webkit-touch-callout: none) {
  #controls {
    height: 24px;
    margin-bottom: -24px;
    position: relative;
  }
}

#controls button {
  padding-inline-end: 1px;
}

#controls svg {
  pointer-events: none;
}

#canvasContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

#canvas {
  display: block;
  top: 0;
  margin: 0 auto;
  min-width: 320px;
  width: 640px;
  max-width: calc(100vw - 64px);
  min-height: 240px;
  height: 480px;
  max-height: calc((100vw - 64px) * 0.75);
  border: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  outline: none;
}

#game_frame {
  display: block;
  width: 100%;
  height: 480px;
  margin: 0 auto;
}

#content.downscale #layout:not(:fullscreen) canvas {
  width: 480px;
  height: 360px;
  image-rendering: auto;
}

#content.downscale2 #layout:not(:fullscreen) canvas {
  width: 320px;
  height: 240px;
}

#layout:fullscreen canvas.fsnocursor {
  cursor: none !important;
}

/* Ignore :fullscreen on iOS since it's not supported */
@supports (-webkit-touch-callout: none) {
  #content.downscale canvas {
    width: 480px;
    height: 360px;
    image-rendering: auto;
  }
  
  #content.downscale2 canvas {
    width: 320px;
    height: 240px;
  }
}

#content.noSideBorders #canvas {
  max-width: calc(100vw - 16px);
  max-height: calc((100vw - 16px) * 0.75);
}

#gameChatContainer {
  position: absolute;
  font-family: 'JF-Dot-Shinonome12';
  font-size: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  pointer-events: none;
  transform-origin: top left;
  transform: scale(var(--canvas-scale));
}

#content.downscale #layout:not(:fullscreen) #gameChatContainer {
  transform: scale(calc(var(--canvas-scale) * 0.75));
}

#content.downscale2 #layout:not(:fullscreen) #gameChatContainer {
  transform: scale(calc(var(--canvas-scale) * 0.5));
}

#gameChatContainer > .gameChatMessageContainer {
  width: fit-content;
  padding: 4px;
  background-color: rgba(var(--shadow-color), 0.5);
}

#gameChatContainer > .gameChatMessageContainer.fade {
  transition: opacity 1s ease-in-out;
}

#gameChatContainer > .gameChatMessageContainer.fade, #gameChatContainer > .gameChatMessageContainer.expired {
  opacity: 0;
}

#gameChatContainer:not(.focused) > #gameChatInputContainer {
  display: none;
}

#gameChatContainer.focused > .gameChatMessageContainer {
  opacity: 1 !important;
}

#gameChatContainer > .gameChatMessageContainer.blockedHidden {
  display: none !important;
}

#gameChatContainer #gameChatInput {
  outline: 0px solid transparent;
}

#gameChatModeIcon {
  margin-inline-end: 6px;
}

#locationDisplayContainer {
  position: absolute;
  font-family: 'JF-Dot-Shinonome12';
  height: 48px;
  margin-top: calc(-48px * var(--canvas-scale));
  pointer-events: none;
  transform-origin: top left;
  transform: scale(var(--canvas-scale));
  clip-path: inset(48px 0px 0px 0px);
  transition: margin-top 0.325s ease-in-out, clip-path 0.325s ease-in-out;
}

#locationDisplayContainer.visible {
  margin-top: 0px;
  clip-path: inset(0px 0px 0px 0px);
}

#locationDisplayContainer.fast {
  transition: margin-top 0.1s ease-in-out, clip-path 0.1s ease-in-out;
}

#locationDisplayLabelContainer {
  height: 24px;
  background-image: var(--container-bg-image-url) !important;
  border: 12px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
}

#locationDisplayLabelContainerOverlay {
  width: 100%;
  height: 48px;
  margin-top: -48px;
  mix-blend-mode: color;
}

#locationDisplayLabel, #locationDisplayLabelOverlay {
  font-size: x-large;
  font-weight: normal;
  white-space: pre;
}

#locationDisplayLabelOverlay {
  display: block;
  margin-top: -36px !important;
  margin-inline-start: 12px;
  -webkit-background-clip: unset;
  background-clip: unset;
  background-image: none !important;
  -webkit-text-fill-color: unset;
  mix-blend-mode: color;
  filter: none;
}

#uiControls {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 16px;
}

#chatboxContainer {
  min-height: 240px;
  border-inline-start: none;
  padding-inline-start: 8px;
  z-index: 1;
}

#content:not(.loggedIn) #layout.hideChat #chatboxContainer, #layout.hideChat:not(.explorer) #chatboxContainer, #layout.hideChat #globalChatButton {
  display: none !important;
}

#content.loggedIn #layout.hideChat.explorer #chatbox {
  display: none !important;
}

#chatbox {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#chatboxInfo {
  display: flex;
  flex-direction: column;
}

#connStatusIcon {
  background: linear-gradient(#b30000, #800000);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#connStatusIcon.connecting {
  background-image: linear-gradient(#b35900, #804000);
}

#connStatusIcon.connected {
  background-image: linear-gradient(#00b33c, #00802b);
}

#connStatusIcon.privateMode {
  background-image: linear-gradient(#595959, #404040);
}

#connStatusText {
  margin-inline-end: 2px;
}

#reconnectButton {
  opacity: 1;
}

#reconnectButton.active {
  animation-name: spin;
  animation-delay: 0.325s;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}

#reconnectButton.disabled {
  opacity: 0.625;
  transform: scale(1);
  pointer-events: none;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

#locationLabel, #nextLocationLabel {
  height: fit-content;
}

#locationLabel {
  padding-inline-start: 22px;
}

#locationText, #nextLocationText {
  text-align: end;
}

#nextLocationContainer {
  display: flex;
  height: min-content;
}

#nextLocation {
  overflow: hidden;
  transition: max-height 0.325s ease-in-out, padding 0.325s ease-in-out;
  max-height: 128px;
  transform-origin: top;
  width: -webkit-fill-available;
  width: -moz-available;
  width: fill-available;
}

#nextLocationContainer.hideContents #nextLocation {
  max-height: 0;
  padding-bottom: 0;
}

#nextLocationLabel {
  padding-inline-start: 4px;
}

#toggleNextLocationButton {
  transition: margin-top 0.5s ease-in-out, padding 0.5s ease-in-out;
  align-self: baseline;
  padding: 0 4px 0 0;
  z-index: 1;
}

#nextLocationContainer.hideContents #toggleNextLocationButton {
  margin-top: -22px;
}

#chatboxContent {
  display: contents;
}

#chatboxTabs {
  display: flex;
  height: 0;
}

.chatboxTab {
  display: flex;
  flex-wrap: wrap;
  height: 22px;
  padding: 4px;
  padding-bottom: 0;
  margin-inline-end: 4px;
  border-bottom-width: 8px;
  pointer-events: all;
  cursor: pointer;
}

.chatboxTab.active {
  padding-bottom: 10px;
  border-bottom-width: 0;
  background-size: 70px;
  background-image: var(--container-bg-image-url) !important;
  z-index: 2;
  pointer-events: none;
  cursor: default;
}

.chatboxTabLabel {
  pointer-events: none;
  font-weight: normal;
}

.chatboxTabSection {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-top: 40px;
}

.chatboxTabSection {
  overflow: hidden;
}

.tabHeader {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-height: 18px;
}

#content:not(.loggedIn):not(.inParty) #playersHeader {
  display: none;
}

.subTabs {
  display: flex;
}

.subTab, .tabButtons button {
  padding: 2px 2px 0 0;
  pointer-events: all;
  cursor: pointer;
}

.subTab.active {
  cursor: default;
}

.subTab .subTabLabel {
  padding: 0 8px;
}

.subTab.unread .subTabLabel {
  font-weight: bold;
  padding: 0 7px;
}

#content:not(.inParty) .partySubTab, #content.inParty #createPartyButton, #content:not(.inParty) #disbandPartyButton, #content:not(.partyOwner) #disbandPartyButton {
  display: none;
}

.subTabBg {
  position: relative;
  width: 100%;
  height: 100%;
  top: -100%;
  border-radius: 4px 4px 0 0;
  background-image: var(--base-gradient) !important;
  opacity: 0;
  z-index: -1;
}

.subTab:hover .subTabBg {
  opacity: 0.1;
}

.subTab.active .subTabBg {
  opacity: 0.25;
}

.notificationCount {
  filter: drop-shadow(1.5px 1.5px rgb(var(--shadow-color)));
}

.chatboxTabContent, .chatboxTabContent > .divider {
  border-top: 8px solid transparent;
  border-image: var(--border-image-url) 10 repeat !important;
  overflow-x: hidden;
}

.playerList > .listEntryCategoryHeader {
  margin-bottom: 4px;
  border-bottom: 8px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
}

#content:not(.loggedIn):not(.inParty) .playerList, #content.inParty:not(.partyOwner) .partyList {
  border-top: none;
}

.chatboxTabContent > .infoText {
  display: flex;
  justify-content: center;
  padding-bottom: 4px;
}

#chatbox #chatHeader #chatButtons {
  display: flex;
  justify-content: space-between;
  min-width: 72px;
  max-width: 86px;
  flex-grow: 1;
}

#chatbox #messages.hideLocations .playerLocation > *, #chatbox #messages.hideTimestamps .messageTimestamp {
  display: none;
}

#chatbox.mapChat .messageContainer.global, #chatbox.mapChat .messageContainer.party, #chatbox.globalChat .messageContainer:not(.global), #chatbox.partyChat .messageContainer:not(.party), #chatbox:not(.mapChat) .messageContainer.map, #chatbox:not(.friendsPlayers) #friendsPlayerList, #chatbox:not(.partyPlayers) #partyPlayerList, #chatbox.friendsPlayers #playerList, #chatbox.partyPlayers #playerList {
  display: none;
}

#layout:not(:fullscreen) #chatbox .chatboxTabSection, #layout:not(:fullscreen) #chatInputContainer form {
  background-color: rgba(var(--shadow-color), 0.5);
}

#layout:not(:fullscreen) #chatbox.partyChat #chatInputContainer form {
  background-color: rgba(var(--party-shadow-color), 0.5);
}

#chatbox.partyChat #messages, #chatbox.partyPlayers #partyPlayerList {
  background-size: 70px;
  background-position-x: -8px;
  background-position-y: -16px;
  border-image-source: var(--party-border-image-url) !important;
}

#layout:not(:fullscreen) #chatbox.partyChat #messages, #layout:not(:fullscreen) #chatbox.partyPlayers #partyPlayerList {
  background-image: var(--party-container-bg-image-url) !important;
}

/* Ignore :fullscreen on iOS since it's not supported */
@supports (-webkit-touch-callout: none) {
  #chatbox .chatboxTabSection {
    background-color: rgba(var(--shadow-color), 0.5);
  }
  
  #chatbox.partyChat .chatboxTabSection {
    background-color: rgba(var(--party-shadow-color), 0.5);
  }

  #chatbox.partyChat #messages, #chatbox.partyPlayers #partyPlayerList {
    background-image: var(--party-container-bg-image-url) !important;
  }
}

.messageContainer {
  word-wrap: break-word;
  border-bottom: 4px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
}

.messageContainer.highlight {
  background: rgba(var(--alt-color), 0.5);
}

.messageContainer.blockedHidden {
  display: none !important;
}

#chatbox.allChat .lastAllTabMessageInLoc, #chatbox.mapChat .lastMapTabMessageInLoc, .messageContainer.locMessage {
  border-bottom-width: 8px !important;
}

.messageContainer.locMessage {
  text-align: center;
}

.messageContents .spoiler {
  border: 1px solid rgb(var(--base-color));
  pointer-events: all;
  cursor: pointer;
  display: inline-block;
}

.messageContents .spoiler:not(.show) {
  color: rgb(var(--shadow-color));
  background-color: rgb(var(--shadow-color));
  cursor: pointer;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.messageContents .spoiler:not(.show) .screenshotEmbed, #gameChatContainer .spoiler:not(.show) .screenshotEmbed {
  visibility: hidden;
}

.messageContents .ynomojiWrapper {
  display: inline-flex;
  justify-content: center;
  vertical-align: middle;
  width: 16px;
  height: 16px;
  padding: 0.33px 0;
}

.messageContents.notext .ynomojiWrapper {
  width: 32px;
  height: 32px;
}

.messageContents .spoiler:not(.show) .ynomojiWrapper {
  opacity: 0;
  pointer-events: none;
}

.messageContents .screenshotEmbed, #gameChatContainer .screenshotEmbed {
  max-width: -webkit-fill-available;
  max-width: -moz-available;
  max-width: fill-available;
  height: 120px;
  cursor: pointer;
}

.messageHeader {
  display: flex;
  justify-content: space-between;
  padding-inline-end: 2px;
  direction: ltr;
  font-size: 14px;
}

.playerLocation {
  display: block;
}

.playerLocation.hidden + .message  > .messageContents.notext {
  vertical-align: top;
}

.messageTimestamp {
  white-space: nowrap;
}

.message, .toastMessage {
  word-break: break-word;
  image-rendering: auto;
}

.message .icon, .listEntry .nameText .icon, .gameChatMessage .icon {
  display: inline-block;
  vertical-align: text-top;
  width: 12px;
  height: 12px;
  margin: 0 2px;
}

.nameBadge {
  display: inline-block;
  width: 18.5px;
  height: 18.5px;
  margin-top: -4px;
  margin-inline-start: 2px;
  background-size: contain;
  vertical-align: middle;
}

.nameBadge > .badgeOverlay {
  -webkit-mask-size: contain;
  mask-size: contain;
}

.playerCountLabel {
  cursor: pointer;
}

.medalsContainer {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  max-width: 40px;
  padding: 0 8px;
}

.medal {
  height: 16px;
  margin-inline-start: -8px;
}

.listEntry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-size: 38px;
  background-position: -2px -2px;
  background-image: var(--container-bg-image-url) !important;
  border: 4px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
  padding: 1px;
  margin-bottom: 4px;
}

.listEntry.fullBg {
  background-origin: border-box;
  background-size: contain;
  background-position: 0;
}

.playerListEntry.offline {
  opacity: 0.5;
}

.listEntry > .listEntryMain {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-inline-end: auto;
}

.playerListEntryBadge {
  min-width: 37px;
  height: 37px;
  margin: -5px 0 -5px;
  margin-inline-end: 4px;
  background-size: cover;
}

.listEntrySprite {
  margin-inline-end: 8px;
  min-width: 40px;
  min-height: 32px;
}

.listEntrySprite.offline {
  opacity: 0.5;
}

.listEntry .detailsContainer {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

.playerListEntry.detailsContainer, .listEntry .nameTextContainer {
  width: 100%;
}

.nameTextContainer .icon {
  display: inline-block;
  vertical-align: text-top;
  width: 12px;
  height: 12px;
  margin: 0 2px;
}

.confirmMessage .nameTextContainer, .toastMessage .nameTextContainer {
  display: inline;
}

.nameText {
  image-rendering: auto;
}

.listEntry .nameText {
  width: 100%;
  background-image: var(--base-color-image-url) !important;
  filter: drop-shadow(1.5px 1.5px rgb(var(--shadow-color)));
}

.listEntry .partyNameContainer {
  display: flex;
  width: 100%;
}

.partyNameContainer .nameText {
  height: 18px;
  word-break: break-all;
}

.listEntry .partyListEntryMemberCount {
  display: flex;
  padding-inline-end: 8px;
  float: right;
}

.listEntry .partyListEntryMemberCount .icon {
  width: 12px;
  height: 12px;
}

.listEntry .partyMemberSpritesContainer {
  height: 16px;
  overflow-y: hidden;
}

.listEntry .partyMemberSpritesContainer img {
  min-width: 20px;
  min-height: 16px;
  margin-inline-end: 4px;
}

.listEntryActionContainer {
  display: flex;
}

.listEntryActionContainer .icon {
  width: 24px;
  height: 24px;
  padding: 0 2px;
}

.listEntryActionContainer .icon:first-child {
  padding-inline-start: 8px;
}

.notificationCountContainer {
  width: 0;
  height: 0;
  margin-top: -16px;
  margin-inline-start: -8px;
  z-index: 3;
}

.notificationCount {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 16px;
  height: 16px;
  padding: 2px;
  border-radius: 12px;
}

.notificationCountLabel {
  font-weight: normal;
}

#chatInputContainer, #ynomojiContainer, #enterNameContainer, .chatboxTab, .chatboxTabSection, .modalTab, .infoMessage {
  border: 8px solid transparent;
}

#chatInputContainer {
  display: flex;
  width: auto;
  height: 48px;
  margin-top: 1px;
}

#chatInputContainer form {
  width: 100%;
  margin-inline-start: -6px;
  margin-inline-end: -38px;
  padding-inline-start: 6px;
  padding-inline-end: 6px;
}

#chatbox.allChat #chatInputContainer.globalCooldown form {
  margin-inline-end: -56px;
}

#chatInput, #nameInput {
  pointer-events: all;
}

#chatInput {
  width: calc(100% - 38px);
  height: 22px;
  right: 8px;
  padding-inline-end: 28px;
  border-image: none !important;
}

html[dir="rtl"] #chatInput {
  right: unset;
  left: 8px;
}

#chatbox.mapChat #chatInputContainer:not(.globalCooldown) #chatInput, #chatbox.globalChat #chatInputContainer:not(.globalCooldown) #chatInput, #chatbox.partyChat #chatInputContainer:not(.globalCooldown) #chatInput {
  width: calc(100% - 13px);
  padding-inline-end: 2px;
}

#chatInput:disabled {
  opacity: 0.675;
}

#chatbox.allChat #chatInputContainer.globalCooldown #chatInput {
  width: calc(100% - 62px);
  padding-inline-end: 52px;
}

.globalCooldownIcon {
  position: relative;
  top: calc(50% - 9px);
  width: 18px;
  height: 18px;
}

.globalCooldownIcon svg {
  stroke-width: 1.5;
}

.globalCooldownIcon .bgCircle {
  opacity: 0.325;
}

.globalCooldownIcon .timerCircle {
  stroke: var(--svg-alt-gradient) !important;
  stroke-dashoffset: 60;
  stroke-dasharray: 0;
  transform: translateY(100%) rotateZ(-90deg);
}

@keyframes timer {
  from {
    stroke-dashoffset: 60;
    stroke-dasharray: 60;
  }
  to {
    stroke-dashoffset: 0;
    stroke-dasharray: 60;
  }
}

#chatInputContainer.globalCooldown .globalCooldownIcon .timerCircle, #gameChatInputContainer.globalCooldown .globalCooldownIcon .timerCircle {
  animation: 5s timer linear;
}

#chatInputContainer:not(.globalCooldown) .globalCooldownIcon, #gameChatInputContainer:not(.globalCooldown) .globalCooldownIcon {
  display: none;
}

#gameChatInputContainer.globalCooldown #gameChatInput {
  margin-inline-start: 12px;
}

#chatbox:not(.allChat) .globalCooldownIcon {
  left: 8px;
}

#globalMessageButton {
  position: relative;
  top: 1px;
  left: 4px;
  pointer-events: all;
}

html[dir="rtl"] #globalMessageButton {
  left: unset;
  right: 4px;
}

#chatbox:not(.allChat) #globalMessageButton {
  display: none;
}

#globalChatInputOverlay, #chatBorder {
  position: relative;
  pointer-events: none;
}

#globalChatInputOverlay {
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  top: calc(-100% + 4px);
  right: 4px;
  padding: 0 8px;
  background-image: var(--alt-gradient-b) !important;
  mix-blend-mode: color;
}

html[dir="rtl"] #globalChatInputOverlay {
  right: unset;
  left: 4px;
}

#chatInput:not([data-global]) + #globalChatInputOverlay {
  display: none;
}

#chatBorder {
  width: calc(100% - 8px);
  right: 8px;
  height: 50%;
  top: -100%;
}

html[dir="rtl"] #chatBorder {
  right: unset;
  left: 8px;
}

#chatInput[data-global] + #globalChatInputOverlay + #chatBorder {
  top: calc(-200% + 8px);
}

#ynomojiContainer, #enterNameContainer, .chatboxTab, .chatboxTabSection, .modalTab, .infoMessage, .checkbox, button.checkboxButton, button[type="button"], button[type="submit"] {
  border-image: var(--border-image-url) 10 repeat !important;
}

#ynomojiContainer {
  position: absolute;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  height: unset;
  min-height: 32px;
  padding: 4px;
  margin-bottom: 9px;
  background-color: rgb(var(--base-bg-color));
  z-index: 3;
}

.ynomoji {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.ynomojiButton {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  margin: 2px;
  pointer-events: all;
}

#enterNameContainer {
  margin-top: 12px;
  width: auto;
  height: auto;
}

#enterNameForm {
  margin-top: 8px;
}

#enterNameInstruction, .nameText, .nameMarker, .themeText, .partyListEntryMemberCountText, .chatboxTabLabel, .notice, .instruction, .infoLabel, .infoText, .messageContents, .toast .toastMessage, h1, h2, h3, h4, a:not(.listEntryAction), label, th, .spoiler.show {
  background-image: var(--base-gradient) !important;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(1.5px 1.5px rgb(var(--shadow-color)));
}

#enterNameInstruction span {
  letter-spacing: -0.675px;
}

#nameInput {
  width: calc(100% - 28px);
}

#onlineInfo {
  justify-content: space-between;
}

#layout:not(.explorer) #explorerContainer {
  display: none;
}

#explorerContainer {
  display: inline-block;
  width: 300px;
  height: 300px;
  text-align: center;
}

#layout.chatboxOverlap:fullscreen #explorerContainer, #layout.hideChat:fullscreen #explorerContainer {
  text-align: right;
}

#mainContainer #explorerContainer {
  width: 640px;
  margin: auto;
}

#explorerFrame {
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  border-width: 8px;
  border-image: var(--border-image-url) 4 repeat !important;
  background-color: rgba(var(--shadow-color), 0.5);
  pointer-events: all;
  cursor: pointer;
}

#mainContainer #explorerFrame {
  height: 284px;
}

#explorerUndiscoveredLocationsLink {
  position: absolute;
  padding: 12px;
}

#explorerUndiscoveredLocationsLink svg {
  width: 18px;
  height: 18px;
  opacity: 0.625;
  transition: 0.125s cubic-bezier(0.7, 0, 0.7, 1.5);
}

#explorerUndiscoveredLocationsLink:hover svg {
  opacity: 1;
}

#explorerUndiscoveredLocations {
  padding: 0;
}

#explorerUndiscoveredLocations li {
  list-style-type: none;
  padding: 2px 0;
}

#wikiFrame {
  width: 100%;
  height: 100%;
  border: none;
}

#footer {
  display: flex;
  width: 100%;
  max-width: 1036px;
  margin: 0 auto;
}

#translationInstruction, #noGameLocInstruction {
  font-size: small;
  padding: 0;
}

.modalContainer {
  position: fixed;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  z-index: 10;
  transition: opacity 0.25s ease-in-out;
}

.modalContainer.hidden.fadeOut {
  display: flex !important;
}

.modalContainer.hidden {
  content-visibility: hidden;
}

.modalContainer.hidden, #confirmModalContainer.fadeOut {
  opacity: 0;
}

.modalContainer.fadeOut, #modalFadeOutContainer, #confirmModalContainer.fadeOut {
  pointer-events: none;
}

.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  top: auto;
  left: auto;
  width: 100%;
  height: auto;
  max-width: min(480px, calc(100% - 112px));
  max-height: calc(100% - 112px);
  margin: 8px;
  padding-bottom: 16px;
  background-image: var(--modal-container-bg-image-url) !important;
  border-image: var(--modal-border-image-url) 10 repeat !important;
  z-index: 20;
}

.modal.semiWideModal {
  max-width: min(640px, calc(100% - 112px));
}

.modal.wideModal {
  max-width: min(720px, calc(100% - 112px));
}

.modal.hidden.fadeOut {
  display: flex !important;
}

.modal.fadeIn, .modal.fadeOut {
  animation-name: modalFade;
  animation-duration: 0.25s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 1;
}

.modal.fadeOut {
  animation-direction: reverse;
}

@keyframes modalFade {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal.fadeIn .loader, .modal.fadeOut .loader {
  top: -24px !important;
  left: -24px !important;
}

.fullscreenModal {
  position: fixed;
  top: 32px;
  left: 32px;
  width: calc(100% - 112px);
  height: calc(100% - 112px);
  max-width: unset;
  margin: 0;
  padding: 0;
}

.modalClose {
  position: absolute;
  right: -32px;
  top: -32px;
  font-size: 32px;
  line-height: 1;
  text-decoration: none;
}

.modal input, .modal textarea, .modal select, .modal .checkbox, .modal .dropdown, .modal button.checkboxButton, .modal button[type="button"], .modal button[type="submit"] {
  color: rgb(var(--modal-base-color)) !important;
  border-image-source: var(--modal-border-image-url) !important;
  background-color: rgb(var(--modal-base-bg-color)) !important;
  text-shadow: 1.5px 1.5px rgb(var(--modal-shadow-color));
}

.modal a:not(.modalClose):not(.listEntryAction) {
  background-image: var(--modal-alt-gradient) !important;
}

.modal select option:checked {
  background: rgba(var(--modal-alt-color), 0.5) !important;
}

.modal .iconButton path, .modal .icon path {
  stroke: var(--modal-svg-base-gradient);
  filter: var(--modal-svg-shadow);
}

.modal .iconButton.altIcon path, .modal .icon.altIcon path {
  stroke: var(--modal-svg-alt-gradient);
}

.modal .fillIcon path {
  stroke: none;
  fill: var(--modal-svg-base-gradient);
}

.modal .fillIcon.altIcon path {
  fill: var(--modal-svg-alt-gradient);
}

.modal .altText {
  background-image: var(--modal-alt-gradient) !important;
}

.modal .baseColorBg {
  background-color: rgb(var(--modal-base-color)) !important;
}

.modal .baseColorFill {
  fill: rgb(var(--modal-base-color)) !important;
}

.modal .infoLabel, .modal .infoText, .modal h1, .modal h2, .modal h3, .modal h4, .modal a:not(.listEntryAction), .modal label {
  background-image: var(--modal-base-gradient) !important;
  filter: drop-shadow(1.5px 1.5px rgb(var(--modal-shadow-color)));
}

.modalContent {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  scrollbar-color: rgb(var(--modal-base-color)) rgb(var(--modal-base-bg-color));
}

.modalContent.noScroll {
  overflow: hidden;
}

.modalContent::-webkit-scrollbar-track {
  border-image: var(--modal-border-image-url) 8 repeat !important;
  background-color: rgb(var(--modal-base-bg-color));
}

.modalContent::-webkit-scrollbar-thumb {
  border-image: var(--modal-border-image-url) 6 round !important;
}

.fullscreenModal .modalContent {
  align-content: baseline;
}

.modalContent .itemCategoryHeader {
  width: 100%;
  text-align: center;
}

.modalHeader .filterInputCheckboxContainer {
  margin-top: 5px;
  text-align: left;
}

#header.fullBg, .modal.fullBg {
  background-size: auto calc(100% + 32px);
}

.itemContainer .item {
  margin: 22px;
  text-align: center;
}

.itemContainer .item > div {
  -webkit-appearance: button;
  appearance: button;
  cursor: pointer;
}

.itemContainer .badgeItem.disabled > div {
  cursor: not-allowed;
}

.itemContainer .uiThemeItem.auto {
  margin-top: 2px;
}

.itemContainer .item > div,
.modalContainer[data-last-modal-id$="createPartyModal"] .modalContent .item > div:not(.partySelected),
.modalContainer[data-last-modal-id$="scheduleEditModal"] .modalContent .item > div:not(.scheduleSelected)
{
  border: 2px solid transparent;
}

.itemContainer .item > div.selected,
.modalContainer[data-last-modal-id$="createPartyModal"] .modalContent .item > div.partySelected,
.modalContainer[data-last-modal-id$="scheduleEditModal"] .modalContent .item > div.scheduleSelected
{
  border-color: white;
}

.itemContainer .badgeItem > div {
  width: 98px;
  height: 98px;
}

.itemContainer .badgeItem > .badgeContainer {
  background-color: rgb(var(--base-bg-color)) !important;
  background-clip: content-box;
}

.itemContainer .itemRow {
  display: flex;
  margin: auto;
}

.modalContent.itemContainer.itemRowContainer {
  flex-flow: column;
  justify-content: space-between;
}

.modalContent.itemContainer .badgeItem > .badgeContainer {
  background-color: rgb(var(--modal-base-bg-color)) !important;
}

.modalContent.itemContainer .badgeItem > .badgeContainer.special {
  background-image: var(--modal-alt-gradient-b);
}

.itemContainer .badgeItem > .badgeContainer > div {
  width: 74px;
  height: 74px;
  border: 12px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
}

.modalContent.itemContainer .badgeItem.locked > .badgeContainer > div:first-child {
  border-image-source: var(--modal-border-image-url) !important;
}

.itemContainer .badgeItem.locked > .badgeContainer > div:first-child {
  border: none !important;
  margin: 12px 12px 8px 12px;
}

.itemContainer .badgeItem.locked > .badgeContainer > .badge:first-child {
  opacity: 0.325;
  filter: grayscale(1);
}

.itemContainer .badgeItem > .badgeContainer > div:nth-child(2) {
  margin-top: -94px;
  mix-blend-mode: lighten; /* Fixes visual bug with opacity and transition */
}

.itemContainer .badgeItem > .badgeContainer > .icon > svg {
  padding: 8px;
}

.itemContainer .badgeItem.locked > .badgeContainer > .icon:nth-child(2) > svg {
  transition: opacity 0.325s ease-in-out;
}

.itemContainer .badgeItem.locked:hover > .badgeContainer > .icon:nth-child(2) > svg {
  opacity: 0;
}

.itemContainer .badgeItem > .badgeContainer > .badge {
  background-size: cover;
  background-repeat: no-repeat;
}

.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlay {
  background: var(--base-gradient);
  -webkit-mask-size: cover;
  mask-size: cover;
}

.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlayBase {
  background: rgb(var(--base-color));
}

.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlayAlt {
  background: rgb(var(--alt-color));
}

.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlayBg {
  background: rgb(var(--base-bg-color));
}

.modalContent.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlay {
  background: var(--modal-base-gradient);
}

.modalContent.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlayBase {
  background: rgb(var(--modal-base-color));
}

.modalContent.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlayAlt {
  background: rgb(var(--modal-alt-color));
}

.modalContent.itemContainer .badgeItem > .badgeContainer > .badge > .badgeOverlayBg {
  background: rgb(var(--modal-base-bg-color));
}

#headerIconContainer .badgeItem {
  margin: -5px 8px 0 0;
}

#headerIconContainer .badgeItem > .badgeContainer {
  margin-bottom: -8px;
}

.smallItemContainer .item {
  margin: 16px;
}

.smallItemContainer .badgeItem > .badgeContainer {
  width: 49px;
  height: 49px;
}

.smallItemContainer .badgeItem > .badgeContainer > div {
  width: 37px;
  height: 37px;
  border: 6px solid transparent;
}

.modalContent .showHidePasswordLink.showPassword > span:first-child, .modalContent .showHidePasswordLink:not(.showPassword) > span:last-child {
  display: none;
}

.modalContainer[data-last-modal-id$="createPartyModal"] .uiThemeItem.auto, .modalContainer[data-last-modal-id$="createPartyModal"] .modalFooter, #createPartyModal:not([data-update]) .modalTitle .updateTitle, #createPartyModal[data-update] .modalTitle .createTitle {
  display: none;
}

#notificationSettingsModal.notificationsOff .formControlRow:not(:first-child) {
  display: none;
}

#partyModal .modalTitle .icon {
  display: inline-block;
  padding: 0 4px;
}

#partyModal .modalTitle .icon svg {
  width: 24px;
  height: 24px;
}

.modalHeader, .modalFooter {
  text-align: center;
}

.modalFooter {
  margin-top: 16px;
}

.modalOverlay {
  position: fixed;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 10;
}

.confirmModal {
  padding: 0;
}

.formControls {
  list-style-type: none;
  overflow-x: hidden;
  padding: 0;
}

.formControls.flexFormControls {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.formControlRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.formControls.flexFormControls .formControlRow.fullWidth {
  width: 100%;
}

.formControlRow.indent {
  padding-inline-start: 40px;
}

.formControlRow > div:first-child {
  width: 100%;
}

.formControlRow > div:first-child > div:nth-child(2) {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.formControlRow > .textareaContainer {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.formControlRow > .textareaContainer > label {
  padding-bottom: 4px;
}

.formControlRow label {
  padding-inline-end: 8px;
}

.formControlRow > label:not(:first-child), .formControlRow > div:not(:first-child) > label {
  margin-inline-start: 16px;
}

.formControlRow div {
  text-align: right;
}

.formControlRow.buttonRow {
  justify-content: space-around;
  flex-wrap: wrap;
}

.formControlRow.buttonRow > button {
  margin: 0 8px 8px 8px;
}

.modalTabsContainer {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin-bottom: 8px;
  row-gap: 4px;
}

.modalTab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  text-align: center;
  padding: 4px;
  margin-inline-end: 4px;
  pointer-events: all;
  cursor: pointer;
  opacity: 0.625;
  transition: opacity 0.325s ease-in-out;
}

.modalTab:hover {
  opacity: 1;
}

.modalTab.active {
  z-index: 2;
  pointer-events: none;
  cursor: default;
  opacity: 1;
}

.modalTabLabel {
  pointer-events: none;
  font-weight: normal;
}

.uiTheme {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 64px;
  height: 64px;
  background-size: 64px;
  background-position-y: -16px;
  border: 24px solid transparent;
  -webkit-appearance: button;
  appearance: button;
  cursor: pointer;
}

form.fullWidth {
  width: calc(100% - 8px);
}

form .uiTheme {
  width: 32px;
  height: 32px;
  background-size: 32px;
  background-position-y: -8px;
  border-width: 12px;
}

.uiTheme.fullBg {
  background-size: 112px;
}

.uiTheme > img {
  width: 100%;
  pointer-events: none;
}

#partyModalDescriptionContainer {
  min-width: 200px;
  max-width: 100%;
}

#partyModalDescriptionContainer > .icon {
  float: left;
  width: 18px;
  height: 100%;
  margin-inline-end: 4px;
}

#partyModalDescription {
  display: inline;
  word-break: break-word;
}

#partyModalPlayerListContainer, #blocklistModalPlayerListContainer {
  width: 360px;
}

#partyModalOfflinePlayerList .playerListEntry {
  opacity: 0.5;
}

#saveSlotList {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

#saveSlotList .saveSlotListEntry {
  width: 214px;
  height: 64px;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px;
}

#saveSlotList .saveSlotListEntry .saveSlotListEntryContent {
  margin-top: 8px;
  height: 100%;
}

#saveSlotList .saveSlotListEntry .saveSlotListEntryContent .saveSlotButtonsContainer {
  display: flex;
  margin-top: 8px;
}

#saveSlotList .saveSlotListEntry .saveSlotListEntryContent .saveSlotButtonsContainer .saveSlotButton {
  width: 18px;
  height: 18px;
  margin-inline-end: 8px;
}

#eventPeriodInfoContainer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
}

.modalInfoContainer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 60%;
  margin: 0 20%;
}

#expRankInfoContainer {
  height: 37px;
  margin: 0 20%;
}

.modalInfoContainer label {
  font-size: 20px;
  white-space: nowrap;
}

#expRankContainer {
  display: flex;
  align-items: center;
}

.badgeSlotRowsContainer {
  max-width: 315px;
  display: block;
  direction: ltr;
}

.badgeSlotRow {
  display: flex;
  justify-content: center;
}

.badgeSlot {
  width: 37px;
  height: 37px;
  margin: 4px;
  background-size: cover;
}

.badgeButton {
  cursor: pointer;
  -webkit-appearance: button;
  appearance: button;
}

.badgeOverlay {
  height: 100%;
}

.badgeOverlayMultiply {
  mix-blend-mode: multiply;
}

.badgeOverlay2 {
  top: -100%;
  position: relative;
}

#expRankBadge {
  margin-inline-start: 8px;
}

#rankExpContainer {
  width: 100%;
  margin-bottom: 16px;
}

#eventPeriod, #eventPeriodEndDateLabel {
  text-align: center;
}

#eventPeriod {
  margin: 0;
}

.progressContainer {
  text-align: start;
  margin-top: 16px;
}

.progressBarHeading {
  margin-inline-end: auto;
}

.progressBarContainer {
  display: flex;
  flex-direction: column;
  width: calc(100% - 8px);
  height: 24px;
  border: 4px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
  background-color: rgb(var(--base-bg-color));
}

.progressBarLabel {
  display: flex;
  align-items: center;
  margin: 0 auto;
  min-height: 24px;
  image-rendering: auto;
}

.progressBar {
  height: 100%;
  margin-top: -24px;
  background: var(--base-gradient-b);
  transition: width 0.5s ease-in-out;
}

#rankExpBarLabel::after {
  counter-reset: rank-exp var(--rank-exp) rank-total-exp var(--rank-total-exp);
  content: counter(rank-exp) '/' counter(rank-total-exp);
}

#weekExpBarLabel::after {
  counter-reset: week-exp var(--week-exp);
  content: counter(week-exp) '/50';
}

#badgeGalleryRowProgressBarLabel::after {
  counter-reset: row-level-bp var(--row-level-bp) row-level-total-bp var(--row-level-total-bp);
  content: counter(row-level-bp) '/' counter(row-level-total-bp);
}

#badgeGalleryColProgressBarLabel::after {
  counter-reset: col-level-bc var(--col-level-bc) col-level-total-bc var(--col-level-total-bc);
  content: counter(col-level-bc) '/' counter(col-level-total-bc);
}

#rankExpBar {
  width: calc((min(var(--rank-exp), max(var(--rank-total-exp), 1)) / max(var(--rank-total-exp), 1)) * 100%);
}

#weekExpBar {
  width: calc(var(--week-exp) * 2%);
}

#badgeGalleryRowProgressBar {
  width: calc(min((var(--row-level-bp) / var(--row-level-total-bp)) * 100%, 100%));
}

#badgeGalleryColProgressBar {
  width: calc(min((var(--col-level-bc) / var(--col-level-total-bc)) * 100%, 100%));
}

.eventList {
  width: 100%;
}

.eventList .eventListEntry.complete {
  opacity: 0.625;
}

.eventList .eventListEntry .detailsContainer {
  flex-direction: column;
  width: 60%;
}

.eventList .eventListEntry .detailsContainer .gameLink, .eventList .eventVmListEntry .vmContainer .gameLink {
  font-size: small;
  margin-bottom: 2px;
}

.eventList .eventListEntry .detailsContainer .depthContainer {
  display: flex;
  height: 18px;
}

.eventList .eventListEntry .detailsContainer .depthFillContainer {
  margin-top: -18px;
}

.eventList .eventListEntry .detailsContainer .maxDepthFillContainer {
  opacity: 0.675;
}

.eventList .eventListEntry .detailsContainer .depthContainer .icon {
  width: 14px;
  margin: 2px 2px 0 0;
}

.eventList .eventListEntry .detailsContainer .depthFillContainer .icon path {
  filter: none;
}

.eventList .eventListEntry .eventEndDateContainer {
  display: flex;
  flex-direction: column;
  width: 40%;
  padding-inline-end: 16px;
}

.eventList .eventListEntry .eventEndDateContainer > div {
  text-align: right;
}

.eventList .eventListEntry .eventPoints {
  padding-inline-end: 16px;
  text-align: right;
  white-space: nowrap;
}

.eventList .eventVmListEntry .vmContainer {
  display: flex;
  flex-direction: column;
  width: 140px;
  margin-inline-end: auto;
}

.eventList .eventVmListEntry .vmContainer .gameLink {
  text-align: center;
}

.eventList .eventVmListEntry .vmContainer .vmImage {
  border: 6px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
  border-image-width: 2 !important;
}

#eventTabs {
  flex-wrap: wrap;
  width: 100%;
  margin-top: 16px;
  border-bottom: 4px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
}

#rankingSubCategoryTabs {
  flex-wrap: wrap;
  width: 100%;
}

#rankingsTable, #rankingsTable tr {
  border-image: var(--border-image-url) 8 repeat !important;
}

#rankingsTable {
  width: 100%;
  border: 12px solid transparent;
}

#rankingsTable th, #rankingsTable td {
  border: 8px solid transparent;
  border-inline-end-width: 0;
  border-bottom-width: 0;
  border-image: var(--border-image-url) 8 repeat !important;
}

#rankingsTable th {
  border-top-width: 0;
  text-align: left;
  white-space: nowrap;
}

#rankingsTable th:first-child, #rankingsTable th:last-child, #rankingsTable td:first-child, #rankingsTable td:last-child {
   text-align: center;
}

#rankingsTable th:first-child, #rankingsTable td:first-child {
  border-inline-start-width: 0;
}

#rankingsTable td:first-child, #rankingsTable td:last-child {
  white-space: nowrap;
  padding: 0 8px;
}

#rankingsTable td:last-child {
  text-align: right;
}

#rankingsTable th:nth-child(2), #rankingsTable td:nth-child(2) {
  display: flex;
  width: 100%;
  padding-inline-start: 4px;
}

#rankingsTable td:nth-child(2) {
  justify-content: space-between;
}

#rankingsTable tr.highlight td {
  background-color: rgba(var(--alt-color), 0.5);
}

#rankingsTable tr td .medalsContainer {
  justify-content: right;
  padding-inline-end: 16px;
}

#rankingsPagination {
  margin-top: 8px;
}

.rankingPageLink {
  font-size: 18px;
  margin: 0 4px;
}

.rankingPageSkipLink {
  letter-spacing: -0.15em;
  padding-inline-end: 0.15em;
}

#screenshotModal .screenshot {
  width: -webkit-fill-available;
  width: -moz-available;
  width: fill-available;
  height: -webkit-fill-available;
  height: -moz-available;
  height: fill-available;
  object-fit: contain;
}

@supports (-moz-appearance:none) {
  #screenshotModal .screenshot {
    width: inherit;
    height: inherit;
  }
}

.screenshotSlotProgressContainer {
  max-width: min(640px, calc(100% - 112px));
  margin: auto;
}

#screenshotSlotProgressBarLabel::after {
  counter-reset: screenshot-slot-level-bp var(--screenshot-slot-level-bp) screenshot-slot-level-total-bp var(--screenshot-slot-level-total-bp);
  content: counter(screenshot-slot-level-bp) '/' counter(screenshot-slot-level-total-bp);
}

#screenshotSlotProgressBar {
  width: calc(min((var(--screenshot-slot-level-bp) / var(--screenshot-slot-level-total-bp)) * 100%, 100%));
}

#layout.immersionMode .playerCountLabel, #layout:not(.immersionMode) #immersionModeLabel, #layout.immersionMode #location, #layout.immersionMode #chatboxTabs, #layout.immersionMode .subTab, #layout.immersionMode #globalMessageLocationsButton, #layout.immersionMode #explorerButton, #layout.immersionMode #mapControls, #layout.immersionMode #explorerControls {
  display: none;
}

#layout.immersionMode .chatboxTabSection {
  margin-top: 0;
}

#layout.privateMode #hideLocationButton {
  display: none;
}

#content.loggedIn #loginButton, #content:not(.loggedIn) #logoutButton, #content:not(.loggedIn) .accountRequired {
  display: none;
}

.loader {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.325s ease-in-out;
}

.loader.visible {
  opacity: 1;
  pointer-events: all;
}

#toastContainer {
  position: fixed;
  display: flex;
  flex-direction: column;
  width: min(320px, calc(100vw - 40px));
  bottom: var(--toast-offset);
  left: 0;
  margin: 0 0 8px;
  margin-inline-start: 8px;
  z-index: 20;
}

#toastContainer.top {
  flex-direction: column-reverse;
  bottom: unset;
  top: var(--toast-offset);
  margin-top: 8px;
  margin-bottom: 0;
}

#toastContainer.right {
  left: unset;
  right: 0;
  margin-inline-start: 0;
  margin-inline-end: 8px;
}

#toastContainer.anim {
  transition: bottom 0.5s cubic-bezier(0.7, 0, 0.7, 1.5);
}

#toastContainer.top.anim {
  transition: top 0.5s cubic-bezier(0.7, 0, 0.7, 1.5);
}

.toast {
  display: flex;
  align-items: center;
  width: calc(100% - 24px);
  margin: 0 0 8px 8px;
  background-image: var(--container-bg-image-url) !important;
  background-size: 35px;
  background-position-y: -8px;
  justify-content: space-between;
}

.toast.fullBg {
  background-origin: border-box;
  background-size: contain;
  background-position: 0;
}

#toastContainer.top .toast {
  margin-top: 8px;
  margin-bottom: 0;
}

#toastContainer.right .toast {
  margin-inline-start: -8px;
}

.toast.fade {
  transition: opacity 1s ease-in-out;
  opacity: 0;
}

.toast > .icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  margin: 4px 0 4px 0;
  margin-inline-end: 8px;
}

.toast > .badgeContainer {
  margin-inline-end: 8px;
}

.toast > .badgeContainer > .badge {
  width: 37px;
  height: 37px;
}

.toastMessageContainer {
  width: 100%;
}

.screenshotToast .toastMessageContainer {
  text-align: center;
}

.toastMessage {
  display: inline;
}

.toast .closeToast {
  right: 0;
  text-decoration: none;
  image-rendering: auto;
  padding-inline-start: 8px;
}

.tippy-box {
  border: 6px solid transparent;
  border-image: var(--border-image-url) 8 repeat !important;
  border-image-width: 2 !important;
  background-image: var(--container-bg-image-url) !important;
}

.fullBg .tippy-box {
  background-size: auto 100% !important;
}

.tippy-content .tooltipContent {
  display: inline;
  background-image: var(--base-gradient) !important;
  filter: drop-shadow(1.5px 1.5px rgb(var(--shadow-color)));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tippy-content .tooltipContent.noShadow {
  filter: unset; 
}

.tippy-content .tooltipContent.altText {
  background-image: var(--alt-gradient) !important;
}

.tippy-content .tooltipTitle {
  margin: 0 0 8px 0;
  text-align: center;
}

.tippy-content .tooltipSpacer {
  margin-top: 4px;
}

.tippy-content .tooltipLocation {
  display: block;
  margin-bottom: 8px;
}

.tippy-content label, .tippy-content .tooltipContent:first-child {
  font-size: 16px;
}

.tippy-content .tooltipContent > .playerAction > .nameTextContainer {
  display: inline;
}

.tippy-content .tooltipFooter {
  display: block;
  text-align: center;
  margin-top: 8px;
}

.tippy-content .tooltipTitle + .tooltipFooter {
  margin-top: 0;
}

.tippy-content .tooltipCornerText {
  display: flex;
  justify-content: right;
  font-size: x-small;
}

@media (hover: none) { 
  .desktopOnly {
    display: none;
  }
}

@media not (hover: none) { 
  .mobileOnly {
    display: none;
  }
}

@media only screen and (min-width: 1051px) and (min-height: 595px) {
  #layout {
    max-height: 667px;
  }

  #content.loggedIn #layout.explorer {
    max-height: 898px;
  }

  #content.loggedIn #layout.explorer:not(:fullscreen) #canvasContainer {
    align-items: baseline;
  }

  #content.loggedIn #layout.explorer:not(:fullscreen) #canvas {
    margin-top: 69px;
    margin-bottom: 4px;
  }

  #chatboxContainer {
    width: 284px;
  }

  #chatbox {
    height: calc(100vh - 50px);
    max-height: 617px;
  }

  #content.loggedIn #layout.hideChat #chatboxContainer {
    display: none !important;
  }

  #content.loggedIn #layout.explorer #chatbox {
    max-height: calc(100% - (max(min(calc(100vh - 468px), 284px), 150px) + 16px));
  }

  #content.loggedIn #layout.explorer:fullscreen #chatbox {
    max-height: calc(100% - 312px);
  }

  .chatboxTabSection {
    width: 268px;
  }

  #explorerContainer {
    margin-top: 4px;
  }

  .container {
    height: calc(100vh - 58px);
    max-height: 617px;
  }

  #content.loggedIn #layout.explorer:not(:fullscreen) .container {
    max-height: 848px;
  }

  @media only screen and (max-height: 999px) {
    #layout:not(:fullscreen) #explorerFrame {
      width: max(min(calc(100vh - 468px), 284px), 150px);
      height: max(min(calc(100vh - 468px), 284px), 150px);
    }
  }

  @media only screen and (min-height: 1000px) {
    #content.loggedIn #layout.explorer #chatbox {
      max-height: 100%;
    }
  }
}

@media only screen and (max-width: 1050px) and (min-height: 595px) {
  #layout {
    flex-wrap: wrap;
  }

  #chatboxContainer {
    width: 100%;
    height: calc(100vh - 594px);
    min-height: 188px;
    max-height: 328px;
    padding-inline-start: 0;
    border-inline-start: 24px solid transparent;
  }

  #chatbox {
    height: calc(100vh - 590px);
    min-height: 200px;
    max-height: 340px;
  }

  #content.downscale #chatboxContainer {
    width: 100%;
    height: calc(100vh - 474px);
  }

  #content.loggedIn.downscale #layout.explorer:not(:fullscreen) #chatboxContainer {
    height: calc(100vh - (464px - max(min(100vh - 512px, 284px), 150px)));
    max-height: 640px;
  }

  #content.loggedIn.downscale #layout.explorer.hideChat:not(:fullscreen) #chatboxContainer {
    height: calc(max(min(100vh - 512px, 284px), 150px) + 32px);
  }

  #content.loggedIn.downscale2 #layout.explorer:not(:fullscreen) #chatboxContainer {
    height: calc(100vh - (424px - max(min(100vh - 512px, 284px), 150px)));
    max-height: 640px;
  }

  #content.loggedIn:not(.downscale) #layout.explorer.hideChat:not(:fullscreen) #chatboxContainer {
    text-align: center;
    height: unset;
  }

  #content.downscale #chatbox {
    height: calc(100vh - 470px);
  }

  #content.downscale2 #chatboxContainer {
    width: 100%;
    height: calc(100vh - 354px);
  }

  #content.downscale2 #chatbox {
    height: calc(100vh - 350px);
  }

  #content.loggedIn:not(.downscale) #layout.explorer:not(:fullscreen) #chatbox {
    width: calc(100% - (max(min(100vh - 644px, 284px), 150px) + 24px));
    float: left;
  }

  .info {
    padding-bottom: 4px;
  }

  #layout:not(:fullscreen) #onlineInfo {
    justify-content: right;
  }

  #layout:not(:fullscreen) #connStatusText, #layout:not(:fullscreen) #locationLabel, #layout:not(:fullscreen) #nextLocationLabel {
    display: none;
  }

  #layout:not(:fullscreen) #nextLocationContainer {
    align-self: flex-end;
    min-width: var(--location-width);
  }

  #layout:not(:fullscreen) #toggleNextLocationButton {
    margin-left: -18px;
  }

  #content:not(.downscale) #layout:not(:fullscreen) #explorerContainer {
    margin-top: 28px;
    margin-inline-start: 8px;
    width: calc(100vh - 644px) !important;
    height: calc(100vh - 644px) !important;
    min-width: 164px;
    min-height: 164px;
    max-width: 300px;
    max-height: 300px;
  }

  #content:not(.downscale) #layout.explorer.hideChat:not(:fullscreen) #explorerContainer {
    margin-top: 8px;
  }

  #content.downscale #explorerContainer, #content #layout:fullscreen #explorerContainer {
    width: 100%;
    margin-top: 8px;
    float: left;
    height: calc(100vh - 512px);
    max-height: 300px;
  }

  #content.downscale #layout:fullscreen:not(.chatboxOverlap) #explorerContainer {
    height: calc(100vh - 612px);
  }

  #content.downscale #explorerFrame, #content #layout:fullscreen #explorerFrame {
    width: calc(100vh - 512px);
    height: calc(100vh - 512px);
    min-width: 150px;
    min-height: 150px;
    max-width: 284px;
    max-height: 284px;
  }

  #content #layout:fullscreen:not(.chatboxOverlap) #explorerFrame {
    width: calc(100vh - 960px);
    height: calc(100vh - 960px);
  }

  #content.downscale #layout:fullscreen:not(.chatboxOverlap) #explorerFrame {
    width: calc(min(100vh - 612px, 100vw - 64px));
    height: calc(min(100vh - 612px, 100vw - 64px));
  }

  /* Ignore :fullscreen on iOS since it's not supported */
  @supports (-webkit-touch-callout: none) {
    #onlineInfo {
      justify-content: right;
    }

    #connStatusText, #locationLabel {
      display: none;
    }
  }

  #connStatus {
    margin-inline-end: 4px;
  }

  .chatboxTabSection {
    width: calc(100% - 16px);
  }

  #layout:not(.chatboxOverlap) #controls {
    align-items: flex-start;
  }

  #layout:not(.chatboxOverlap) #leftControls, #layout:not(.chatboxOverlap) #mapControls {
    display: flex;
    flex-direction: column;
    align-items: baseline;
    flex-wrap: wrap;
  }

  #layout:not(.chatboxOverlap) #leftControls {
    position: absolute;
    left: 0;
    width: auto;
  }
  
  #layout:not(.chatboxOverlap) #rightControls {
    position: absolute;
    display: flex;
    flex-direction: column-reverse;
    align-items: baseline;
    right: 0;
  }

  #layout:fullscreen #chatboxContainer {
    width: calc(100% - 48px);
  }
}

#layout.overflow {
  flex-wrap: wrap;
}

#layout.overflow #controls {
  align-items: flex-start;
}

#layout.overflow #leftControls, #layout.overflow #mapControls {
  display: flex;
  flex-direction: column;
  align-items: baseline;
  flex-wrap: wrap;
}

#layout.overflow #leftControls {
  position: absolute;
  left: 0;
  width: auto;
}

#layout.overflow #rightControls {
  position: absolute;
  display: flex;
  flex-direction: column-reverse;
  align-items: baseline;
  right: 0;
}

#layout.overflow .info {
  padding-bottom: 4px;
}

#layout.overflow .infoContainer {
  margin-inline-end: 4px;
}

#layout.overflow #connStatusText, #layout.overflow #locationLabel {
  display: none;
}

#layout.overflow:not(:fullscreen) #onlineInfo, #layout.overflow:not(:fullscreen) #location {
  justify-content: right;
}

#layout:not(:fullscreen).overflow #chatboxContainer {
  width: 100%;
  height: calc(100vh - 638px);
  min-height: 188px;
  max-height: 328px;
  padding-inline-start: 0;
  border-inline-start: 24px solid transparent;
}

#content.loggedIn #layout:not(:fullscreen).overflow.hideChat.explorer #chatboxContainer {
  text-align: center;
}

#content.loggedIn #layout:not(:fullscreen).overflow.explorer #chatbox {
  width: calc(100% - (max(min(100vh - 644px, 284px), 150px) + 24px));
  float: left;
}

#layout:not(:fullscreen).overflow #chatbox {
  height: calc(100vh - 634px);
  min-height: 200px;
  max-height: 340px;
}

#layout:not(:fullscreen).overflow .chatboxTabSection {
  width: calc(100% - 16px);
}

#layout:not(:fullscreen).overflow #explorerContainer {
  width: calc(100vh - 644px) !important;
  height: calc(100vh - 644px) !important;
  min-width: 164px;
  min-height: 164px;
  max-width: 300px;
  max-height: 300px;
}

/* Ignore :fullscreen on iOS since it's not supported */
@supports (-webkit-touch-callout: none) {
  #layout.overflow #onlineInfo, #layout.overflow #location {
    justify-content: right;
  }
  
  #layout.overflow #chatboxContainer {
    width: 100%;
    height: calc(100vh - 638px);
    min-height: 188px;
    max-height: 328px;
  }
  
  #layout.overflow #chatbox {
    height: calc(100vh - 634px);
    min-height: 200px;
    max-height: 340px;
  }
  
  #layout.overflow .chatboxTabSection {
    width: calc(100% - 16px);
  }
}

@media only screen and (min-width: 705px) and (max-height: 594px) {
  #layout:not(.overflow) #chatbox {
    width: 240px;
    height: 100%;
  }

  #layout:not(.overflow) .chatboxTabSection {
    height: 100%;
  }

  #canvas {
    max-width: calc((100vh - 96px) * 1.3333);
    max-height: calc(100vh - 96px);
  }

  #content.noSideBorders #mainContainer #canvas {
    max-width: calc((100vh - 48px) * 1.3333);
    max-height: calc(100vh - 48px);
  }

  #chatboxContainer {
    max-height: 100vh;
  }

  #layout.hideChat:not(:fullscreen) #chatboxContainer {
    display: none !important;
  }

  #layout:not(:fullscreen) #explorerContainer {
    display: none;
  }

  #layout:fullscreen #explorerContainer {
    width: 100%;
    height: 166px;
  }

  #layout:fullscreen #explorerFrame {
    width: 150px;
  }
}

@media only screen and (max-width: 704px) and (max-height: 594px) {
  #chatboxContainer {
    height: calc(100vh - (((100vw - 64px) * 0.75) + 158px));
  }

  #chatbox {
    height: calc(100vh - (((100vw - 64px) * 0.75) + 154px));
  }
}

#layout:fullscreen #mainContainer, #layout:fullscreen #chatboxContainer, #layout:fullscreen #chatbox {
  height: 100%;
  max-height: 100%;
}

#layout:fullscreen #chatboxContainer, #layout:fullscreen #chatbox {
  height: calc(100% - 24px);
}

#content.loggedIn #layout.explorer:fullscreen #chatbox {
  height: calc((100% - 24px) - max(min(100vh - 512px, 300px), 150px));
}

#layout.overflow.chatboxOverlap:fullscreen #chatboxContainer {
  width: calc(100% - 72px);
  left: 24px;
}

#layout:fullscreen #mainContainer {
  border: none;
  background-image: none !important;
  width: 100%;
  z-index: auto;
}

#content.downscale #layout:fullscreen canvas {
  image-rendering: auto;
  min-width: 640px;
  min-height: 480px;
}

#layout:fullscreen #controls {
  position: fixed;
  top: 0;
  right: 0;
}

#layout:fullscreen #controls button {
  margin: 8px 0 0 0;
  margin-inline-end: 8px;
}

#layout:fullscreen #leftControls {
  margin-inline-start: 8px;
}

#layout:fullscreen #chatboxContainer {
  position: absolute;
  right: 0;
  height: calc(100% - 48px);
  border-image: none !important;
  background-image: none !important;
  z-index: 2;
}

html[dir="rtl"] #layout:fullscreen #chatboxContainer {
  right: unset;
  left: 0;
}

#layout.chatboxOverlap:fullscreen #chatboxContainer {
  opacity: 50%;
  pointer-events: none;
}

#layout:fullscreen .chatboxTab.active {
  background-image: none !important;
  background-color: rgb(var(--base-bg-color));
}

#layout.chatboxOverlap:fullscreen #messages {
  overflow-y: hidden;
}

#layout:fullscreen #uiControls {
  display: none;
}

#content.downscale:not(.downscale2) #layout:fullscreen:not(.chatboxOverlap) #explorerContainer, #content.downscale2 #layout:fullscreen.chatboxOverlap #explorerContainer {
  width: 100%;
}

#content.downscale:not(.downscale2) #layout:fullscreen:not(.chatboxOverlap) #explorerFrame, #content.downscale2 #layout:fullscreen.chatboxOverlap #explorerFrame {
  width: 150px;
  height: 150px;
}

/* Safari only */
@media not all and (min-resolution:.001dpcm) {
  #layout::-webkit-scrollbar-track, .modalContent::-webkit-scrollbar-track, .scrollableContainer::-webkit-scrollbar-track, #layout::-webkit-scrollbar-thumb, .modalContent::-webkit-scrollbar-thumb, .scrollableContainer::-webkit-scrollbar-thumb, #header, #ynomojiContainer, #enterNameContainer, .container, .modal, .chatboxTab, .chatboxTabSection, #chatBorder, .modalTab, .toast, input, select, .checkbox, button.checkboxButton, button[type="button"], button[type="submit"] {
    border-color: unset !important;
  }

  #chatInput {
    border-color: transparent !important;
  }

  .chatboxTabContent {
    border-top-color: unset !important;
    border-inline-start: 0;
    border-inline-end: 0;
    border-bottom: 0;
  }

  .messageContainer {
    border-top: 0;
    border-inline-start: 0;
    border-inline-end: 0;
    border-bottom-color: unset !important;
  }

  #rankingsTable th, #rankingsTable td {
    border-top-color: unset !important;
    border-inline-end: 0;
    border-bottom: 0;
    border-inline-start-color: unset !important;
  }
  
  #rankingsTable th:first-child, #rankingsTable td:first-child {
    border-inline-start: 0;
  }
  
  #rankingsTable th {
    border-top: 0;
  }

   /* Don't use text background on Safari since it doesn't repeat properly */
   #enterNameInstruction, .messageContents, .nameText, .nameMarker, .chatboxTabLabel, .subTabLabel, .modalTabLabel, .notice, .instruction, .infoLabel, .infoText, .locationLink, .altText, .toastMessage, h1, h2, h3, h4, a, label, th {
    -webkit-text-fill-color: unset;
    background-image: none !important;
  }

  .altText, a:not(.modalClose):not(.listEntryAction) {
    color: rgb(var(--alt-color));
  }

  .modal .altText, .modal a:not(.modalClose):not(.listEntryAction) {
    color: rgb(var(--modal-alt-color));
  }
}

@media (-webkit-min-device-pixel-ratio: 1.1), (-webkit-max-device-pixel-ratio: 1.9) {
  #gameLogo {
    image-rendering: auto;
  }

  .badge:not(.scaledBadge):not(.overlayBadge) {
    image-rendering: auto;
  }
}


@media only screen and (max-width: 768px) {
  .fullscreenModal {
    top: 16px;
    left: 8px;
    width: calc(100% - 70px);
    height: calc(100%);
  }

  .itemContainer .item {
    margin-inline-start: 4px;
    margin-inline-end: 4px;
  }

  .imageItem {
    width: 136px;
    padding-bottom: 12px;
  }

  .badgeItem,
  .uiThemeItem {
    margin-bottom: 12px;
  }

  .imageItem .imageThumbnailContainer {
    height: 90px;
  }

  .imageItem .spoilerLabel {
    margin: -60px;
  }

  .modalTitle {
    margin: 0;
    margin-bottom: 8px;
  }

  .imageControls {
    width: 112px;
  }

  .imageThumbnail {
    width: 120px;
    height: 90px;
  }

  .itemContainer .item {
    margin: 0;
  }

  .modalContent {
    justify-content: space-evenly;
    padding-top: 12px;
  }

  .modalInfoContainer {
    width: 100%;
    margin: 0;
    justify-content: space-around;
  }

  h3 {
    margin: 8px;
  }

  .screenshotSlotProgressContainer {
    padding-bottom: 12px;
  }
}

@media only screen and (max-height: 500px) {
  h1,
  h3 {
    margin: 8px;
  }

  h1 {
    font-size: 1.5rem;
  }

  #connStatusText {
    display: none;
  }

  #layout:fullscreen #chatboxContainer {
    height: calc(100% - 24px);
  }

  .fullscreenModal {
    top: 16px;
    height: 80%;
    max-height: unset;
  }

  .itemContainer .item {
    margin: 12px;
  }
}

.infiniteScrollContainer {
  overflow-x: auto;
  overflow-y: visible;
}

#uiThemesModal .itemContainer {
  place-items: end;
}

/* Collapse tabs into horizontal strip */
@media only screen and (orientation: portrait), only screen and (height < 768px) {
  #badgeGameTabs, #badgeCategoryTabs {
    flex-wrap: nowrap;
    min-height: 3.1rem;
    overflow-x: scroll;
    white-space: nowrap;
  }
    
  #badgeCategoryTabs {
    min-height: 2.2rem;
  }

  /* https://stackoverflow.com/questions/11387805/media-query-to-detect-if-device-is-touchscreen */
  @media (hover: none), (hover: on-demand), (-moz-touch-enabled: 1), (pointer: coarse) {
    #badgeGameTabs, #badgeCategoryTabs {
      scrollbar-width: none;
    }

    #badgeGameTabs {
      min-height: 2.5rem;
    }

    #badgeCategoryTabs {
      min-height: 1.1rem;
    }
  }
}

#badgeCategoryTabs:empty {
  display: none;
}

#badgeCategoryTabs {
  border-bottom: 4px solid transparent;
  border-image: var(--border-image-url) 8 repeat;
}

.dropdown {
  position: fixed;
  width: 194px;
  border: 12px solid transparent;
  border-image: var(--border-image-url) 8 repeat;
  border-top: none;
  z-index: 10;
  background: black;
}

.dropdownItem {
  padding-inline-start: 4px;
  line-height: 1.3em;
  text-align: initial;
  opacity: 0.5;
  overflow: hidden;
  white-space: nowrap;
}

.dropdownItem:not(:last-child) {
  border-bottom: 4px solid transparent;
  border-image: var(--border-image-url) 8 repeat;
}

.dropdownItem:focus,
.dropdownItem:hover {
  opacity: 1;
}

.searchIcon {
  position: absolute;
  z-index: 11;
  margin: 9px 0 0 0;
  margin-inline-start: 8px;
}

#badgeSearch {
  padding-inline-end: 22px;
}

#badgeSearch.active {
  padding-inline-end: initial;
  padding-inline-start: 24px;
}

[draggable="true"] {
  -webkit-user-drag: element;
}

.dragging {
  opacity: 0.25;
}

.dropTarget {
  background: white;
}

.removing .item:not([data-badge-id="null"]),
.item.removing {
  background-color: #a00;
}

.dropTarget .badgeContainer,
.item.removing .badgeContainer,
.removing .item:not([data-badge-id="null"]) .badgeContainer {
  opacity: 0.5;
}

body.browserFirefox tag {
  opacity: 0.6;
  text-decoration: line-through;
}

body:not(.browserFirefox) tag {
  -webkit-text-fill-color: rgba(0, 0, 0, 0.4);
  text-decoration: line-through;
  filter: invert(1);
}

.messageSender {
  float: left;
  height: 1lh;
  padding-inline-end: 4px;
}

html[dir="rtl"] .messageSender {
  float: right;
}

#gameChatContainer .messageContentsWrapper {
  display: inline;
}

.listEntry.schedule {
  display: block;
  padding: 2px 4px;
}

.schedule > .listEntryMain {
  justify-content: space-between;
  width: 100%;
}

.schedule .eventName {
  font-size: 1.2em;
  width: unset;
}

.scheduleHeader {
  display: flex;
  justify-content: space-between;
}

.scheduleGroupHeader {
  margin-top: 8px;
  margin-bottom: 4px;
}

.scheduleGroupHeader:has(+ .scheduleContainer:empty) {
  display: none;
}

.scheduleDescription {
  margin: 4px 4px 8px 4px;
  max-height: 3lh;
  overflow-y: auto;
}

.scheduleDescription > [data-role="description"]:empty {
  display: none;
}

.screenshotBlur {
  filter: blur(8px);
  transition: filter 0.125s cubic-bezier(0.7, 0, 0.7, 1.5);
  clip-path: inset(1px);
}

.screenshotBlur:hover {
  filter: blur(2px);
}
