:root {
  --bg: #0e1014;
  --panel: #171a21;
  --panel-2: #1f232c;
  --line: #2a2f3a;
  --text: #eef1f6;
  --muted: #98a0ae;
  --accent: #ff5a36;
  --accent-2: #36c2ff;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}
#scene.grabbing { cursor: grabbing; }
#scene.pointer { cursor: pointer; }

/* ---- Top bar ---- */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: linear-gradient(to bottom, rgba(14,16,20,.85), rgba(14,16,20,0));
  z-index: 20;
  pointer-events: none;
}
#topbar .brand, #topbar .actions { pointer-events: auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;            /* relaxed space between the logo and the street name */
}
.brand-logo { display: inline-flex; align-items: center; }
.brand-logo img {
  height: 22px; width: auto; display: block;
  filter: invert(1) brightness(1.8);   /* dark logo → light, for the dark topbar */
}
.brand-street {
  font-size: 16px; font-weight: 600; letter-spacing: .2px; color: var(--text);
}

.actions { display: flex; gap: 8px; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { background: #262b35; border-color: #3a414f; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }

/* ---- User area (top-right) ---- */
.user-area { position: relative; display: inline-flex; align-items: center; margin-left: 6px; pointer-events: auto; }
.user-area .avatar-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer; padding: 0; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); font-weight: 700; font-size: 13px;
}
.user-area .avatar-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-area .avatar-btn:hover { border-color: #3a414f; }
.user-area .dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(0,0,0,.55);
  display: none;
  z-index: 50;
}
.user-area.open .dropdown { display: block; }
.user-area .dropdown .user-info {
  padding: 12px 16px;
  font-size: 12.5px; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.user-area .dropdown .user-info strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.user-area .dropdown a, .user-area .dropdown button {
  display: block; width: 100%;
  padding: 11px 16px;
  color: var(--text); background: transparent; border: 0;
  text-align: left; font-size: 14px; cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}
.user-area .dropdown a:hover, .user-area .dropdown button:hover { background: var(--panel-2); }
.user-area .dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 0; }
.user-area .signin-btn {
  appearance: none; border: 1px solid var(--accent); background: var(--accent);
  color: #fff; padding: 9px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.user-area .signin-btn:hover { filter: brightness(1.08); }

/* ---- Artwork details modal (interior eseri tıklamada) ---- */
.ad-fields { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; }
.ad-row { display: flex; flex-direction: column; gap: 2px; }
.ad-lbl { font-size: 11px; color: var(--muted); letter-spacing: .5px; text-transform: uppercase; font-weight: 600; }
.ad-val { font-size: 14px; color: var(--text); }
@media (max-width: 720px) {
  .ad-fields { grid-template-columns: 1fr; gap: 8px; }
}

/* ---- Character creator modal ---- */
#characterModal .modal-inner { max-width: 540px; width: calc(100vw - 40px); }
#characterModal h3 { margin: 0 0 4px; font-size: 18px; }
#characterModal #characterModalBody { margin: 0 0 14px; font-size: 13px; }
.cc-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 18px;
  align-items: start;
}
.cc-preview-box {
  background: linear-gradient(180deg, #1c2230 0%, #0e1014 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 200px;
}
.cc-preview-box canvas {
  image-rendering: pixelated; image-rendering: crisp-edges;
  display: block;
}
.cc-fields-col { display: flex; flex-direction: column; gap: 14px; }
.cc-section h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .8px; }
.cc-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.cc-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--text); cursor: pointer;
}
.cc-row span { color: var(--muted); }
.cc-row input[type=color] {
  width: 30px; height: 24px; border: 1px solid var(--line); border-radius: 5px;
  background: transparent; cursor: pointer; padding: 0;
}
.cc-row input[type=checkbox] {
  width: 16px; height: 16px; accent-color: var(--accent-2);
}
.cc-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.cc-preset {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  padding: 6px 12px; border-radius: 999px;
  font-size: 12.5px; cursor: pointer;
  font-family: inherit;
}
.cc-preset:hover { background: #262b35; border-color: #3a414f; }

/* Halı motifi seçici — thumbnail + ad */
.cc-section h4 .cc-hint { font-size: 11px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 6px; }
.cc-carpets { display: flex; flex-wrap: wrap; gap: 8px; }
.cc-carpet {
  appearance: none;
  border: 2px solid transparent;
  background: var(--panel-2);
  color: var(--text);
  padding: 4px 6px 6px;
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
  font-family: inherit;
}
.cc-carpet canvas {
  display: block;
  border-radius: 4px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.cc-carpet span { font-size: 11px; color: var(--muted); }
.cc-carpet:hover { background: #262b35; }
.cc-carpet.active { border-color: var(--accent-2); }
.cc-carpet.active span { color: var(--text); }

@media (max-width: 520px) {
  .cc-grid { grid-template-columns: 1fr; }
  .cc-preview-box { min-height: 180px; }
}

/* ---- Hint ---- */
.hint {
  position: fixed;
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  background: rgba(23,26,33,.8);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 999px;
  z-index: 15;
  transition: opacity .4s ease;
}

/* ---- Info card ---- */
.card {
  position: fixed;
  top: 50%; right: 22px;
  transform: translateY(-50%);
  width: 340px;
  max-width: calc(100vw - 44px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 30;
  overflow: hidden;
  transition: opacity .2s ease, transform .2s ease;
}
.card.hidden, .modal.hidden, .interior-bar.hidden, .hidden { display: none; }

.card-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 30px; height: 30px;
  border-radius: 8px;
  border: none;
  background: rgba(0,0,0,.35);
  color: #fff;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.card-close:hover { background: rgba(0,0,0,.6); }

.card-media {
  height: 190px;
  background: #0a0c10;
  background-size: cover;
  background-position: center;
}
.card-body { padding: 16px 18px 18px; }
.tag {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--accent-2);
  border: 1px solid rgba(54,194,255,.3);
  padding: 3px 8px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.card-body h2 { margin: 0 0 4px; font-size: 21px; }
.card-body .sub { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.card-body .desc { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: #cfd5df; }
.card-actions { display: flex; flex-direction: column; gap: 8px; }

/* ---- Modal ---- */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,9,12,.6);
  backdrop-filter: blur(4px);
  z-index: 40;
}
.modal-inner {
  width: 420px;
  max-width: calc(100vw - 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 26px 22px;
  text-align: center;
}
.modal-inner.left { text-align: left; }
.modal-inner h3 { margin: 6px 0 6px; font-size: 20px; }
.modal-inner p { margin: 0 0 18px; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.cones { font-size: 46px; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

.help-list { margin: 0 0 18px; padding-left: 18px; line-height: 1.85; color: #cfd5df; font-size: 14px; }
.help-list b { color: var(--text); }

/* ---- Interior bar ---- */
.interior-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: rgba(14,16,20,.92);
  border-bottom: 1px solid var(--line);
  z-index: 25;
}
.interior-bar #interiorName { font-weight: 600; }

/* ---- Now playing (mekan radyosu) ---- */
.now-playing {
  position: fixed;
  left: 18px; bottom: 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: rgba(23,26,33,.85);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  padding: 9px 15px 9px 12px;
  border-radius: 12px;
  z-index: 16;
  transition: opacity .3s ease, transform .3s ease;
}
.now-playing.hidden { opacity: 0; transform: translateY(8px); pointer-events: none; display: flex; }
.np-text { display: flex; flex-direction: column; line-height: 1.25; }
.np-text b { font-size: 13px; }
.np-text small { color: var(--muted); font-size: 11.5px; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 18px; }
.eq i {
  width: 3px; height: 100%;
  background: var(--accent-2);
  border-radius: 2px;
  animation: eq 0.9s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: .15s; }
.eq i:nth-child(3) { animation-delay: .35s; }
.eq i:nth-child(4) { animation-delay: .5s; }
@keyframes eq { 0%,100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* ---- Van Gogh eleştiri boyutu ---- */
.critique {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  animation: fadeIn .35s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.critique-bg {
  position: absolute;
  inset: -4%;
  background-size: cover;
  background-position: center;
  filter: saturate(1.1);
  transform: scale(1.04);
}
.critique-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 100% at 0% 50%, rgba(8,9,12,.92) 35%, rgba(8,9,12,.5) 70%, rgba(8,9,12,.2) 100%),
    linear-gradient(to top, rgba(8,9,12,.85), rgba(8,9,12,.25));
  backdrop-filter: blur(1.5px);
}
.critique-close {
  position: absolute; top: 16px; right: 18px;
  width: 40px; height: 40px; font-size: 24px; z-index: 3;
}
.critique-grid {
  position: relative;
  z-index: 2;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 6vh 5vw;
  box-sizing: border-box;
}
.critique-left { max-width: 620px; }
.critique-left h2 { margin: 8px 0 4px; font-size: clamp(26px, 4vw, 44px); }
.critique-sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.critique-text {
  font-size: clamp(17px, 2.1vw, 24px);
  line-height: 1.6;
  color: #f2f4f8;
  min-height: 4.5em;
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
}
.critique-text .cursor { opacity: .7; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.scores { display: flex; flex-direction: column; gap: 11px; margin-bottom: 18px; }
.score-row { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 12px; }
.score-row .lbl { font-size: 14px; color: #cfd5df; }
.score-bar { height: 9px; background: rgba(255,255,255,.12); border-radius: 999px; overflow: hidden; }
.score-bar i { display: block; height: 100%; border-radius: 999px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.score-row .val { font-size: 14px; font-weight: 700; text-align: right; }
.critique-overall { display: flex; align-items: baseline; gap: 10px; font-size: 15px; color: var(--muted); }
.critique-overall b { font-size: 30px; color: var(--text); }

.critique-right { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.vg-stage {
  width: 300px; height: 400px;
  display: flex; align-items: flex-end; justify-content: center;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,.5));
}
.vg-stage canvas { image-rendering: pixelated; width: 260px; height: 380px; }
.vg-name { font-size: 13px; letter-spacing: .5px; color: #e9d9bf; font-weight: 600; }

@media (max-width: 760px) {
  .critique-grid { grid-template-columns: 1fr; gap: 8px; padding: 8vh 6vw; }
  .critique-right { order: -1; }
  .vg-stage { width: 180px; height: 240px; }
  .vg-stage canvas { width: 150px; height: 220px; }
}

/* ---- Sokak lambası detayı ---- */
.lamp-grid {
  position: relative; z-index: 2; height: 100%;
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center; gap: 28px; padding: 7vh 6vw; box-sizing: border-box;
}
.lamp-left { max-width: 680px; }
.lamp-left h2 { margin: 8px 0 4px; font-size: clamp(26px, 4vw, 42px); }
.lamp-dirs { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 20px; }
.dir-sign {
  background: #1f6b40; color: #fff; border: 3px solid #fff;
  border-radius: 8px; padding: 8px 14px; font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 16px rgba(0,0,0,.4);
}
.stickers-wall { display: flex; flex-wrap: wrap; gap: 10px; max-width: 640px; }
.sticker {
  padding: 8px 13px; border-radius: 7px; font-weight: 800; font-size: 14px;
  color: #11131a; box-shadow: 0 4px 12px rgba(0,0,0,.35);
  transform: rotate(var(--rot, 0deg));
  border: 2px solid rgba(0,0,0,.15);
}
.lamp-right { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lamp-qr {
  width: 220px; height: 220px; border-radius: 14px; background: #fff;
  padding: 12px; box-sizing: border-box; image-rendering: pixelated;
  box-shadow: 0 14px 34px rgba(0,0,0,.5);
}
.qr-cap { font-size: 13px; color: #cfd5df; letter-spacing: .3px; }
@media (max-width: 760px) {
  .lamp-grid { grid-template-columns: 1fr; gap: 14px; padding: 8vh 6vw; }
  .lamp-right { order: -1; }
  .lamp-qr { width: 150px; height: 150px; }
}

/* ---- Speech bubble (programlanabilir karakter) ---- */
.speech {
  position: fixed;
  z-index: 18;
  max-width: min(70vw, 560px);
  transform: translate(-50%, -100%);
  background: #fffdf5;
  color: #1c2530;
  border: 3px solid #1c2530;
  border-radius: 20px;
  padding: 30px 38px 34px;
  font-size: 34px;
  line-height: 1.2;
  box-shadow: 0 14px 34px rgba(0,0,0,.4);
  pointer-events: none;
  transition: opacity .18s ease;
}
#speechText { display: block; }
.speech::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -10px;
  transform: translateX(-50%);
  border: 9px solid transparent;
  border-top-color: #1c2530;
}
.speech .speech-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: #c4622d;
  margin-bottom: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---- Copy-to-clipboard (resident quotes + critiques) ---- */
.copy-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  color: currentColor; opacity: .42;
  pointer-events: auto;       /* .speech sets pointer-events:none on the bubble */
  border-radius: 8px;
  transition: opacity .15s ease, background .15s ease, color .15s ease;
}
.copy-btn:hover { opacity: .95; }
.copy-btn.is-copied { opacity: 1; }
/* Brief "Kopyalandı" confirmation above the button. */
.copy-btn::after {
  content: attr(data-copied-label);
  position: absolute; bottom: calc(100% + 7px); right: 0;
  padding: 5px 8px; border-radius: 6px;
  background: #1c2530; color: #fff;
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .02em; white-space: nowrap;
  opacity: 0; transform: translateY(3px); pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
.copy-btn.is-copied::after { opacity: 1; transform: translateY(0); }

/* Speech bubble: small ghost icon tucked in the top-right corner. */
.copy-btn--speech {
  position: absolute; top: 8px; right: 10px;
  width: 30px; height: 30px;
  color: #1c2530;
}
.copy-btn--speech:hover { background: rgba(28, 37, 48, .08); }

/* Critique: a quiet outlined chip near the top of the review column. */
.copy-btn--critique {
  height: 28px; padding: 0 10px; gap: 6px;
  margin-left: 10px; vertical-align: middle;
  color: #cdd3da; border: 1px solid rgba(255, 255, 255, .2);
  font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase; letter-spacing: .08em;
  opacity: .7;
}
.copy-btn--critique:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.copy-btn--critique::after { background: #f2f4f8; color: #1c2530; }

/* ---- Loading ---- */
.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  letter-spacing: .3px;
  z-index: 50;
  transition: opacity .5s ease;
}
.loading.gone { opacity: 0; pointer-events: none; }

/* Embed mode (?embed=1) — hide the street's own chrome so only the 3D scene
   shows when iframed into the home hero. The host page brings its own navbar. */
html.embed #topbar,
html.embed #hint,
html.embed #nowPlaying,
/* Also suppress every HTML overlay (speech bubbles, info cards, modals,
   loading) so a preview shows ONLY the live 3D scene — the bubbles render at
   full desktop size and would swamp a mini card. */
html.embed #speechBubble,
html.embed #card,
html.embed #construction,
html.embed #interiorBar,
html.embed #help,
html.embed #critique,
html.embed #lamp,
html.embed #artworkDetails,
html.embed #characterModal,
html.embed #loading { display: none !important; }
