/* www.biddyboo.co.uk — Saturday-Morning Cartoon Cat House Styles */

:root {
  --ink: #2b1e15;
  --cream: #fff9ec;
  --cream-warm: #f5e6c8;
  --gold: #ffcf48;
  --coral: #e55b3c;
  --sky: #d6ecff;
  --backdrop: #1e1611;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #34261d 0%, var(--backdrop) 78%);
  font-family: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

.app-shell {
  width: 100vw;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 10px 14px 12px;
  gap: 8px;
}

/* ==================== TOP COMIC HUD ==================== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 20;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  border: 2.8px solid var(--ink);
  border-radius: 999px;
  padding: 5px 16px 5px 12px;
  box-shadow: 0 3px 0 var(--ink);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.3px;
  color: var(--ink);
}

.brand-pill .paw {
  font-size: 18px;
  line-height: 1;
}

.hud-cats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  border: 2.4px solid var(--ink);
  border-radius: 999px;
  padding: 4px 13px 4px 10px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  color: var(--ink);
  font-family: inherit;
  font-size: 12.5px;
  transition: transform 0.08s ease, background 0.15s ease;
}

.cat-pill:hover {
  background: #ffe89e;
  transform: translateY(-1px);
}

.cat-pill:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.cat-pill-name {
  font-weight: 900;
}

.cat-pill-status {
  color: #654b38;
  font-weight: 700;
  max-width: 175px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==================== MAIN HOUSE STAGE ==================== */
.stage-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.house-stage {
  position: relative;
  width: 1376px;
  height: 768px;
  flex-shrink: 0;
  transform-origin: center center;
  border-radius: 16px;
  border: 4px solid var(--ink);
  box-shadow: 0 14px 48px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(255, 236, 198, 0.25);
  overflow: hidden;
  background: #2b1e15;
  cursor: pointer;
}

.house-bg-img {
  position: absolute;
  inset: 0;
  width: 1376px;
  height: 768px;
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* Layer stacking */
.layer-ambient,
.layer-props,
.layer-toys,
.layer-cats,
.layer-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.layer-ambient { z-index: 5; }
.layer-props { z-index: 10; }
.layer-toys { z-index: 12; }
.layer-cats { z-index: 15; }
.layer-particles { z-index: 950; }

/* ==================== LIVING AMBIENT OVERLAYS ==================== */

/* Breathing neon glow over KITCHEN DISCO sign */
.kitchen-disco-glow {
  position: absolute;
  left: 162px;
  top: 148px;
  width: 96px;
  height: 74px;
  border-radius: 14px;
  background: radial-gradient(ellipse at center, rgba(255, 110, 215, 0.36) 0%, rgba(255, 110, 215, 0) 72%);
  mix-blend-mode: screen;
  animation: discoPulse 3.6s ease-in-out infinite;
}

@keyframes discoPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.92; transform: scale(1.06); }
}

/* Clickable animated TV screen under the stairs */
.tv-screen-overlay {
  position: absolute;
  left: 761px;
  top: 344px;
  width: 60px;
  height: 58px;
  transform: skewY(9deg);
  border-radius: 3px;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(100, 195, 255, 0.52), rgba(165, 115, 255, 0.42), rgba(85, 230, 190, 0.45));
  background-size: 240% 240%;
  animation: tvGlow 6s ease-in-out infinite;
  box-shadow: 0 0 18px rgba(120, 200, 255, 0.32);
  transition: opacity 0.25s ease;
}

.tv-screen-overlay.tv-off {
  opacity: 0.05;
  animation: none;
  box-shadow: none;
}

.tv-bars {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.09) 0px,
    rgba(255, 255, 255, 0.09) 2px,
    transparent 2px,
    transparent 5px
  );
}

@keyframes tvGlow {
  0% { background-position: 0% 50%; opacity: 0.52; }
  50% { background-position: 100% 50%; opacity: 0.72; }
  100% { background-position: 0% 50%; opacity: 0.52; }
}

/* PC Monitor cat-typing text overlay */
.pc-monitor-overlay {
  position: absolute;
  left: 1258px;
  top: 432px;
  width: 84px;
  height: 76px;
  transform: skewY(12deg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: rgba(16, 46, 74, 0.78);
  border-radius: 3px;
}

.pc-monitor-overlay.active {
  opacity: 1;
}

.pc-screen-text {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 9px;
  font-weight: 700;
  color: #9ff7c4;
  text-align: center;
  word-break: break-word;
  line-height: 1.25;
}

/* Clickable warm sideboard lamp glow */
.lamp-glow-overlay {
  position: absolute;
  left: 1072px;
  top: 344px;
  width: 72px;
  height: 74px;
  border-radius: 50%;
  pointer-events: auto;
  cursor: pointer;
  background: radial-gradient(circle, rgba(255, 224, 102, 0.44) 0%, rgba(255, 210, 90, 0) 70%);
  mix-blend-mode: screen;
  transition: opacity 0.25s ease;
}

.lamp-glow-overlay.lamp-off {
  opacity: 0;
}

/* Swinging cat flap shadow overlay */
.cat-flap-overlay {
  position: absolute;
  left: 66px;
  top: 560px;
  width: 24px;
  height: 46px;
  transform-origin: top center;
  border-radius: 3px;
  background: rgba(43, 30, 21, 0.12);
}

/* ==================== CATS, PROPS & PARTICLES ==================== */
.cat-actor {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  transition: opacity 0.22s ease;
}

.cat-actor:hover {
  filter: drop-shadow(0 0 6px rgba(255, 232, 130, 0.7));
}

.cat-svg-wrap {
  width: 100%;
  height: 100%;
}

.cat-pulse {
  animation: catPop 0.36s ease;
}

@keyframes catPop {
  0% { filter: drop-shadow(0 0 0 rgba(255, 224, 90, 0)); }
  45% { filter: drop-shadow(0 0 14px rgba(255, 224, 90, 1)); }
  100% { filter: drop-shadow(0 0 0 rgba(255, 224, 90, 0)); }
}

.knock-prop {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
}

.knock-prop.is-fallen:hover {
  filter: drop-shadow(0 0 6px rgba(154, 240, 165, 0.95));
}

.floor-toy {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.particle {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.particle-dust {
  background: rgba(255, 246, 224, 0.85);
  border: 1.5px solid rgba(43, 30, 21, 0.35);
}

.particle-sand {
  background: #e5cb94;
  border: 1.5px solid #7d6237;
}

.particle-drop {
  background: #8fd8ff;
  border: 1.4px solid #2b678a;
}

.comic-burst {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 2px 9px;
  border: 2.2px solid var(--ink);
  border-radius: 999px;
  font-family: 'Comic Sans MS', 'Trebuchet MS', sans-serif;
  font-weight: 900;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--ink);
}

/* ==================== BOTTOM ACTION TRAY ==================== */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 20;
}

.hint-text {
  color: #e6d5bc;
  font-size: 12.5px;
  font-weight: 600;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--cream);
  color: var(--ink);
  border: 2.4px solid var(--ink);
  border-radius: 11px;
  padding: 6px 13px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.08s ease, background 0.14s ease;
}

.btn:hover:not(:disabled) {
  background: #ffe799;
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn.active {
  background: var(--gold);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.tidy-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--coral);
  color: #ffffff;
  border: 1.8px solid var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.tidy-badge.visible {
  display: inline-flex;
}

@media (max-width: 900px) {
  .app-shell { padding: 6px 8px 8px; gap: 6px; }
  .cat-pill-status { display: none; }
  .hint-text { display: none; }
  .brand-pill { font-size: 14px; padding: 4px 12px; }
  .btn { font-size: 12px; padding: 5px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .kitchen-disco-glow, .tv-screen-overlay { animation: none; }
}
