/* Game font — bundled Tahoma (same TTFs the Godot build ships) */
@font-face {
  font-family: "GameTahoma";
  src: url("tahoma.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "GameTahoma";
  src: url("tahomabd.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* page */
  --page-bg:    #2b2b2b;   /* dark grey */
  --page-bg-2:  #242424;
  --header-fg:  #ffffff;

  /* win95 chrome */
  --win-face:   #c0c0c0;   /* classic 3D face */
  --win-hi:     #ffffff;   /* top-left highlight */
  --win-lt:     #dfdfdf;   /* inner highlight */
  --win-sh:     #808080;   /* inner shadow */
  --win-dk:     #0a0a0a;   /* outer shadow */
  --title-navy: #000080;   /* active title bar */
  --title-blue: #1084d0;   /* gradient end */
  --win-text:   #000000;

  /* layout */
  --content-max: 720px;    /* skinnier centred page column */
  --gutter:      2rem;
  --panel-bg:    #353535;   /* page panel — slightly lighter than --page-bg */
  --void:        #0a0a0b;   /* near-black sides */
}

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

html, body { height: 100%; }

body {
  /* near-black sides with a soft vignette toward the edges */
  background:
    radial-gradient(130% 100% at 50% 0%, #17171a 0%, var(--void) 70%);
  background-color: var(--void);
  color: var(--header-fg);
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100vh;
}

/* Centred page panel — a lit slab floating over the dark void */
.page {
  position: relative;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 100vh;
  /* top-lit gradient gives the slab depth */
  background: linear-gradient(180deg, #3b3b3e 0%, #2e2e30 100%);
  /* hairline light edges + understated rim-light + drop shadow */
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),   /* top glare */
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 24px 70px rgba(0, 0, 0, 0.6);            /* floats over the void */
  display: flex;
  flex-direction: column;
}

/* ───────── HEADER ───────── */
header {
  position: relative;
  z-index: 2;
  /* faint top sheen so the bar catches light */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  /* dark lip at the bottom of the header — top wall of the groove */
  border-bottom: 1px solid rgba(0, 0, 0, 0.6);
}

/* Recessed channel: the body below sits in a machined groove.
   A crisp light catch on its top edge + a soft inner shadow pressed
   INTO the body (not a blurry shadow dropped on top of it). */
.stage {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 6px 8px -6px rgba(0, 0, 0, 0.7);
}

/* inner bar fills the page panel */
header .bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  padding: 2rem var(--gutter);
}

header .logo {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  display: block;
}

header .wordmark {
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.1;
  color: var(--header-fg);
}

/* ───────── STAGE (centres the popup within the page panel) ───────── */
.stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem var(--gutter) 4rem;
}

/* ───────── WIN95 POPUP ───────── */
.window {
  width: 380px;
  max-width: 100%;
  background: var(--win-face);
  /* authentic raised 3D border */
  box-shadow:
    inset -1px -1px 0 0 var(--win-dk),
    inset  1px  1px 0 0 var(--win-hi),
    inset -2px -2px 0 0 var(--win-sh),
    inset  2px  2px 0 0 var(--win-lt);
  padding: 3px;
  font-family: "GameTahoma", "Tahoma", "Segoe UI", "MS Sans Serif", sans-serif;
  color: var(--win-text);
  user-select: none;
}

/* Title bar — navy → blue gradient like the in-game RunFrame */
.title-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 22px;
  padding: 0 3px 0 4px;
  background: linear-gradient(90deg, var(--title-navy) 0%, var(--title-blue) 100%);
  color: #ffffff;
}

.title-bar .title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 22px;
}

/* App icon in the title bar — like the in-game window.
   Tall figure: fill the bar height, let width follow naturally. */
.title-bar .title-icon {
  height: 19px;
  width: auto;
  flex: 0 0 auto;
  display: block;
  image-rendering: auto;
}

/* Close button (raised bevel) */
.title-btn {
  width: 17px;
  height: 15px;
  background: var(--win-face);
  box-shadow:
    inset -1px -1px 0 0 var(--win-dk),
    inset  1px  1px 0 0 var(--win-hi),
    inset -2px -2px 0 0 var(--win-sh),
    inset  2px  2px 0 0 var(--win-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  color: #000;
  cursor: default;
  text-decoration: none;
}
.title-btn:active {
  box-shadow:
    inset  1px  1px 0 0 var(--win-dk),
    inset -1px -1px 0 0 var(--win-hi),
    inset  2px  2px 0 0 var(--win-sh),
    inset -2px -2px 0 0 var(--win-lt);
}

/* Window body */
.window-body {
  padding: 18px 16px 16px;
}

/* Sunken white inset box */
.inset {
  background: #ffffff;
  /* sunken bevel (DL2 client-edge colours) */
  box-shadow:
    inset  1px  1px 0 0 #808080,
    inset -1px -1px 0 0 #ffffff,
    inset  2px  2px 0 0 #a0a0a0,
    inset -2px -2px 0 0 #e3e3e3;
  padding: 30px 16px;
  text-align: center;
  margin-bottom: 18px;
}

.inset .coming-soon {
  font-size: 1.15rem;
  font-weight: 700;
  color: #000080;
  letter-spacing: 0.02em;
}

/* Button row */
.button-row {
  display: flex;
  gap: 8px;
}

.win-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 8px;
  background: var(--win-face);
  color: #000;
  text-decoration: none;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 400;
  cursor: pointer;
  box-shadow:
    inset -1px -1px 0 0 var(--win-dk),
    inset  1px  1px 0 0 var(--win-hi),
    inset -2px -2px 0 0 var(--win-sh),
    inset  2px  2px 0 0 var(--win-lt);
}

.win-btn:active:not(.is-disabled) {
  box-shadow:
    inset  1px  1px 0 0 var(--win-dk),
    inset -1px -1px 0 0 var(--win-hi),
    inset  2px  2px 0 0 var(--win-sh),
    inset -2px -2px 0 0 var(--win-lt);
}

/* Disabled (greyed-out) — classic Win95 engraved label */
.win-btn.is-disabled {
  cursor: default;
  pointer-events: none;
}
.win-btn.is-disabled .label {
  color: var(--win-sh);            /* grey text */
  text-shadow: 1px 1px 0 var(--win-hi); /* engraved highlight */
}
.win-btn.is-disabled svg {
  color: var(--win-sh);
  opacity: 0.7;
}

.win-btn:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -4px;
}

.win-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: block;
}

.win-btn .label { line-height: 1; }

/* A single non-stretched button (used on the 404 page) */
.button-row.center { justify-content: center; }
.win-btn.compact { flex: 0 0 auto; min-width: 140px; }

/* ───────── FOOTER ───────── */
footer {
  width: 100%;
  text-align: center;
  padding: 1.25rem var(--gutter);
  font-size: 0.72rem;
  color: #888;
  border-top: 1px solid #404040;
}

footer a {
  color: #bbb;
  text-decoration: none;
}
footer a:hover { color: #fff; text-decoration: underline; }
footer .sep { margin: 0 0.4rem; color: #555; }
