@font-face {
  font-family: "Segment7";
  src: url("DSEG7Classic-Bold.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #17191d;
  color: #f3f4f6;
}

* { box-sizing: border-box; }

html, body, .game {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #17191d;
}

.game {
  position: relative;
  display: block;
  overflow: hidden;
  --scene-scale-x: 1;
  --scene-scale-y: 1;
}

.game-error-overlay {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(7 9 12 / 88%);
}

.game-error-card {
  display: grid;
  justify-items: center;
  width: min(520px, 100%);
  padding: 30px;
  border: 1px solid #484d57;
  border-radius: 12px;
  background: #202329;
  text-align: center;
  box-shadow: 0 24px 70px rgb(0 0 0 / 45%);
}

.game-error-card h1 {
  margin: 0 0 12px;
  font-size: 21px;
  font-weight: 600;
}

.game-error-card p {
  margin: 0;
  color: #c6cad1;
  white-space: pre-wrap;
}

.game-script-error-details {
  width: 100%;
  max-height: min(42vh, 320px);
  margin: 18px 0 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid #3b4049;
  border-radius: 6px;
  background: #15171b;
  color: #d7dae0;
  font: 13px/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  text-align: left;
  white-space: pre-wrap;
}

.game-error-card button {
  min-width: 110px;
  height: 39px;
  margin-top: 24px;
  border: 0;
  border-radius: 6px;
  background: #3977bd;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.game-error-card button:hover { background: #4386d2; }

.placeholder {
  color: #8f949e;
  text-align: center;
}

.placeholder strong {
  display: block;
  margin-bottom: 5px;
  color: #c9ccd2;
  font-size: 18px;
  font-weight: 500;
}

.login-dialog {
  width: min(360px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid #3b3f47;
  border-radius: 12px;
  background: #24272d;
  color: inherit;
  box-shadow: 0 24px 70px rgb(0 0 0 / 45%);
}

.login-dialog::backdrop { background: rgb(8 10 14 / 72%); }

.login-dialog form {
  display: grid;
  gap: 9px;
  padding: 28px;
}

.login-dialog h1 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
}

.login-branding-image {
  max-width: 112px;
  max-height: 112px;
  margin: 0 auto 7px;
  object-fit: contain;
}

.login-version {
  margin: -3px 0 10px;
  color: #999ea8;
  font-size: 12px;
  text-align: center;
}

.login-dialog label {
  margin-top: 5px;
  color: #c8cbd1;
  font-size: 13px;
}

.login-dialog input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #50545e;
  border-radius: 6px;
  outline: none;
  background: #191b20;
  color: #fff;
  font: inherit;
}

.login-dialog input:focus {
  border-color: #6ca0dc;
  box-shadow: 0 0 0 2px rgb(108 160 220 / 20%);
}

.login-dialog button {
  height: 39px;
  margin-top: 13px;
  border: 0;
  border-radius: 6px;
  background: #3977bd;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.login-dialog button:hover:not(:disabled) { background: #4386d2; }
.login-dialog button:disabled { cursor: wait; opacity: 0.65; }

.login-error {
  min-height: 18px;
  margin: 5px 0 -4px;
  color: #ff9d9d;
  font-size: 13px;
}
.scene {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--scene-design-width, 1920px);
  height: var(--scene-design-height, 1080px);
  overflow: hidden;
  background: #0d0f12;
  transform: scale(var(--scene-scale-x), var(--scene-scale-y));
  transform-origin: top left;
}

.scene-background,
.scene-background-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-background {
  z-index: 0;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}

.scene-background.interactive-hit { cursor: pointer; }

.scene-background img {
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.scene-background-image {
  object-fit: cover;
}

.scene-background-image.stretch { object-fit: fill; }
.scene-background-image.contain { object-fit: contain; }

.scene-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.scene-layer.interactive {
  cursor: default;
  pointer-events: none;
}

.scene-layer.interactive.pixel-hover:not(:disabled),
.scene-layer.interactive:focus-visible:not(:disabled) {
  filter:
    drop-shadow(0 0 calc(var(--interaction-glow-size) / 2)
      var(--interaction-glow-color))
    drop-shadow(0 0 var(--interaction-glow-size)
      var(--interaction-glow-color));
}

.scene-layer.tint {
  pointer-events: none;
}

.scene-layer.effect {
  pointer-events: none;
}

.scene-effect-colorize {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-layer-filter-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.scene-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.scene-layer.sprite {
  inset: auto;
  perspective-origin: 50% 50%;
  transform-origin: top left;
}

.scene-layer.sprite img {
  display: block;
  object-fit: fill;
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: visible;
  pointer-events: none;
  user-select: none;
}

.scene-positioned {
  position: absolute;
  --edge-offset: 20px;
}

.scene-positioned[data-position="top-left"] {
  top: var(--edge-offset);
  left: var(--edge-offset);
}

.scene-positioned[data-position="top-center"] {
  top: var(--edge-offset);
  left: 50%;
  transform: translateX(-50%);
}

.scene-positioned[data-position="top-right"] {
  top: var(--edge-offset);
  right: var(--edge-offset);
}

.scene-positioned[data-position="center-left"] {
  top: 50%;
  left: var(--edge-offset);
  transform: translateY(-50%);
}

.scene-positioned[data-position="center"] {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.scene-positioned[data-position="center-right"] {
  top: 50%;
  right: var(--edge-offset);
  transform: translateY(-50%);
}

.scene-positioned[data-position="bottom-left"] {
  bottom: var(--edge-offset);
  left: var(--edge-offset);
}

.scene-positioned[data-position="bottom-center"] {
  bottom: var(--edge-offset);
  left: 50%;
  transform: translateX(-50%);
}

.scene-positioned[data-position="bottom-right"] {
  right: var(--edge-offset);
  bottom: var(--edge-offset);
}

.scene-toolbar,
.scene-menu {
  z-index: 4;
  display: flex;
  gap: 9px;
}

.scene-menu {
  gap: var(--menu-gap, 12px);
}

.scene-menu[data-style] button {
  width: var(--menu-button-width, 360px);
  height: var(--menu-button-height, 64px);
  min-height: var(--menu-button-height, 64px);
}

.scene-menu[data-style="modern"] button {
  border-color: #626a77;
  border-radius: 8px;
  background: linear-gradient(180deg, rgb(48 55 67 / 94%), rgb(25 29 36 / 94%));
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%), 0 5px 14px rgb(0 0 0 / 28%);
}

.scene-menu[data-style="modern"] button:hover:not(:disabled) {
  border-color: #8590a1;
  background: linear-gradient(180deg, rgb(67 77 93 / 96%), rgb(43 51 64 / 96%));
}

.scene-menu[data-style="classic"] button {
  border: 2px solid #b49359;
  border-radius: 5px;
  background: linear-gradient(180deg, rgb(83 60 39 / 96%), rgb(43 30 21 / 96%));
  color: #f5e6c7;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.035em;
  box-shadow: inset 0 0 0 2px rgb(39 25 16 / 70%), 0 5px 15px rgb(0 0 0 / 36%);
}

.scene-menu[data-style="classic"] button:hover:not(:disabled) {
  border-color: #e0c180;
  background: linear-gradient(180deg, rgb(111 80 49 / 98%), rgb(61 41 27 / 98%));
}

.scene-menu[data-style="military"] button {
  border: 1px solid #a6aa7b;
  border-radius: 0;
  background:
    linear-gradient(135deg, transparent 10px, rgb(56 65 43 / 97%) 0) top left,
    linear-gradient(315deg, transparent 10px, rgb(42 49 33 / 97%) 0) bottom right;
  background-size: 51% 100%;
  background-repeat: no-repeat;
  color: #eef0d3;
  font-family: "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgb(21 25 17 / 70%), 0 5px 14px rgb(0 0 0 / 38%);
}

.scene-menu[data-style="military"] button:hover:not(:disabled) {
  border-color: #d0d5a0;
  background:
    linear-gradient(135deg, transparent 10px, rgb(78 91 57 / 98%) 0) top left,
    linear-gradient(315deg, transparent 10px, rgb(60 70 45 / 98%) 0) bottom right;
  background-size: 51% 100%;
  background-repeat: no-repeat;
}

.scene-toolbar[data-layout="horizontal"],
.scene-menu[data-layout="horizontal"] { flex-direction: row; }

.scene-toolbar[data-layout="vertical"],
.scene-menu[data-layout="vertical"] { flex-direction: column; }

.scene-toolbar button,
.scene-menu button,
.game-dialog-buttons button {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #626a77;
  border-radius: 8px;
  background: rgb(25 29 36 / 90%);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.scene-toolbar button {
  box-sizing: border-box;
  width: var(--toolbar-button-width, 64px);
  height: var(--toolbar-button-height, 64px);
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--toolbar-button-color, #191D24E6);
}

.scene-toolbar button:hover:not(:disabled) { filter: brightness(1.14); }
.scene-menu button:hover:not(:disabled),
.game-dialog-buttons button:hover:not(:disabled) { background: #394454; }
.scene button:disabled { cursor: default; opacity: 0.5; }
.scene-menu button img,
.game-dialog-buttons button img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.scene-toolbar button img {
  width: var(--toolbar-button-size, 64px);
  height: var(--toolbar-button-size, 64px);
  max-width: none;
  flex: 0 0 auto;
  object-fit: var(--toolbar-image-fit, contain);
  transform: scale(var(--toolbar-content-scale-x, 1),
    var(--toolbar-content-scale-y, 1));
}

.scene-toolbar button > span {
  transform: scale(var(--toolbar-content-scale-x, 1),
    var(--toolbar-content-scale-y, 1));
}

.scene-toolbar button.icon-only > span { display: none; }

.scene-widgets {
  position: absolute;
  z-index: 3;
  display: flex;
  gap: var(--widget-gap, 8px);
  max-width: calc(100% - 36px);
}

.scene-widgets[data-layout="vertical"] { flex-direction: column; }
.scene-widgets[data-layout="horizontal"] {
  flex-direction: row;
  flex-wrap: wrap;
}

.scene-widgets[data-position="top-left"] { top: 18px; left: 18px; }
.scene-widgets[data-position="top-center"] {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
}
.scene-widgets[data-position="top-right"] { top: 18px; right: 18px; }
.scene-widgets[data-position="center-left"] {
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
}
.scene-widgets[data-position="center"] {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.scene-widgets[data-position="center-right"] {
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
}
.scene-widgets[data-position="bottom-left"] { bottom: 18px; left: 18px; }
.scene-widgets[data-position="bottom-center"] {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
}
.scene-widgets[data-position="bottom-right"] { right: 18px; bottom: 18px; }

.scene-widget {
  box-sizing: border-box;
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 190px;
  padding: 10px 14px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 14px;
  color: #fff;
  background: var(--widget-surface, rgb(12 15 20 / 82%));
  box-shadow: 0 5px 18px rgb(0 0 0 / 24%);
  text-shadow: 0 1px 2px rgb(0 0 0 / 65%);
}

.scene-widget.time {
  justify-content: center;
  min-height: 64px;
}

.scene-widget-time {
  display: inline-flex;
  align-items: center;
  font-family: "Segment7", monospace;
  font-size: 27px;
  font-weight: 400;
  font-synthesis: none;
  line-height: 1;
  letter-spacing: 0.03em;
}

.scene-widget-time-separator {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 9px;
  height: 13px;
  font-size: 0;
}

.scene-widget-time-separator::before,
.scene-widget-time-separator::after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.scene-widget.date {
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}

.scene-widget-weekday { font-size: 19px; font-weight: 550; }
.scene-widget-date { font-size: 17px; }

.scene-widget.date-weather {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.scene-widget-date-weather-date,
.scene-widget-date-weather-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.scene-widget-date-weather-weather {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.scene-widget.date-weather .scene-widget-weather-image {
  flex: 0 0 auto;
}

.scene-widget.date-weather .scene-widget-temperature,
.scene-widget.date-weather .scene-widget-weather-description {
  align-self: auto;
}

.scene-widget.weather {
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: auto auto;
  min-height: 78px;
}

.scene-widget-weather-image {
  grid-row: 1 / 3;
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.scene-widget-temperature {
  align-self: end;
  font-size: 24px;
  line-height: 1;
}

.scene-widget-weather-description {
  align-self: start;
  color: rgb(255 255 255 / 78%);
  font-size: 13px;
}

.scene-widget.player {
  align-items: stretch;
  min-width: 220px;
}

.scene-widget-mood {
  width: 52px;
  height: 52px;
  align-self: center;
  border-radius: 50%;
  object-fit: cover;
}

.scene-widget-player-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}

.scene-widget-player-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 26px;
}

.scene-widget-player-row.money { justify-content: space-between; }

.scene-widget-stat-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  object-fit: contain;
}

.scene-widget-health-track {
  height: 9px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(255 255 255 / 22%);
}

.scene-widget-health-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #54e86d;
  box-shadow: 0 0 7px rgb(84 232 109 / 60%);
}

.scene-widget.stats {
  flex-direction: column;
  align-items: flex-start;
}
.scene-action-panel {
  z-index: 3;
  --edge-offset: 24px;
  position: absolute;
  width: calc(100% - 48px);
  height: var(--action-panel-height, 176px);
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  border-radius: 12px;
  background: transparent;
}

.scene-action-panel-surface {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.scene-action-panel-surface path {
  fill: var(--action-panel-surface, rgb(12 15 20 / 90%));
}

.scene-action-panel.scene-positioned[data-position="bottom-center"] {
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 0;
  transform: none;
}

.scene-action-panel.without-narrative {
  grid-template-columns: 1fr;
}

.scene-action-panel.without-narrative .scene-action-list {
  grid-column: 1 / -1;
  border-left: 0;
}

.scene-narrative {
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 24px 32px;
  background: transparent;
  font-size: 1.38em;
}

.scene-narrative p { margin: 0; }
.scene-narrative p.is-typing { cursor: pointer; }
.narrative-unrevealed { visibility: hidden; }

.scene-speaker-tab {
  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 24px;
  min-width: 240px;
  padding: 9px 25px 8.5px;
  background: transparent;
  font-size: 1.587em;
  line-height: 1.2;
  text-align: center;
}

.scene-action-list {
  display: flex;
  min-width: 0;
  height: 100%;
  gap: 10px;
  padding: 20px 28px;
}

.scene-panel-action {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.scene-panel-action-image {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  transform: translateY(0.085em);
}

.scene-panel-action-link {
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #edbc33;
  font: inherit;
  font-size: 1.38em;
  text-align: left;
  text-decoration: none;
  transform: translateY(-0.02em);
  cursor: pointer;
}

.scene-panel-action-link:hover:not(:disabled) {
  background: transparent;
  color: #fff;
  text-decoration: none;
}

.scene-panel-action-link:active:not(:disabled),
.scene-panel-action-link:focus:not(:disabled) {
  background: transparent;
  color: #edbc33;
  text-decoration: none;
}

.scene-panel-action-link:focus:hover:not(:disabled),
.scene-panel-action-link:active:hover:not(:disabled) {
  color: #fff;
}

.scene-action-list[data-layout="horizontal"] {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: flex-start;
}

.scene-action-list[data-layout="vertical"] {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.game.busy .scene button { pointer-events: none; opacity: 0.65; }


.bbcode-link,
.bbcode-action {
  color: #edbc33;
  text-decoration: underline;
}

.bbcode-action {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  line-height: inherit;
  vertical-align: baseline;
  cursor: pointer;
}

.bbcode-link:hover,
.bbcode-link:focus,
.bbcode-action:hover:not(:disabled),
.bbcode-action:focus:not(:disabled) {
  color: #fff;
}

.bbcode-action:disabled {
  color: inherit;
  text-decoration: none;
  cursor: default;
}

.login-providers:not([hidden]) {
  display: grid;
  gap: 9px;
  margin-top: 9px;
  padding-top: 16px;
  border-top: 1px solid #50545e;
}
.login-dialog .login-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0 12px;
}
.login-provider img { width: 24px; height: 24px; object-fit: contain; }
.login-dialog button:focus-visible { outline: 2px solid #a4caff; outline-offset: 3px; }
