/* Red / black Aero-inspired UI, sharp corners; Pixelify Sans = Minecraft-inspired (Google Fonts) */
:root {
  --bg-deep: #0a0000;
  --bg-mid: #1a0508;
  --glass: rgba(40, 0, 8, 0.45);
  --glass-edge: rgba(255, 60, 60, 0.35);
  --glass-highlight: rgba(255, 120, 120, 0.12);
  --text: #f0e0e0;
  --text-dim: #9a6a6a;
  --accent: #e02020;
  --accent-bright: #ff4040;
  --page-border: rgba(255, 80, 80, 0.55);
  --chrome: linear-gradient(
    180deg,
    rgba(90, 20, 30, 0.95) 0%,
    rgba(50, 5, 12, 0.98) 48%,
    rgba(30, 0, 6, 1) 100%
  );
  --font-pixel: "Pixelify Sans", "Segoe UI", system-ui, sans-serif;
  /* set95_windows_7_red / Aero Red — matches INSTALL.inf roles */
  --c-arrow: url("../assets/cursors/ColouredAero_arrow.cur") 0 0, auto;
  --c-link: url("../assets/cursors/ColouredAero_link.cur") 0 0, pointer;
  --c-text: url("../assets/cursors/ColouredAero_select.cur") 0 0, text;
  --c-help: url("../assets/cursors/ColouredAero_helpsel.cur") 0 0, help;
  --c-work: url("../assets/cursors/ColouredAero_working.ani") 0 0, progress;
  --c-busy: url("../assets/cursors/ColouredAero_busy.ani") 0 0, wait;
  --c-prec: url("../assets/cursors/ColouredAero_prec.cur") 0 0, crosshair;
  --c-no: url("../assets/cursors/ColouredAero_unavail.cur") 0 0, not-allowed;
  --c-ns: url("../assets/cursors/ColouredAero_ns.cur") 0 0, ns-resize;
  --c-ew: url("../assets/cursors/ColouredAero_ew.cur") 0 0, ew-resize;
  --c-nwse: url("../assets/cursors/ColouredAero_nwse.cur") 0 0, nwse-resize;
  --c-nesw: url("../assets/cursors/ColouredAero_nesw.cur") 0 0, nesw-resize;
  --c-move: url("../assets/cursors/ColouredAero_move.cur") 0 0, move;
  --c-pen: url("../assets/cursors/ColouredAero_pen.cur") 0 0, grab;
  --c-alt: url("../assets/cursors/ColouredAero_alt.cur") 0 0, alias;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  cursor: var(--c-arrow);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-pixel);
  color: var(--text);
  background: var(--bg-deep);
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  cursor: inherit;
}

/* Aero Red cursor roles (see assets/cursors/INSTALL.inf) */
a,
button,
[role="button"],
label[for],
summary {
  cursor: var(--c-link);
}

select {
  cursor: var(--c-arrow);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
textarea {
  cursor: var(--c-text);
}

:disabled,
[disabled],
[aria-disabled="true"] {
  cursor: var(--c-no);
}

/* Centered main box with outer border */
.page {
  /* Keep the whole layout (box + counter) fitting in 1080p */
  max-width: min(720px, 100vw - 2rem);
  max-width: 100%;
  width: 100%;
  /* Add a bit of breathing room even when content is short */
  min-height: min(680px, 100vh - 2rem);
  margin-top: auto;
  margin-bottom: auto;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border: 2px solid var(--page-border);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.75),
    0 16px 48px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 120, 120, 0.18);
  overflow: hidden;
  background: rgba(8, 0, 2, 0.35);
}

/* Subtle red glow grid + vignette (keeps file size tiny vs large images) */
.aero-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(80, 0, 15, 0.5), transparent 55%),
    radial-gradient(ellipse 100% 80% at 50% 100%, rgba(120, 0, 20, 0.25), transparent 50%),
    linear-gradient(180deg, #120003 0%, var(--bg-deep) 40%, #050000 100%);
  pointer-events: none;
}

.aero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 0, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.6;
}

/* Top title bar — Aero strip */
.title-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 36px;
  padding: 0 8px 0 10px;
  background: var(--chrome);
  border-bottom: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 rgba(255, 100, 100, 0.25),
    0 1px 0 rgba(0, 0, 0, 0.6);
}

.title-bar__icon {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--accent-bright), #600010);
  border: 1px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.title-bar__text {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px #000;
}

.title-bar__controls {
  display: flex;
  gap: 2px;
}

.title-bar__btn {
  width: 36px;
  height: 22px;
  display: block;
  padding: 0;
  cursor: var(--c-link);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 80, 80, 0.25), rgba(40, 0, 10, 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.title-bar__btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(255, 80, 80, 0.18);
}

.title-bar__btn.is-active {
  background: linear-gradient(180deg, #c03030, #501010);
  outline: 1px solid rgba(255, 120, 120, 0.35);
  outline-offset: -2px;
}

.title-bar__btn:focus-visible {
  outline: 2px solid rgba(255, 120, 120, 0.6);
  outline-offset: 1px;
}

.app-page[hidden] {
  display: none;
}

.title-bar__btn--close {
  /* Bright red is now reserved for the active page button. */
}

/* Main glass region — fills square; scrolls when needed */
.shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: visible;
  overflow-x: hidden;
  padding: 1.25rem 0.75rem 1.5rem;
  display: block;
}

/* Every “page” centered by default */
.app-page {
  display: grid;
  gap: 1rem;
  justify-items: center;
  align-content: start;
}

/* Centered single-column pages */
.app-page > .aero-window {
  width: 100%;
  max-width: 520px;
}

/* Home: centered 2-column layout (main + side) + centered widget row */
@media (min-width: 640px) {
  .app-page[data-page="home"] {
    grid-template-columns: 520px 240px;
    justify-content: center;
    align-items: start;
  }

  .app-page[data-page="home"] .aero-window--narrow {
    max-width: 240px;
  }

  .app-page[data-page="home"] .discord-embed {
    grid-column: 1 / -1;
  }
}

/* Aero window — sharp corners, blur */
.aero-window {
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5),
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 var(--glass-highlight);
}

.aero-window--narrow {
  max-width: 520px;
}

.aero-window__chrome {
  padding: 0.5rem 0.75rem;
  background: linear-gradient(
    180deg,
    rgba(100, 20, 35, 0.55) 0%,
    rgba(30, 5, 12, 0.85) 100%
  );
  border-bottom: 1px solid rgba(255, 60, 60, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 150, 150, 0.12);
}

.aero-window__title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  text-shadow: 0 1px 2px #000;
}

.aero-window__body {
  padding: 1rem 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 400;
}

.lead {
  margin-top: 0;
  font-weight: 700;
  color: var(--accent-bright);
  text-shadow: 0 0 12px rgba(255, 40, 40, 0.35);
}

.aero-window__body p {
  margin: 0 0 1rem;
  color: var(--text-dim);
}

.aero-window__body p:last-child {
  margin-bottom: 0;
}

.link-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.875rem;
}

.link-list a {
  color: var(--accent-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 64, 64, 0.4);
}

.link-list a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

/* Status strip */
.status-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 26px;
  padding: 0 10px;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: linear-gradient(180deg, rgba(25, 0, 5, 0.95), #080002);
  border-top: 1px solid rgba(255, 50, 50, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 80, 80, 0.08);
}

.status-bar__sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 80, 80, 0.25);
}

/* Counter under the bordered square */
.counter-outside {
  width: 100%;
  max-width: 720px;
  display: flex;
  justify-content: center;
  margin-top: 0.75rem;
}

.counter-outside__img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Discord widget on Home tab */
.discord-embed {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
}

.discord-embed iframe {
  border: 0;
  max-width: 100%;
}
