
/* ==========================================
   BADING TAMBAYAN — NEW VISUAL IDENTITY
   Homepage redesign · Phase 1
   ========================================== */

:root {
  --bt-ink: #21172c;
  --bt-plum: #352344;
  --bt-violet: #76529a;
  --bt-lilac: #d9c3f0;
  --bt-cream: #fbf4e9;
  --bt-gold: #e9c88d;
  --bt-line: rgba(255, 255, 255, 0.14);
}

/* HOMEPAGE FOUNDATION */
#home {
  isolation: isolate;
}

#home .hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 24px;
  min-height: 430px;
  padding: clamp(28px, 5vw, 68px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(233, 200, 141, .32);
  border-radius: 8px 34px 8px 34px;
  background:
    radial-gradient(ellipse at 78% 48%, rgba(126, 78, 157, .42), transparent 37%),
    radial-gradient(ellipse at 10% 100%, rgba(92, 55, 116, .34), transparent 42%),
    linear-gradient(112deg, #21172c 0%, #30203d 55%, #191426 100%);
  box-shadow: 0 24px 70px rgba(12, 7, 20, .28);
}

#home .hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .22;
  background-image:
    radial-gradient(rgba(255,255,255,.7) .7px, transparent .7px);
  background-size: 27px 27px;
  mask-image: linear-gradient(90deg, transparent, #000 75%);
}

#home .hero::after {
  content: "TAMBAYANVERSE";
  position: absolute;
  right: -12px;
  bottom: 12px;
  z-index: -1;
  color: rgba(255,255,255,.035);
  font-size: clamp(42px, 9vw, 118px);
  font-weight: 900;
  letter-spacing: .12em;
  white-space: nowrap;
  pointer-events: none;
}

#home .hero-copy {
  position: relative;
  z-index: 2;
  max-width: 590px;
}

#home .hero .eyebrow {
  color: var(--bt-gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .23em;
}

#home .hero h1 {
  margin: 18px 0;
  color: var(--bt-cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(38px, 6vw, 70px);
  font-weight: 500;
  line-height: .99;
  letter-spacing: -.055em;
}

#home .hero h1 em {
  display: inline-block;
  margin-top: 9px;
  color: var(--bt-gold);
  font-size: .72em;
  font-weight: 400;
  letter-spacing: -.04em;
}

#home .hero-text {
  max-width: 420px;
  color: rgba(251,244,233,.76);
  font-size: 14px;
  line-height: 1.9;
}

#home .hero-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 27px;
}

#home .hero .primary-btn {
  border: 1px solid var(--bt-gold);
  border-radius: 3px 15px 3px 15px;
  background: var(--bt-gold);
  color: var(--bt-ink);
  font-weight: 800;
  box-shadow: 5px 5px 0 rgba(233,200,141,.18);
  transition: transform .22s ease, box-shadow .22s ease;
}

#home .hero .primary-btn:hover {
  transform: translate(-2px, -3px);
  box-shadow: 8px 9px 0 rgba(233,200,141,.16);
}

#home .hero .soft-btn {
  border: 1px solid rgba(251,244,233,.3);
  border-radius: 3px 13px 3px 13px;
  background: rgba(255,255,255,.06);
  color: var(--bt-cream);
  backdrop-filter: blur(8px);
}

/* CUSTOM CSS-ILLUSTRATED UNIVERSE */
#home .hero-orbit {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 300px;
  isolation: isolate;
}

#home .hero-orbit::before {
  content: "";
  position: absolute;
  width: min(29vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #f5dfc0 0 2%, transparent 3%),
    radial-gradient(circle at 65% 70%, rgba(255,255,255,.16) 0 1%, transparent 2%),
    radial-gradient(circle at 38% 35%, #c99edc, #78528e 48%, #382548 75%);
  box-shadow:
    0 0 45px rgba(202,158,220,.25),
    0 0 110px rgba(146,99,177,.2),
    inset -25px -22px 45px rgba(20,12,29,.5);
  animation: btPlanetFloat 7s ease-in-out infinite;
}

#home .hero-orbit::after {
  content: "";
  position: absolute;
  width: min(38vw, 390px);
  aspect-ratio: 1;
  border: 1px solid rgba(233,200,141,.5);
  border-radius: 50%;
  transform: rotate(-24deg) scaleY(.36);
  box-shadow: 0 0 18px rgba(233,200,141,.12);
}

#home .hero-orbit .planet {
  z-index: 2;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 50%;
  background: rgba(35,23,46,.65);
  font-size: 35px;
  box-shadow: 0 0 35px rgba(233,200,141,.22);
}

#home .hero-orbit .orbit {
  position: absolute;
  border: 1px solid rgba(217,195,240,.2);
  border-radius: 50%;
  pointer-events: none;
}

#home .hero-orbit .orbit-a {
  width: 78%;
  height: 48%;
  transform: rotate(35deg);
}

#home .hero-orbit .orbit-b {
  width: 95%;
  height: 62%;
  transform: rotate(-35deg);
}

#home .hero-orbit .float {
  position: absolute;
  z-index: 3;
  filter: drop-shadow(0 0 10px rgba(233,200,141,.4));
  animation: btSparkFloat 5s ease-in-out infinite;
}

#home .hero-orbit .f1 {
  top: 12%;
  left: 18%;
}

#home .hero-orbit .f2 {
  right: 10%;
  top: 28%;
  animation-delay: -1.5s;
}

#home .hero-orbit .f3 {
  bottom: 13%;
  left: 20%;
  animation-delay: -3s;
}

@keyframes btPlanetFloat {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

@keyframes btSparkFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-10px) rotate(12deg); }
}

/* MOBILE HERO */
@media (max-width: 700px) {
  #home .hero {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: auto;
    padding: 32px 23px 18px;
    border-radius: 7px 25px 7px 25px;
  }

  #home .hero-copy {
    order: 1;
  }

  #home .hero-orbit {
    order: 2;
    min-height: 205px;
    margin-top: 4px;
  }

  #home .hero-orbit::before {
    width: 165px;
  }

  #home .hero-orbit::after {
    width: 225px;
  }

  #home .hero h1 {
    font-size: clamp(39px, 11vw, 58px);
  }

  #home .hero-text {
    font-size: 13px;
  }

  #home .hero::after {
    font-size: 45px;
    bottom: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home .hero-orbit *,
  #home .hero-orbit::before {
    animation: none !important;
  }
}

/* ==========================================
   PHASE 2 — SIX WORLDS, SIX PERSONALITIES
   ========================================== */

#home .world-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(175px, auto);
  gap: 13px;
  margin-top: 20px;
}

#home .world-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: 190px;
  padding: 23px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 5px 22px 5px 22px;
  text-decoration: none;
  transition: transform .3s ease, border-color .3s ease, filter .3s ease;
}

#home .world-card::before,
#home .world-card::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  transition: transform .5s ease, opacity .5s ease;
}

#home .world-card:hover {
  transform: translateY(-5px);
  filter: brightness(1.09);
}

#home .world-card .world-icon {
  align-self: flex-start;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: auto;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px 5px 16px 5px;
  font-size: 27px;
}

#home .world-card .world-kicker {
  margin-top: 24px;
  font-size: 9px;
  letter-spacing: .22em;
}

#home .world-card h3 {
  position: relative;
  margin: 7px 0 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 600;
  line-height: 1.08;
}

#home .world-card p {
  position: relative;
  min-height: 0;
  margin: 0 0 13px;
  font-size: 11px;
  line-height: 1.65;
}

#home .world-card b {
  position: relative;
  font-size: 10px;
  letter-spacing: .04em;
}

/* 01 — CHAOS ARCADE: neon cabinet */
#home .world-card.arcade {
  grid-column: span 2;
  grid-row: span 2;
  min-height: 370px;
  border-color: #ff4fc455;
  background:
    linear-gradient(145deg, transparent 35%, rgba(15,5,35,.92) 100%),
    repeating-linear-gradient(90deg, transparent 0 24px, #ff4fc40b 25px 26px),
    linear-gradient(135deg, #351052, #170d31 70%);
  box-shadow: inset 0 0 55px #ff3fc41c;
}

#home .world-card.arcade::before {
  width: 220px;
  height: 220px;
  top: 15px;
  right: -45px;
  border: 1px solid #ff62d766;
  border-radius: 50%;
  box-shadow: 0 0 0 18px #ff62d711, 0 0 0 38px #46eaff0b;
}

#home .world-card.arcade::after {
  width: 100px;
  height: 100px;
  top: 55px;
  right: 22px;
  border: 2px solid #4beaff88;
  transform: rotate(45deg);
}

#home .world-card.arcade .world-icon {
  color: #fff;
  background: #ff4fc422;
  box-shadow: 0 0 25px #ff4fc444;
}

#home .world-card.arcade .world-kicker,
#home .world-card.arcade b {
  color: #ff83df;
}

#home .world-card.arcade h3 {
  color: #fff0fc;
  font-size: clamp(25px, 3vw, 38px);
}

#home .world-card.arcade p {
  color: #d9c0ed;
}

/* 02 — COMFORT CORNER: soft paper and garden */
#home .world-card.comfort {
  border-color: #b8c9a477;
  background:
    radial-gradient(circle at 85% 15%, #ffffff88, transparent 38%),
    linear-gradient(145deg, #e8e6cc, #b8c9a4);
  color: #344735;
}

#home .world-card.comfort::before {
  width: 125px;
  height: 125px;
  top: -55px;
  right: -25px;
  border: 1px solid #718b6b66;
  border-radius: 50%;
  box-shadow: 0 0 0 15px #ffffff25, 0 0 0 30px #ffffff18;
}

#home .world-card.comfort .world-icon {
  background: #ffffff55;
  border-color: #718b6b55;
}

#home .world-card.comfort .world-kicker,
#home .world-card.comfort b {
  color: #526e4e;
}

#home .world-card.comfort h3 {
  color: #2c4934;
}

#home .world-card.comfort p {
  color: #50634d;
}

/* 03 — EXPERIMENT LAB: technical specimen label */
#home .world-card.lab {
  border: 1px solid #b5ef5277;
  border-radius: 3px;
  background:
    linear-gradient(0deg, #18251c 0%, #18251c 48%, transparent 100%),
    repeating-linear-gradient(0deg, #b5ef520a 0 1px, transparent 1px 17px),
    linear-gradient(135deg, #304a28, #15251d);
  color: #eaffcf;
}

#home .world-card.lab::before {
  top: 17px;
  right: 18px;
  width: 70px;
  height: 70px;
  border: 1px dashed #c4f76a99;
  border-radius: 50%;
}

#home .world-card.lab::after {
  top: 36px;
  right: 37px;
  width: 32px;
  height: 32px;
  border: 1px solid #f5a34d99;
  transform: rotate(45deg);
}

#home .world-card.lab .world-icon {
  background: #b5ef521a;
  border-color: #b5ef5266;
  border-radius: 3px;
}

#home .world-card.lab .world-kicker,
#home .world-card.lab b {
  color: #c6f76a;
}

#home .world-card.lab h3 {
  color: #f0ffd9;
}

#home .world-card.lab p {
  color: #c1d5b2;
}

/* 04 — MYSTERY LIBRARY: midnight and antique gold */
#home .world-card.library {
  grid-column: span 2;
  border-color: #c5a66b66;
  background:
    radial-gradient(ellipse at 80% 10%, #8d6caa33, transparent 45%),
    linear-gradient(110deg, #171a35, #302344 75%, #19172b);
  color: #f7e9c8;
}

#home .world-card.library::before {
  top: -45px;
  right: 32px;
  width: 130px;
  height: 180px;
  border: 1px solid #d8b97866;
  border-radius: 4px 18px 4px 18px;
  transform: rotate(18deg);
  box-shadow: 12px 8px 0 -1px #171a35, 13px 8px 0 0 #d8b97844;
}

#home .world-card.library .world-icon {
  background: #d8b97816;
  border-color: #d8b97855;
}

#home .world-card.library .world-kicker,
#home .world-card.library b {
  color: #e7c98c;
}

#home .world-card.library h3 {
  color: #fff1d2;
}

#home .world-card.library p {
  color: #d2c5dc;
}

/* 05 — CONFESSION ROOM: handwritten diary */
#home .world-card.diary {
  border-color: #d99aa477;
  background:
    repeating-linear-gradient(0deg, transparent 0 27px, #8d40551b 28px 29px),
    linear-gradient(145deg, #f0c9c5, #d89da8);
  color: #542c3b;
  border-radius: 3px 20px 3px 20px;
}

#home .world-card.diary::before {
  top: 20px;
  right: 23px;
  width: 54px;
  height: 68px;
  border: 1px solid #9e586a88;
  background: #fff2e455;
  transform: rotate(9deg);
  box-shadow: 5px 5px 0 #9e586a22;
}

#home .world-card.diary::after {
  top: 40px;
  right: 41px;
  width: 20px;
  height: 20px;
  border: 1px solid #9e586a99;
  transform: rotate(45deg);
}

#home .world-card.diary .world-icon {
  background: #fff4e655;
  border-color: #9e586a55;
}

#home .world-card.diary .world-kicker,
#home .world-card.diary b {
  color: #8c4359;
}

#home .world-card.diary h3 {
  color: #512b3c;
}

#home .world-card.diary p {
  color: #704252;
}

/* 06 — TAMBAYAN LOUNGE: little digital town */
#home .world-card.community {
  border-color: #76c8c477;
  background:
    radial-gradient(circle at 85% 18%, #f7d77c55, transparent 25%),
    linear-gradient(145deg, #174b50, #1c343f);
  color: #e8fff3;
}

#home .world-card.community::before {
  right: 18px;
  top: 22px;
  width: 80px;
  height: 65px;
  border: 1px solid #f7d77c88;
  border-bottom: 0;
  background: #f7d77c18;
  clip-path: polygon(50% 0, 100% 35%, 100% 100%, 0 100%, 0 35%);
}

#home .world-card.community::after {
  right: 51px;
  top: 51px;
  width: 15px;
  height: 28px;
  border: 1px solid #f7d77c88;
  background: #f7d77c22;
}

#home .world-card.community .world-icon {
  background: #7ed7c51c;
  border-color: #7ed7c577;
}

#home .world-card.community .world-kicker,
#home .world-card.community b {
  color: #f7d77c;
}

#home .world-card.community h3 {
  color: #effff5;
}

#home .world-card.community p {
  color: #b9d9d2;
}

/* RESPONSIVE WORLD LAYOUT */
@media (max-width: 700px) {
  #home .world-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: minmax(165px, auto);
    gap: 10px;
  }

  #home .world-card {
    min-height: 185px;
    padding: 15px;
  }

  #home .world-card.arcade {
    min-height: 290px;
  }

  #home .world-card.library {
    min-height: 185px;
  }

  #home .world-card h3 {
    font-size: 18px;
  }

  #home .world-card.arcade h3 {
    font-size: 27px;
  }

  #home .world-card p {
    font-size: 10px;
  }
}

@media (max-width: 390px) {
  #home .world-grid {
    gap: 8px;
  }

  #home .world-card {
    padding: 12px;
    min-height: 175px;
  }

  #home .world-card .world-icon {
    width: 43px;
    height: 43px;
    font-size: 23px;
  }

  #home .world-card h3 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home .world-card,
  #home .world-card::before,
  #home .world-card::after {
    transition: none !important;
  }
}

/* ==========================================
   PHASE 3 — HOMEPAGE EDITORIAL COMPOSITION
   ========================================== */

/* WORLD INTRODUCTION */
#home > .section-heading#worlds {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 58px 0 19px;
  padding: 0 0 17px;
  border-bottom: 1px solid rgba(233,200,141,.28);
}

#home > .section-heading#worlds::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 92px;
  height: 2px;
  background: var(--bt-gold);
}

#home > .section-heading#worlds .eyebrow {
  margin: 0 0 9px;
  color: var(--bt-violet);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .25em;
}

#home > .section-heading#worlds h2 {
  margin: 0;
  color: var(--bt-cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(29px, 4vw, 43px);
  font-weight: 500;
  letter-spacing: -.045em;
}

#home > .section-heading#worlds .section-note {
  max-width: 190px;
  color: rgba(251,244,233,.58);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
  text-align: right;
}

/* BALANCED DESKTOP COMPOSITION */
@media (min-width: 701px) {
  #home .world-card.diary,
  #home .world-card.community {
    grid-column: span 2;
    min-height: 185px;
  }

  #home .world-card.diary::before {
    right: 42px;
  }

  #home .world-card.community::before {
    right: 45px;
  }
}

/* SECTION SPACING */
#home .world-grid {
  margin-bottom: 48px;
}

#home #verse-map {
  margin-top: 38px;
}

/* SMALL SCREEN COMPOSITION */
@media (max-width: 700px) {
  #home > .section-heading#worlds {
    align-items: flex-start;
    margin-top: 42px;
    padding-bottom: 13px;
  }

  #home > .section-heading#worlds .section-note {
    max-width: 115px;
    font-size: 11px;
  }

  #home > .section-heading#worlds h2 {
    font-size: 30px;
  }

  #home .world-card.diary,
  #home .world-card.community {
    grid-column: span 1;
  }

  #home .world-grid {
    margin-bottom: 35px;
  }
   }

/* ==========================================
   PHASE 4 — TAMBAYANVERSE TRAVELER STATUS
   ========================================== */

#home > .stats-grid {
  display: grid;
  grid-template-columns: .8fr 1.4fr 1fr 1fr;
  gap: 0;
  margin: 25px 0 42px;
  overflow: hidden;
  border: 1px solid rgba(233,200,141,.22);
  border-radius: 4px 18px 4px 18px;
  background: linear-gradient(110deg, #241a31, #30213b 55%, #21182d);
  box-shadow: 0 12px 35px rgba(0,0,0,.16);
}

#home > .stats-grid .stat {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 112px;
  padding: 19px 21px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid rgba(233,200,141,.16);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

#home > .stats-grid .stat:last-child {
  border-right: 0;
}

#home > .stats-grid .stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  width: 32px;
  height: 2px;
  background: var(--bt-gold);
  opacity: .75;
}

#home > .stats-grid .stat::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -35px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(217,195,240,.10);
  border-radius: 50%;
  pointer-events: none;
}

#home > .stats-grid .stat > span {
  color: #d7bd91;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .19em;
}

#home > .stats-grid .stat > strong {
  margin: 9px 0 3px;
  color: #fff5e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 500;
  line-height: 1;
}

#home > .stats-grid .stat > small {
  color: rgba(251,244,233,.58);
  font-size: 10px;
  line-height: 1.5;
}

#home > .stats-grid .stat .progress {
  height: 4px;
  margin: 10px 0 7px;
  border-radius: 0;
  background: rgba(255,255,255,.12);
}

#home > .stats-grid .stat .progress i {
  border-radius: 0;
  background: linear-gradient(90deg, #a98acb, #e9c88d);
  box-shadow: 0 0 9px rgba(233,200,141,.3);
}

/* XP gets a little extra breathing room */
#home > .stats-grid .stat:nth-child(2) > strong {
  font-size: 25px;
}

/* MOBILE STATUS STRIP */
@media (max-width: 700px) {
  #home > .stats-grid {
    grid-template-columns: 1fr 1fr;
    margin: 18px 0 34px;
  }

  #home > .stats-grid .stat {
    min-height: 100px;
    padding: 16px;
    border-right: 1px solid rgba(233,200,141,.16);
    border-bottom: 1px solid rgba(233,200,141,.16);
  }

  #home > .stats-grid .stat:nth-child(2n) {
    border-right: 0;
  }

  #home > .stats-grid .stat:nth-last-child(-n+2) {
    border-bottom: 0;
  }

  #home > .stats-grid .stat > strong {
    font-size: 25px;
  }
}

/* ==========================================
   PHASE 5 — TAMBAYANVERSE ATMOSPHERE
   ========================================== */

#home {
  position: relative;
  color: var(--bt-cream);
}

#home > .hero,
#home > .stats-grid,
#home > .section-heading,
#home > .world-grid,
#home > #verse-map {
  position: relative;
  z-index: 1;
}

/* Subtle universe backdrop */
#home::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 160px;
  right: -80px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(217,195,240,.07);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(217,195,240,.018),
    0 0 0 58px rgba(217,195,240,.014),
    0 0 0 92px rgba(217,195,240,.01);
  pointer-events: none;
}


/* Give the homepage welcome panel room below the site header */
#home > .hero {
  margin-top: clamp(28px, 4.5vh, 54px);
}

@media (max-width: 700px) {
  #home > .hero {
    margin-top: 28px;
  }
}

/* Refined page rhythm */
#home.shell {
  padding-top: 24px;
  padding-bottom: 65px;
}

#home > .hero {
  margin-bottom: 0;
}

#home > .section-heading:not(#worlds) {
  margin-top: 52px;
}

/* More deliberate text rendering */
#home h1,
#home h2,
#home h3 {
  text-wrap: balance;
}

#home p {
  text-wrap: pretty;
}

/* Selection detail */
#home ::selection {
  color: #21172c;
  background: #e9c88d;
}

/* Elegant focus states */
#home a:focus-visible,
#home button:focus-visible {
  outline: 2px solid var(--bt-gold);
  outline-offset: 4px;
}

/* Avoid unwanted horizontal overflow */
#home {
  min-width: 0;
  overflow-x: clip;
}

#home .world-card {
  overflow-wrap: anywhere;
}

/* Responsive spacing */
@media (max-width: 700px) {
  #home.shell {
    padding-top: 13px;
    padding-bottom: 42px;
  }

  #home > .section-heading:not(#worlds) {
    margin-top: 38px;
  }

  #home::before {
    top: 230px;
    right: -170px;
    width: 230px;
    height: 230px;
  }
}

/* Respect accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  #home *,
  #home *::before,
  #home *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ==========================================
   PHASE 6 — RESPONSIVE POLISH
   ========================================== */

/* Improve heading contrast */
#home > .section-heading#worlds .eyebrow {
  color: var(--bt-gold);
}

/* Mobile: prevent the arcade from occupying
   an unnecessary second grid row */
@media (max-width: 700px) {
  #home .world-card.arcade {
    grid-column: span 2;
    grid-row: span 1;
    min-height: 235px;
  }

  #home .world-card.arcade .world-icon {
    margin-bottom: 18px;
  }

  #home .world-card.arcade::before {
    width: 170px;
    height: 170px;
    right: -25px;
  }

  #home .world-card.arcade::after {
    right: 20px;
    width: 75px;
    height: 75px;
  }
}

/* Very narrow screens */
@media (max-width: 360px) {
  #home > .section-heading#worlds {
    flex-direction: column;
    gap: 7px;
  }

  #home > .section-heading#worlds .section-note {
    max-width: none;
    text-align: left;
  }

  #home .world-card.arcade {
    min-height: 215px;
  }
}
/* PHASE 7 — KEEP HERO ACTIONS CLEAR OF MOBILE NAV */
@media (max-width: 850px) {
  #home .hero-orbit {
    min-height: 135px;
    margin-top: 0;
  }

  #home .hero-orbit::before {
    width: 125px;
  }

  #home .hero-orbit::after {
    width: 175px;
  }

  #home .hero {
    padding-bottom: 12px;
  }

  body {
    padding-bottom: calc(125px + env(safe-area-inset-bottom)) !important;
  }
}
/* PHASE 8 — LIFT NOTIFICATIONS ABOVE MOBILE NAV */
@media (max-width: 850px) {
  .toast {
    bottom: calc(105px + env(safe-area-inset-bottom)) !important;
    z-index: 200 !important;
    width: max-content;
    max-width: calc(100% - 30px);
    white-space: normal;
    line-height: 1.5;
  }
}
/* PHASE 9 — CENTER-SCREEN MESSAGE POPUP */
.toast {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  z-index: 99999 !important;

  width: max-content;
  max-width: calc(100% - 36px);
  padding: 22px 25px;
  border: 1px solid #e9c88d;
  border-radius: 5px 20px 5px 20px;
  background: #f7eafa;
  color: #281b36;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
  text-align: center;
  white-space: normal;

  box-shadow: 0 15px 60px rgba(0,0,0,.55);
  transform: translate(-50%, -40%) !important;
  transition: opacity .25s ease, transform .25s ease !important;
}

.toast:not(.show) {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.toast.show {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) !important;
}
/* ==========================================
   PHASE 10 — TAMBAYANVERSE ATLAS
   ========================================== */

#home .verse-map-panel {
  position: relative;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(215, 180, 255, .28);
  border-radius: 4px 24px 4px 24px;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(111, 65, 165, .24), transparent 58%),
    linear-gradient(145deg, #21152f, #100e20 72%);
  box-shadow:
    0 18px 50px rgba(12, 7, 24, .22),
    inset 0 0 45px rgba(174, 125, 220, .045);
}

#home .map-sky {
  border: 1px solid rgba(224, 196, 255, .13);
  border-radius: 3px 18px 3px 18px;
  background:
    radial-gradient(circle at 50% 50%, rgba(158, 105, 220, .18), transparent 35%),
    radial-gradient(circle at 15% 18%, rgba(90, 117, 190, .13), transparent 30%),
    radial-gradient(circle at 85% 82%, rgba(188, 104, 175, .12), transparent 30%),
    #111020;
  box-shadow: inset 0 0 65px rgba(0, 0, 0, .32);
}

#home .map-sky::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(218, 190, 255, .07);
  border-radius: 2px 14px 2px 14px;
  pointer-events: none;
}

#home .map-center {
  border: 1px solid rgba(236, 207, 255, .85);
  background:
    radial-gradient(circle at 35% 30%, #8861b3, #392452 65%, #21142f);
  box-shadow:
    0 0 22px rgba(177, 112, 255, .45),
    0 0 65px rgba(135, 75, 220, .22),
    inset 0 0 22px rgba(255, 255, 255, .09);
}

#home .map-location {
  border: 1px solid rgba(218, 190, 255, .42);
  border-radius: 4px 13px 4px 13px;
  background:
    linear-gradient(145deg, rgba(63, 43, 83, .97), rgba(24, 19, 39, .97));
  box-shadow:
    0 8px 22px rgba(0, 0, 0, .25),
    inset 0 1px rgba(255, 255, 255, .07);
}

#home .map-location strong {
  letter-spacing: .2px;
}

#home .map-location small {
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

#home .map-caption {
  padding: 13px 8px 3px;
  color: #d9c2ec;
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  letter-spacing: .25px;
}

@media (max-width: 600px) {
  #home .verse-map-panel {
    padding: 10px;
  }

  #home .map-sky::before {
    inset: 9px;
  }

  #home .map-caption {
    font-size: 12px;
  }
   }

/* ==========================================
   PHASE 11 — CHAOS ARCADE
   RETRO ARCADE FLOOR / NEON CABINETS
   ========================================== */

#home #games {
  position: relative;
  padding: 22px 0 15px 18px;
  border-left: 3px solid #ff55d8;
  background:
    linear-gradient(90deg, rgba(255, 55, 205, .07), transparent 75%);
}

#home #games .eyebrow {
  color: #ff79df;
  letter-spacing: .22em;
}

#home #games h2 {
  color: #fff0fc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 48px);
  text-shadow: 0 0 22px rgba(255, 65, 213, .22);
}

#home #games .section-note {
  color: #7deeff;
  font-family: monospace;
  font-size: 11px;
  letter-spacing: .06em;
}

#home #games + .content-panel {
  position: relative;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(92, 220, 255, .35);
  border-radius: 5px 22px 5px 22px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(111, 47, 157, .24), transparent 55%),
    linear-gradient(145deg, #17112e, #100e22 75%);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, .25),
    inset 0 0 45px rgba(76, 217, 255, .035);
}

#home #games + .content-panel::before {
  content: "INSERT COIN  ✦  PLAYER ONE  ✦  LET'S PLAY";
  display: block;
  margin: 0 0 20px;
  padding: 10px 12px;
  border-top: 1px solid rgba(92, 220, 255, .25);
  border-bottom: 1px solid rgba(92, 220, 255, .25);
  color: #70eaff;
  font-family: monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
  text-align: center;
  text-shadow: 0 0 12px rgba(92, 220, 255, .5);
}

#home #games + .content-panel .game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

#home #games + .content-panel .game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 225px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid rgba(151, 116, 255, .34);
  border-radius: 5px 17px 5px 17px;
  background:
    linear-gradient(145deg, rgba(50, 32, 83, .96), rgba(20, 17, 42, .98));
  box-shadow:
    inset 0 1px rgba(255, 255, 255, .07),
    0 8px 22px rgba(0, 0, 0, .2);
  transition: transform .25s ease, border-color .25s ease,
              box-shadow .25s ease;
}

#home #games + .content-panel .game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 42px;
  height: 3px;
  background: #ff58d9;
  box-shadow: 0 0 13px #ff58d9;
}

#home #games + .content-panel .game-card:nth-child(3n + 2)::before {
  background: #5ceaff;
  box-shadow: 0 0 13px #5ceaff;
}

#home #games + .content-panel .game-card:nth-child(3n)::before {
  background: #b5ef52;
  box-shadow: 0 0 13px #b5ef52;
}

#home #games + .content-panel .game-card:hover {
  transform: translateY(-4px);
  border-color: rgba(92, 234, 255, .7);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, .3),
    0 0 20px rgba(92, 234, 255, .09);
}

#home #games + .content-panel .game-emoji {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 15px;
  border: 1px solid rgba(255, 88, 217, .35);
  border-radius: 12px 4px 12px 4px;
  background: rgba(255, 88, 217, .09);
  font-size: 25px;
  box-shadow: inset 0 0 18px rgba(255, 88, 217, .06);
}

#home #games + .content-panel .game-card:nth-child(3n + 2) .game-emoji {
  border-color: rgba(92, 234, 255, .35);
  background: rgba(92, 234, 255, .08);
}

#home #games + .content-panel .game-card:nth-child(3n) .game-emoji {
  border-color: rgba(181, 239, 82, .35);
  background: rgba(181, 239, 82, .08);
}

#home #games + .content-panel .game-card h3 {
  color: #fff0fc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.2;
}

#home #games + .content-panel .game-card p {
  color: #c8bbdf;
  font-size: 12px;
  line-height: 1.65;
}

#home #games + .content-panel .game-card .game-result {
  margin-top: auto;
  padding-top: 12px;
  color: #7deeff;
  font-size: 11px;
}

#home #games + .content-panel .game-card input {
  min-width: 0;
  border: 1px solid rgba(125, 238, 255, .35);
  border-radius: 4px;
  background: #100e22;
  color: #fff;
}

#home #games + .content-panel .game-card button {
  border: 1px solid rgba(255, 88, 217, .55);
  border-radius: 4px 11px 4px 11px;
  background: linear-gradient(120deg, #8b347f, #563c91);
  color: #fff;
  font-weight: 800;
  transition: filter .2s ease, transform .2s ease;
}

#home #games + .content-panel .game-card button:hover {
  filter: brightness(1.25);
  transform: translateY(-1px);
}

#home #games + .content-panel .game-card .tiny-link {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: #7deeff;
  box-shadow: none;
}

#home #games + .content-panel .memory-board {
  margin-top: 10px;
}

/* Mobile arcade floor */
@media (max-width: 700px) {
  #home #games + .content-panel {
    padding: 13px;
  }

  #home #games + .content-panel .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #home #games + .content-panel .game-card {
    min-height: 215px;
    padding: 13px;
  }

  #home #games + .content-panel .game-card h3 {
    font-size: 16px;
  }

  #home #games + .content-panel .game-card p {
    font-size: 11px;
  }

  #home #games + .content-panel::before {
    font-size: 8px;
    letter-spacing: .12em;
  }
}

@media (max-width: 360px) {
  #home #games + .content-panel .game-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home #games + .content-panel .game-card {
    transition: none;
  }
}

/* ==========================================
   PHASE 12 — COMFORT CORNER
   THE COZY SOFT SANCTUARY
   ========================================== */

#home #comfort {
  position: relative;
  margin-top: 65px;
  padding: 20px 0 17px 19px;
  border-left: 3px solid #b8c9a4;
  background: linear-gradient(90deg, rgba(184,201,164,.09), transparent 75%);
}

#home #comfort .eyebrow {
  color: #b8c9a4;
  letter-spacing: .22em;
}

#home #comfort h2 {
  color: #f5ead8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 47px);
  font-weight: 500;
}

#home #comfort + .comfort-panel {
  position: relative;
  display: grid;
  grid-template-columns: .7fr 1.3fr;
  align-items: center;
  gap: 30px;
  min-height: 270px;
  padding: clamp(22px, 4vw, 42px);
  overflow: hidden;
  isolation: isolate;
  border: 1px solid #c8c9a8;
  border-radius: 5px 32px 5px 32px;
  background:
    radial-gradient(ellipse at 18% 15%, rgba(255,255,255,.8), transparent 40%),
    radial-gradient(ellipse at 90% 90%, rgba(215,170,169,.28), transparent 42%),
    linear-gradient(130deg, #f3eedf, #e1e6d2 58%, #d6dfc9);
  box-shadow:
    0 18px 40px rgba(0,0,0,.16),
    inset 0 0 35px rgba(255,255,255,.35);
}

#home #comfort + .comfort-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -75px;
  right: -35px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(93,125,89,.19);
  border-radius: 50%;
  box-shadow:
    0 0 0 22px rgba(93,125,89,.045),
    0 0 0 48px rgba(93,125,89,.035);
  pointer-events: none;
}

#home #comfort + .comfort-panel::after {
  content: "a little place to breathe";
  position: absolute;
  right: 25px;
  bottom: 17px;
  color: rgba(66,91,67,.55);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-style: italic;
  letter-spacing: .04em;
}

#home #comfort + .comfort-panel .comfort-art {
  display: grid;
  place-items: center;
  width: min(100%, 190px);
  aspect-ratio: 1;
  margin: auto;
  border: 1px solid rgba(107,135,100,.4);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #fff9e8, transparent 42%),
    linear-gradient(145deg, #d5dfc4, #a9bd9c);
  color: #4f7053;
  font-size: clamp(55px, 8vw, 82px);
  box-shadow:
    0 12px 30px rgba(83,107,75,.15),
    inset 0 0 30px rgba(255,255,255,.45);
  animation: comfortSanctuaryFloat 6s ease-in-out infinite;
}

#home #comfort + .comfort-panel > div:last-child {
  position: relative;
  z-index: 1;
}

#home #comfort + .comfort-panel .eyebrow {
  color: #71886a;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .23em;
}

#home #comfort + .comfort-panel h3 {
  max-width: 570px;
  margin: 12px 0;
  color: #344b39;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 3.5vw, 39px);
  font-weight: 500;
  line-height: 1.2;
  text-shadow: none;
}

#home #comfort + .comfort-panel p:not(.eyebrow) {
  max-width: 480px;
  color: #62735d;
  font-size: 13px;
  line-height: 1.9;
}

#home #comfort + .comfort-panel .soft-btn {
  margin-top: 12px;
  padding: 12px 18px;
  border: 1px solid #8da184;
  border-radius: 3px 14px 3px 14px;
  background: #71886a;
  color: #fff9ed;
  font-weight: 700;
  box-shadow: 4px 4px 0 rgba(113,136,106,.15);
  transition: transform .2s ease, background .2s ease;
}

#home #comfort + .comfort-panel .soft-btn:hover {
  transform: translateY(-2px);
  background: #5f785a;
}

@keyframes comfortSanctuaryFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

@media (max-width: 700px) {
  #home #comfort {
    margin-top: 43px;
  }

  #home #comfort + .comfort-panel {
    grid-template-columns: 1fr;
    gap: 16px;
    min-height: auto;
    padding: 24px 20px 38px;
  }

  #home #comfort + .comfort-panel .comfort-art {
    width: 115px;
    font-size: 54px;
  }

  #home #comfort + .comfort-panel h3 {
    font-size: 27px;
  }

  #home #comfort + .comfort-panel p:not(.eyebrow) {
    font-size: 12px;
  }

  #home #comfort + .comfort-panel::after {
    right: 16px;
    bottom: 12px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home #comfort + .comfort-panel .comfort-art {
    animation: none !important;
  }
   }

/* ==========================================
   PHASE 13 — EXPERIMENT LAB
   PLAYFUL UNDERGROUND SCIENCE FACILITY
   ========================================== */

#home #lab {
  position: relative;
  margin-top: 68px;
  padding: 20px 0 18px 19px;
  border-left: 3px solid #c4f35b;
  background: linear-gradient(90deg, rgba(196,243,91,.09), transparent 75%);
}

#home #lab .eyebrow {
  color: #c4f35b;
  letter-spacing: .2em;
}

#home #lab h2 {
  color: #efffcf;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 47px);
}

#home #lab + .tool-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(196,243,91,.35);
  border-radius: 4px 24px 4px 24px;
  background:
    linear-gradient(rgba(196,243,91,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(196,243,91,.035) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 0%, rgba(61,117,61,.25), transparent 65%),
    #111b1a;
  background-size: 24px 24px, 24px 24px, auto, auto;
  box-shadow:
    0 18px 45px rgba(0,0,0,.25),
    inset 0 0 55px rgba(196,243,91,.035);
}

#home #lab + .tool-grid::before {
  content: "EXPERIMENTAL ZONE  /  LAB ACCESS 03  /  HANDLE WITH CARE";
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-top: 1px dashed rgba(196,243,91,.4);
  border-bottom: 1px dashed rgba(196,243,91,.4);
  color: #c4f35b;
  font-family: monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-align: center;
}

#home #lab + .tool-grid .tool-card {
  position: relative;
  min-width: 0;
  min-height: 220px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(173,208,126,.25);
  border-radius: 4px 16px 4px 16px;
  background:
    linear-gradient(145deg, rgba(35,57,47,.97), rgba(18,32,30,.98));
  box-shadow:
    inset 0 1px rgba(255,255,255,.055),
    0 9px 22px rgba(0,0,0,.22);
  transition: transform .22s ease, border-color .22s ease;
}

#home #lab + .tool-grid .tool-card:nth-child(3n + 2) {
  border-color: rgba(255,153,77,.32);
}

#home #lab + .tool-grid .tool-card:nth-child(3n) {
  border-color: rgba(75,209,232,.32);
}

#home #lab + .tool-grid .tool-card:hover {
  transform: translateY(-3px);
  border-color: #c4f35b;
}

#home #lab + .tool-grid .tool-card::after {
  content: "● ● ●";
  position: absolute;
  top: 13px;
  right: 14px;
  color: rgba(196,243,91,.55);
  font-family: monospace;
  font-size: 8px;
  letter-spacing: 3px;
}

#home #lab + .tool-grid .tool-card > span {
  display: grid;
  place-items: center;
  width: 47px;
  height: 47px;
  margin-bottom: 16px;
  border: 1px solid rgba(196,243,91,.4);
  border-radius: 12px 3px 12px 3px;
  background: rgba(196,243,91,.09);
  font-size: 25px;
}

#home #lab + .tool-grid .tool-card:nth-child(3n + 2) > span {
  border-color: rgba(255,153,77,.4);
  background: rgba(255,153,77,.09);
}

#home #lab + .tool-grid .tool-card:nth-child(3n) > span {
  border-color: rgba(75,209,232,.4);
  background: rgba(75,209,232,.09);
}

#home #lab + .tool-grid .tool-card h3 {
  color: #f0ffd9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

#home #lab + .tool-grid .tool-card p {
  color: #b7c9b4;
  font-size: 12px;
  line-height: 1.7;
}

#home #lab + .tool-grid .tool-card strong {
  display: block;
  margin-top: 12px;
  color: #c4f35b;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.6;
}

#home #lab + .tool-grid .tool-card input[type="range"] {
  width: 100%;
  margin: 17px 0 8px;
  accent-color: #c4f35b;
  cursor: pointer;
}

#home #lab + .tool-grid .tool-card button {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(196,243,91,.5);
  border-radius: 3px 11px 3px 11px;
  background: #526b35;
  color: #f5ffdf;
  font-weight: 800;
  transition: background .2s ease, transform .2s ease;
}

#home #lab + .tool-grid .tool-card button:hover {
  transform: translateY(-2px);
  background: #718d43;
}

@media (max-width: 700px) {
  #home #lab {
    margin-top: 45px;
  }

  #home #lab + .tool-grid {
    gap: 10px;
    padding: 13px;
  }

  #home #lab + .tool-grid .tool-card {
    min-height: 210px;
    padding: 14px;
  }

  #home #lab + .tool-grid .tool-card h3 {
    font-size: 17px;
  }

  #home #lab + .tool-grid .tool-card p {
    font-size: 11px;
  }

  #home #lab + .tool-grid::before {
    font-size: 8px;
    letter-spacing: .08em;
  }
}

@media (max-width: 360px) {
  #home #lab + .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home #lab + .tool-grid .tool-card {
    transition: none;
  }
}

/* ==========================================
   PHASE 14 — MYSTERY LIBRARY
   ENCHANTED DARK FANTASY ARCHIVE
   ========================================== */

#home #mystery {
  position: relative;
  margin-top: 68px;
  padding: 22px 0 18px 19px;
  border-left: 3px solid #c9a96e;
  background: linear-gradient(90deg, rgba(157,119,190,.11), transparent 75%);
}

#home #mystery .eyebrow {
  color: #c9a96e;
  letter-spacing: .2em;
}

#home #mystery h2 {
  color: #f1e5d0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 47px);
  font-weight: 500;
  text-shadow: 0 0 25px rgba(191,151,220,.17);
}

#home #mystery + .tool-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(201,169,110,.34);
  border-radius: 3px 25px 3px 25px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(99,63,123,.27), transparent 60%),
    radial-gradient(circle at 12% 85%, rgba(60,75,122,.15), transparent 35%),
    linear-gradient(145deg, #171529, #100f20 75%);
  box-shadow:
    0 18px 45px rgba(0,0,0,.3),
    inset 0 0 65px rgba(178,142,210,.045);
}

#home #mystery + .tool-grid::before {
  content: "✦ THE ARCHIVE OF UNANSWERED QUESTIONS ✦";
  grid-column: 1 / -1;
  padding: 11px 10px;
  border-top: 1px solid rgba(201,169,110,.3);
  border-bottom: 1px solid rgba(201,169,110,.3);
  color: #d8bd8d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  letter-spacing: .19em;
  text-align: center;
}

#home #mystery + .tool-grid .tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 225px;
  padding: 19px;
  overflow: hidden;
  border: 1px solid rgba(174,145,192,.28);
  border-radius: 3px 16px 3px 16px;
  background:
    linear-gradient(145deg, rgba(47,39,67,.96), rgba(24,22,43,.98));
  box-shadow:
    inset 0 1px rgba(255,255,255,.055),
    0 9px 22px rgba(0,0,0,.22);
  transition: transform .25s ease, border-color .25s ease,
              box-shadow .25s ease;
}

#home #mystery + .tool-grid .tool-card:nth-child(3n + 2) {
  background: linear-gradient(145deg, #30263f, #1c1b32);
}

#home #mystery + .tool-grid .tool-card:nth-child(3n) {
  background: linear-gradient(145deg, #30283b, #1d1a30);
}

#home #mystery + .tool-grid .tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(220,190,130,.7);
  box-shadow:
    0 13px 28px rgba(0,0,0,.3),
    0 0 20px rgba(201,169,110,.07);
}

#home #mystery + .tool-grid .tool-card::after {
  content: "✧";
  position: absolute;
  top: 12px;
  right: 15px;
  color: rgba(215,190,145,.6);
  font-size: 18px;
}

#home #mystery + .tool-grid .tool-card > span {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  margin-bottom: 16px;
  border: 1px solid rgba(201,169,110,.4);
  border-radius: 50% 50% 4px 4px;
  background: rgba(201,169,110,.08);
  font-size: 25px;
  box-shadow: inset 0 0 20px rgba(201,169,110,.06);
}

#home #mystery + .tool-grid .tool-card h3 {
  color: #f0e4d1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.35;
}

#home #mystery + .tool-grid .tool-card p {
  color: #c1b4cb;
  font-size: 12px;
  line-height: 1.75;
}

#home #mystery + .tool-grid .tool-card button {
  align-self: flex-start;
  margin-top: auto;
  padding: 10px 14px;
  border: 1px solid rgba(201,169,110,.5);
  border-radius: 3px 12px 3px 12px;
  background: linear-gradient(120deg, #66503d, #59436b);
  color: #fff1d9;
  font-size: 12px;
  font-weight: 800;
  transition: transform .2s ease, filter .2s ease;
}

#home #mystery + .tool-grid .tool-card button:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}

#home #mystery + .tool-grid .tool-card .danger-btn {
  border-color: rgba(209,100,115,.55);
  background: linear-gradient(120deg, #803c55, #49304f);
}

@media (max-width: 700px) {
  #home #mystery {
    margin-top: 45px;
  }

  #home #mystery + .tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 13px;
  }

  #home #mystery + .tool-grid .tool-card {
    min-height: 215px;
    padding: 14px;
  }

  #home #mystery + .tool-grid .tool-card h3 {
    font-size: 16px;
  }

  #home #mystery + .tool-grid .tool-card p {
    font-size: 11px;
  }

  #home #mystery + .tool-grid::before {
    font-size: 9px;
    letter-spacing: .1em;
  }
}

@media (max-width: 360px) {
  #home #mystery + .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home #mystery + .tool-grid .tool-card {
    transition: none;
  }
}

/* ==========================================
   PHASE 15 — CONFESSION ROOM
   ROMANTIC DIARY / LETTER ARCHIVE
   ========================================== */

#home #diary {
  position: relative;
  margin-top: 68px;
  padding: 22px 0 18px 19px;
  border-left: 3px solid #d99aab;
  background: linear-gradient(90deg, rgba(217,154,171,.11), transparent 75%);
}

#home #diary .eyebrow {
  color: #dca5b2;
  letter-spacing: .19em;
}

#home #diary h2 {
  color: #f8e6e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 47px);
  font-weight: 500;
}

#home #diary .section-note {
  color: #d7b5bd;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
}

#home #diary + .diary-layout {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: start;
  gap: 17px;
  padding: 21px;
  border: 1px solid rgba(218,164,174,.3);
  border-radius: 4px 25px 4px 25px;
  background:
    radial-gradient(ellipse at 12% 5%, rgba(180,85,111,.16), transparent 42%),
    linear-gradient(145deg, #281723, #1a1420 75%);
  box-shadow:
    0 18px 45px rgba(0,0,0,.25),
    inset 0 0 55px rgba(218,164,174,.035);
}

#home #diary + .diary-layout .diary-form {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  padding: 24px;
  border: 1px solid #d5b7a1;
  border-radius: 3px 17px 3px 17px;
  background:
    repeating-linear-gradient(
      transparent 0px,
      transparent 31px,
      rgba(145,112,110,.12) 32px
    ),
    linear-gradient(145deg, #f6e9dc, #ead8cf);
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

#home #diary + .diary-layout .diary-form::before {
  content: "A PAGE JUST FOR YOU";
  display: block;
  margin-bottom: 9px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(133,82,85,.25);
  color: #9a5968;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
}

#home #diary + .diary-layout .diary-form label {
  color: #79535a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 700;
}

#home #diary + .diary-layout .diary-form input,
#home #diary + .diary-layout .diary-form select,
#home #diary + .diary-layout .diary-form textarea {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(153,105,111,.3);
  border-radius: 3px 9px 3px 9px;
  outline: none;
  background: rgba(255,250,242,.83);
  color: #543c43;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  box-shadow: inset 0 1px 3px rgba(91,53,58,.05);
}

#home #diary + .diary-layout .diary-form input:focus,
#home #diary + .diary-layout .diary-form select:focus,
#home #diary + .diary-layout .diary-form textarea:focus {
  border-color: #b96f84;
  box-shadow: 0 0 0 3px rgba(185,111,132,.12);
}

#home #diary + .diary-layout .diary-form textarea {
  min-height: 145px;
  line-height: 1.8;
  resize: vertical;
}

#home #diary + .diary-layout .diary-form input::placeholder,
#home #diary + .diary-layout .diary-form textarea::placeholder {
  color: #aa8b8c;
  font-style: italic;
}

#home #diary + .diary-layout .diary-form .primary-btn {
  padding: 13px 16px;
  border: 1px solid #a85f76;
  border-radius: 3px 13px 3px 13px;
  background: linear-gradient(120deg, #9c536b, #71405c);
  color: #fff4ed;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  box-shadow: 4px 4px 0 rgba(156,83,107,.13);
  transition: transform .2s ease, filter .2s ease;
}

#home #diary + .diary-layout .diary-form .primary-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
}

#home #diary + .diary-layout .diary-form .form-note {
  color: #98767a;
  font-size: 10px;
  line-height: 1.6;
}

#home #diary + .diary-layout .diary-list-panel {
  min-width: 0;
  padding: 23px;
  border: 1px solid rgba(218,164,174,.35);
  border-radius: 3px 17px 3px 17px;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(145deg, #392331, #241925);
  background-size: 100% 34px, auto;
  box-shadow: inset 0 0 35px rgba(218,164,174,.035);
}

#home #diary + .diary-layout .diary-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(218,164,174,.22);
}

#home #diary + .diary-layout .diary-list-head .eyebrow {
  color: #d9a4b2;
  font-size: 9px;
  letter-spacing: .16em;
}

#home #diary + .diary-layout .diary-list-head h3 {
  margin-top: 5px;
  color: #f5e1e4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

#home #diary + .diary-layout .diary-list-head input {
  width: min(100%, 190px);
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(218,164,174,.35);
  border-radius: 3px 10px 3px 10px;
  background: #211721;
  color: #f8e6e8;
  font-size: 11px;
}

#home #diary + .diary-layout .diary-list-head input::placeholder {
  color: #b99ba8;
}

#home #diary + .diary-layout .diary-list {
  padding-top: 16px;
  color: #e8d2d8;
  font-size: 12px;
  line-height: 1.8;
}

#home #diary + .diary-layout .empty-state {
  padding: 32px 12px;
  color: #d4b5c0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
  text-align: center;
}

@media (max-width: 700px) {
  #home #diary {
    margin-top: 45px;
  }

  #home #diary + .diary-layout {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 12px;
  }

  #home #diary + .diary-layout .diary-form {
    padding: 19px;
  }

  #home #diary + .diary-layout .diary-list-panel {
    padding: 17px;
  }

  #home #diary + .diary-layout .diary-list-head h3 {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home #diary + .diary-layout .diary-form .primary-btn {
    transition: none;
  }
                                  }

/* ==========================================
   PHASE 16 — TAMBAYAN LOUNGE
   COZY DIGITAL TOWN
   ========================================== */

#home #hangout {
  position: relative;
  margin-top: 68px;
  padding: 22px 0 18px 19px;
  border-left: 3px solid #72c9b9;
  background: linear-gradient(90deg, rgba(114,201,185,.11), transparent 75%);
}

#home #hangout .eyebrow {
  color: #83d6c5;
  letter-spacing: .19em;
}

#home #hangout h2 {
  color: #e8f6e9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 47px);
  font-weight: 500;
}

#home #hangout .section-note {
  color: #c0d8d0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
}

#home #hangout + .hangout-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(114,201,185,.3);
  border-radius: 5px 25px 5px 25px;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(114,201,185,.16), transparent 45%),
    radial-gradient(ellipse at 95% 100%, rgba(241,157,133,.12), transparent 40%),
    linear-gradient(145deg, #172b30, #142127 75%);
  box-shadow:
    0 18px 45px rgba(0,0,0,.25),
    inset 0 0 55px rgba(114,201,185,.035);
}

/* Welcome sign */
#home #hangout + .hangout-layout .lounge-welcome {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  min-height: 165px;
  padding: 27px;
  overflow: hidden;
  border: 1px solid rgba(244,190,125,.48);
  border-radius: 4px 22px 4px 22px;
  background:
    radial-gradient(circle at 85% 15%, rgba(255,255,255,.16), transparent 28%),
    linear-gradient(120deg, #315c59, #386d68 55%, #a36d68);
  box-shadow: inset 0 1px rgba(255,255,255,.12);
}

#home #hangout + .hangout-layout .lounge-welcome::after {
  content: "✦  ✧  ✦";
  position: absolute;
  right: 22px;
  bottom: 13px;
  color: rgba(255,239,194,.65);
  font-size: 18px;
  letter-spacing: 12px;
  pointer-events: none;
}

#home #hangout + .hangout-layout .lounge-welcome .big-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border: 1px solid rgba(255,239,194,.5);
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  font-size: 43px;
  box-shadow: 0 8px 22px rgba(0,0,0,.13);
}

#home #hangout + .hangout-layout .lounge-welcome h3 {
  color: #fff4dc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 31px);
}

#home #hangout + .hangout-layout .lounge-welcome p {
  max-width: 510px;
  margin-top: 9px;
  color: #f0e9d9;
  font-size: 12px;
  line-height: 1.8;
}

/* Neighborhood districts */
#home #hangout + .hangout-layout .lounge-section {
  min-width: 0;
  padding: 19px;
  border: 1px solid rgba(114,201,185,.25);
  border-radius: 4px 17px 4px 17px;
  background:
    linear-gradient(145deg, rgba(36,65,65,.86), rgba(25,43,49,.94));
  box-shadow: inset 0 1px rgba(255,255,255,.04);
}

#home #hangout + .hangout-layout .lounge-section > .eyebrow {
  color: #e9c77f;
  font-family: monospace;
  font-size: 9px;
  letter-spacing: .17em;
}

#home #hangout + .hangout-layout .lounge-section > h3 {
  margin: 8px 0 16px;
  color: #f3ead7;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

/* Game and community activity tiles */
#home #hangout + .hangout-layout .lounge-section .tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#home #hangout + .hangout-layout .lounge-section .tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 190px;
  padding: 15px;
  border: 1px solid rgba(244,190,125,.25);
  border-radius: 4px 13px 4px 13px;
  background: linear-gradient(145deg, #354c4b, #253a3e);
  box-shadow: inset 0 1px rgba(255,255,255,.055);
  transition: transform .22s ease, border-color .22s ease;
}

#home #hangout + .hangout-layout .lounge-section .tool-card:nth-child(even) {
  border-color: rgba(196,157,220,.3);
  background: linear-gradient(145deg, #403b52, #2c2c43);
}

#home #hangout + .hangout-layout .lounge-section .tool-card:hover {
  transform: translateY(-3px);
  border-color: #e9c77f;
}

#home #hangout + .hangout-layout .lounge-section .tool-card > span {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 12px;
  border: 1px solid rgba(244,190,125,.3);
  border-radius: 50% 50% 5px 5px;
  background: rgba(244,190,125,.09);
  font-size: 23px;
}

#home #hangout + .hangout-layout .lounge-section .tool-card h3 {
  color: #f4e9d8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

#home #hangout + .hangout-layout .lounge-section .tool-card p {
  margin-top: 7px;
  color: #bfd1c9;
  font-size: 11px;
  line-height: 1.7;
}

#home #hangout + .hangout-layout .lounge-section .tool-card button {
  align-self: flex-start;
  margin-top: auto;
  padding: 9px 12px;
  border: 1px solid rgba(233,199,127,.4);
  border-radius: 3px 10px 3px 10px;
  background: #526f68;
  color: #fff3d9;
  font-size: 11px;
  font-weight: 800;
}

#home #hangout + .hangout-layout .lounge-section .tool-card button:disabled {
  opacity: .65;
  cursor: not-allowed;
}

/* Shared community spaces */
#home #hangout + .hangout-layout .lounge-section > .hangout-card {
  position: relative;
  margin-top: 12px;
  padding: 19px;
  border: 1px solid rgba(244,190,125,.3);
  border-radius: 4px 15px 4px 15px;
  background:
    radial-gradient(circle at 100% 0%, rgba(244,190,125,.09), transparent 35%),
    #293c40;
}

#home #hangout + .hangout-layout .lounge-section > .hangout-card .big-icon {
  display: inline-grid;
  place-items: center;
  width: 43px;
  height: 43px;
  margin-bottom: 10px;
  border: 1px solid rgba(244,190,125,.3);
  border-radius: 50%;
  background: rgba(244,190,125,.08);
  font-size: 23px;
}

#home #hangout + .hangout-layout .lounge-section > .hangout-card h3 {
  color: #f4e9d9;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

#home #hangout + .hangout-layout .lounge-section > .hangout-card p {
  margin-top: 7px;
  color: #bfd1c9;
  font-size: 12px;
  line-height: 1.7;
}

/* Kindness Wall noticeboard */
#home #hangout + .hangout-layout .prompt-box {
  margin-top: 15px;
  padding: 13px;
  border: 1px dashed rgba(233,199,127,.45);
  border-radius: 3px 12px 3px 12px;
  background: rgba(15,30,34,.35);
}

#home #hangout + .hangout-layout .prompt-box textarea {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(114,201,185,.3);
  border-radius: 4px 10px 4px 10px;
  background: #17292e;
  color: #f4eadc;
  font-size: 12px;
  line-height: 1.7;
}

#home #hangout + .hangout-layout .prompt-box textarea::placeholder {
  color: #9fb9b0;
}

#home #hangout + .hangout-layout .prompt-box button {
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(233,199,127,.5);
  border-radius: 3px 11px 3px 11px;
  background: #a36d68;
  color: #fff4e4;
  font-weight: 800;
}

#home #hangout + .hangout-layout #kindFeed {
  margin-top: 13px;
  color: #f0dfc7;
  font-size: 12px;
  line-height: 1.8;
}

/* Mobile town layout */
@media (max-width: 700px) {
  #home #hangout {
    margin-top: 45px;
  }

  #home #hangout + .hangout-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  #home #hangout + .hangout-layout .lounge-welcome {
    grid-template-columns: 58px 1fr;
    gap: 13px;
    min-height: 145px;
    padding: 18px;
  }

  #home #hangout + .hangout-layout .lounge-welcome .big-icon {
    width: 56px;
    height: 56px;
    font-size: 29px;
  }

  #home #hangout + .hangout-layout .lounge-welcome h3 {
    font-size: 21px;
  }

  #home #hangout + .hangout-layout .lounge-welcome p {
    font-size: 11px;
  }

  #home #hangout + .hangout-layout .lounge-section {
    padding: 15px;
  }

  #home #hangout + .hangout-layout .lounge-section > h3 {
    font-size: 21px;
  }

  #home #hangout + .hangout-layout .lounge-section .tool-card {
    min-height: 185px;
    padding: 12px;
  }

  #home #hangout + .hangout-layout .lounge-section .tool-card h3 {
    font-size: 15px;
  }

  #home #hangout + .hangout-layout .lounge-section .tool-card p {
    font-size: 10px;
  }
}

@media (max-width: 350px) {
  #home #hangout + .hangout-layout .lounge-section .tool-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #home #hangout + .hangout-layout .lounge-section .tool-card {
    transition: none;
  }
   }

/* PHASE 16 — WELCOME PANEL LAYOUT FIX */

#home #hangout + .hangout-layout .lounge-welcome h3,
#home #hangout + .hangout-layout .lounge-welcome p {
  grid-column: 2;
  min-width: 0;
}

#home #hangout + .hangout-layout .lounge-welcome h3 {
  align-self: end;
}

#home #hangout + .hangout-layout .lounge-welcome p {
  align-self: start;
  margin-top: 0;
}

@media (max-width: 700px) {
  #home #hangout + .hangout-layout .lounge-welcome h3,
  #home #hangout + .hangout-layout .lounge-welcome p {
    grid-column: 2;
  }
}

/* PHASE 16 — COMPACT COMMUNITY & DISCOVERY TILES */

#home #hangout + .hangout-layout > .lounge-section:nth-of-type(3) .tool-card,
#home #hangout + .hangout-layout > .lounge-section:nth-of-type(4) .tool-card {
  min-height: 0;
  padding: 13px;
}

#home #hangout + .hangout-layout > .lounge-section:nth-of-type(3) .tool-card > span,
#home #hangout + .hangout-layout > .lounge-section:nth-of-type(4) .tool-card > span {
  width: 37px;
  height: 37px;
  margin-bottom: 9px;
  font-size: 20px;
}

#home #hangout + .hangout-layout > .lounge-section:nth-of-type(3) .tool-card h3,
#home #hangout + .hangout-layout > .lounge-section:nth-of-type(4) .tool-card h3 {
  font-size: 15px;
}

#home #hangout + .hangout-layout > .lounge-section:nth-of-type(3) .tool-card p,
#home #hangout + .hangout-layout > .lounge-section:nth-of-type(4) .tool-card p {
  margin-top: 5px;
}

#home #hangout + .hangout-layout > .lounge-section:nth-of-type(3) .tool-card button,
#home #hangout + .hangout-layout > .lounge-section:nth-of-type(4) .tool-card button {
  margin-top: 12px;
}

/* PHASE 16 — NPC CARD SPACING FIX */

#home #hangout .tool-card[data-npc-ready="true"] {
  grid-column: 1 / -1;
  min-height: 0;
  padding: 15px;
}

#home #hangout .npc-day-card {
  width: 100%;
  margin-top: 12px;
}

#home #hangout .npc-day-profile {
  padding: 16px 12px;
}

#home #hangout .npc-day-avatar {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  margin-bottom: 10px;
  font-size: 2.8rem;
}

#home #hangout .npc-day-dialogue {
  position: relative;
  min-height: 65px;
  margin: 12px 0;
  overflow-wrap: anywhere;
}

#home #hangout .npc-day-choices {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

#home #hangout .npc-day-choice {
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 9px 5px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

#home #hangout .npc-day-note {
  line-height: 1.6;
}

/* ==========================================
   PHASE 17 — FINAL RESPONSIVE POLISH
   ALL WORLDS / ALL SCREEN SIZES
   ========================================== */

/* Prevent grid children and long content from forcing overflow */
#home .world-grid > *,
#home .tool-grid > *,
#home .hangout-layout > *,
#home .diary-layout > *,
#home .verse-map-panel,
#home .panel {
  min-width: 0;
}

#home p,
#home h1,
#home h2,
#home h3,
#home strong,
#home small {
  overflow-wrap: break-word;
}

#home img,
#home svg,
#home video {
  max-width: 100%;
}

#home input,
#home select,
#home textarea,
#home button {
  box-sizing: border-box;
  max-width: 100%;
}

/* Clear keyboard focus without changing the visual theme */
#home a:focus-visible,
#home button:focus-visible,
#home input:focus-visible,
#home select:focus-visible,
#home textarea:focus-visible {
  outline: 2px solid #e8c77f;
  outline-offset: 3px;
}

/* Tablet and phone refinements */
@media (max-width: 850px) {
  #home .world-grid,
  #home .tool-grid {
    min-width: 0;
  }

  #home .world-grid > *,
  #home .tool-grid > * {
    min-width: 0;
  }

  #home button {
    white-space: normal;
    line-height: 1.4;
  }
}

/* Smaller phones */
@media (max-width: 380px) {
  #home .world-grid,
  #home .tool-grid {
    column-gap: 8px;
    row-gap: 9px;
  }

  #home .section-heading {
    padding-left: 13px;
    padding-right: 10px;
  }

  #home .verse-map-panel {
    padding: 9px;
  }

  #home button {
    padding-left: 9px;
    padding-right: 9px;
  }
}

/* Respect device motion preferences */
@media (prefers-reduced-motion: reduce) {
  #home *,
  #home *::before,
  #home *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =========================================
   MY SPACE — PERSONAL KEEPSAKE ROOM
   ========================================= */

#home .shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, .85fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 14px;
}

#home .shop-panel,
#home .collection-panel,
#home .theme-panel,
#home .achievements-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(190, 157, 210, .24);
  border-radius: 19px;
  box-shadow: 0 12px 34px rgba(29, 18, 44, .12);
}

/* Star Shop — celestial boutique */
#home .shop-panel {
  padding: 23px;
  background:
    radial-gradient(ellipse at 90% 5%, rgba(226, 194, 255, .2), transparent 36%),
    linear-gradient(145deg, #29203d, #403052 58%, #30253f);
  color: #fff5e8;
}

#home .shop-panel::before {
  content: "✦";
  position: absolute;
  top: 62px;
  right: 24px;
  color: rgba(255, 225, 166, .55);
  font-size: 25px;
  pointer-events: none;
}

#home .shop-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}

#home .shop-heading h3 {
  margin: 3px 0 0;
  color: #fff4df;
  font-family: Georgia, serif;
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: -.5px;
}

#home .shop-panel .eyebrow {
  color: #e8c9a2;
  letter-spacing: 2px;
}

#home .shop-panel .currency {
  padding: 9px 13px;
  border: 1px solid rgba(255, 222, 163, .35);
  border-radius: 30px;
  background: rgba(255, 231, 187, .1);
  color: #ffe2a9;
  white-space: nowrap;
}

/* Collection — personal display shelf */
#home .collection-panel {
  padding: 23px;
  background:
    radial-gradient(ellipse at 10% 0%, rgba(255,255,255,.9), transparent 45%),
    linear-gradient(150deg, #f6e9dc, #ead8d0 55%, #e5d8e9);
  color: #49374c;
}

#home .collection-panel::after {
  content: "♡";
  position: absolute;
  right: 18px;
  top: 10px;
  color: rgba(148, 102, 139, .2);
  font-family: Georgia, serif;
  font-size: 56px;
  pointer-events: none;
}

#home .collection-panel h3 {
  position: relative;
  z-index: 1;
  margin: 5px 0 18px;
  color: #49374c;
  font-family: Georgia, serif;
  font-size: 23px;
}

#home .collection-panel .eyebrow {
  color: #9a6685;
  letter-spacing: 2px;
}

/* Theme wardrobe */
#home .theme-panel {
  padding: 24px;
  background:
    linear-gradient(115deg, rgba(255,255,255,.94), rgba(248,235,244,.92)),
    #f6eaf1;
  color: #49384c;
}

#home .theme-panel > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

#home .theme-panel h3 {
  margin: 0 0 6px;
  color: #513c55;
  font-family: Georgia, serif;
  font-size: 22px;
}

#home .theme-panel p {
  margin: 0;
  color: #846f82;
}

#home .theme-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

#home .theme-choice {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(133, 100, 139, .25);
  border-radius: 9px;
  background: rgba(255,255,255,.72);
  color: #59445e;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

#home .theme-choice:hover {
  transform: translateY(-2px);
  border-color: #b58bb7;
}

#home .theme-choice.active {
  border-color: #9671a4;
  background: #e9d9ef;
  box-shadow: inset 0 -3px 0 rgba(130, 91, 151, .2);
  color: #493052;
}

/* Achievement wall */
#home .achievements-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  background: #eee5d9;
  color: #493c3b;
}

#home .achievements-panel > div {
  min-width: 0;
  padding: 23px;
}

#home .achievements-panel > div + div {
  border-left: 1px solid rgba(115, 83, 91, .16);
  background: rgba(255,255,255,.25);
}

#home .achievements-panel h3 {
  margin: 0 0 16px;
  color: #594354;
  font-family: Georgia, serif;
  font-size: 21px;
}

/* Gentle lift for interactive shop items */
#home .shop-grid > *,
#home .collection-list > *,
#home .chip-list > * {
  transition: transform .2s ease, box-shadow .2s ease;
}

#home .shop-grid > *:hover,
#home .collection-list > *:hover {
  transform: translateY(-3px);
}

/* Mobile layout */
@media (max-width: 700px) {
  #home .shop-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #home .shop-panel,
  #home .collection-panel {
    padding: 18px;
  }

  #home .theme-panel {
    padding: 19px;
  }

  #home .theme-panel > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 17px;
  }

  #home .theme-options {
    justify-content: flex-start;
    width: 100%;
  }

  #home .theme-choice {
    flex: 1 1 calc(50% - 9px);
  }

  #home .achievements-panel > div {
    padding: 17px 13px;
  }

  #home .achievements-panel h3 {
    font-size: 18px;
  }
}

@media (max-width: 380px) {
  #home .achievements-panel {
    grid-template-columns: 1fr;
  }

  #home .achievements-panel > div + div {
    border-left: 0;
    border-top: 1px solid rgba(115, 83, 91, .16);
  }
}

/* =========================================
   DAILY TAMBAYAN — THE DAILY DISPATCH
   ========================================= */

#home .daily-tambayan-panel {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  padding: 25px;
  border: 1px solid rgba(190, 157, 210, .28);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 92% 5%, rgba(221, 181, 139, .17), transparent 35%),
    linear-gradient(125deg, #292039, #403047 58%, #33263d);
  color: #fff2df;
  box-shadow: 0 14px 36px rgba(31, 20, 43, .14);
}

#home .daily-tambayan-panel::after {
  content: "✦";
  position: absolute;
  top: 12px;
  right: 24px;
  color: rgba(255, 224, 174, .35);
  font-size: 42px;
  pointer-events: none;
}

#home .daily-board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 19px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}

#home .daily-board-top .eyebrow {
  color: #e9c99f;
  letter-spacing: 2px;
}

#home .daily-board-top h3 {
  margin: 5px 0;
  color: #fff0d9;
  font-family: Georgia, serif;
  font-size: clamp(23px, 3vw, 31px);
}

#home .daily-board-top p:not(.eyebrow) {
  margin: 0;
  color: #d8c9d9;
  font-size: 14px;
  line-height: 1.6;
}

#home .daily-board-icon {
  flex: 0 0 auto;
  font-size: 48px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 7px 10px rgba(0,0,0,.2));
}

#home .daily-mission {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 17px;
  border: 1px solid rgba(239, 207, 165, .2);
  border-radius: 14px;
  background: rgba(255, 246, 229, .075);
}

#home .daily-mission-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(231, 197, 157, .13);
  font-size: 25px;
}

#home .daily-mission-content {
  min-width: 0;
}

#home .daily-mission-content .eyebrow {
  margin: 0 0 5px;
  color: #e8c99e;
  font-size: 10px;
  letter-spacing: 1.5px;
}

#home .daily-mission-content h3 {
  margin: 0 0 5px;
  color: #fff0d9;
  font-family: Georgia, serif;
  font-size: 19px;
}

#home .daily-mission-content p:not(.eyebrow) {
  margin: 0;
  color: #d8c9d9;
  font-size: 13px;
  line-height: 1.55;
}

#home .daily-mission-number {
  align-self: start;
  color: rgba(245, 218, 181, .45);
  font-family: Georgia, serif;
  font-size: 25px;
}

#home .daily-mission-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 2px 9px;
  color: #f0d2a7;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .7px;
}

#home .daily-progress-track {
  height: 5px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255,255,255,.13);
}

#home .daily-progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d9a978, #f4d9a9);
  transition: width .35s ease;
}

#home .daily-progress-label {
  margin: 7px 0 0;
  color: #cbb9cd;
  font-size: 11px;
}

#home .daily-mystery {
  margin-top: 17px;
  border-top: 1px solid rgba(255,255,255,.14);
  padding-top: 14px;
}

#home .daily-mystery summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  color: #f4dfc4;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

#home .daily-mystery summary::-webkit-details-marker {
  display: none;
}

#home .daily-mystery-toggle {
  color: #e8c99e;
  font-size: 20px;
  transition: transform .2s ease;
}

#home .daily-mystery[open] .daily-mystery-toggle {
  transform: rotate(45deg);
}

#home .daily-mystery-content {
  padding: 8px 2px 3px;
  animation: dailyDispatchReveal .25s ease both;
}

#home .daily-mystery-content p {
  margin: 0 0 7px;
  color: #e3d5e2;
  font-size: 13px;
  line-height: 1.6;
}

#home .daily-mystery-content span {
  color: #e8c99e;
  font-size: 11px;
}

@keyframes dailyDispatchReveal {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Phone layout */
@media (max-width: 700px) {
  #home .daily-tambayan-panel {
    padding: 17px;
    border-radius: 16px;
  }

  #home .daily-board-top {
    gap: 10px;
  }

  #home .daily-board-icon {
    font-size: 37px;
  }

  #home .daily-board-top h3 {
    font-size: 23px;
  }

  #home .daily-board-top p:not(.eyebrow) {
    font-size: 12px;
  }

  #home .daily-mission {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }

  #home .daily-mission-icon {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }

  #home .daily-mission-content h3 {
    font-size: 16px;
  }

  #home .daily-mission-content p:not(.eyebrow) {
    font-size: 12px;
  }

  #home .daily-mission-number {
    font-size: 19px;
  }

  #home .daily-mission-footer {
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  #home .daily-tambayan-panel {
    padding: 14px;
  }

  #home .daily-board-icon {
    font-size: 31px;
  }

  #home .daily-mission {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  #home .daily-mission-number {
    display: none;
  }
}
/* Daily Tambayan completion celebration */
#home .daily-tambayan-panel.daily-just-completed .daily-mission {
  animation: dailyMissionCelebrate .8s ease both;
  border-color: rgba(238, 204, 145, .8);
  box-shadow: 0 0 22px rgba(238, 204, 145, .18);
}

#home .daily-tambayan-panel.daily-just-completed .daily-mission-icon {
  animation: dailyStarPop .65s ease both;
}

@keyframes dailyMissionCelebrate {
  0% { transform: scale(1); }
  35% { transform: scale(1.025); }
  65% { transform: scale(.995); }
  100% { transform: scale(1); }
}

@keyframes dailyStarPop {
  0% { transform: rotate(0) scale(1); }
  45% { transform: rotate(-12deg) scale(1.2); }
  100% { transform: rotate(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  #home .daily-tambayan-panel.daily-just-completed .daily-mission,
  #home .daily-tambayan-panel.daily-just-completed .daily-mission-icon {
    animation: none;
  }
}
/* Tomorrow's little preview */
#home .daily-tomorrow-teaser {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 14px;
  border-top: 1px solid rgba(232, 201, 158, .25);
  background: rgba(232, 201, 158, .055);
  border-radius: 11px;
}

#home .daily-tomorrow-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 201, 158, .25);
  border-radius: 50%;
  background: rgba(232, 201, 158, .09);
  font-size: 19px;
}

#home .daily-tomorrow-copy {
  flex: 1;
  min-width: 0;
}

#home .daily-tomorrow-copy .eyebrow {
  margin: 0 0 5px;
  color: #d9bb91;
  font-size: 9px;
  letter-spacing: 1.1px;
}

#home .daily-tomorrow-copy h4 {
  margin: 0 0 4px;
  color: #f5e5d1;
  font-size: 13px;
  line-height: 1.35;
}

#home .daily-tomorrow-copy p:not(.eyebrow) {
  margin: 0;
  color: #cbb9cd;
  font-size: 11px;
  line-height: 1.5;
}

#home .daily-tomorrow-sparkle {
  flex: 0 0 auto;
  color: #e8c99e;
  font-size: 17px;
}

@media (max-width: 380px) {
  #home .daily-tomorrow-teaser {
    gap: 9px;
    padding: 11px;
  }

  #home .daily-tomorrow-icon {
    flex-basis: 33px;
    width: 33px;
    height: 33px;
    font-size: 17px;
  }

  #home .daily-tomorrow-copy h4 {
    font-size: 12px;
  }
   }
/* Daily Tambayan streak tracker */
#home .daily-streak-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid rgba(232, 201, 158, .2);
  border-radius: 10px;
  background: rgba(232, 201, 158, .07);
}

#home .daily-streak-icon {
  flex: 0 0 auto;
  font-size: 21px;
}

#home .daily-streak-info {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

#home .daily-streak-info strong {
  color: #f5e5d1;
  font-size: 12px;
  font-weight: 700;
}

#home .daily-streak-info span {
  color: #cbb9cd;
  font-size: 10px;
  line-height: 1.4;
}

#home .daily-streak-goal {
  flex: 0 0 auto;
  color: #e8c99e;
  font-size: 10px;
  letter-spacing: .4px;
  white-space: nowrap;
}

@media (max-width: 380px) {
  #home .daily-streak-strip {
    gap: 8px;
    padding: 9px;
  }

  #home .daily-streak-goal {
    font-size: 9px;
  }
}
/* =========================================
   HIDDEN ROOMS — BEYOND THE MAP
   ========================================= */

#home .hidden-entrance {
  position: relative;
  margin: 42px 0 20px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid rgba(194, 164, 218, .25);
  background:
    linear-gradient(110deg, #211a30, #30223b 55%, #211a30);
}

#home .hidden-entrance-inner {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 17px;
  padding: 23px 25px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 95% 50%, rgba(151, 111, 177, .18), transparent 40%);
}

#home .hidden-entrance-inner::after {
  content: "✧";
  position: absolute;
  right: 35px;
  top: -38px;
  color: rgba(226, 198, 241, .08);
  font-size: 145px;
  pointer-events: none;
}

#home .hidden-entrance-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(220, 192, 239, .35);
  border-radius: 50%;
  color: #e4c9f4;
  font-size: 28px;
  box-shadow: 0 0 25px rgba(180, 133, 208, .13);
}

#home .hidden-entrance-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
}

#home .hidden-entrance-copy .eyebrow {
  margin: 0 0 7px;
  color: #c4a4d9;
  font-size: 9px;
  letter-spacing: 2px;
}

#home .hidden-entrance-copy h2 {
  margin: 0 0 6px;
  color: #f4e8f7;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
}

#home .hidden-entrance-copy p:not(.eyebrow) {
  max-width: 470px;
  margin: 0;
  color: #c8b9d1;
  font-size: 12px;
  line-height: 1.7;
}

#home .hidden-entrance-hint {
  position: relative;
  z-index: 1;
  grid-column: 2;
  margin-top: -8px;
  color: #d6b6e8;
  font-size: 10px;
  letter-spacing: .7px;
}

@media (max-width: 500px) {
  #home .hidden-entrance {
    margin-top: 32px;
  }

  #home .hidden-entrance-inner {
    grid-template-columns: 43px minmax(0, 1fr);
    gap: 12px;
    padding: 17px 14px;
  }

  #home .hidden-entrance-mark {
    width: 42px;
    height: 42px;
    font-size: 23px;
  }

  #home .hidden-entrance-copy h2 {
    font-size: 22px;
  }

  #home .hidden-entrance-copy p:not(.eyebrow) {
    font-size: 11px;
  }

  #home .hidden-entrance-hint {
    font-size: 9px;
  }
}
/* =========================================
   FORGOTTEN ATTIC — ROOM DESIGN
   ========================================= */

#home .hidden-room {
  position: relative;
  margin: 30px 0 48px;
  padding: 25px;
  overflow: hidden;
  border: 1px solid rgba(190, 164, 135, .22);
  background:
    radial-gradient(ellipse at 85% 5%, rgba(151, 113, 78, .15), transparent 40%),
    linear-gradient(145deg, #211d1b, #302720 55%, #211d1b);
  color: #e8d9c5;
}

#home .hidden-room-heading {
  max-width: 540px;
  margin-bottom: 25px;
}

#home .hidden-room-heading .eyebrow {
  color: #c6a77e;
  font-size: 9px;
  letter-spacing: 2px;
}

#home .hidden-room-heading h2 {
  margin: 8px 0;
  color: #f0dfc8;
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
}

#home .hidden-room-heading p:not(.eyebrow) {
  color: #b9a995;
  font-size: 12px;
  line-height: 1.7;
}

#home .attic-discovery {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-bottom: 20px;
  padding: 17px;
  border: 1px solid rgba(194, 164, 126, .2);
  background: rgba(12, 10, 9, .25);
}

#home .attic-object {
  display: grid;
  flex: 0 0 58px;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(205, 174, 128, .25);
  border-radius: 50%;
  background: rgba(185, 145, 91, .08);
  font-size: 29px;
}

#home .attic-discovery .eyebrow {
  color: #b99a70;
  font-size: 8px;
  letter-spacing: 1.5px;
}

#home .attic-discovery h3 {
  margin: 5px 0;
  color: #f0dfc8;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}

#home .attic-discovery p {
  margin: 4px 0;
  color: #b9a995;
  font-size: 11px;
  line-height: 1.6;
}

#home .attic-discovery .attic-note {
  color: #d1b58e;
  font-family: Georgia, serif;
  font-style: italic;
}

#home .attic-drawers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#home .attic-drawer {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 14px 11px;
  border: 1px solid rgba(194, 164, 126, .2);
  background: rgba(10, 9, 8, .3);
  color: #e8d9c5;
  text-align: left;
  cursor: pointer;
}

#home .attic-drawer > span {
  font-size: 23px;
}

#home .attic-drawer strong {
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 500;
}

#home .attic-drawer small {
  color: #aa9985;
  font-size: 10px;
  line-height: 1.5;
}

#home .attic-drawer b {
  margin-top: 4px;
  color: #d2b58e;
  font-size: 10px;
  font-weight: 500;
}

#home .attic-result {
  margin-top: 15px;
  padding: 15px;
  border-left: 2px solid #a98760;
  background: rgba(10, 9, 8, .24);
}

#home .attic-result p {
  margin: 0 0 6px;
  color: #d2b58e;
  font-size: 9px;
  letter-spacing: 1.5px;
}

#home .attic-result span {
  color: #c0b09d;
  font-size: 11px;
  line-height: 1.6;
}

@media (max-width: 500px) {
  #home .hidden-room {
    padding: 18px 14px;
  }

  #home .hidden-room-heading h2 {
    font-size: 25px;
  }

  #home .attic-drawers {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #home .attic-drawer {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 9px;
    padding: 11px;
  }

  #home .attic-drawer > span {
    grid-row: span 2;
  }

  #home .attic-drawer strong,
  #home .attic-drawer small {
    grid-column: 2;
  }

  #home .attic-drawer b {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
     }
/* =========================================
   THE PHOTOGRAPH THAT CHANGES
   ========================================= */

#home .hidden-room .attic-changing-photo {
  position: relative;
  max-width: 460px;
  margin: 28px auto;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 119, .35);
  background:
    radial-gradient(circle at 50% 20%, rgba(179, 135, 83, .16), transparent 65%),
    linear-gradient(145deg, #211b19, #33271f, #1d1918);
  box-shadow: 0 12px 35px rgba(0, 0, 0, .28);
}

#home .hidden-room .attic-photo-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 17px;
  color: #c6a77e;
  font-size: 9px;
  letter-spacing: 1.5px;
}

#home .hidden-room .attic-photo-frame {
  padding: 12px;
  border: 1px solid rgba(205, 174, 128, .35);
  background: #171413;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .5);
}

#home .hidden-room .attic-photo-image {
  display: grid;
  min-height: 190px;
  place-items: center;
  border: 7px solid #b49a78;
  background:
    radial-gradient(circle at 50% 35%, #8b7863, #3c3530 65%, #211d1b);
  color: #e7d4b5;
  font-size: 76px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, .5);
}

#home .hidden-room .attic-photo-frame p {
  margin: 13px 2px 3px;
  color: #e0c9a7;
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.7;
  text-align: center;
}

#home .hidden-room .attic-photo-caption {
  margin: 15px 0 0;
  color: #b9a58c;
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}
#home .hidden-room .attic-photo-secret {
  margin: 14px 0 0;
  padding: 13px;
  border: 1px dashed rgba(201, 169, 119, .45);
  background: rgba(10, 9, 8, .35);
  color: #e0c9a7;
  font-family: Georgia, serif;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
   }
#home .hidden-room .attic-photo-clue-link {
  display: block;
  width: fit-content;
  margin: 12px auto 0;
  padding: 9px 13px;
  border: 1px solid rgba(201, 169, 119, .45);
  border-radius: 999px;
  color: #e8c99b;
  font-size: 11px;
  text-align: center;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}

#home .hidden-room .attic-photo-clue-link:hover,
#home .hidden-room .attic-photo-clue-link:focus-visible {
  background: rgba(201, 169, 119, .12);
  border-color: rgba(201, 169, 119, .8);
  outline: none;
}

#home .hidden-room .attic-photo-clue-link[hidden] {
  display: none;
}

@media (max-width: 500px) {
  #home .hidden-room .attic-changing-photo {
    padding: 14px;
  }

  #home .hidden-room .attic-photo-image {
    min-height: 160px;
    font-size: 65px;
  }
}
/* MYSTERY LIBRARY — RESTRICTED ARCHIVE */

#view-mystery .mystery-library-intro {
  position: relative;
  max-width: 900px;
  margin: 30px auto;
  padding: 35px 24px;
  overflow: hidden;
  border: 1px solid rgba(193, 157, 104, .35);
  background:
    radial-gradient(circle at 50% 0%, rgba(166, 119, 68, .2), transparent 65%),
    linear-gradient(145deg, #211a18, #30231e, #191514);
  color: #e7d4b5;
  text-align: center;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .3);
}

#view-mystery .mystery-library-label {
  margin-bottom: 16px;
  color: #c9a977;
  font-size: 10px;
  letter-spacing: 3px;
}

#view-mystery .mystery-library-intro h2 {
  margin: 0 auto 14px;
  color: #f0dfc2;
  font-family: Georgia, serif;
  font-size: clamp(24px, 5vw, 38px);
  font-weight: normal;
  line-height: 1.3;
}

#view-mystery .mystery-library-intro p {
  max-width: 560px;
  margin: 0 auto;
  color: #c7b49b;
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1.9;
}

#view-mystery .mystery-library-warning {
  margin-top: 23px;
  padding-top: 15px;
  border-top: 1px solid rgba(193, 157, 104, .2);
  color: #c9a977;
  font-size: 9px;
  letter-spacing: 1.5px;
  line-height: 1.8;
}

#view-mystery .mystery-library-warning span {
  margin-right: 6px;
  color: #d6a45e;
}

@media (max-width: 500px) {
  #view-mystery .mystery-library-intro {
    padding: 28px 17px;
  }
}
/* MYSTERY LIBRARY — ARCHIVE CARDS */

#view-mystery .tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

@media (max-width: 600px) {
  #view-mystery .tool-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

#view-mystery .tool-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(193, 157, 104, .25);
  background:
    linear-gradient(145deg, rgba(55, 40, 32, .96), rgba(27, 22, 20, .98));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .2);
  transition: transform .25s ease, border-color .25s ease;
    display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: 16px;
  padding: 22px 18px;
}

#view-mystery .tool-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 169, 119, .65);
}

#view-mystery .tool-card > span {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 12px;
  border: 1px solid rgba(201, 169, 119, .4);
  border-radius: 50%;
  background: rgba(201, 169, 119, .08);
  filter: sepia(.35);
  font-size: 22px;
}

#view-mystery .tool-card h3 {
  color: #e7d4b5;
  font-family: Georgia, serif;
}

#view-mystery .tool-card p {
  color: #b9a58c;
  line-height: 1.7;
}

#view-mystery .tool-card button {
  border-color: rgba(201, 169, 119, .4);
}
/* MYSTERY LIBRARY — ARCHIVE DIVIDER */

#view-mystery .mystery-archive-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 620px;
  margin: 32px auto 24px;
  padding: 0 12px;
}

#view-mystery .mystery-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 169, 119, .55)
  );
}

#view-mystery .mystery-divider-line:last-child {
  background: linear-gradient(
    90deg,
    rgba(201, 169, 119, .55),
    transparent
  );
}

#view-mystery .mystery-divider-mark {
  color: #c9a977;
  font-size: 12px;
}

#view-mystery .mystery-divider-label {
  color: #c9a977;
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 2px;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 380px) {
  #view-mystery .mystery-archive-divider {
    gap: 7px;
  }

  #view-mystery .mystery-divider-label {
    font-size: 8px;
    letter-spacing: 1.3px;
  }
}
/* MYSTERY LIBRARY — FORTUNE TELLER */

#view-mystery .tool-card:nth-child(1) {
  border-color: rgba(173, 139, 205, .45);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(116, 76, 153, .25),
      transparent 65%
    ),
    linear-gradient(145deg, #30243a, #1d1925);
  box-shadow: 0 8px 25px rgba(20, 10, 30, .35);
}

#view-mystery .tool-card:nth-child(1) > span {
  border-color: rgba(201, 169, 119, .65);
  background: rgba(137, 94, 166, .18);
  box-shadow: 0 0 18px rgba(153, 112, 190, .18);
}

#view-mystery .tool-card:nth-child(1) h3 {
  color: #e3c9ef;
}

#view-mystery .tool-card:nth-child(1) button {
  border: 1px solid #d9b9f0;
  background: linear-gradient(120deg, #d7b5ff, #f0b9df);
  color: #24152f;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(189, 145, 255, .3);
}
/* FORTUNE TELLER — REVEALED MESSAGE */

#view-mystery .tool-card:nth-child(1) p {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(205, 174, 230, .22);
  border-left: 3px solid #c5a0e8;
  border-radius: 8px;
  background: rgba(15, 10, 25, .38);
  color: #e5d5f2;
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.8;
  text-align: center;
   }
/* MYSTERY LIBRARY — BADING COURT */

#view-mystery .tool-card:nth-child(2) {
  border-color: rgba(190, 151, 91, .55);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(139, 78, 57, .2),
      transparent 65%
    ),
    linear-gradient(145deg, #35251f, #211815);
  box-shadow: 0 8px 25px rgba(20, 10, 5, .35);
}

#view-mystery .tool-card:nth-child(2) > span {
  border-color: rgba(211, 177, 119, .65);
  background: rgba(153, 111, 66, .16);
  box-shadow: 0 0 18px rgba(190, 151, 91, .15);
}

#view-mystery .tool-card:nth-child(2) h3 {
  color: #ead2a6;
}

#view-mystery .tool-card:nth-child(2) p {
  color: #c9b69e;
}

#view-mystery .tool-card:nth-child(2) button {
  border: 1px solid #d5b77f;
  background: linear-gradient(120deg, #d9bd88, #b98c61);
  color: #2c1c15;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(190, 151, 91, .2);
}
/* MYSTERY LIBRARY — PALAKANG MARITES */

#view-mystery .tool-card:nth-child(3) {
  border-color: rgba(133, 174, 125, .5);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(83, 133, 82, .25),
      transparent 65%
    ),
    linear-gradient(145deg, #24352a, #17231c);
  box-shadow: 0 8px 25px rgba(5, 20, 10, .35);
}

#view-mystery .tool-card:nth-child(3) > span {
  border-color: rgba(173, 194, 130, .65);
  background: rgba(112, 153, 91, .18);
  box-shadow: 0 0 18px rgba(126, 176, 108, .18);
}

#view-mystery .tool-card:nth-child(3) h3 {
  color: #c9dfb2;
}

#view-mystery .tool-card:nth-child(3) p {
  color: #b5c6aa;
}

#view-mystery .tool-card:nth-child(3) button {
  border: 1px solid #b4c98c;
  background: linear-gradient(120deg, #c3d49b, #8eae78);
  color: #1c2b1c;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(126, 176, 108, .2);
}
/* MYSTERY LIBRARY — ASK THE UNIVERSE */

#view-mystery .tool-card:nth-child(4) {
  border-color: rgba(135, 147, 220, .5);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(104, 91, 180, .3),
      transparent 65%
    ),
    linear-gradient(145deg, #252744, #171a30);
  box-shadow: 0 8px 25px rgba(8, 10, 35, .4);
}

#view-mystery .tool-card:nth-child(4) > span {
  border-color: rgba(171, 174, 235, .7);
  background: rgba(119, 112, 194, .2);
  box-shadow: 0 0 18px rgba(140, 139, 230, .22);
}

#view-mystery .tool-card:nth-child(4) h3 {
  color: #d5d3ff;
}

#view-mystery .tool-card:nth-child(4) p {
  color: #b9bddb;
}

#view-mystery .tool-card:nth-child(4) button {
  border: 1px solid #b9b5ef;
  background: linear-gradient(120deg, #c9c2ff, #9da9e8);
  color: #20203b;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(157, 169, 232, .25);
}
/* MYSTERY LIBRARY — SAMPAL O LAMBING MACHINE */

#view-mystery .tool-card:nth-child(5) {
  border-color: rgba(207, 151, 93, .55);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(166, 73, 67, .3),
      transparent 65%
    ),
    linear-gradient(145deg, #3a2225, #211719);
  box-shadow: 0 8px 25px rgba(25, 8, 10, .4);
}

#view-mystery .tool-card:nth-child(5) > span {
  border-color: rgba(225, 178, 116, .7);
  background: rgba(170, 91, 67, .2);
  box-shadow: 0 0 18px rgba(220, 153, 91, .2);
}

#view-mystery .tool-card:nth-child(5) h3 {
  color: #f0c99f;
}

#view-mystery .tool-card:nth-child(5) p {
  color: #d0b3a4;
}

#view-mystery .tool-card:nth-child(5) button {
  border: 1px solid #e0b77d;
  background: linear-gradient(120deg, #e7bd83, #c77b69);
  color: #321c1b;
  font-weight: 800;
  box-shadow: 0 0 14px rgba(220, 153, 91, .25);
}
/* MYSTERY LIBRARY — THE FORBIDDEN BUTTON */

#view-mystery .tool-card:nth-child(6) {
  border-color: rgba(190, 75, 75, .55);
  background:
    radial-gradient(
      circle at 50% 0%,
      rgba(151, 43, 48, .28),
      transparent 65%
    ),
    linear-gradient(145deg, #351e22, #1c1519);
  box-shadow: 0 8px 25px rgba(25, 5, 8, .4);
}

#view-mystery .tool-card:nth-child(6) > span {
  border-color: rgba(218, 105, 105, .7);
  background: rgba(160, 47, 55, .2);
  box-shadow: 0 0 18px rgba(210, 70, 75, .2);
}

#view-mystery .tool-card:nth-child(6) h3 {
  color: #f0b7b7;
}

#view-mystery .tool-card:nth-child(6) p {
  color: #cbaaaa;
}

#view-mystery .tool-card:nth-child(6) button {
  border: 1px solid #e17c7c;
  background: linear-gradient(120deg, #e36d70, #a93442);
  color: #fff0ed;
  font-weight: 800;
  box-shadow: 0 0 16px rgba(220, 65, 75, .3);
}
/* FORTUNE TELLER — REVEAL ANIMATION */

@keyframes fortuneReveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

#view-mystery .tool-card:nth-child(1) p.revealed {
  animation: fortuneReveal .65s ease both;
}
/* FORTUNE TELLER — READING STAMP */

#view-mystery .fortune-stamp {
  margin: 8px 0 10px;
  color: #c9a5e8;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 3px;
  text-align: center;
  text-shadow: 0 0 12px rgba(190, 145, 230, .4);
}
/* FORTUNE TELLER — MYSTICAL CARD GLOW */

#view-mystery .tool-card:nth-child(1) {
  position: relative;
}

#view-mystery .tool-card:nth-child(1)::after {
  content: "✧";
  position: absolute;
  top: 14px;
  right: 18px;
  color: rgba(220, 190, 245, .45);
  font-size: 24px;
  pointer-events: none;
  animation: fortuneTwinkle 3s ease-in-out infinite;
}

@keyframes fortuneTwinkle {
  0%, 100% { opacity: .35; transform: scale(.9) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}
/* BADING COURT — VERDICT PANEL */

#view-mystery .tool-card:nth-child(2) p {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(213, 183, 127, .25);
  border-left: 3px solid #d5b77f;
  border-radius: 8px;
  background: rgba(20, 12, 9, .4);
  color: #f0dfc2;
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}
/* BADING COURT — VERDICT REVEAL */

@keyframes verdictReveal {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.98);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

#view-mystery .tool-card:nth-child(2) p.revealed {
  animation: verdictReveal .6s ease both;
}
/* BADING COURT — OFFICIAL STAMP */

#view-mystery .court-stamp {
  margin: 8px 0 10px;
  color: #d5b77f;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 10px rgba(213, 183, 127, .3);
}
/* BADING COURT — COURTROOM SEAL */

#view-mystery .tool-card:nth-child(2)::after {
  content: "§";
  position: absolute;
  top: 12px;
  right: 17px;
  color: rgba(213, 183, 127, .45);
  font-family: Georgia, serif;
  font-size: 25px;
  pointer-events: none;
  animation: courtSeal 4s ease-in-out infinite;
}

@keyframes courtSeal {
  0%, 100% {
    opacity: .35;
    transform: rotate(-8deg);
  }
  50% {
    opacity: .9;
    transform: rotate(8deg);
  }
}
/* PALAKANG MARITES — GOSSIP PANEL */

#view-mystery .tool-card:nth-child(3) p {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(173, 194, 130, .25);
  border-left: 3px solid #a8c47e;
  border-radius: 8px;
  background: rgba(10, 22, 14, .4);
  color: #d5e5c4;
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}
/* PALAKANG MARITES — GOSSIP REVEAL */

@keyframes gossipReveal {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(.97);
    filter: blur(3px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

#view-mystery .tool-card:nth-child(3) p.revealed {
  animation: gossipReveal .6s ease both;
   }
/* PALAKANG MARITES — GOSSIP STAMP */

#view-mystery .frog-stamp {
  margin: 8px 0 10px;
  color: #b9d49a;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 10px rgba(153, 190, 120, .35);
}
/* PALAKANG MARITES — GOSSIP SEAL */

#view-mystery .tool-card:nth-child(3)::after {
  content: "🐸";
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 19px;
  opacity: .65;
  pointer-events: none;
  animation: frogPeek 3s ease-in-out infinite;
}

@keyframes frogPeek {
  0%, 100% {
    transform: translateY(2px) rotate(-8deg);
    opacity: .45;
  }
  50% {
    transform: translateY(-4px) rotate(8deg);
    opacity: 1;
  }
}
/* ASK THE UNIVERSE — COSMIC MESSAGE PANEL */

#view-mystery .tool-card:nth-child(4) p {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(171, 174, 235, .28);
  border-left: 3px solid #aaa8ef;
  border-radius: 8px;
  background: rgba(12, 13, 35, .5);
  color: #d9d8ff;
  font-family: Georgia, serif;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
  text-shadow: 0 0 12px rgba(150, 145, 230, .2);
}
/* ASK THE UNIVERSE — COSMIC REVEAL */

@keyframes cosmicReveal {
  0% {
    opacity: 0;
    transform: scale(.94);
    filter: blur(5px);
  }
  60% {
    opacity: .8;
    transform: scale(1.02);
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

#view-mystery .tool-card:nth-child(4) p.revealed {
  animation: cosmicReveal .8s ease both;
   }
/* ASK THE UNIVERSE — COSMIC STAMP */

#view-mystery .universe-stamp {
  margin: 8px 0 10px;
  color: #c4c2ff;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 12px rgba(160, 155, 255, .5);
}
/* ASK THE UNIVERSE — FLOATING STAR */

#view-mystery .tool-card:nth-child(4)::after {
  content: "✦";
  position: absolute;
  top: 13px;
  right: 17px;
  color: rgba(196, 194, 255, .75);
  font-size: 22px;
  pointer-events: none;
  animation: universeStar 3s ease-in-out infinite;
}

@keyframes universeStar {
  0%, 100% {
    opacity: .35;
    transform: scale(.85) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.2) rotate(35deg);
  }
}
/* ASK THE UNIVERSE — FULL COSMIC REDESIGN */

#view-mystery .tool-card:nth-child(4) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px 20px 24px;
  text-align: center;
  border: 1px solid rgba(166, 158, 255, .55);
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 25%, rgba(105, 91, 190, .38), transparent 48%),
    radial-gradient(ellipse at 10% 90%, rgba(63, 75, 151, .24), transparent 55%),
    linear-gradient(145deg, #171b3d, #101329 65%, #211a40);
  box-shadow:
    0 15px 35px rgba(5, 5, 25, .4),
    inset 0 0 35px rgba(128, 116, 230, .08);
}

/* Nebula glow */
#view-mystery .tool-card:nth-child(4)::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 190px;
  height: 190px;
  top: -85px;
  right: -65px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(174, 155, 255, .3), transparent 70%);
  pointer-events: none;
}

/* Celestial orbit */
#view-mystery .tool-card:nth-child(4)::after {
  content: "";
  position: absolute;
  top: -65px;
  right: -65px;
  width: 175px;
  height: 175px;
  border: 1px solid rgba(194, 184, 255, .2);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(151, 135, 255, .12);
  pointer-events: none;
  animation: none;
}

/* Cosmic icon */
#view-mystery .tool-card:nth-child(4) > span {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
  border: 1px solid rgba(203, 193, 255, .65);
  border-radius: 50%;
  background: radial-gradient(circle, #514b91, #25234f 70%);
  box-shadow:
    0 0 18px rgba(158, 143, 255, .4),
    inset 0 0 16px rgba(210, 200, 255, .15);
  font-size: 34px;
  filter: none;
}

/* Title */
#view-mystery .tool-card:nth-child(4) h3 {
  margin-bottom: 12px;
  color: #eeeaff;
  font-family: Georgia, serif;
  font-size: 22px;
  letter-spacing: .3px;
}

/* Transmission label */
#view-mystery .universe-stamp {
  display: inline-block;
  margin: 4px auto 14px;
  padding: 7px 11px;
  border: 1px solid rgba(181, 170, 255, .3);
  border-radius: 20px;
  background: rgba(130, 113, 220, .12);
  color: #c9c0ff;
  font-size: 8px;
  letter-spacing: 1.5px;
  line-height: 1.6;
  text-shadow: 0 0 10px rgba(174, 160, 255, .4);
}

/* Message window */
#view-mystery .tool-card:nth-child(4) p {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 18px;
  padding: 17px;
  border: 1px solid rgba(172, 164, 255, .28);
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(9, 12, 36, .8), rgba(48, 39, 91, .45));
  color: #e4e0ff;
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
  box-shadow: inset 0 0 20px rgba(126, 113, 220, .08);
}

/* Cosmic button */
#view-mystery .tool-card:nth-child(4) button {
  display: block;
  margin: 0 auto;
  padding: 12px 23px;
  border: 1px solid #c6bdff;
  border-radius: 30px;
  background: linear-gradient(120deg, #d6ceff, #a9b5f5);
  color: #201d45;
  font-weight: 800;
  box-shadow: 0 0 20px rgba(166, 155, 255, .3);
  transition: transform .25s ease, box-shadow .25s ease;
}

#view-mystery .tool-card:nth-child(4) button:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 28px rgba(166, 155, 255, .5);
}
/* SAMPAL O LAMBING — MACHINE DISPLAY */

#view-mystery .tool-card:nth-child(5) p {
  min-height: 85px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  padding: 16px;
  border: 2px solid rgba(224, 183, 125, .4);
  border-radius: 12px;
  background:
    radial-gradient(circle at center, rgba(173, 83, 75, .2), transparent 75%),
    rgba(20, 10, 14, .55);
  color: #f4d2b5;
  font-family: Georgia, serif;
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
  box-shadow: inset 0 0 18px rgba(220, 130, 90, .1);
}
/* SAMPAL O LAMBING — CARNIVAL MACHINE */

#view-mystery .tool-card:nth-child(5) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 26px 20px;
  text-align: center;
  border: 1px solid rgba(235, 164, 111, .55);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 15%, rgba(190, 77, 67, .3), transparent 50%),
    linear-gradient(145deg, #321a27, #1c1420 65%, #38202a);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3),
              inset 0 0 25px rgba(220, 130, 90, .08);
}

/* Carnival light border */
#view-mystery .tool-card:nth-child(5)::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(244, 190, 139, .3);
  border-radius: 12px;
  pointer-events: none;
}

/* Machine title */
#view-mystery .tool-card:nth-child(5) h3 {
  color: #ffe0bd;
  font-family: Georgia, serif;
  font-size: 21px;
  text-shadow: 0 0 12px rgba(255, 155, 110, .25);
}

/* Machine result display */
#view-mystery .tool-card:nth-child(5) p {
  position: relative;
  z-index: 1;
}

/* Carnival button */
#view-mystery .tool-card:nth-child(5) button {
  border: 1px solid #f4c18e;
  border-radius: 30px;
  padding: 12px 23px;
  background: linear-gradient(135deg, #e7a36e, #bd5b61);
  color: #29151b;
  font-weight: 800;
  box-shadow: 0 4px 18px rgba(223, 126, 102, .25);
   }
/* SAMPAL O LAMBING — CARNIVAL MARQUEE */

#view-mystery .tool-card:nth-child(5) .machine-stamp {
  display: inline-block;
  margin: 8px auto 14px;
  padding: 7px 13px;
  border: 1px solid rgba(255, 202, 151, .4);
  border-radius: 20px;
  background: rgba(174, 88, 78, .18);
  color: #ffd5ae;
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 177, 130, .4);
}
/* SAMPAL O LAMBING — MARQUEE GLOW */

#view-mystery .tool-card:nth-child(5) .machine-stamp {
  animation: machineGlow 2.5s ease-in-out infinite;
}

@keyframes machineGlow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(255, 177, 130, .08);
    text-shadow: 0 0 5px rgba(255, 177, 130, .2);
  }
  50% {
    box-shadow: 0 0 16px rgba(255, 177, 130, .25);
    text-shadow: 0 0 12px rgba(255, 177, 130, .65);
  }
}
/* SAMPAL O LAMBING — JACKPOT REVEAL */

@keyframes machineReveal {
  0% {
    opacity: 0;
    transform: scale(.92) translateY(8px);
    filter: blur(4px);
  }
  65% {
    opacity: 1;
    transform: scale(1.03) translateY(-2px);
    filter: blur(0);
  }
  100% {
    transform: scale(1);
  }
}

#view-mystery .tool-card:nth-child(5) p.revealed {
  animation: machineReveal .65s ease both;
   }
/* THE FORBIDDEN BUTTON — RESTRICTED ACCESS */

#view-mystery .tool-card:has(#forbiddenBtn) {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 26px 20px;
  text-align: center;
  border: 1px solid rgba(220, 65, 65, .55);
  border-radius: 18px;
  background:
    radial-gradient(ellipse at top, rgba(135, 35, 40, .3), transparent 65%),
    linear-gradient(145deg, #271719, #171315 70%, #30191d);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
}

/* Warning border */
#view-mystery .tool-card:has(#forbiddenBtn)::before {
  content: "RESTRICTED ACCESS • AUTHORIZATION REQUIRED";
  display: block;
  margin-bottom: 20px;
  padding: 8px 5px;
  border-top: 1px solid rgba(255, 95, 95, .3);
  border-bottom: 1px solid rgba(255, 95, 95, .3);
  color: #ff8585;
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 2px;
}

/* Forbidden icon */
#view-mystery .tool-card:has(#forbiddenBtn) > span {
  display: block;
  margin: 8px auto 14px;
  font-size: 42px;
  filter: drop-shadow(0 0 12px rgba(255, 65, 65, .4));
}

/* Heading */
#view-mystery .tool-card:has(#forbiddenBtn) h3 {
  color: #ffcccc;
  font-family: Georgia, serif;
  font-size: 21px;
}

/* Description */
#view-mystery .tool-card:has(#forbiddenBtn) p {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e6bcbc;
  font-family: Georgia, serif;
  line-height: 1.8;
}

/* Danger button */
#view-mystery .tool-card:has(#forbiddenBtn) button {
  border: 1px solid #ff7777;
  border-radius: 8px;
  padding: 13px 22px;
  background: linear-gradient(135deg, #a82e37, #641b25);
  color: #fff0f0;
  font-weight: 900;
  letter-spacing: 1.5px;
  box-shadow: 0 0 18px rgba(220, 50, 65, .2);
}
/* FORBIDDEN BUTTON — CLASSIFIED FILE REDESIGN */

#view-mystery .forbidden-card {
  position: relative;
  overflow: hidden;
  gap: 14px;
  padding: 20px 18px;
  background:
    radial-gradient(circle at 50% 35%, rgba(120, 15, 25, 0.28), transparent 55%),
    linear-gradient(145deg, #211114, #100d10 75%);
  border: 1px solid rgba(220, 55, 65, 0.5);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

#view-mystery .forbidden-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(220, 55, 65, 0.25);
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 800;
}

#view-mystery .forbidden-status {
  color: #ff626c;
}

#view-mystery .forbidden-file {
  color: #a99a9c;
}

#view-mystery .forbidden-icon {
  align-self: center;
  font-size: 42px;
  margin: 5px 0;
  filter: drop-shadow(0 0 12px rgba(255, 45, 60, 0.45));
}

#view-mystery .forbidden-classification {
  align-self: center;
  padding: 5px 10px;
  border: 1px solid rgba(255, 75, 85, 0.45);
  border-radius: 4px;
  color: #ff777e;
  background: rgba(120, 10, 20, 0.2);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
}

#view-mystery .forbidden-card h3 {
  color: #ffe6e7;
  text-align: center;
  letter-spacing: 0.4px;
}

#view-mystery .forbidden-card #forbiddenText {
  color: #c8b5b7;
  text-align: center;
}

#view-mystery .forbidden-warning {
  padding: 9px;
  border: 1px dashed rgba(255, 80, 90, 0.4);
  border-radius: 6px;
  color: #ff858b;
  background: rgba(130, 15, 25, 0.16);
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.6px;
}

#view-mystery .forbidden-card #forbiddenBtn {
  width: 100%;
  min-height: 46px;
  border: 1px solid #ff555f;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #a91e2b, #64101a);
  box-shadow: 0 0 16px rgba(220, 35, 50, 0.2);
  font-weight: 900;
  letter-spacing: 2px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#view-mystery .forbidden-card #forbiddenBtn:active {
  transform: scale(0.97);
  box-shadow: 0 0 22px rgba(255, 45, 60, 0.5);
}

#view-mystery .forbidden-footer {
  padding-top: 9px;
  border-top: 1px solid rgba(220, 55, 65, 0.2);
  color: #817174;
  text-align: center;
  font-size: 8px;
  letter-spacing: 1.5px;
}
/* ===== COSMIC PLAYER HUD ===== */

.top-actions {
  gap: 8px;
}

.star-wallet {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 215, 130, .28);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 210, 115, .17), rgba(255, 255, 255, .045));
  color: #ffe5a4;
  box-shadow: 0 5px 18px rgba(0, 0, 0, .15);
}

.star-wallet-icon {
  color: #ffd36e;
  font-size: 17px;
}

.star-wallet-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.star-wallet b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 150px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(190, 160, 255, .3);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(169, 139, 255, .2), rgba(255, 255, 255, .055));
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.account-chip-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.account-chip-icon {
  color: #d7c5ff;
}

.profile-avatar-btn {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(213, 190, 255, .5);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .22), rgba(169, 139, 255, .15));
  box-shadow: 0 0 0 3px rgba(169, 139, 255, .08), 0 5px 16px rgba(0, 0, 0, .18);
  font-size: 22px;
}

#headerAvatar {
  line-height: 1;
}

@media (max-width: 560px) {
  .top-actions {
    gap: 5px;
  }

  .star-wallet {
    gap: 4px;
    padding: 7px 9px;
  }

  .star-wallet-label {
    display: none;
  }

  .star-wallet b {
    font-size: 13px;
  }

  .account-chip {
    max-width: 105px;
    min-height: 38px;
    padding: 7px 9px;
    font-size: 11px;
  }

  .account-chip-icon {
    display: none;
  }

  .profile-avatar-btn {
    width: 38px;
    min-width: 38px;
    height: 38px;
    font-size: 20px;
  }
}

@media (max-width: 380px) {
  .account-chip {
    max-width: 84px;
  }
}
/* ===== SMOOTH INTERACTION FOUNDATION ===== */

button,
a,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:active,
[role="button"]:active {
  transform: scale(.97);
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid rgba(217, 195, 240, .9);
  outline-offset: 3px;
}

/* Desktop hover feedback */
@media (hover: hover) and (pointer: fine) {
  button:hover,
  [role="button"]:hover {
    filter: brightness(1.08);
  }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  button:active,
  [role="button"]:active {
    transform: none;
  }
}
/* ===== MOBILE PERFORMANCE POLISH ===== */

@media (max-width: 700px) {
  .hero::before {
    animation: none !important;
  }

  .hero-orbit .orbit-a,
  .hero-orbit .orbit-b {
    animation: none !important;
  }

  .hero-orbit {
    animation-duration: 9s;
  }
}




   



   




     



/* Forgotten Attic: new chapter */
#home .hidden-room .attic-new-chapter{display:grid;gap:16px;margin-top:24px}
#home .hidden-room .attic-chapter-heading{margin:8px 0 2px}
#home .hidden-room .attic-chapter-heading h3{margin:4px 0;font-family:Georgia,serif;font-size:clamp(21px,4vw,27px)}
#home .hidden-room .attic-chapter-heading>p:last-child{max-width:560px;color:var(--muted);line-height:1.65}
#home .hidden-room .attic-music-box,#home .hidden-room .attic-cabinet,#home .hidden-room .attic-keepsakes{padding:19px;border:1px solid rgba(190,160,125,.25);border-radius:16px;background:rgba(38,27,23,.42);color:var(--text)}
#home .hidden-room .attic-music-box{display:grid;grid-template-columns:76px minmax(0,1fr);gap:16px;align-items:center}
#home .hidden-room .attic-music-art{display:grid;place-items:center;width:72px;height:72px;border:1px solid rgba(218,185,139,.35);border-radius:50%;background:rgba(176,132,83,.12);color:#e4c99e;font-family:Georgia,serif;font-size:38px}
#home .hidden-room .attic-feature-copy h3,#home .hidden-room .attic-cabinet h3,#home .hidden-room .attic-keepsakes h3{margin:3px 0 7px;font-family:Georgia,serif;font-size:21px}
#home .hidden-room .attic-feature-copy>p:not(.eyebrow),#home .hidden-room .attic-cabinet p:not(.eyebrow),#home .hidden-room .attic-keepsakes-intro{color:var(--muted);line-height:1.65}
#home .hidden-room .attic-action{min-height:42px;margin-top:8px;padding:10px 16px;border:1px solid rgba(211,177,126,.45);border-radius:9px;background:#49372c;color:#f6e8d3;font:inherit;font-size:13px;font-weight:750;cursor:pointer}
#home .hidden-room .attic-reveal-note{margin-top:12px;padding:13px;border-left:3px solid #c7a878;border-radius:0 9px 9px 0;background:rgba(0,0,0,.18);color:#f1dfc2;line-height:1.75}
#home .hidden-room .attic-archive-count{display:block;margin-top:9px;color:var(--muted);font-size:11px}
#home .hidden-room .attic-cabinet-top{display:flex;gap:14px;align-items:flex-start}
#home .hidden-room .attic-cabinet-top>span{font-size:38px}
#home .hidden-room .attic-cabinet-clue{margin:13px 0;padding:13px;border:1px dashed rgba(211,177,126,.4);border-radius:9px;background:rgba(0,0,0,.15);color:#e9d3b0;font-family:Georgia,serif;line-height:1.65}
#home .hidden-room .attic-cabinet-controls{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
#home .hidden-room #attic-cabinet-code{width:94px;min-height:43px;padding:8px 10px;border:1px solid rgba(211,177,126,.45);border-radius:8px;background:rgba(0,0,0,.25);color:var(--text);font:inherit;font-size:18px;letter-spacing:5px;text-align:center}
#home .hidden-room .attic-cabinet-feedback{min-height:22px;margin:10px 0;color:#d8c5a7;font-size:13px}
#home .hidden-room .attic-cabinet-prize{display:flex;gap:12px;align-items:center;margin-top:12px;padding:13px;border:1px solid rgba(211,177,126,.3);border-radius:10px;background:rgba(170,130,78,.1)}
#home .hidden-room .attic-cabinet-prize>span{font-size:29px}
#home .hidden-room .attic-cabinet-prize p{margin:4px 0 0;font-size:13px}
#home .hidden-room .attic-keepsakes-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}
#home .hidden-room .attic-keepsakes-heading>span{padding:6px 10px;border:1px solid rgba(211,177,126,.35);border-radius:20px;color:#e9d3b0;font-size:12px;font-weight:800;white-space:nowrap}
#home .hidden-room .attic-keepsakes-intro{margin:0 0 13px;font-size:13px}
#home .hidden-room .attic-keepsake-shelf{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
#home .hidden-room .attic-keepsake{display:flex;gap:10px;align-items:center;min-width:0;padding:11px;border:1px solid rgba(211,177,126,.2);border-radius:10px;background:rgba(0,0,0,.12)}
#home .hidden-room .attic-keepsake-icon{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border-radius:9px;background:rgba(211,177,126,.12);font-size:19px}
#home .hidden-room .attic-keepsake strong,#home .hidden-room .attic-keepsake small{display:block;overflow-wrap:anywhere}
#home .hidden-room .attic-keepsake strong{font-size:12px;line-height:1.4}
#home .hidden-room .attic-keepsake small{margin-top:3px;color:var(--muted);font-size:10px;line-height:1.4}
#home .hidden-room .attic-keepsake.is-hidden{opacity:.62;border-style:dashed}
#home .hidden-room .attic-keepsake.is-hidden .attic-keepsake-icon{color:var(--muted)}
@media(max-width:600px){#home .hidden-room .attic-music-box{grid-template-columns:54px minmax(0,1fr);gap:12px;padding:15px}#home .hidden-room .attic-music-art{width:52px;height:52px;font-size:28px}#home .hidden-room .attic-music-box,#home .hidden-room .attic-cabinet,#home .hidden-room .attic-keepsakes{padding:15px}#home .hidden-room .attic-keepsake-shelf{grid-template-columns:1fr}#home .hidden-room .attic-keepsake{padding:10px}}


/* PHASE 14 — LAB WORKSHOP: three hands-on creative benches */
#home .lab-workshop{margin:18px 0 42px;padding:clamp(14px,3vw,26px);border:1px solid rgba(196,243,91,.26);background:linear-gradient(145deg,rgba(26,38,29,.96),rgba(17,24,21,.97));box-shadow:0 16px 42px rgba(0,0,0,.18)}
#home .lab-workshop-heading{padding:3px 2px 20px;border-bottom:1px dashed rgba(196,243,91,.28);margin-bottom:18px}
#home .lab-file-tag,#home .lab-bench-top{font:700 10px/1.4 monospace;letter-spacing:.16em;color:#c4f35b}
#home .lab-workshop-heading h3{margin:8px 0 5px;color:#f1f5df;font:500 clamp(25px,4vw,34px)/1.1 Georgia,serif}
#home .lab-workshop-heading p{margin:0;color:#b9c5ae;font-size:13px;line-height:1.6}
#home .lab-bench{margin:16px 0;padding:clamp(14px,2.5vw,22px);border:1px solid rgba(210,225,190,.18);background:#202a22;color:#eaf0df}
#home .lab-bench-top{display:flex;justify-content:space-between;gap:10px;padding-bottom:10px;border-bottom:1px solid rgba(210,225,190,.14);color:#b9d58b;font-size:9px}
#home .lab-bench-top span:last-child{color:#9ba995;text-align:right}
#home .lab-bench-heading{display:flex;align-items:flex-start;gap:13px;padding:17px 0}
#home .lab-bench-icon{display:grid;place-items:center;flex:0 0 43px;height:43px;background:#303d30;border:1px solid #718b6b55;font-size:23px}
#home .lab-bench-heading h3{margin:0 0 5px;color:#f3f1df;font:500 22px/1.2 Georgia,serif}
#home .lab-bench-heading p{margin:0;color:#b7c1b1;font-size:12px;line-height:1.6}
#home .creature-workspace,#home .craft-workspace,#home .machine-workspace{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:18px;align-items:center}
#home .creature-preview-wrap{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:220px;padding:18px;background:radial-gradient(circle,#526449 0,#354331 45%,#293528 75%);border:1px dashed #a8c18c66}
#home .creature-preview{display:flex;align-items:center;justify-content:center;gap:2px;min-height:110px;font-size:clamp(42px,8vw,64px);filter:drop-shadow(0 5px 4px #10191066)}
#home #creatureSpecimenLabel{margin-top:13px;color:#d0dfb9;font:700 9px monospace;letter-spacing:.15em;text-align:center}
#home .creature-controls,#home .craft-controls,#home .machine-controls{display:grid;gap:10px;min-width:0}
#home .lab-bench label{display:grid;gap:5px;color:#dce5d0;font-size:11px;font-weight:700}
#home .lab-bench input,#home .lab-bench select{width:100%;min-width:0;min-height:41px;padding:9px 11px;border:1px solid #71846b66;border-radius:3px;background:#172019;color:#f0f3e8;font:500 13px inherit}
#home .lab-bench input::placeholder{color:#9ba995}
#home .lab-action{min-height:42px;padding:10px 14px;border:1px solid #b4d17c88;border-radius:2px 12px 2px 12px;background:#d6e6b5;color:#263523;font-weight:800;font-size:12px;cursor:pointer}
#home .lab-action:hover{background:#e5f0d0}
#home .lab-feedback{min-height:18px;margin:0;color:#b9d58b;font-size:11px;line-height:1.5}
#home .specimen-shelf{margin-top:18px;padding-top:14px;border-top:1px solid rgba(210,225,190,.15)}
#home .lab-subhead{display:flex;justify-content:space-between;gap:10px;color:#e7ecd9;font-size:12px}
#home .lab-subhead span,#home .lab-local-note{color:#9eae98;font-size:10px}
#home .specimen-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
#home .specimen-chip{display:flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid #718b6b55;background:#293629;color:#e8efdc;font-size:11px}
#home .specimen-chip span:first-child{font-size:20px}
#home .specimen-chip button{border:0;background:transparent;color:#d5b3a8;font-size:11px;cursor:pointer}
#home .lab-empty{margin:0;color:#9eae98;font-size:11px}
#home .lab-local-note{margin:9px 0 0}
#home .craft-preview{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:255px;padding:20px;border:7px solid rgba(255,255,255,.55);outline:1px solid rgba(255,255,255,.3);text-align:center;color:#43354d;box-shadow:0 10px 24px #0003;transition:background .2s}
#home .craft-preview[data-paper="lilac"]{background:#e9ddf4;color:#443451}
#home .craft-preview[data-paper="peach"]{background:#f6ddc9;color:#583b32}
#home .craft-preview[data-paper="matcha"]{background:#e2ebd4;color:#344633}
#home .craft-preview[data-paper="night"]{background:#29334b;color:#f3e9ff}
#home .craft-preview[data-paper="pink"]{background:#f5d9e7;color:#57374b}
#home .craft-preview-decoration{font-size:17px;letter-spacing:.3em}
#home .craft-preview-icon{font-size:54px;line-height:1.2}
#home .craft-preview strong{max-width:100%;overflow-wrap:anywhere;font:600 clamp(20px,3vw,27px)/1.15 Georgia,serif}
#home .craft-preview-footer{font:700 8px monospace;letter-spacing:.2em;opacity:.72}
#home .machine-visual{display:flex;align-items:center;justify-content:center;gap:clamp(5px,1.5vw,13px);min-height:175px;padding:18px 8px;background:repeating-linear-gradient(0deg,#ffffff06 0 1px,transparent 1px 15px),#18221b;border:1px dashed #9caf8a66}
#home .machine-visual>span:not(.machine-join){display:grid;place-items:center;width:clamp(43px,7vw,68px);height:clamp(43px,7vw,68px);background:#303d30;border:1px solid #829b6c66;font-size:clamp(23px,4vw,34px)}
#home .machine-join{color:#b9d58b;font-size:17px}
#home .machine-result{margin-top:15px;padding:14px 16px;border-left:3px solid #b9d58b;background:#293629}
#home .machine-result-label{color:#b9d58b;font:700 9px monospace;letter-spacing:.17em}
#home .machine-result p{margin:7px 0 0;color:#e7ecd9;font:500 14px/1.6 Georgia,serif}
@media(max-width:650px){
 #home .lab-workshop{padding:12px}
 #home .lab-bench{padding:13px}
 #home .creature-workspace,#home .craft-workspace,#home .machine-workspace{grid-template-columns:1fr;gap:14px}
 #home .creature-preview-wrap{min-height:165px}
 #home .craft-preview{min-height:225px}
 #home .machine-visual{min-height:125px}
 #home .lab-bench-top{font-size:8px;letter-spacing:.1em}
}
@media(prefers-reduced-motion:reduce){#home .craft-preview{transition:none}}


/* Creature Bench: assembled, illustrated specimens */
#home .creature-preview{display:grid;place-items:center;width:100%;min-height:175px;font-size:initial;filter:none}
#home .assembled-creature{display:block;width:min(100%,210px);height:auto;overflow:visible;filter:drop-shadow(0 9px 7px #10191055);animation:specimen-arrive .35s ease-out both}
#home .specimen-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:9px}
#home .specimen-card{display:grid;grid-template-columns:76px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;gap:4px 9px;padding:8px;border:1px solid #718b6b55;background:#293629;color:#e8efdc;min-width:0}
#home .specimen-art{grid-row:1 / span 2;display:grid;place-items:center;min-height:76px;background:radial-gradient(circle,#526449 0,#354331 72%);overflow:hidden}
#home .specimen-creature{width:82px;height:76px;filter:drop-shadow(0 3px 3px #10191055)}
#home .specimen-details{display:grid;gap:3px;min-width:0}
#home .specimen-details strong{overflow-wrap:anywhere;color:#f0f2e4;font:600 12px Georgia,serif}
#home .specimen-details small{color:#aebda5;font-size:10px;line-height:1.3}
#home .specimen-remove{justify-self:start;padding:3px 0;border:0;background:transparent;color:#e4a9b4;font-size:10px;text-decoration:underline;cursor:pointer}
@keyframes specimen-arrive{from{opacity:.45;transform:translateY(7px) scale(.94)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:650px){
 #home .creature-preview{min-height:180px}
 #home .assembled-creature{width:min(100%,205px)}
 #home .specimen-list{grid-template-columns:repeat(auto-fill,minmax(145px,1fr))}
}
@media(prefers-reduced-motion:reduce){#home .assembled-creature{animation:none}}


/* THEME POLISH — keep text contrast consistent when the atmosphere changes */
body[data-theme="cloud"] #home .hero,
body[data-theme="peach"] #home .hero,
body[data-theme="matcha"] #home .hero{
  color:var(--text);
  background:
    radial-gradient(circle at 85% 35%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 34%),
    linear-gradient(125deg,var(--panel2),var(--panel) 68%);
  border-color:var(--line);
}
body[data-theme="cloud"] #home .hero h1,
body[data-theme="peach"] #home .hero h1,
body[data-theme="matcha"] #home .hero h1{color:var(--text);text-shadow:none}
body[data-theme="cloud"] #home .hero h1 em,
body[data-theme="peach"] #home .hero h1 em,
body[data-theme="matcha"] #home .hero h1 em{color:var(--accent);text-shadow:none}
body[data-theme="cloud"] #home .hero-text,
body[data-theme="peach"] #home .hero-text,
body[data-theme="matcha"] #home .hero-text{color:var(--muted)}
body[data-theme="cloud"] #home .stat,
body[data-theme="peach"] #home .stat,
body[data-theme="matcha"] #home .stat{
  background:linear-gradient(145deg,var(--panel),var(--panel2));
  color:var(--text);border-color:var(--line);
}
body[data-theme="cloud"] #home .stat span,
body[data-theme="cloud"] #home .stat small,
body[data-theme="peach"] #home .stat span,
body[data-theme="peach"] #home .stat small,
body[data-theme="matcha"] #home .stat span,
body[data-theme="matcha"] #home .stat small{color:var(--muted)}
body[data-theme="cloud"] #home .diary-entry p,
body[data-theme="peach"] #home .diary-entry p,
body[data-theme="matcha"] #home .diary-entry p,
body[data-theme="cloud"] #home .hangout-card>p,
body[data-theme="peach"] #home .hangout-card>p,
body[data-theme="matcha"] #home .hangout-card>p,
body[data-theme="cloud"] #home .prompt-box p,
body[data-theme="peach"] #home .prompt-box p,
body[data-theme="matcha"] #home .prompt-box p,
body[data-theme="cloud"] #home .feed-item,
body[data-theme="peach"] #home .feed-item,
body[data-theme="matcha"] #home .feed-item{color:var(--text)}
body[data-theme="cloud"] #home .entry-meta,
body[data-theme="peach"] #home .entry-meta,
body[data-theme="matcha"] #home .entry-meta,
body[data-theme="cloud"] #home .form-note,
body[data-theme="peach"] #home .form-note,
body[data-theme="matcha"] #home .form-note,
body[data-theme="cloud"] #home .empty-state,
body[data-theme="peach"] #home .empty-state,
body[data-theme="matcha"] #home .empty-state{color:var(--muted)}
body[data-theme="cloud"] #home .diary-form input,
body[data-theme="cloud"] #home .diary-form textarea,
body[data-theme="cloud"] #home .diary-form select,
body[data-theme="cloud"] #home .diary-list-head input,
body[data-theme="cloud"] #home .hangout-form input,
body[data-theme="cloud"] #home .prompt-box textarea,
body[data-theme="peach"] #home .diary-form input,
body[data-theme="peach"] #home .diary-form textarea,
body[data-theme="peach"] #home .diary-form select,
body[data-theme="peach"] #home .diary-list-head input,
body[data-theme="peach"] #home .hangout-form input,
body[data-theme="peach"] #home .prompt-box textarea,
body[data-theme="matcha"] #home .diary-form input,
body[data-theme="matcha"] #home .diary-form textarea,
body[data-theme="matcha"] #home .diary-form select,
body[data-theme="matcha"] #home .diary-list-head input,
body[data-theme="matcha"] #home .hangout-form input,
body[data-theme="matcha"] #home .prompt-box textarea{
  background:var(--panel2);color:var(--text);border-color:var(--line);
}
body[data-theme="cloud"] #home .diary-form label,
body[data-theme="peach"] #home .diary-form label,
body[data-theme="matcha"] #home .diary-form label{color:var(--muted)}
body[data-theme="cloud"] #home .comfort-panel,
body[data-theme="peach"] #home .comfort-panel,
body[data-theme="matcha"] #home .comfort-panel,
body[data-theme="cloud"] #home .hangout-card,
body[data-theme="peach"] #home .hangout-card,
body[data-theme="matcha"] #home .hangout-card{
  background:var(--panel);color:var(--text);border-color:var(--line);
}
body[data-theme="cloud"] #home .comfort-panel p:not(.eyebrow),
body[data-theme="peach"] #home .comfort-panel p:not(.eyebrow),
body[data-theme="matcha"] #home .comfort-panel p:not(.eyebrow){color:var(--muted)}
body[data-theme="cloud"] #home .kind-item,
body[data-theme="peach"] #home .kind-item,
body[data-theme="matcha"] #home .kind-item{background:var(--panel2);color:var(--text)}
body[data-theme="cloud"] #home .small-btn,
body[data-theme="peach"] #home .small-btn,
body[data-theme="matcha"] #home .small-btn{color:#fff}
body[data-theme="cloud"] #home .primary-btn,
body[data-theme="peach"] #home .primary-btn,
body[data-theme="matcha"] #home .primary-btn{color:#fff}
body[data-theme="cloud"] #home .game-result,
body[data-theme="peach"] #home .game-result,
body[data-theme="matcha"] #home .game-result{color:var(--text)!important}
body[data-theme="cloud"] #home .theme-panel,
body[data-theme="peach"] #home .theme-panel,
body[data-theme="matcha"] #home .theme-panel{color:#49384c}
body[data-theme="cloud"] #home .theme-panel p,
body[data-theme="peach"] #home .theme-panel p,
body[data-theme="matcha"] #home .theme-panel p{color:#66566b}
body[data-theme="cloud"] #home .theme-choice,
body[data-theme="peach"] #home .theme-choice,
body[data-theme="matcha"] #home .theme-choice{color:#49384c}
body[data-theme="cloud"] #home .theme-choice.active,
body[data-theme="peach"] #home .theme-choice.active,
body[data-theme="matcha"] #home .theme-choice.active{color:#34213f;background:#e9d9ef}
body[data-theme="cloud"] #home .topbar,
body[data-theme="peach"] #home .topbar,
body[data-theme="matcha"] #home .topbar{color:var(--text)}
body[data-theme="cloud"] #home .topbar .brand small,
body[data-theme="peach"] #home .topbar .brand small,
body[data-theme="matcha"] #home .topbar .brand small{color:var(--muted)}
body[data-theme="cloud"] #home .icon-btn,
body[data-theme="peach"] #home .icon-btn,
body[data-theme="matcha"] #home .icon-btn{background:var(--panel2);color:var(--text);border-color:var(--line)}
body[data-theme="cloud"] #home .footer,
body[data-theme="peach"] #home .footer,
body[data-theme="matcha"] #home .footer{color:var(--muted)}

/* Cleaner type rhythm: sharper labels, calmer body copy, consistent controls */
#home :is(input,textarea,select,button){font-family:'DM Sans',sans-serif}
#home :is(input,textarea,select):focus-visible,
#home button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}


/* Tambayan Lounge — give the Poll and Mood Garden equal room */
#view-community .hangout-layout > .lounge-community-garden {
  width: 100%;
  min-width: 0;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch;
  gap: clamp(16px, 2.4vw, 28px) !important;
  margin-top: 18px;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 205px;
  padding: clamp(20px, 2.6vw, 30px) !important;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 8px;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card > span {
  font-size: 32px;
  line-height: 1.2;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card h3 {
  margin: 8px 0 2px;
  font-size: 18px;
  line-height: 1.3;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card p {
  max-width: 34ch;
  margin: 0;
  line-height: 1.65;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card button {
  margin-top: auto;
}
@media (max-width: 560px) {
  #view-community .hangout-layout > .lounge-community-garden > .tool-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  #view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card {
    min-height: 0;
    padding: 21px !important;
  }
}


/* Our Shared Spaces is an introduction only; the two destinations keep their own pages. */
#view-community .shared-spaces-intro-copy {
  max-width: 62ch;
  margin: 6px 0 18px;
  color: var(--muted);
  line-height: 1.65;
}
#view-community .shared-spaces-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
#view-community .shared-space-card {
  min-width: 0;
  min-height: 168px;
  padding: 23px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
#view-community .shared-space-card > span { font-size: 30px; line-height: 1.2; }
#view-community .shared-space-card h3 { margin: 7px 0 0; font-size: 18px; }
#view-community .shared-space-card p { max-width: 42ch; margin: 0; line-height: 1.65; }
@media (max-width: 560px) {
  #view-community .shared-spaces-grid { grid-template-columns: 1fr; gap: 13px; }
  #view-community .shared-space-card { min-height: 0; padding: 20px; }
}


/* FINAL LOUNGE GRID OVERRIDES — full-width cards, no squeezed side-by-side tiles. */
#view-community .hangout-layout > .lounge-community-garden > .tool-grid,
#view-community .hangout-layout > .lounge-discovery-corner > .tool-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  width: 100% !important;
  gap: 18px !important;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card,
#view-community .hangout-layout > .lounge-discovery-corner > .tool-grid > .tool-card {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
  padding: clamp(20px, 3vw, 30px) !important;
}
#view-community .hangout-layout > .lounge-community-garden > .tool-grid > .tool-card p,
#view-community .hangout-layout > .lounge-discovery-corner > .tool-grid > .tool-card p {
  max-width: 58ch;
  line-height: 1.7;
}
#view-community .hangout-layout > .lounge-discovery-corner > .tool-grid > .tool-card > span {
  font-size: 32px;
  line-height: 1.2;
}
#view-community .hangout-layout > .lounge-discovery-corner > .tool-grid > .tool-card h3 {
  margin: 10px 0 4px;
  font-size: 19px;
}
#view-community .hangout-layout > .shared-spaces-intro .shared-spaces-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
@media (max-width: 560px) {
  #view-community .hangout-layout > .shared-spaces-intro .shared-spaces-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}


/* Shared Spaces cards are direct, accessible shortcuts to their own destinations. */
#view-community .shared-space-card {
  appearance: none;
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
#view-community .shared-space-card:hover {
  border-color: var(--accent);
  background: var(--panel2);
  transform: translateY(-2px);
}
#view-community .shared-space-card:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
#view-community .shared-space-card .shared-space-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: .02em;
}
#view-community .shared-space-card .shared-space-action span {
  font-size: 17px;
}

/* HOMEPAGE PLAYER IDENTITY CARD */
#home .profile-hero{display:grid;gap:19px;padding:clamp(18px,3.2vw,30px);border:1px solid var(--line);border-radius:22px;background:var(--panel);color:var(--text);overflow:hidden}
#home .profile-hero-top{display:flex;align-items:center;gap:19px;min-width:0}
#home .profile-hero-avatar-wrap{position:relative;flex:0 0 88px;width:88px;height:88px}
#home .profile-hero-avatar{display:grid;place-items:center;width:100%;height:100%;overflow:hidden;border:1px solid var(--line);border-radius:25px;background:var(--panel2);font-size:43px}
#home .profile-hero-avatar .profile-photo-image{width:100%;height:100%;object-fit:cover}
#home .profile-hero-avatar[data-frame]:not([data-frame=""]){outline:3px solid var(--accent);outline-offset:3px}
#home .profile-online-mark{position:absolute;right:-3px;bottom:-3px;width:17px;height:17px;border:3px solid var(--panel);border-radius:50%;background:#6dbb88}
#home .profile-hero-identity{min-width:0;flex:1}
#home .profile-hero-identity .eyebrow{margin:0 0 5px;color:var(--muted);font-size:9px;letter-spacing:.16em}
#home .profile-hero-identity h1{margin:0;color:var(--text);font-size:clamp(25px,4vw,36px);line-height:1.12;overflow-wrap:anywhere}
#home .profile-hero-greeting{margin:6px 0 0;color:var(--muted);font-size:12px;line-height:1.55}
#home .profile-hero-equipped{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
#home .profile-hero-chip{display:inline-flex;align-items:center;min-height:25px;padding:4px 9px;border:1px solid var(--line);border-radius:999px;background:var(--panel2);color:var(--text);font-size:10px;font-weight:700}
#home .profile-hero-chip-empty{color:var(--muted);font-weight:500}
#home .profile-hero-bio{padding:13px 15px;border-left:3px solid var(--accent);border-radius:0 12px 12px 0;background:var(--panel2)}
#home .profile-hero-bio-label{color:var(--muted);font-size:9px;font-weight:900;letter-spacing:.14em}
#home .profile-hero-bio p{margin:6px 0 0;color:var(--text);font-size:13px;line-height:1.7;overflow-wrap:anywhere}
#home .profile-hero-bottom{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
#home .profile-hero-stats{display:flex;flex-wrap:wrap;gap:clamp(17px,4vw,34px)}
#home .profile-hero-stats span{display:grid;gap:2px}
#home .profile-hero-stats b{color:var(--text);font-size:19px;font-variant-numeric:tabular-nums}
#home .profile-hero-stats small{color:var(--muted);font-size:9px;letter-spacing:.1em}
#home .profile-edit-btn{min-height:40px;padding:9px 13px;font-size:11px}
#profileDialog #profileBio{display:block;width:100%;min-height:82px;margin:7px 0 4px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:var(--panel2);color:var(--text);font:inherit;font-size:13px;line-height:1.6;resize:vertical}
@media(max-width:520px){#home .profile-hero{gap:15px;padding:17px;border-radius:17px}#home .profile-hero-top{align-items:flex-start;gap:13px}#home .profile-hero-avatar-wrap{flex-basis:68px;width:68px;height:68px}#home .profile-hero-avatar{border-radius:19px;font-size:34px}#home .profile-hero-bottom{align-items:flex-start}#home .profile-edit-btn{width:100%}}


/* FIRST-LOGIN WELCOME — THE TAMBAYANVERSE */
#welcomeUniverse[hidden]{display:none!important}
.welcome-universe{
  position:fixed;inset:0;z-index:99990;display:grid;grid-template-columns:minmax(180px,.82fr) minmax(0,1.18fr);
  align-items:center;gap:clamp(18px,4vw,58px);padding:clamp(22px,5vw,64px);
  overflow-y:auto;color:#fbf4e9;
  background:radial-gradient(ellipse at 18% 45%,rgba(116,73,151,.34),transparent 42%),radial-gradient(ellipse at 82% 12%,rgba(193,131,165,.15),transparent 38%),linear-gradient(135deg,#171020,#24172f 56%,#11101d);
  opacity:1;transition:opacity .55s ease,transform .55s ease;
}
html.welcome-open,html.welcome-open body{overflow:hidden}
.welcome-universe.is-entering{opacity:0;transform:scale(1.035);pointer-events:none}
.welcome-universe-sky{position:relative;display:grid;place-items:center;min-height:340px;isolation:isolate}
.welcome-universe-sky:before{content:"";position:absolute;width:min(74vw,340px);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle,rgba(191,145,224,.23),rgba(130,84,168,.08) 48%,transparent 70%);filter:blur(5px);animation:welcomeGlow 4s ease-in-out infinite alternate}
.welcome-portal{position:relative;z-index:2;width:clamp(130px,22vw,205px);aspect-ratio:1;display:grid;place-items:center;border:1px solid rgba(239,211,255,.75);border-radius:50%;background:radial-gradient(circle at 40% 35%,#76538e,#342344 62%,#1b1428);box-shadow:0 0 0 14px rgba(204,165,226,.07),0 0 0 34px rgba(204,165,226,.045),0 0 70px rgba(177,124,221,.45),inset 0 0 34px rgba(255,255,255,.16);animation:welcomePortal 5s ease-in-out infinite}
.welcome-portal-emblem{position:relative;display:grid;place-items:center;width:clamp(76px,12vw,104px);height:clamp(76px,12vw,104px);border:1px solid rgba(255,231,197,.78);border-radius:29% 29% 42% 42%;background:linear-gradient(145deg,rgba(255,240,218,.18),rgba(255,255,255,.035));box-shadow:inset 0 0 0 5px rgba(255,231,197,.07),0 0 28px rgba(239,204,255,.18);transform:rotate(45deg)}
.welcome-portal-emblem:before,.welcome-portal-emblem:after{content:"";position:absolute;inset:9px;border:1px solid rgba(255,231,197,.28);border-radius:25% 25% 38% 25%}
.welcome-portal-emblem:after{inset:-7px;border-color:rgba(239,211,255,.22);border-radius:50%}
.welcome-portal-emblem i{position:absolute;top:9px;right:11px;color:#f7dfad;font-size:14px;font-style:normal;transform:rotate(-45deg);text-shadow:0 0 12px rgba(255,224,169,.9)}
.welcome-portal-emblem b{color:#fff1dc;font:600 clamp(29px,5vw,42px)/1 Georgia,serif;letter-spacing:-.12em;text-shadow:0 2px 15px rgba(255,225,255,.55);transform:rotate(-45deg) translateX(-2px)}
.welcome-portal small{position:absolute;bottom:17%;padding:4px 9px;border:1px solid rgba(241,223,247,.28);border-radius:20px;background:rgba(28,19,41,.62);color:#f1dff7;font-size:7px;font-weight:800;letter-spacing:.22em;white-space:nowrap}

.welcome-orbit{position:absolute;border:1px solid rgba(229,197,244,.22);border-radius:50%;pointer-events:none}
.welcome-orbit-a{width:min(88vw,390px);aspect-ratio:1;transform:rotate(-24deg) scaleY(.48)}
.welcome-orbit-b{width:min(78vw,330px);aspect-ratio:1;transform:rotate(48deg) scaleY(.48)}
.welcome-star{position:absolute;color:#f2d9ff;text-shadow:0 0 13px #d3a8f4;animation:welcomeTwinkle 2.4s ease-in-out infinite alternate}
.welcome-star-a{top:15%;left:18%;font-size:23px}.welcome-star-b{top:22%;right:14%;font-size:18px;animation-delay:.7s}.welcome-star-c{bottom:18%;left:14%;font-size:17px;animation-delay:1.1s}.welcome-star-d{bottom:14%;right:20%;font-size:24px;animation-delay:.4s}
.welcome-universe-content{width:min(100%,680px);margin:auto}
.welcome-universe-content>.eyebrow{color:#e5c18f;font-weight:800;letter-spacing:.2em}
.welcome-universe-content h1{margin:12px 0 14px;font:500 clamp(34px,5vw,58px)/1.04 Georgia,serif;letter-spacing:-.045em}
.welcome-universe-content h1 em{display:block;color:#e8c58f;font-weight:400}
.welcome-universe-lead{max-width:590px;color:rgba(251,244,233,.78);font-size:14px;line-height:1.8}
.welcome-worlds{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:22px 0 14px}
.welcome-worlds article{display:flex;align-items:flex-start;gap:11px;min-width:0;padding:12px 13px;border:1px solid rgba(255,255,255,.12);border-radius:13px;background:rgba(255,255,255,.045)}
.welcome-worlds article>span{font-size:22px;line-height:1.2}
.welcome-worlds strong,.welcome-worlds small{display:block}
.welcome-worlds strong{font-size:12px;color:#fff1df}
.welcome-worlds small{margin-top:4px;color:rgba(251,244,233,.66);font-size:11px;line-height:1.5}
.welcome-universe-note{margin:14px 0;color:rgba(251,244,233,.66);font-size:12px;line-height:1.6}
.welcome-enter-button{display:flex;align-items:center;justify-content:space-between;gap:18px;width:100%;max-width:330px;margin:18px 0 12px;padding:15px 19px;border:1px solid #e8c58f;border-radius:5px 16px 5px 16px;background:#e8c58f;color:#24172e;font-weight:800;box-shadow:0 8px 28px rgba(0,0,0,.2);transition:transform .2s ease,box-shadow .2s ease}
.welcome-enter-button:hover{transform:translateY(-3px);box-shadow:0 12px 34px rgba(232,197,143,.22)}
.welcome-enter-button span:first-child{font-size:18px}
.welcome-universe-signoff{color:rgba(251,244,233,.45);font-size:9px;letter-spacing:.2em}
@keyframes welcomeGlow{from{transform:scale(.9);opacity:.55}to{transform:scale(1.08);opacity:1}}
@keyframes welcomePortal{0%,100%{transform:scale(.97) rotate(-3deg)}50%{transform:scale(1.035) rotate(3deg)}}
@keyframes welcomeTwinkle{from{opacity:.35;transform:scale(.8)}to{opacity:1;transform:scale(1.18)}}
@media(max-width:760px){
  .welcome-universe{grid-template-columns:1fr;align-content:start;gap:2px;padding:18px 20px 28px}
  .welcome-universe-sky{min-height:190px;margin:-4px auto 0;width:100%;max-width:330px}
  .welcome-universe-sky:before{width:220px}
  .welcome-portal{width:112px;box-shadow:0 0 0 9px rgba(204,165,226,.07),0 0 0 22px rgba(204,165,226,.045),0 0 48px rgba(177,124,221,.4),inset 0 0 25px rgba(255,255,255,.16)}
  .welcome-portal span{font-size:43px}
  .welcome-orbit-a{width:250px}.welcome-orbit-b{width:215px}
  .welcome-universe-content>.eyebrow{font-size:9px;margin:5px 0}
  .welcome-universe-content h1{font-size:clamp(34px,9vw,46px);margin:9px 0}
  .welcome-universe-lead{font-size:12px;line-height:1.65;margin:8px 0}
  .welcome-worlds{gap:7px;margin:14px 0 8px}
  .welcome-worlds article{padding:10px;gap:8px}
  .welcome-worlds article>span{font-size:19px}
  .welcome-worlds strong{font-size:11px}
  .welcome-worlds small{font-size:10px}
  .welcome-universe-note{font-size:11px;margin:9px 0}
  .welcome-enter-button{max-width:none;margin:12px 0 9px;padding:14px 17px}
  .welcome-universe-signoff{font-size:8px}
}
@media(max-width:360px){.welcome-universe{padding:14px 15px 22px}.welcome-worlds{grid-template-columns:1fr}.welcome-universe-sky{min-height:160px}}
@media(prefers-reduced-motion:reduce){
  .welcome-universe,.welcome-portal,.welcome-universe-sky:before,.welcome-star{animation:none!important;transition:none!important}
}


/* TYPOGRAPHY RESTORE — welcome screen and Chaos Arcade */
#home .hero .eyebrow {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .24em !important;
  text-transform: uppercase !important;
}
#home .hero h1 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(42px, 6vw, 72px) !important;
  font-weight: 700 !important;
  line-height: 1.04 !important;
  letter-spacing: -.045em !important;
  text-shadow: 0 5px 24px rgba(8,4,18,.32) !important;
}
#home .hero h1 em {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-style: italic !important;
  font-weight: 600 !important;
  letter-spacing: -.035em !important;
  text-shadow: 0 0 22px rgba(255,218,151,.24) !important;
}
#home .hero-text {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1.85 !important;
  letter-spacing: .01em !important;
}
#home #games .eyebrow {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .25em !important;
  text-transform: uppercase !important;
  text-shadow: 0 0 14px rgba(255,88,217,.42) !important;
}
#home #games h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(36px, 5.2vw, 52px) !important;
  font-weight: 700 !important;
  font-style: italic !important;
  line-height: 1.08 !important;
  letter-spacing: -.035em !important;
  text-shadow: 0 0 10px rgba(255,65,213,.28), 0 3px 18px rgba(0,0,0,.35) !important;
}
#home #games .section-note {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: .08em !important;
}
#home #games + .content-panel::before {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: .18em !important;
}
#home #games + .content-panel .game-card h3 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -.015em !important;
  line-height: 1.22 !important;
  text-shadow: 0 0 13px rgba(255,88,217,.14) !important;
}
#home #games + .content-panel .game-card p {
  font-family: 'DM Sans', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.7 !important;
}
#home #games + .content-panel .game-card button,
#home #games + .content-panel .game-card label,
#home #games + .content-panel .game-card input {
  font-family: 'DM Sans', sans-serif !important;
  font-weight: 700 !important;
}
@media(max-width:560px) {
  #home .hero h1 { font-size: clamp(39px, 11vw, 52px) !important; }
  #home .hero-text { font-size: 14px !important; line-height: 1.8 !important; }
  #home #games h2 { font-size: clamp(34px, 10vw, 43px) !important; }
  #home #games + .content-panel .game-card h3 { font-size: 21px !important; }
}


/* iPhone-sized screens: give the profile header and status cards room */
@media (max-width: 520px) {
  #home {
    width: 100%;
    min-width: 0;
    padding-left: 14px;
    padding-right: 14px;
    box-sizing: border-box;
  }
  #home .profile-hero {
    gap: 18px;
    padding: 18px 16px;
    overflow: visible;
  }
  #home .profile-hero-top {
    align-items: flex-start;
    gap: 12px;
  }
  #home .profile-hero-avatar-wrap {
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
  }
  #home .profile-hero-identity {
    min-width: 0;
    flex: 1 1 0;
  }
  #home .profile-hero-identity h1 {
    font-size: clamp(24px, 7vw, 30px);
    line-height: 1.15;
  }
  #home .profile-hero-greeting {
    font-size: 12px;
    line-height: 1.55;
  }
  #home .profile-hero-equipped {
    gap: 7px;
  }
  #home .profile-hero-chip {
    min-height: 30px;
    padding: 6px 10px;
  }
  #home .profile-hero-bio {
    padding: 14px;
  }
  #home .profile-hero-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }
  #home .profile-hero-stats {
    justify-content: flex-start;
    gap: 28px;
  }
  #home .profile-edit-btn {
    width: 100%;
    min-height: 48px;
    font-size: 13px;
  }
  #home > .stats-grid {
    gap: 8px;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  #home > .stats-grid .stat {
    min-height: 116px;
    padding: 15px 14px;
    border: 1px solid rgba(233,200,141,.22);
    border-radius: 14px;
  }
  #home > .stats-grid .stat > strong {
    font-size: 25px;
    letter-spacing: .04em;
  }
  #home > .stats-grid .stat:nth-child(2) > strong {
    font-size: 23px;
  }
}


/* My Space — Ocean theme readability for collectibles, exchange, wardrobe and achievements. */
body[data-theme="ocean"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel){
  color:#d9efff!important;
}
body[data-theme="ocean"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(h1,h2,h3,h4,h5,h6){
  color:#a9e1ff!important;
  -webkit-text-fill-color:#a9e1ff!important;
}
body[data-theme="ocean"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(p,span,small,label,li,.muted,.eyebrow,.equipment-help,.shop-season-note,.collection-empty,.shop-empty){
  color:#c5ddec!important;
  -webkit-text-fill-color:#c5ddec!important;
}
body[data-theme="ocean"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(b,strong,.currency,.shop-price,.collection-count,.chip,.equipped-profile-title){
  color:#e2f5ff!important;
  -webkit-text-fill-color:#e2f5ff!important;
}
body[data-theme="ocean"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(button,select,input){
  color:#e8f7ff!important;
}
body[data-theme="ocean"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(.shop-item,.collection-item,.shop-set,.collection-set,.equipment-slot,.theme-choice,.chip){
  color:#e2f5ff!important;
}
body[data-theme="ocean"] #home .collection-panel{
  background:radial-gradient(ellipse at 10% 0%,#b7e8ff22,transparent 45%),linear-gradient(150deg,#15344b,#1c4058 55%,#263d59)!important;
  border-color:#77c9ef55!important;
}
body[data-theme="ocean"] #home .theme-panel,
body[data-theme="ocean"] #home .achievements-panel{
  background:linear-gradient(145deg,#15344b,#1c4058 58%,#20364f)!important;
  border-color:#77c9ef55!important;
}
body[data-theme="ocean"] #home .shop-panel{
  background:radial-gradient(ellipse at 90% 5%,#8bdcff20,transparent 36%),linear-gradient(145deg,#102b43,#17405b 58%,#203b59)!important;
  border-color:#77c9ef55!important;
}
body[data-theme="ocean"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(.shop-item,.collection-item,.shop-set,.collection-set,.theme-choice,.chip){
  background-color:#ffffff10!important;
  border-color:#9bdcff44!important;
}
body[data-theme="ocean"] #home .shop-panel .eyebrow,
body[data-theme="ocean"] #home .collection-panel .eyebrow{
  color:#8edcff!important;
  -webkit-text-fill-color:#8edcff!important;
}


/* My Space theme palettes — Midnight Rose and Violet. Keep the collectible
   exchange surfaces rich and dark, with accents matching each theme. */
body[data-theme="rose"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel){
  color:#ffe8f1!important;
  border-color:#ef9cbd55!important;
}
body[data-theme="rose"] #home .shop-panel{
  background:radial-gradient(ellipse at 90% 5%,#f28bbd22,transparent 38%),linear-gradient(145deg,#32172b,#51233f 58%,#3d1d35)!important;
}
body[data-theme="rose"] #home :is(.collection-panel,.theme-panel,.achievements-panel){
  background:radial-gradient(ellipse at 10% 0%,#f8b8d51b,transparent 45%),linear-gradient(150deg,#351a30,#512542 58%,#40203b)!important;
}
body[data-theme="rose"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(h1,h2,h3,h4,h5,h6){
  color:#ffc5dc!important;-webkit-text-fill-color:#ffc5dc!important;
}
body[data-theme="rose"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(p,span,small,label,li,.muted,.eyebrow,.equipment-help,.shop-season-note,.collection-empty,.shop-empty){
  color:#f0cbdc!important;-webkit-text-fill-color:#f0cbdc!important;
}
body[data-theme="rose"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(b,strong,.currency,.shop-price,.collection-count,.chip,.equipped-profile-title){
  color:#ffe8f1!important;-webkit-text-fill-color:#ffe8f1!important;
}
body[data-theme="rose"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(button,select,input){color:#fff0f6!important}
body[data-theme="rose"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(.shop-item,.collection-item,.shop-set,.collection-set,.equipment-slot,.theme-choice,.chip){
  color:#ffe8f1!important;background-color:#ffffff0d!important;border-color:#f4a9ca55!important;
}
body[data-theme="rose"] #home :is(.shop-panel,.collection-panel) .eyebrow{color:#ff9fc7!important;-webkit-text-fill-color:#ff9fc7!important}

body[data-theme="violet"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel){
  color:#eee5ff!important;border-color:#b99aff55!important;
}
body[data-theme="violet"] #home .shop-panel{
  background:radial-gradient(ellipse at 90% 5%,#b995ff25,transparent 38%),linear-gradient(145deg,#211735,#35234f 58%,#291d43)!important;
}
body[data-theme="violet"] #home :is(.collection-panel,.theme-panel,.achievements-panel){
  background:radial-gradient(ellipse at 10% 0%,#c7aaff1b,transparent 45%),linear-gradient(150deg,#211832,#35234e 58%,#2a1d42)!important;
}
body[data-theme="violet"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(h1,h2,h3,h4,h5,h6){
  color:#d7bdff!important;-webkit-text-fill-color:#d7bdff!important;
}
body[data-theme="violet"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(p,span,small,label,li,.muted,.eyebrow,.equipment-help,.shop-season-note,.collection-empty,.shop-empty){
  color:#d8c9f2!important;-webkit-text-fill-color:#d8c9f2!important;
}
body[data-theme="violet"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(b,strong,.currency,.shop-price,.collection-count,.chip,.equipped-profile-title){
  color:#f0e8ff!important;-webkit-text-fill-color:#f0e8ff!important;
}
body[data-theme="violet"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(button,select,input){color:#f4edff!important}
body[data-theme="violet"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(.shop-item,.collection-item,.shop-set,.collection-set,.equipment-slot,.theme-choice,.chip){
  color:#f0e8ff!important;background-color:#ffffff0d!important;border-color:#c1a5ff55!important;
}
body[data-theme="violet"] #home :is(.shop-panel,.collection-panel) .eyebrow{color:#c5a1ff!important;-webkit-text-fill-color:#c5a1ff!important}


/* My Space — Midnight is a separate theme from Rose. */
body[data-theme="midnight"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel){
  color:#e4edf8!important;border-color:#8ca8ce55!important;
}
body[data-theme="midnight"] #home .shop-panel{
  background:radial-gradient(ellipse at 90% 5%,#8fb7e51b,transparent 38%),linear-gradient(145deg,#101a2a,#1b2a40 58%,#141f31)!important;
}
body[data-theme="midnight"] #home :is(.collection-panel,.theme-panel,.achievements-panel){
  background:radial-gradient(ellipse at 10% 0%,#9ab9df14,transparent 45%),linear-gradient(150deg,#111b2b,#1d2c42 58%,#172338)!important;
}
body[data-theme="midnight"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(h1,h2,h3,h4,h5,h6){
  color:#d7e7ff!important;-webkit-text-fill-color:#d7e7ff!important;
}
body[data-theme="midnight"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(p,span,small,label,li,.muted,.eyebrow,.equipment-help,.shop-season-note,.collection-empty,.shop-empty){
  color:#b9c9dd!important;-webkit-text-fill-color:#b9c9dd!important;
}
body[data-theme="midnight"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(b,strong,.currency,.shop-price,.collection-count,.chip,.equipped-profile-title){
  color:#edf4ff!important;-webkit-text-fill-color:#edf4ff!important;
}
body[data-theme="midnight"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(button,select,input){color:#f0f6ff!important}
body[data-theme="midnight"] #home :is(.shop-panel,.collection-panel,.theme-panel,.achievements-panel) :is(.shop-item,.collection-item,.shop-set,.collection-set,.equipment-slot,.theme-choice,.chip){
  color:#eaf2ff!important;background-color:#ffffff08!important;border-color:#9bb8df44!important;
}
body[data-theme="midnight"] #home :is(.shop-panel,.collection-panel) .eyebrow{color:#9fc5f4!important;-webkit-text-fill-color:#9fc5f4!important}


/* EXPANDED WELCOME — purpose, world guide, and discovery preview */
.welcome-purpose,.welcome-discover,.welcome-howto{margin:18px 0;padding:17px 18px;border:1px solid rgba(232,197,143,.2);border-radius:15px;background:linear-gradient(135deg,rgba(255,255,255,.065),rgba(255,255,255,.025))}
.welcome-section-kicker{margin:0 0 7px;color:#e8c58f;font-size:9px;font-weight:900;letter-spacing:.19em}
.welcome-purpose h2,.welcome-discover h2,.welcome-howto h2{margin:0 0 9px;color:#fff1df;font:500 clamp(20px,2.5vw,25px)/1.15 Georgia,serif;letter-spacing:-.025em}
.welcome-purpose>p:not(.welcome-section-kicker){margin:8px 0;color:rgba(251,244,233,.76);font-size:12px;line-height:1.75}
.welcome-purpose .welcome-purpose-emphasis{padding:10px 12px;border-left:2px solid #e8c58f;background:rgba(232,197,143,.07);color:#f4dfbf!important}
.welcome-worlds{margin:15px 0}
.welcome-worlds article{min-height:66px;background:rgba(255,255,255,.055);border-color:rgba(232,197,143,.14)}
.welcome-worlds strong{font-size:12px}
.welcome-worlds small{font-size:10.5px;line-height:1.55}
.welcome-discover{margin-top:17px}
.welcome-discover-heading>p:last-child{margin:0 0 13px;color:rgba(251,244,233,.65);font-size:11px;line-height:1.6}
.welcome-discover-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.welcome-discover-grid article{display:flex;gap:10px;align-items:flex-start;padding:11px;border:1px solid rgba(255,255,255,.1);border-radius:12px;background:rgba(15,10,25,.25)}
.welcome-discover-grid article>span{font-size:20px;line-height:1.2}
.welcome-discover-grid strong,.welcome-discover-grid small{display:block}
.welcome-discover-grid strong{color:#fff0dc;font-size:11px}
.welcome-discover-grid small{margin-top:4px;color:rgba(251,244,233,.64);font-size:10px;line-height:1.5}
.welcome-howto{margin-bottom:14px}
.welcome-howto ol{display:grid;gap:9px;margin:12px 0 0;padding:0;list-style:none;counter-reset:welcome-step}
.welcome-howto li{display:grid;grid-template-columns:25px 1fr;column-gap:9px;align-items:start;counter-increment:welcome-step}
.welcome-howto li:before{content:counter(welcome-step,decimal-leading-zero);grid-row:span 2;color:#e8c58f;font-size:10px;font-weight:900;letter-spacing:.06em;padding-top:2px}
.welcome-howto li b{color:#fff0dc;font-size:11px}
.welcome-howto li span{color:rgba(251,244,233,.63);font-size:10px;line-height:1.5}
.welcome-universe-note{padding:0 2px}
@media(max-width:760px){
 .welcome-purpose,.welcome-discover,.welcome-howto{margin:12px 0;padding:13px}
 .welcome-purpose h2,.welcome-discover h2,.welcome-howto h2{font-size:21px}
 .welcome-purpose>p:not(.welcome-section-kicker){font-size:11px;line-height:1.65}
 .welcome-worlds{grid-template-columns:1fr 1fr;margin:12px 0}
 .welcome-worlds article{min-height:72px;padding:9px}
 .welcome-worlds small{font-size:9.5px}
 .welcome-discover-grid{gap:7px}
 .welcome-discover-grid article{padding:9px;gap:7px}
 .welcome-discover-grid article>span{font-size:18px}
 .welcome-discover-grid strong{font-size:10px}
 .welcome-discover-grid small{font-size:9px}
}
@media(max-width:360px){
 .welcome-worlds,.welcome-discover-grid{grid-template-columns:1fr}
 .welcome-worlds article{min-height:0}
}


/* Keep the private Inbox launcher off the first-visit welcome screen. */
html.welcome-open #btDmLauncher{display:none!important}


/* Critical: preserve the native hidden state for the full-screen welcome layer. */
.welcome-universe[hidden]{display:none!important}


/* WELCOME SCREEN — stronger, consistent text contrast on the dark portal backdrop. */
.welcome-universe,
.welcome-universe .welcome-universe-content {
  color: #fff8ef !important;
}
.welcome-universe .welcome-universe-content > .eyebrow,
.welcome-universe .welcome-section-kicker {
  color: #f2d39e !important;
}
.welcome-universe .welcome-universe-content h1,
.welcome-universe .welcome-purpose h2,
.welcome-universe .welcome-discover h2,
.welcome-universe .welcome-howto h2,
.welcome-universe .welcome-worlds strong,
.welcome-universe .welcome-discover-grid strong,
.welcome-universe .welcome-howto li b {
  color: #fff8ef !important;
}
.welcome-universe .welcome-universe-lead,
.welcome-universe .welcome-purpose > p:not(.welcome-section-kicker),
.welcome-universe .welcome-discover-heading > p:last-child,
.welcome-universe .welcome-worlds small,
.welcome-universe .welcome-discover-grid small,
.welcome-universe .welcome-howto li span,
.welcome-universe .welcome-universe-note {
  color: #eee5f6 !important;
}
.welcome-universe .welcome-universe-signoff {
  color: #d9cbe8 !important;
}
