/* Maze Wars UI kit: the ornate steel pieces from the Maze Wars project (F:\mw\ui\ornate,
   ui/panel.png and ui/default_theme.tres), as CSS 9-slices. The slice sizes and outsets
   match the theme's texture_margin and expand_margin values, so the pieces sit at 1:1
   as they do in game. Copy the PNGs over again if the game's look changes. */

@font-face {
  font-family: "MedievalSharp";
  src: url("fonts/MedievalSharp-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  /* default_theme.tres colours */
  --mw-ink: #ebe3d4;          /* Label/font_color 0.92 0.89 0.83 */
  --mw-ink-hi: #fff7e6;       /* Button/font_hover_color 1 0.97 0.9 */
  --mw-ink-dim: #b3ab9c;      /* Button/font_disabled_color 0.7 0.67 0.61 */
  --mw-gold: #c28a36;         /* slider/progress fill 0.76 0.54 0.21 */
  --mw-gold-light: #e0a847;   /* grabber highlight 0.88 0.66 0.28 */
  --mw-gold-hi: #ffd14d;      /* caret / grabber border 1 0.82 0.3 */
  --mw-steel: #8c806b;        /* window border 0.55 0.5 0.42 */
  --mw-steel-dark: #4a453d;   /* slider border 0.29 0.27 0.24 */
  --mw-iron: #211f1d;         /* dialog panel 0.13 0.125 0.115 */
  --mw-iron-deep: #0d0c0b;    /* slider track 0.05 0.047 0.043 */
  /* Faces of the textures below, sampled from their centres */
  --mw-frame-face: #1d1c1b;
  --mw-inset-face: #161514;
  --mw-plate-face: #272624;
  --mw-font: "MedievalSharp", Georgia, serif;
}

/* WindowPanel: the riveted steel frame with corner plates. The face is a background
   (not border-image fill) so it doesn't band when stretched. */
.mw-frame {
  border: 0 solid transparent;
  border-image: url("frame_outer.png") 38 / 38px / 10px stretch;
  border-radius: 3px;
  background: radial-gradient(ellipse at 50% 35%, #252321, var(--mw-frame-face) 75%);
  padding: 24px;
  color: var(--mw-ink);
}

/* InsetPanel: the sunken well round lists and previews */
.mw-inset {
  border: 0 solid transparent;
  border-image: url("frame_inset.png") 26 / 26px / 6px stretch;
  border-radius: 3px;
  background: var(--mw-inset-face);
  padding: 6px;
}

/* PanelContainer: the steel plate with bracketed corners */
.mw-plate {
  border: 0 solid transparent;
  border-image: url("plate.png") 20 / 20px stretch;
  background: linear-gradient(to bottom, #1d1c1a, var(--mw-plate-face));
  padding: 16px 20px;
  color: var(--mw-ink);
}

/* Button: steel by default; the gold "selected" plate marks the primary action.
   --mw-h sets the height; the plate's glow and shadow spill 10px outside it. */
.mw-button,
.mw-button-primary {
  --mw-h: 48px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--mw-h);
  min-width: calc(var(--mw-h) * 3);
  padding: 0 calc(var(--mw-h) * 0.5);
  border: 0 solid transparent;
  border-image: url("btn_normal.png") 15 fill / 15px / 10px stretch;
  font-family: var(--mw-font);
  font-size: calc(var(--mw-h) * 0.4);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  color: var(--mw-ink);
  text-shadow: 0 1px 0 #000, 0 0 3px rgba(0, 0, 0, 0.8);
  cursor: pointer;
  /* Fetch the other states up front so hovering doesn't flash. */
  background: url("btn_hover.png") no-repeat, url("btn_pressed.png") no-repeat,
    url("btn_selected_hover.png") no-repeat;
  background-size: 0 0;
  transition: color 120ms ease;
}

.mw-button:hover {
  border-image-source: url("btn_hover.png");
  color: var(--mw-ink-hi);
}

.mw-button-primary {
  border-image-source: url("btn_selected.png");
  color: var(--mw-ink-hi);
}

.mw-button-primary:hover {
  border-image-source: url("btn_selected_hover.png");
  color: #fff;
}

.mw-button:active,
.mw-button-primary:active {
  border-image-source: url("btn_pressed.png");
  padding-top: 2px;
}

.mw-button[aria-disabled="true"],
.mw-button:disabled,
.mw-button-primary[aria-disabled="true"],
.mw-button-primary:disabled {
  border-image-source: url("btn_disabled.png");
  padding-top: 0;
  color: color-mix(in srgb, var(--mw-ink-dim) 60%, transparent);
  cursor: default;
  pointer-events: none;
}

/* A small gold-edged tag, as on the game's tooltip and popup panels */
.mw-tag {
  --mw-h: 28px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  height: var(--mw-h);
  padding: 0 calc(var(--mw-h) * 0.45);
  border: 1px solid color-mix(in srgb, var(--mw-gold-hi) 75%, transparent);
  border-radius: 2px;
  background: rgba(17, 16, 15, 0.94);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
  font-family: var(--mw-font);
  font-size: calc(var(--mw-h) * 0.46);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--mw-gold-hi);
}
