.map-hint {
  margin: 8px 0 12px;
  color: var(--soft);
  font-size: .72rem;
  line-height: 1.5;
}

.aura-map {
  height: min(67vh, 610px);
  min-height: 460px;
  touch-action: none;
  cursor: grab;
  border-color: #244330;
}
.aura-map:active { cursor: grabbing; }
.aura-map:focus-visible { outline: 1px solid var(--green); }
.aura-world {
  position: absolute;
  inset: 0;
  transform-origin: center center;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.aura-map.is-dragging .aura-world { transition: none; }
.aura-world[hidden], .map-controls[hidden] { display: none; }
.earth-world[hidden], .thought-interactions[hidden], .earth-empty[hidden] { display: none; }
.aura-map > .map-controls { z-index: 3; }
.pool-tool-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.earth-world { position: absolute; inset: 0; transform-origin: center; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.aura-map.is-dragging .earth-world { transition: none; }
.earth-surface { position: absolute; top: 50%; left: 0; width: 100%; aspect-ratio: 2; transform: translateY(-50%); border: 1px solid #4a756b; background: radial-gradient(ellipse at 50% 50%, #17322b, #071a1c 74%); overflow: hidden; }
.earth-surface::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 calc(25% - 1px), #51796b42 25%), repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), #51796b42 25%); opacity: .45; }
.earth-shape { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 0 9px #7acb8275); user-select: none; pointer-events: none; }
.earth-markers { position: absolute; inset: 0; }
.earth-cities { position: absolute; inset: 0; pointer-events: none; }
.earth-marker { --aura: #9fc79a; position: absolute; z-index: 2; width: 12px; height: 12px; padding: 0; border: 2px solid #ebffde; border-radius: 50%; background: var(--aura); box-shadow: 0 0 0 8px color-mix(in srgb, var(--aura) 29%, transparent), 0 0 19px var(--aura); transform: translate(-50%, -50%); }
.earth-marker:hover, .earth-marker:focus-visible { width: 18px; height: 18px; outline: none; }
.city-label { position: absolute; color: #e6f7d8; font-size: .57rem; white-space: nowrap; transform: translate(6px, -100%); text-shadow: 0 1px 3px #000, 0 0 5px #000; }
.city-label[hidden] { display: none; }
.earth-empty { position: absolute; left: 50%; bottom: 8%; width: 90%; transform: translateX(-50%); text-align: center; font-size: .7rem; color: var(--soft); text-shadow: 0 1px 5px #000; }
.location-choice { display: flex; align-items: center; gap: 9px; text-transform: none !important; cursor: pointer; }
.location-choice input { width: 17px; height: 17px; accent-color: var(--green); }
.location-note { color: var(--soft); font-size: .68rem; line-height: 1.5; margin: 0 0 5px; }

.region {
  position: absolute;
  z-index: 4;
  inset: 0;
  padding: 14px;
  background: radial-gradient(ellipse at 48% 48%, #183122, #06120b 78%);
  display: flex;
  flex-direction: column;
}
.region-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.region-heading h2 {
  margin: 0;
  color: var(--green);
  font-size: .83rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.region .map-hint { margin: 5px 0 9px; }
.region .thought-map { flex: 1; min-height: 0; height: auto; }
.thought-interactions { position: absolute; z-index: 6; right: 12px; top: 64px; bottom: 12px; width: min(318px, calc(100% - 24px)); padding: 14px; overflow-y: auto; background: #07160ff5; border: 1px solid #88b58d; box-shadow: 0 0 35px #0009; font-size: .73rem; }
.interaction-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-transform: uppercase; color: var(--green); }
.interaction-head button { color: var(--ink); background: transparent; border: 1px solid var(--line); width: 28px; height: 28px; }
.interaction-thought { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 100px; overflow-y: auto; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.reaction-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.reaction-list button { border: 1px solid #45654a; background: #0d2416; color: var(--ink); padding: 7px 3px; font-size: .66rem; }
.reaction-list button[aria-pressed="true"] { border-color: var(--green); background: #295b36; }
.reaction-list button span { display: block; font-size: 1.1rem; }
.comment-list { list-style: none; padding: 0; margin: 14px 0; max-height: 160px; overflow-y: auto; }
.comment-list li { border-top: 1px solid #28432d; padding: 7px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-list time { display: block; color: var(--soft); font-size: .61rem; }
.comment-form { display: grid; gap: 6px; }
.comment-form label { color: var(--soft); }
.comment-form textarea { width: 100%; padding: 8px; }
.comment-form div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--soft); }
.comment-form button[type=submit] { min-height: 30px; padding: 5px 9px; }

.aura {
  transition: transform .5s ease, opacity .5s ease, filter .5s ease;
}
.aura-1::before { background: radial-gradient(ellipse, #3ba6bcad, #24728455 46%, transparent 76%); }
.aura-2::before { background: radial-gradient(ellipse, #7976d3ad, #544d9955 46%, transparent 76%); }
.aura-3::before { background: radial-gradient(ellipse, #59b675ad, #3a855455 46%, transparent 76%); }
.aura-4::before { background: radial-gradient(ellipse, #e6b64ead, #a27d2755 46%, transparent 76%); }
.aura-5::before { background: radial-gradient(ellipse, #eb748bad, #a5435b55 46%, transparent 76%); }
.aura.selected { transform: scale(1.24); }
.aura-map:has(.aura.selected) .aura:not(.selected) { opacity: .65; filter: blur(2px); }
.region-enter { animation: region-zoom .55s ease-out both; }
@keyframes region-zoom {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}

.thought-map {
  position: relative;
  height: min(66vh, 600px);
  min-height: 420px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  outline: none;
  border: 0;
  background:
    radial-gradient(ellipse at 45% 49%, #3452474a 0, transparent 47%),
    radial-gradient(ellipse at 68% 25%, #6a537a28 0, transparent 40%),
    radial-gradient(ellipse at 25% 80%, #4f685036 0, transparent 45%),
    #05100b;
}

.thought-map:focus-visible { outline: 1px solid var(--green); }
.thought-map:active { cursor: grabbing; }
.thought-map::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .27;
  background: radial-gradient(#b9d0ba 1px, transparent 1px) 0 0 / 25px 25px;
}

.thought-world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-origin: 0 0;
  transition: transform .55s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.thought-map.is-dragging .thought-world { transition: none; }

.map-thought {
  --aura: #9fc79a;
  position: absolute;
  width: 220px;
  min-height: 120px;
  padding: 17px 19px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 39% 56% 43% 47% / 23% 19% 24% 20%;
  background: radial-gradient(ellipse at 50% 48%, color-mix(in srgb, var(--aura) 22%, #10221a) 0, #0a1a12ed 52%, transparent 100%);
  isolation: isolate;
  color: var(--ink);
  text-align: left;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: width .5s ease, min-height .5s ease, transform .5s ease, background .5s ease;
}

.map-thought::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -28px;
  pointer-events: none;
  border-radius: 46% 54% 62% 38% / 54% 40% 60% 46%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--aura) 24%, transparent), transparent 70%);
  filter: blur(18px);
  opacity: .85;
  transition: inset .5s ease, opacity .5s ease;
}

.map-thought:hover, .map-thought:focus-visible, .map-thought.expanded {
  background: radial-gradient(ellipse at 50% 48%, color-mix(in srgb, var(--aura) 33%, #10221a), #0a1a12f5 56%, transparent 100%);
}
.map-thought:hover::before, .map-thought.expanded::before { inset: -43px; opacity: 1; }
.map-thought:focus-visible { outline: 2px solid var(--aura); outline-offset: 3px; }
.map-thought.expanded {
  z-index: 2;
  width: min(310px, 78vw);
  min-height: 180px;
  max-height: 330px;
  border-radius: 33% 50% 39% 45% / 17% 18% 16% 20%;
  transform: translate(-50%, -50%) scale(1.04);
  background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--aura) 37%, #10221a), #091810e8 78%, transparent 100%);
}
.map-thought-body {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  font-size: .79rem;
}
.map-thought.expanded .map-thought-body {
  display: block;
  max-height: 240px;
  overflow: auto;
  font-size: .93rem;
}
.map-thought-date { color: var(--soft); font-size: .64rem; }
.map-empty {
  position: absolute;
  width: 220px;
  transform: translate(-50%, -50%);
  color: var(--soft);
  text-align: center;
  font-size: .8rem;
}
.map-controls {
  position: absolute;
  z-index: 3;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #06120cf2;
  border: 1px solid #355640;
}
.map-controls button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--green);
  font-size: 1.2rem;
}
.map-controls button:hover, .map-controls button:focus-visible { background: #24472b; }

@media (max-width: 650px) {
  .thought-interactions { top: auto; height: min(49%, 315px); }
  .city-label { font-size: .45rem; }
  .aura-map { height: 60vh; min-height: 440px; }
  .region { padding: 10px; }
  .region .thought-map { min-height: 0; }
  .map-thought { width: 195px; }
  .map-thought.expanded { width: min(280px, 72vw); }
}

@media (prefers-reduced-motion: reduce) {
  .region-enter { animation: none; }
  .aura, .aura-world, .thought-world, .map-thought, .map-thought::before { transition: none; }
}
