/* Haunted House site: colors and shapes match the game's UI (scripts/ui/ui_config.gd). */
:root {
  --bg: #14121a;
  --panel: rgba(26, 15, 36, 0.92);
  --pill: #291a38;
  --pill-border: #6b4d8c;
  --title: #ffeb59;
  --title-outline: #400d4d;
  --tile: #12091a;
  --tile-text: #2e0a38;
  --text: #ece6f5;
  --muted: #b8aecb;
  --scare: #ffeb59;
  --money: #73f280;
  --danger: #f24d4d;
  --star: #ffcc33;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(107, 77, 140, 0.35), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Open Sans", system-ui, sans-serif;
  font-weight: 600;
  line-height: 1.5;
  overflow-x: hidden;
}

img.pixel { image-rendering: pixelated; }

a { color: var(--title); }

/* --- Title ---------------------------------------------------------- */
.title {
  position: relative;
  margin: 0;
  font-size: 1em;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  color: var(--title);
  -webkit-text-stroke: 0.12em var(--title-outline);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}

.title-wrap {
  position: relative;
  display: inline-block;
  font-size: clamp(44px, 11vw, 84px);
}

/* Miss Kitty, the mascot, sits on the title like on the game's title screen. */
.kitty-sitter {
  position: absolute;
  right: 4%;
  /* Sits on the letters' cap height, a little below the line box's top. */
  top: -0.66em;
  width: 0.9em;
  z-index: 2;
}

.page-title { font-size: clamp(34px, 8vw, 56px); }

/* On panels the sitter is sized in pixels instead. */
.panel > .kitty-sitter { font-size: 56px; top: -48px; right: 24px; }

/* --- HUD pills ------------------------------------------------------ */
.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 2px solid var(--pill-border);
  border-radius: 12px;
  background: var(--pill);
  font-size: 16px;
  white-space: nowrap;
}

.pill .scare { color: var(--scare); }
.pill .money { color: var(--money); }
.pill .round { color: #d9d1f2; }
.pill .stars { color: var(--star); letter-spacing: 1px; }
.pill .danger { color: var(--danger); letter-spacing: 1px; }

/* --- Layout --------------------------------------------------------- */
.page {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 16px 48px;
  text-align: center;
}

.panel {
  position: relative;
  max-width: 680px;
  margin: 28px auto 0;
  padding: 22px 24px;
  border-radius: 14px;
  background: var(--panel);
  text-align: left;
}

.panel h2 {
  margin: 0 0 8px;
  color: var(--title);
  font-size: 22px;
}

.panel h3 {
  margin: 20px 0 4px;
  font-size: 17px;
}

.panel p, .panel li { color: var(--text); font-weight: 500; }

.panel .muted { color: var(--muted); }

.tagline {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 18px;
}

/* --- The full house ------------------------------------------------- */
.house-stage {
  position: relative;
  margin: 34px auto 0;
  width: min(432px, 88vw);
}

.house {
  position: relative;
  width: 100%;
  aspect-ratio: 144 / 240;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--pill-border), 0 24px 60px rgba(0, 0, 0, 0.6);
}

.house > img.house-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Guests stand on 24px tiles of the 144x240 house; positions are set in percent. */
.guest {
  position: absolute;
  width: calc(16 / 144 * 100%);
  aspect-ratio: 1;
  animation: hop 1.6s ease-in-out infinite;
}

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6%); }
}

/* --- Big characters leaning in from the edges ------------------------ */
.leaner {
  position: fixed;
  width: clamp(120px, 22vw, 220px);
  z-index: 0;
  pointer-events: none;
  animation: bob 1.8s ease-in-out infinite;
}

.leaner.left { left: clamp(-90px, -9vw, -50px); }
.leaner.right { right: clamp(-90px, -9vw, -50px); transform: scaleX(-1); }
.leaner.right { animation-name: bob-flipped; }

@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

@keyframes bob-flipped {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -10px; }
}

.page > *:not(.leaner) { position: relative; z-index: 1; }

/* --- Persona buttons -------------------------------------------------- */
.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 22px;
  margin: 40px 0 0;
}

.persona {
  display: inline-block;
  min-width: 200px;
  padding: 12px 28px;
  border: 3px solid #fff;
  background: var(--tile);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000, 2px 2px 0 #000;
  transform: rotate(-3deg) skewX(-12deg);
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.persona:nth-child(2) { transform: rotate(2.5deg) skewX(-12deg); }
.persona:nth-child(3) { transform: rotate(-1.5deg) skewX(-12deg); }

.persona:hover, .persona:focus-visible, .persona.primary {
  background: var(--title);
  border-color: var(--tile-text);
  color: var(--tile-text);
  text-shadow: none;
}

.persona:hover, .persona:focus-visible { transform: rotate(-4.5deg) skewX(-12deg) scale(1.06); }

.persona.disabled { opacity: 0.55; pointer-events: none; }

.persona > span { display: inline-block; transform: skewX(12deg); }

/* --- Cast grid ------------------------------------------------------ */
.cast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.cast img {
  width: 100%;
  aspect-ratio: 1;
}

.icon-star {
  color: var(--star);
}

footer {
  margin-top: 48px;
  color: var(--muted);
  font-size: 14px;
}

footer a { color: var(--muted); }

@media (max-width: 560px) {
  .page { padding-top: 56px; }
  .persona { min-width: 0; width: 100%; max-width: 320px; font-size: 20px; }
  .leaner { opacity: 0.8; }
}
