:root {
  --scene-width: 5200px;
  --street-h: 120px;
  --ui-bg: #0f1220;
  --ui-fg: #e7ecff;
  --accent: #7aa2ff;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
  background: #0b0e1a;
  color: #fff;
  font-family: system-ui, Segoe UI, Roboto, Arial, sans-serif;
}

.wrap {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.topbar {
  padding: 10px 14px;
  background: linear-gradient(180deg, #0f1220, #0c1020);
  border-bottom: 1px solid #1c223c;
}
.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #cfd7ff;
}
.topbar h1 span {
  opacity: 0.7;
  font-weight: 400;
}

.viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: linear-gradient(
    #89b6ff 0,
    #6aa0ff 20%,
    #4d7fff 45%,
    #2a3e78 100%
  );
}

/* Parallax rétegek */
.layer {
  position: absolute;
  inset: 0;
  will-change: transform;
  transition: opacity 0.35s ease;
}
.layer .strip {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: var(--scene-width);
}
.clouds1 {
  opacity: 0.95;
  z-index: 1;
}
.clouds1 .strip {
  background: url('data:image/svg+xml;utf8,\
  <svg xmlns="http://www.w3.org/2000/svg" width="1200" height="260" viewBox="0 0 1200 260">\
    <defs><filter id="b" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur stdDeviation="2"/></filter></defs>\
    <g fill="white" filter="url(%23b)" opacity="0.95">\
      <path d="M120 140c-25 0-45-17-45-38 0-18 13-33 30-37 8-28 34-48 65-48 31 0 57 20 65 48 4-1 9-2 13-2 26 0 46 19 46 42s-21 42-46 42H120z"/>\
      <path d="M540 170c-28 0-50-19-50-42 0-17 10-32 25-39 7-26 33-45 64-45 31 0 57 19 64 45 4-1 8-1 12-1 26 0 47 18 47 40s-21 42-47 42H540z"/>\
      <path d="M940 150c-24 0-44-16-44-36 0-16 11-30 26-35 7-23 31-40 60-40 29 0 53 17 60 40 3-1 7-1 10-1 24 0 44 16 44 36s-20 36-44 36H940z"/>\
    </g>\
  </svg>')
    repeat-x;
  background-size: 1200px 260px;
  background-position: 0 30px;
}
.clouds2 {
  opacity: 0.7;
  z-index: 2;
}
.clouds2 .strip {
  background: url('data:image/svg+xml;utf8,\
  <svg xmlns="http://www.w3.org/2000/svg" width="900" height="200" viewBox="0 0 900 200">\
    <g fill="white" opacity="0.85">\
      <ellipse cx="100" cy="110" rx="70" ry="30"/>\
      <ellipse cx="180" cy="100" rx="50" ry="25"/>\
      <ellipse cx="250" cy="115" rx="60" ry="28"/>\
      <ellipse cx="480" cy="90" rx="80" ry="32"/>\
      <ellipse cx="560" cy="95" rx="55" ry="22"/>\
      <ellipse cx="760" cy="120" rx="70" ry="28"/>\
    </g>\
  </svg>')
    repeat-x;
  background-size: 900px 200px;
  background-position: 0 60px;
}

/* Várossziluettek */
.city-far {
  z-index: 3;
}
.city-far .strip {
  background: url('data:image/svg+xml;utf8,\
  <svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400">\
    <rect width="800" height="400" fill="%231b2450"/>\
    <g fill="%23202b5e">\
      <rect x="20" y="220" width="60" height="160"/>\
      <rect x="110" y="180" width="80" height="200"/>\
      <rect x="220" y="210" width="70" height="170"/>\
      <rect x="320" y="150" width="120" height="230"/>\
      <rect x="480" y="200" width="90" height="180"/>\
      <rect x="600" y="170" width="100" height="210"/>\
    </g>\
  </svg>')
    repeat-x;
  background-size: 800px 400px;
  background-position: 0 170px;
  opacity: 0.9;
}
.city-mid {
  z-index: 4;
}
.city-mid .strip {
  background: url('data:image/svg+xml;utf8,\
  <svg xmlns="http://www.w3.org/2000/svg" width="800" height="400" viewBox="0 0 800 400">\
    <rect width="800" height="400" fill="%23203064"/>\
    <g fill="%232a3a7d">\
      <rect x="0" y="200" width="120" height="200"/>\
      <rect x="150" y="160" width="140" height="240"/>\
      <rect x="330" y="210" width="120" height="190"/>\
      <rect x="500" y="170" width="160" height="230"/>\
      <rect x="690" y="220" width="110" height="180"/>\
    </g>\
  </svg>')
    repeat-x;
  background-size: 800px 400px;
  background-position: 0 210px;
}

/* Járda */
.street {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--street-h);
  background: linear-gradient(
    #2c2f47 0,
    #26293f 60%,
    #1a1d2f 60%,
    #141729 100%
  );
  border-top: 2px solid #31365c;
  z-index: 6;
  transition: opacity 0.35s ease;
}

/* Házsor */
.houses {
  position: absolute;
  left: 0;
  width: var(--scene-width);
  height: 300px;
  bottom: calc(var(--street-h));
  z-index: 7;
  transition: bottom 0.35s ease, height 0.35s ease, transform 0.05s linear;
}
.house {
  position: absolute;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  cursor: pointer;
}
.house.hasImg {
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
}
.house.locked {
  filter: grayscale(0.75) contrast(1.05);
}

/* --- Tervrajz nézet mód --- */
body.mode-blueprints .clouds1,
body.mode-blueprints .clouds2,
body.mode-blueprints .city-far,
body.mode-blueprints .city-mid,
body.mode-blueprints .street {
  opacity: 0;
  pointer-events: none;
}

body.mode-blueprints .houses {
  bottom: 50%;
  height: 50%;
}

/* Tervrajz panel (alsó 50%) */
.bp-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    180deg,
    rgba(12, 15, 30, 0.95),
    rgba(10, 12, 24, 0.97)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  z-index: 8;
  overflow: hidden;
  transition: height 0.35s ease, opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
}
body.mode-blueprints .bp-panel {
  height: 50%;
  opacity: 1;
  pointer-events: auto;
}

.bp-row {
  display: flex;
  gap: 16px;
  align-items: center;
  overflow-x: auto;
  padding: 16px 18px;
}
.bp-card {
  flex: 0 0 auto;
  width: 440px;
  height: 340px;
  border-radius: 14px;
  background: #0d2a63;
  border: 1px solid #214a9a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  cursor: grab;
  user-select: none;
}
.bp-card:active {
  cursor: grabbing;
}
.bp-card .thumb {
  position: absolute;
  inset: 8px;
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

/* UI */
.ui {
  padding: 10px 14px;
  background: var(--ui-bg);
  border-top: 1px solid #1c223c;
}
.ui .row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.ui input[type="range"] {
  flex: 1;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #20264a;
  outline: none;
}
.ui input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
}
.sep {
  opacity: 0.5;
}

/* ===== Interior overlay ===== */
.interior{
  position:fixed; inset:0; z-index:999;
  display:none;                      /* alapból rejtve */
  background:linear-gradient(180deg, #0b0e1a, #0a0d18);
}
.interior.visible{                   /* megjelenítés */
  display:block;
  animation:fadeIn .2s ease-out;
}
@keyframes fadeIn{from{opacity:0} to{opacity:1}}

.interior .topbar{
  position:absolute; left:0; right:0; top:0; height:56px;
  display:flex; align-items:center; gap:12px; padding:0 16px;
  background:linear-gradient(180deg, rgba(10,14,26,.9), rgba(10,14,26,.6));
  border-bottom:1px solid rgba(255,255,255,.08);
  backdrop-filter:blur(6px);
}
.interior .btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:10px;
  border:1px solid rgba(255,255,255,.15);
  background:rgba(255,255,255,.06); color:#e7ecff; cursor:pointer;
}
.interior .btn:hover{ background:rgba(255,255,255,.1); }
.interior .title{ font-weight:600; opacity:.9 }

.interior .room{
  position:absolute; inset:72px 20px 20px 20px;
  border-radius:16px;
  background:#0f1322;
  box-shadow:0 20px 40px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.05);
  overflow:hidden;
}
.interior .room .bg{
  position:absolute; inset:0;
  background-position:center bottom;
  background-repeat:no-repeat;
  background-size:contain;           /* kép szépen beférjen */
  filter:drop-shadow(0 16px 36px rgba(0,0,0,.35));
}

