/*
 * Launcher styling in the ROSE in-game UI idiom.
 *
 * The game's windows are light panels floating over the 3D world: a cream outer
 * frame with rounded corners, a dusty mauve body, a dark olive title bar carrying
 * gold text, sunken near-black fields, and chunky gold buttons with a hard bevel.
 * Section headers use the orange gradient the party/quest windows use. Every colour
 * below is sampled from the client's own dialogs rather than invented.
 */

:root {
  color-scheme: dark;

  /* Window shell - fat ivory bezel over a lavender panel, as on the status window */
  --ui-frame: #fbf7ea;
  --ui-frame-shade: #cdc3a8;
  --ui-edge: #2a2038;
  --ui-body: #9a92cd;
  --ui-body-dark: #7a71ae;
  --ui-body-line: #574d86;

  /* Title bars */
  --ui-title: #4a3c1b;
  --ui-title-dark: #2c2410;
  --ui-purple: #a99ee0;
  --ui-purple-mid: #8073bd;
  --ui-purple-dark: #5d4f96;
  --ui-purple-edge: #3b2f66;
  --ui-gold: #f0d074;
  --ui-gold-bright: #ffeaa8;
  --ui-gold-dim: #c9ab5f;

  /* Orange window title, teal sub-header - the party window uses exactly this pair */
  --ui-orange: #f39d36;
  --ui-orange-light: #ffc45e;
  --ui-teal: #3093ba;
  --ui-teal-light: #63b8d8;
  --ui-teal-dark: #1f6c8e;

  /* Sunken fields and item slots */
  --ui-inset: #2a2211;
  --ui-inset-line: #16110a;
  --ui-slot: #43566a;
  --ui-slot-light: #6d879f;

  /* Buttons */
  --ui-btn: #f1dc9f;
  --ui-btn-mid: #d3ac5c;
  --ui-btn-dark: #a97f34;
  --ui-btn-edge: #6d4e1e;
  --ui-btn-ink: #33260b;
  --ui-blue: #a6bcd6;
  --ui-blue-mid: #7593b8;
  --ui-blue-dark: #4d6b92;
  --ui-blue-edge: #33496b;
  --ui-blue-ink: #10203a;

  /* Text on the mauve body */
  --ui-ink: #2b2018;
  --ui-ink-soft: #4a3a33;
  --ui-parchment: #f4e9d4;
  --ui-caption-ink: #fff;
  --ui-body-ink: #f2e6d8;

  --ui-danger: #ff9c8e;
  --ui-ok: #b6e88a;
  --ui-name: #8fd857;

  --ui-shadow: rgba(0, 0, 0, 0.55);
  --ui-font: Tahoma, Verdana, "Trebuchet MS", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  scrollbar-color: #b99a58 #2a2211;
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

*::-webkit-scrollbar-track {
  background: var(--ui-inset);
  border: 1px solid var(--ui-inset-line);
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #8c6a2c, #e0c37a, #8c6a2c);
  border: 1px solid #5d4318;
  border-radius: 2px;
}

/* ---------------------------------------------------------------- backdrop */

#loading-overlay,
#admin-overlay {
  color: var(--ui-parchment);
  font-family: var(--ui-font);
  /* ROSE is a bright, saturated world - its UI floats over sky and grass, never
     over a dark void. */
  background-color: #6fb7e8;
  background-image:
    linear-gradient(rgba(10, 16, 28, 0.24), rgba(10, 16, 28, 0.34)),
    url("ui/bg.jpg");
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
}

#loading-overlay {
  justify-content: flex-start;
  overflow: auto;
}

/* The game frames the whole screen with a thin light rule. */
#loading-overlay::before,
#admin-overlay::before {
  content: "";
  position: fixed;
  inset: 6px;
  z-index: -1;
  pointer-events: none;
  border: 1px solid rgba(247, 241, 222, 0.14);
  border-radius: 4px;
}

#launcher-shell {
  width: min(660px, calc(100% - 28px));
  margin: auto;
  padding: 26px 0 34px;
  font-size: 15px;
}

/* ------------------------------------------------------------------- brand */

.launcher-brand {
  position: relative;
  width: fit-content;
  min-width: min(520px, 86vw);
  margin: 0 auto 20px;
  padding: 0 40px 12px;
  text-align: center;
}

.launcher-brand::before,
.launcher-brand::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 42%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  border-radius: 2px;
  opacity: 0.75;
}

.launcher-brand::before {
  right: 50%;
  margin-right: 14px;
}

.launcher-brand::after {
  left: 50%;
  margin-left: 14px;
  background: linear-gradient(270deg, transparent, #fff);
}

/* The ROSE wordmark is a heavy gold serif with a hard dark outline. */
.launcher-brand #loading-logo {
  margin: 0;
  background:
    linear-gradient(#fff6cf 8%, var(--ui-gold) 42%, #d09c33 62%, #f6dd93 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 3px #5a3410;
  paint-order: stroke fill;
  filter: drop-shadow(0 3px 0 rgba(74, 40, 10, 0.9)) drop-shadow(0 5px 8px rgba(0, 0, 0, 0.4));
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: clamp(2.6rem, 7.5vw, 4.6rem);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
}

.launcher-brand #loading-subtitle {
  margin: 6px 0 0;
  color: #fff;
  font: bold 11px/1.2 var(--ui-font);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #a6620f, 0 2px 3px rgba(0, 0, 0, 0.45);
}

/* ------------------------------------------------------------------ window */

.launcher-card {
  position: relative;
  border: 18px solid transparent;
  border-image: url("ui/win.png") 6 fill stretch;
  image-rendering: pixelated;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.45));
}


.launcher-auth {
  width: min(400px, calc(100% - 28px));
  margin: 0 auto;
  padding: 0 0 18px;
}

/* -------------------------------------------------------------------- tabs */

.launcher-tabs {
  display: flex;
  align-items: stretch;
  gap: 3px;
  margin: -18px -18px 14px;
  padding: 3px 7px 0;
  border: 21px solid transparent;
  border-width: 11px 21px;
  border-image: url("ui/cap_orange.png") 8 fill stretch;
  image-rendering: pixelated;
}

.launcher-tabs button,
.launcher-button {
  appearance: none;
  min-height: 0;
  box-sizing: border-box;
  border: 14px solid transparent;
  border-width: 14px 20px;
  border-image: url("ui/btn.png") 8 9 fill stretch;
  image-rendering: pixelated;
  border-radius: 0;
  padding: 0 4px;
  min-height: 0;
  color: var(--ui-btn-ink);
  background: none;
  box-shadow: none;
  font: bold 15px/1.15 var(--ui-font);
  text-shadow: 0 1px rgba(255, 245, 205, 0.5);
  cursor: pointer;
  transition: filter 80ms linear;
}

.launcher-tabs button {
  min-height: 28px;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  padding: 6px 16px;
}

.launcher-tabs button.active {
  color: var(--ui-btn-ink);
}

/* ------------------------------------------------------------------ fields */

.launcher-form {
  display: grid;
  gap: 11px;
  padding: 0;
}

.launcher-field {
  display: grid;
  gap: 5px;
  color: var(--ui-body-ink);
  font: bold 13px/1.3 var(--ui-font);
  letter-spacing: 0.035em;
}

/* Sunken, near-black fields with gold text - the game's name/level readouts. */
.launcher-field input,
.launcher-field select,
.launcher-field textarea,
.launcher-inline input,
.admin-entry select,
#detail-gm-level {
  width: 100%;
  min-height: 0;
  box-sizing: border-box;
  border: 9px solid transparent;
  border-width: 9px 12px;
  border-image: url("ui/field.png") 4 fill stretch;
  image-rendering: pixelated;
  border-radius: 0;
  padding: 0 4px;
  outline: none;
  color: var(--ui-gold);
  background: none;
  box-shadow: none;
  font: 15px/1.25 var(--ui-font);
}

.launcher-field textarea,
.launcher-field input:focus,
.launcher-field select:focus,
.launcher-inline input:focus,
.admin-entry select:focus,
#detail-gm-level:focus {
  color: var(--ui-gold-bright);
  border-color: var(--ui-btn-dark);
  box-shadow:
    inset 1px 2px 4px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(240, 208, 116, 0.45);
}

.launcher-field select,
.admin-entry select,
#detail-gm-level {
  color-scheme: dark;
}

/* ----------------------------------------------------------------- buttons */

.launcher-button.primary {
  color: var(--ui-btn-ink);
}

.launcher-button.secondary {
  /* the default blue-grey */
  color: var(--ui-blue-ink);
}

.launcher-button.danger {
  color: #fff;
  border-color: var(--ui-frame);
  box-shadow: 0 0 0 1px #7a2b2b, inset 0 1px rgba(255, 235, 228, 0.7);
  background: linear-gradient(#f0a89c, #c76258 52%, #97382f);
  box-shadow:
    inset 1px 1px rgba(255, 224, 216, 0.7),
    inset -1px -1px rgba(80, 24, 20, 0.6),
    0 2px 2px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px rgba(255, 226, 218, 0.5);
}

.launcher-button:hover:not(:disabled),
.launcher-tabs button:hover:not(:disabled) {
  border-image: url("ui/btn_over.png") 8 9 fill stretch;
}

.launcher-button:active:not(:disabled) {
  border-image: url("ui/btn_down.png") 8 9 fill stretch;
}

.launcher-button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.65);
  opacity: 0.5;
}

/* ---------------------------------------------------------------- messages */

.launcher-message {
  min-height: 1.25em;
  margin: 8px 0 0;
  color: var(--ui-body-ink);
  font: 13px/1.5 var(--ui-font);
}

.launcher-message.error {
  color: var(--ui-danger);
}

.launcher-message.ok {
  color: var(--ui-ok);
}

/* ------------------------------------------------------------- app / title */

.launcher-app {
  padding: 0;
  border: 0;
  background: none;
  filter: none;
  overflow: visible;
}

/* Each block of the signed-in view is its own compact window floating over the
   world, the way the game never shows one panel covering the screen. */
.launcher-toolbar,
.launcher-grid > main,
.launcher-admin,
.launcher-app > .launcher-actions {
  border: 18px solid transparent;
  border-image: url("ui/win.png") 6 fill stretch;
  image-rendering: pixelated;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
}

.launcher-grid > main,
.launcher-admin,
.launcher-app > .launcher-actions {
  margin: 0 0 14px;
  padding: 0;
}

.launcher-app > .launcher-actions {
  justify-content: flex-end;
  gap: 10px;
}

.launcher-grid {
  display: block;
  margin: 0;
}

.launcher-admin {
  padding-top: 0;
  border-top-width: 18px;
  box-shadow: none;
}

.launcher-toolbar,
.launcher-row,
.launcher-actions,
.launcher-inline {
  display: flex;
  align-items: center;
  gap: 7px;
}

/* The window's own title bar: dark olive with gold text. */
.launcher-toolbar {
  min-height: 26px;
  justify-content: space-between;
  margin: 0 0 14px;
  padding: 3px 8px;
  color: var(--ui-caption-ink);
  text-shadow: 0 1px 1px rgba(122, 60, 6, 0.95);
  border-width: 11px 21px;
  border-image: url("ui/cap_orange.png") 8 fill stretch;
  image-rendering: pixelated;
  font-weight: bold;
}

.launcher-user {
  font-size: 12px;
}

.launcher-user::before {
  content: "●";
  margin-right: 7px;
  color: var(--ui-name);
  font-size: 8px;
  text-shadow: 0 0 6px rgba(143, 216, 87, 0.8);
}

.launcher-user strong {
  color: #fff6c4;
}

.launcher-user small {
  margin-left: 7px;
  color: #ffe3b0;
  font-size: 10px;
}

.launcher-toolbar .launcher-button {
  min-height: 26px;
  padding: 4px 9px;
  font-size: 10px;
}

.launcher-toolbar a.launcher-button {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.launcher-grid {
  display: grid;
  margin: 0;
}

/* Section headers take the orange gradient bar of the party/quest windows. */
.launcher-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  padding: 0 6px;
  min-height: 0;
  color: #fff;
  border: 18px solid transparent;
  border-width: 9px 18px;
  border-image: url("ui/cap_teal.png") 8 fill stretch;
  image-rendering: pixelated;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font: bold 14px/1.2 var(--ui-font);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 1px rgba(12, 62, 84, 0.9);
  text-transform: uppercase;
}

.launcher-section-title::before {
  content: "◆";
  color: #d8f1fb;
  font-size: 9px;
  text-shadow: 0 1px 1px rgba(12, 62, 84, 0.9);
}

.launcher-section-title::after {
  content: "";
  flex: 1;
}

/* A section title used as a window title sits directly on the orange bar rather
   than stacking a second pill on top of it. */
.launcher-toolbar .launcher-section-title {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: #fff;
  text-shadow: 0 1px 1px rgba(122, 60, 6, 0.95);
}

.launcher-toolbar .launcher-section-title::before {
  color: #fff3d0;
  text-shadow: 0 1px 1px rgba(122, 60, 6, 0.95);
}

/* --------------------------------------------------------------- character */

#launcher-characters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 7px;
}

/* Character entries read as the game's item slots: sunken blue-grey plates. */
.character-card {
  position: relative;
  display: block;
  min-height: 72px;
  padding: 11px 11px 10px 17px;
  overflow: hidden;
  border: 1px solid #2b3947;
  border-radius: 8px;
  color: var(--ui-parchment);
  background: linear-gradient(rgba(255, 255, 255, 0.12), transparent 45%), var(--ui-slot);
  box-shadow:
    0 0 0 1px var(--ui-inset-line),
    inset 1px 2px 4px rgba(0, 0, 0, 0.5);
  text-align: left;
  cursor: pointer;
}

.character-card::before {
  content: "";
  position: absolute;
  inset: 4px auto 4px 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--ui-slot-light);
}

.character-card:hover {
  border-color: var(--ui-btn-dark);
  filter: brightness(1.12);
}

.character-card.selected {
  border-color: var(--ui-gold);
  background: linear-gradient(rgba(255, 235, 175, 0.16), transparent 45%), #4f6580;
  box-shadow:
    inset 1px 1px 3px rgba(0, 0, 0, 0.5),
    0 0 9px rgba(240, 208, 116, 0.45);
}

.character-card.selected::before {
  background: var(--ui-gold);
  box-shadow: 0 0 7px rgba(240, 208, 116, 0.8);
}

.character-card h3 {
  margin: 1px 0 5px;
  color: #dff3c4;
  font: bold 14px/1.2 var(--ui-font);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.character-meta {
  color: #d5e2ee;
  font: 10px/1.45 var(--ui-font);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
}

.character-create-open {
  margin-top: 9px;
}

.character-create-panel {
  margin-top: 12px;
  padding: 13px 0;
  border: 1px solid var(--ui-purple-edge);
  border-radius: 8px;
  background: rgba(45, 32, 82, 0.26);
  box-shadow: inset 0 2px 4px rgba(28, 18, 56, 0.5), 0 1px rgba(255, 255, 255, 0.14);
}

.character-create-panel > .launcher-section-title {
  margin: 0 13px 10px;
}

.character-create-panel > .launcher-message {
  margin: -4px 13px 11px;
}

.character-create-panel .launcher-form {
  padding: 0 13px;
}

.character-create-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  color: var(--ui-body-ink);
  border-bottom: 1px solid rgba(0, 0, 0, 0.18);
  font-size: 11px;
}

.character-create-stepper strong {
  margin-left: 6px;
  color: var(--ui-gold-bright);
}

.character-create-stepper .launcher-button {
  min-width: 34px;
  min-height: 26px;
  padding: 3px 9px;
  font-size: 15px;
}

.character-create-actions {
  margin-top: 3px;
}

.launcher-actions {
  justify-content: flex-end;
  margin: 10px 0 0;
  flex-wrap: wrap;
}

.character-create-actions,
.admin-entry .launcher-actions {
  margin-inline: 0;
}

#loading-sound {
  margin: 0 auto 0 0;
  color: var(--ui-body-ink);
  font: 10px var(--ui-font);
  letter-spacing: 0.03em;
}

/* The checked marker has to survive two things that both used to swallow it.
   The UA stylesheet makes form controls border-box, so a 14px box with a 9/12px
   border had no interior left at all - the field frame was the entire widget and
   the state was invisible. And `fill` paints the middle slice over the element
   background, which would hide the marker even once there is room for it. Hence
   an explicit content box, and the interior drawn as a background colour that
   matches field.png's centre pixel. */
#loading-sound input {
  appearance: none;
  box-sizing: content-box;
  width: 9px;
  height: 9px;
  margin: 0 5px -4px 0;
  border: 4px solid transparent;
  border-image: url("ui/field.png") 4 stretch;
  background: #332211;
  image-rendering: pixelated;
  cursor: pointer;
}

#loading-sound input:checked {
  background: #332211 url("ui/check.png") no-repeat center / 9px auto;
}

/* ------------------------------------------------------------------- admin */

.launcher-admin {
  margin: 0 0 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.22);
  box-shadow: 0 -1px rgba(255, 255, 255, 0.12);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 9px;
}

.admin-panel {
  min-width: 0;
  padding: 0 9px 9px;
  border: 1px solid var(--ui-purple-edge);
  border-radius: 8px;
  background: rgba(45, 32, 82, 0.26);
  box-shadow: inset 0 2px 4px rgba(28, 18, 56, 0.5), 0 1px rgba(255, 255, 255, 0.14);
}

.admin-panel > h3 {
  margin: 0 -9px 9px;
  padding: 4px 9px;
  color: #fff;
  border: 18px solid transparent;
  border-width: 9px 18px;
  border-image: url("ui/cap_teal.png") 8 fill stretch;
  image-rendering: pixelated;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-shadow: 0 1px 1px rgba(12, 62, 84, 0.9);
  font: bold 13px/1.2 var(--ui-font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-panel > h3::before {
  content: "▸";
  margin-right: 6px;
  color: #d8f1fb;
}

.admin-panel h4 {
  margin: 13px 0 7px;
  color: var(--ui-gold-bright);
  font: bold 11px var(--ui-font);
  text-transform: uppercase;
}

.admin-list {
  display: grid;
  gap: 4px;
}

.admin-entry {
  display: grid;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid #2b3947;
  border-left: 4px solid var(--ui-teal);
  border-radius: 6px;
  color: #e2ebf3;
  background: var(--ui-slot);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.4);
  font-size: 11px;
}

.admin-entry:nth-child(even) {
  background: #4a5d72;
}

.admin-entry > strong {
  color: #ffe9a8;
  font: bold 11px var(--ui-font);
}

.admin-entry > small {
  color: #c3d2e0;
  font-size: 10px;
}

.admin-entry .launcher-actions {
  align-items: center;
  justify-content: flex-start;
  margin: 0;
}

.admin-entry .launcher-button {
  min-height: 24px;
  padding: 3px 8px;
  font-size: 10px;
}

.admin-ticket-body {
  margin: 0;
  color: #d5e2ee;
  font-size: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.launcher-inline {
  align-items: stretch;
}

.launcher-inline input {
  min-width: 0;
}

/* ---------------------------------------------------------------- entering */

#launcher-entering {
  width: min(430px, calc(100% - 40px));
  margin: auto;
  padding: 26px;
  text-align: center;
}

#launcher-entering .launcher-section-title {
  justify-content: center;
}

#launcher-entering .launcher-message {
  margin-inline: 0;
}

.launcher-spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 16px;
  border: 4px solid rgba(0, 0, 0, 0.3);
  border-top-color: var(--ui-gold);
  border-radius: 50%;
  animation: launcher-spin 0.9s steps(12) infinite;
}

@keyframes launcher-spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------- 3D preview side-by-side */

#loading-overlay.preview-active {
  background:
    linear-gradient(90deg, rgba(16, 19, 26, 0.97) 0%, rgba(20, 24, 32, 0.92) 42%, rgba(16, 19, 26, 0.34) 67%, rgba(16, 19, 26, 0.04) 100%);
  pointer-events: none;
}

#loading-overlay.preview-active #launcher-shell {
  width: min(510px, calc(100% - 28px));
  margin: auto auto auto 24px;
  pointer-events: auto;
}

#loading-overlay.preview-active .launcher-brand {
  min-width: 0;
  margin-left: 0;
  padding-left: 12px;
  text-align: left;
}

#loading-overlay.preview-active .launcher-brand #loading-logo {
  font-size: 2.75rem;
}

#loading-overlay.preview-active .launcher-brand::before,
#loading-overlay.preview-active .launcher-brand::after {
  display: none;
}

#loading-overlay.preview-active .launcher-grid {
  display: block;
}

#loading-overlay.preview-active #launcher-characters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --------------------------------------------------------------- asset gate */

#asset-folder-gate {
  padding-top: 8px;
  text-align: center;
}

#asset-folder-gate::after {
  content: "LOCAL GAME FILES";
  position: absolute;
  top: -10px;
  left: 50%;
  z-index: 3;
  padding: 0 4px;
  min-height: 0;
  color: var(--ui-btn-ink);
  border: 1px solid var(--ui-btn-edge);
  border-radius: 4px;
  background: linear-gradient(var(--ui-btn), var(--ui-btn-mid) 55%, var(--ui-btn-dark));
  box-shadow: inset 0 1px rgba(255, 248, 214, 0.8);
  font: bold 9px var(--ui-font);
  letter-spacing: 0.14em;
  transform: translateX(-50%);
}

#asset-folder-gate .launcher-message {
  margin-bottom: 13px;
  text-align: left;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  #launcher-shell {
    width: min(100% - 18px, 1040px);
    padding: 14px 0 24px;
  }

  .launcher-brand {
    min-width: 0;
    padding-inline: 24px;
  }

  .launcher-form {
    padding-inline: 14px;
  }

  .launcher-message,
  .launcher-grid,
  .launcher-actions,
  .launcher-admin {
    margin-inline: 14px;
  }

  .launcher-grid {
    grid-template-columns: 1fr;
  }

  .launcher-toolbar {
    align-items: stretch;
  }

  .launcher-row,
  .launcher-toolbar {
    flex-direction: column;
  }

  .launcher-user {
    padding: 3px 0;
  }

  .launcher-toolbar .launcher-actions {
    justify-content: stretch;
    margin: 0;
  }

  .launcher-actions .launcher-button {
    flex: 1 1 auto;
  }

  #loading-overlay.preview-active {
    background: rgba(16, 19, 26, 0.92);
  }

  #loading-overlay.preview-active #launcher-shell {
    width: min(100% - 18px, 510px);
    margin: auto;
  }
}

@media (max-width: 460px) {
  .launcher-brand #loading-logo {
    font-size: 2.25rem;
  }

  .launcher-brand #loading-subtitle {
    letter-spacing: 0.25em;
  }

  #launcher-characters {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------- in-game DOM overlays */

/* Tooling that floats over the game canvas (overlay.js): the ticket form, and
   the GM panel once it moves here. Wears the same window chrome as the
   launcher, so it reads as part of the same client rather than a web page. */
.rose-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 16, 28, 0.55);
  font-family: var(--ui-font);
}

.rose-overlay.hidden {
  display: none !important;
}

.rose-overlay-window {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.rose-overlay-window .launcher-form,
.rose-overlay-window .launcher-message,
.rose-overlay-window .launcher-actions {
  margin-inline: 14px;
}

.rose-overlay-window .launcher-field textarea {
  min-height: 96px;
  resize: vertical;
}

/* The console's own panels already carry chrome; inside the overlay they only
   need room to breathe. */
.rose-overlay-wide .launcher-admin {
  margin: 0 14px 14px;
  padding-top: 0;
  border: 0;
  box-shadow: none;
}

/* The console needs the room its panel grid was designed for. */
.rose-overlay-window.rose-overlay-wide {
  width: min(1100px, 100%);
}
