/* =========================================================
   The Critical Failures - styles.css
   - Visual / layout styles for hub, games, and placeholder pages
   - Static site version with future login/admin styles preserved
   ========================================================= */

/* -------------------------
   Fonts (local .woff2 files)
   ------------------------- */
@font-face{
  font-family: "PressStart";
  src: url("../fonts/PressStart2P-Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face{
  font-family: "GlassTTY";
  src: url("../fonts/Glass_TTY_VT220.woff2") format("woff2");
  font-display: swap;
}

/* -------------------------
   Root + base typography
   ------------------------- */
:root{
  --ui-font: "PressStart", system-ui, sans-serif;
  --dm-font: "GlassTTY", monospace;

  /* Shared UI colors */
  --ui-fill: #f2e9d8;
  --ui-stroke: rgba(20, 12, 8, 0.95);

  /* Login state colors (kept for future expansion) */
  --login-out: #52e6df; /* teal */
  --login-in:  #5cff79; /* green */

  /* Warm candle glow */
  --warm-core: rgba(255, 210, 140, 0.22);
  --warm-mid:  rgba(255, 200, 120, 0.16);
  --warm-far:  rgba(255, 160, 90, 0.08);

  /* Soft UI glow */
  --ui-glow: rgba(255, 200, 120, 0.22);

  /* HUD label styling */
  --hud-bg: rgba(0, 0, 0, 0.45);
  --hud-border: rgba(92,255,121,0.3);
}

html, body{
  height: 100%;
  margin: 0;
  background: #000;
  font-family: var(--ui-font);
}

/* -------------------------
   Fullscreen stage/canvas
   ------------------------- */
.page .stage{
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Background images:
   - cover the screen
   - preserve top of image (crop bottom if needed)
*/
.bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Shared UI text style */
.ui-text{
  color: var(--ui-fill);
  letter-spacing: 1px;
  text-shadow:
    0 2px 0 var(--ui-stroke),
    0 0 10px var(--ui-glow);
}

.ui-link{
  text-decoration: none;
  cursor: pointer;
}

.ui-link:hover{
  text-shadow:
    0 2px 0 var(--ui-stroke),
    0 0 16px rgba(255, 200, 120, 0.40),
    0 0 26px rgba(255, 160, 90, 0.22);
}

/* =========================================================
   HUB PAGE (index.html) - Basement wide view
   ========================================================= */

/* Banner (top-left) */
.banner{
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 10;
}

.banner-title{
  font-size: clamp(28px, 3.2vw, 54px);
  line-height: 1.05;
  color: var(--login-in);
  text-shadow:
    0 0 6px rgba(92,255,121,0.35),
    0 0 18px rgba(92,255,121,0.25);
}

/* Bottom center navigation */
.nav-bottom{
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: clamp(32px, 6vw, 90px);
  z-index: 10;
  font-size: clamp(14px, 1.2vw, 20px);
}

/* Login indicator (top-right) - preserved for future use */
.login-indicator{
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 20;
  font-size: clamp(14px, 1.2vw, 20px);
  user-select: none;
}

/* State coloring applied by JS if login is restored later */
.login-indicator.is-logged-out{ color: var(--login-out); }
.login-indicator.is-logged-in{ color: var(--login-in); }

/* Clickable hotspot over the table on the hub page */
.hotspot{
  position: absolute;
  z-index: 6;
  display: block;
}

/* Elliptical hover glow hotspot (no harsh box edges) */
.hotspot-table{
  position: absolute;
  left: 34%;
  top: 50%;
  width: 42%;
  height: 32%;
  border-radius: 50% / 32%;
  overflow: visible;
  cursor: pointer;
}

.hotspot-table::after{
  content: "";
  position: absolute;
  inset: -38%;
  border-radius: 50%;

  background: radial-gradient(
    ellipse at 50% 60%,
    rgba(255,210,140,0.30) 0%,
    rgba(255,210,140,0.20) 25%,
    rgba(255,210,140,0.12) 45%,
    rgba(255,210,140,0.06) 60%,
    rgba(255,210,140,0.03) 70%,
    rgba(255,210,140,0.00) 90%
  );

  filter: blur(45px);
  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}

.hotspot-table:hover::after{
  opacity: 1;
}

/* =========================================================
   GAMES PAGE (games.html) - Table view + books + HUD
   ========================================================= */

/* Home icon button (top-left corner) */
.corner-btn{
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 30;

  width: 58px;
  height: 58px;

  display: grid;
  place-items: center;
  text-decoration: none;
  border-radius: 12px;

  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255, 220, 170, 0.2);
}

.corner-btn:hover{
  box-shadow: 0 0 18px rgba(255, 200, 120, 0.22);
}

.home-icon{
  font-size: 26px;
  color: var(--ui-fill);
  text-shadow: 0 2px 0 var(--ui-stroke), 0 0 10px var(--ui-glow);
}

/* -------------------------
   Book links
   ------------------------- */
.book{
  position: absolute;
  z-index: 8;
  display: block;
  overflow: visible;
  transition: transform .15s ease;
}

.book img{
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* Individual book positions */
.book-1{ left: 4%;  top: 60%; width: 25%; }
.book-2{ left: 28%; top: 37%; width: 20%; }
.book-3{ left: 48%; top: 57%; width: 20%; }

/* Candle-like elliptical hover glow */
.book::after{
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50% / 40%;

  background: radial-gradient(
    ellipse at 50% 60%,
    rgba(255, 200, 120, 0.36) 0%,
    rgba(255, 170, 90, 0.22) 28%,
    rgba(255, 140, 70, 0.14) 48%,
    rgba(255, 110, 50, 0.07) 65%,
    rgba(255, 90, 40, 0.03) 78%,
    rgba(255, 80, 30, 0.00) 90%
  );

  filter: blur(38px);
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}

.book:hover::after,
.book:focus-visible::after{
  opacity: 1;
  transform: scale(1.03);
}

.book:hover{
  transform: translateY(-3px);
}

/* HUD label (positioned by JS relative to book cluster) */
.hud-label{
  position: absolute;
  z-index: 11;

  font-size: clamp(16px, 1.2vw, 22px);
  padding: 12px 18px;

  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 10px;

  color: var(--login-in);
  text-shadow: 0 0 8px rgba(92,255,121,0.25);

  user-select: none;
  pointer-events: none;
}

/* -------------------------
   Future admin styles
   Preserved so commented HTML can be restored later
   ------------------------- */
.admin-corner{
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 40;

  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.admin-corner .login-indicator{
  position: static;
  top: auto;
  right: auto;
}

.dm-toggle{
  font-family: var(--dm-font);
  font-size: clamp(12px, 1.05vw, 16px);
  letter-spacing: 0.06em;
  text-transform: uppercase;

  color: var(--login-in);
  background: rgba(0,0,0,.70);
  border: 1px solid rgba(92,255,121,.35);
  border-radius: 10px;

  padding: 10px 12px;
  cursor: pointer;

  text-shadow: 0 0 10px rgba(92,255,121,.20);
  box-shadow: 0 0 18px rgba(0,0,0,.35);
}

.dm-toggle:hover{
  filter: brightness(1.08);
  box-shadow: 0 0 22px rgba(92,255,121,.14);
}

.dm-panel{
  width: min(420px, 36vw);
  height: 52vh;
  overflow: hidden;

  background: rgba(0,0,0,.82);
  border: 1px solid rgba(92,255,121,.35);
  border-radius: 14px;

  box-shadow:
    0 0 26px rgba(0,0,0,.55),
    0 0 18px rgba(92,255,121,.10);

  position: relative;
}

.dm-panel::before{
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(92,255,121,.16),
      rgba(92,255,121,.16) 1px,
      rgba(0,0,0,0) 3px,
      rgba(0,0,0,0) 6px
    );
}

.dm-panel__header{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 14px 10px 14px;
  border-bottom: 1px solid rgba(92,255,121,.22);
  font-family: var(--dm-font);
}

.dm-panel__title{
  color: var(--login-in);
  font-size: clamp(14px, 1.2vw, 18px);
  letter-spacing: 0.08em;
}

.dm-panel__status{
  color: rgba(92,255,121,.75);
  font-size: clamp(12px, 1.0vw, 14px);
}

.dm-panel__body{
  padding: 12px 14px;
  height: calc(52vh - 110px);
  overflow: auto;

  font-family: var(--dm-font);
  color: rgba(92,255,121,.92);
}

.dm-panel__hint{
  opacity: 0.85;
  font-size: clamp(12px, 1.0vw, 14px);
  margin-bottom: 10px;
}

.dm-row{
  border: 1px solid rgba(92,255,121,.18);
  border-radius: 12px;
  padding: 10px;
  margin: 10px 0;
  background: rgba(0,0,0,.50);
}

.dm-row__title{
  font-size: clamp(13px, 1.1vw, 16px);
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  color: rgba(92,255,121,.95);
}

.dm-field{
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.dm-field__label{
  font-size: clamp(11px, 0.95vw, 13px);
  opacity: 0.85;
}

.dm-input{
  font-family: var(--dm-font);
  font-size: clamp(12px, 1.0vw, 14px);
  color: rgba(92,255,121,.95);

  background: rgba(0,0,0,.65);
  border: 1px solid rgba(92,255,121,.25);
  border-radius: 10px;
  padding: 10px 10px;

  outline: none;
}

.dm-input:focus{
  border-color: rgba(92,255,121,.5);
  box-shadow: 0 0 10px rgba(92,255,121,.12);
}

.dm-check{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(12px, 1.0vw, 14px);
  user-select: none;
}

.dm-check input{
  width: 18px;
  height: 18px;
  accent-color: rgb(92,255,121);
}

.dm-panel__footer{
  padding: 12px 14px;
  border-top: 1px solid rgba(92,255,121,.22);
  display: flex;
  justify-content: flex-end;
}

.dm-save{
  font-family: var(--dm-font);
  font-size: clamp(12px, 1.0vw, 15px);
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: var(--login-in);
  background: rgba(0,0,0,.65);
  border: 1px solid rgba(92,255,121,.35);
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.dm-save:hover{
  filter: brightness(1.08);
}

/* =========================================
   SORRY PAGE
   Placeholder page for unfinished features
   ========================================= */

body.sorry-page {
  background-color: #000;
  margin: 0;
  height: 100vh;
  color: #00ff00;
  font-family: inherit;
}

.sorry-wrapper {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.sorry-image {
  max-width: 450px;
  height: auto;
}

.sorry-text {
  margin-top: 20px;
  width: 450px;
  text-align: center;
  font-size: 22px;
  letter-spacing: 1px;
  color: #00ff00;
}

.sorry-return{
  margin-top: 24px;
  font-size: 18px;

  text-decoration: none;
  color: #ffffff;   /* white instead of green */

  text-shadow:
    0 0 4px rgba(255,255,255,0.25);
}

.sorry-return:hover{
  text-shadow:
    0 0 8px rgba(255,255,255,0.45),
    0 0 16px rgba(255,255,255,0.25);
}
