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

body {
  font-family: 'Courier New', monospace;
  background: #1a1a1a;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 16px 24px;
}

.lang-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 101;
  font-family: inherit;
  font-size: 11px;
  min-width: 40px;
  text-align: center;
  color: #555;
  background: none;
  border: 1px solid #333;
  padding: 2px 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.lang-toggle:hover {
  color: #aaa;
  border-color: #555;
}

.lang-menu {
  position: fixed;
  z-index: 102;
  background: #1a1a1a;
  border: 1px solid #333;
  min-width: 100px;
}

.lang-menu-item {
  padding: 6px 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.lang-menu-item:hover {
  color: #fff;
  background: #252525;
}

.lang-menu-item.active {
  color: #fff;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 2px;
  text-decoration: none;
  cursor: pointer;
}

.dots::after {
  content: '.';
  animation: dots 1.5s steps(1) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

#app {
  width: 100%;
  height: 100vh;
  position: relative;
}

/* Landing page */
.landing {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.landing-flow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.landing-whisper {
  position: absolute;
  white-space: nowrap;
  color: #fff;
  transition: opacity 0.3s ease;
}

.landing-whisper.fade-out {
  opacity: 0 !important;
  transition: opacity 1.5s ease;
}

.landing button {
  z-index: 2;
  position: relative;
  padding: 12px 28px;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  letter-spacing: 1px;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.landing button:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

/* Coordinate page */
.wall {
  width: calc(100% - 240px);
  height: 100%;
  position: relative;
  cursor: crosshair;
  user-select: none;
  overflow: hidden;
}

.zoom-indicator {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 12px;
  color: #555;
  pointer-events: none;
  z-index: 10;
}

.room-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
}

.wall-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #333;
  font-size: 14px;
  pointer-events: none;
  z-index: 0;
  text-align: center;
  line-height: 1.8;
}

/* Minimap */
.minimap {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 120px;
  height: 80px;
  background: #111;
  border: 1px solid #333;
  z-index: 10;
  overflow: hidden;
}

.minimap-viewport {
  position: absolute;
  border: 1px solid #888;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.minimap-dot {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #666;
  border-radius: 50%;
  transform: translate(-1px, -1px);
  pointer-events: none;
}

.murmur {
  position: absolute;
  color: #b0b0b0;
  font-size: 14px;
  max-width: 220px;
  word-break: break-word;
  pointer-events: auto;
  cursor: pointer;
  transition: font-size 0.3s ease, opacity 0.3s ease, color 0.3s ease,
              text-shadow 0.3s ease, transform 0.15s ease;
  z-index: 2;
}

/* Hover: murmur glows softly */
.murmur:hover {
  color: #e8e8e8;
}

/* Like action area — hidden until hover */
.murmur .like-btn {
  display: inline-block;
  opacity: 0;
  color: #555;
  font-size: 12px;
  cursor: pointer;
  margin-left: 4px;
  transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
  vertical-align: middle;
}

.murmur:hover .like-btn {
  opacity: 1;
}

.murmur .like-btn:hover:not(.liked) {
  color: #ff6b6b;
  transform: scale(1.3);
}

.murmur .like-btn.liked {
  opacity: 1;
  color: #ff6b6b;
  cursor: default;
}

/* Glow tiers based on likes — applied via JS */
.murmur.glow-1 {
  color: #d0d0d0;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
}
.murmur.glow-2 {
  color: #e0e0e0;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}
.murmur.glow-3 {
  color: #f0f0f0;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.25), 0 0 40px rgba(255, 255, 255, 0.08);
}

/* Reply target — breathing pulse */
.murmur.reply-target {
  color: #fff;
  animation: reply-pulse 1.6s ease-in-out infinite;
}

@keyframes reply-pulse {
  0%, 100% { text-shadow: 0 0 6px rgba(255, 255, 255, 0.2); }
  50%      { text-shadow: 0 0 18px rgba(255, 255, 255, 0.5), 0 0 36px rgba(255, 255, 255, 0.15); }
}

/* Reply (child) murmurs — subtler */
.murmur.is-reply {
  font-size: 12px;
  color: #909090;
}

/* Connection lines */
.lines-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.lines-layer line {
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 1;
}

.lines-layer .reply-line {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.murmur.cluster {
  color: #999;
}

.cluster-count {
  color: #fff;
  font-weight: bold;
}

/* Input popup */
.input-popup {
  position: absolute;
  z-index: 50;
  display: flex;
  gap: 4px;
}

.input-popup input {
  padding: 6px 10px;
  font-family: inherit;
  font-size: 14px;
  background: #222;
  color: #fff;
  border: 1px solid #555;
  outline: none;
  width: 200px;
}

.input-popup button {
  padding: 6px 12px;
  font-family: inherit;
  font-size: 14px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  cursor: pointer;
}

/* Room sidebar */
.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 240px;
  height: 100%;
  background: #111;
  border-left: 1px solid #333;
  padding: 60px 12px 12px;
  overflow-y: auto;
  z-index: 90;
}

.sidebar h2 {
  font-size: 14px;
  color: #888;
  margin-bottom: 12px;
}

.room-item {
  padding: 8px;
  margin-bottom: 4px;
  background: #1a1a1a;
  border: 1px solid #333;
  cursor: pointer;
  font-size: 13px;
}

.room-item:hover {
  background: #252525;
}

.create-room {
  padding: 8px;
  margin-bottom: 8px;
  color: #666;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
  border: 1px dashed #333;
}

.create-room:hover {
  color: #999;
  border-color: #555;
}

/* Room name input */
.room-input {
  margin-bottom: 8px;
}

.room-input input {
  width: 100%;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  outline: none;
  margin-bottom: 4px;
}

.room-input button {
  width: 100%;
  padding: 8px;
  font-family: inherit;
  font-size: 13px;
  background: #333;
  color: #fff;
  border: 1px solid #555;
  cursor: pointer;
}

/* --- Mobile --- */
@media (max-width: 640px) {
  header {
    padding: 10px 16px;
  }


  .logo {
    font-size: 18px;
  }

  /* Sidebar: bottom drawer */
  .sidebar {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    max-height: 40vh;
    border-left: none;
    border-top: 1px solid #333;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: flex-start;
    align-content: flex-start;
  }

  .sidebar h2 {
    width: 100%;
    margin-bottom: 4px;
  }

  .room-item {
    margin-bottom: 0;
    padding: 6px 10px;
    font-size: 12px;
  }

  .create-room {
    margin-top: 0;
    padding: 6px 10px;
    font-size: 12px;
  }

  .room-input {
    width: 100%;
    margin-top: 4px;
  }

  /* Wall: full width */
  .wall {
    width: 100%;
    height: calc(100% - 120px);
  }

  /* Input popup: fixed at bottom */
  .input-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    padding: 12px;
    background: #111;
    border-top: 1px solid #333;
    gap: 8px;
  }

  .input-popup input {
    flex: 1;
    width: auto;
    font-size: 16px;
    padding: 10px 12px;
  }

  .input-popup button {
    font-size: 16px;
    padding: 10px 16px;
  }

  /* Minimap: smaller */
  .minimap {
    width: 80px;
    height: 54px;
    bottom: 8px;
    left: 8px;
  }

  /* Zoom indicator */
  .zoom-indicator {
    bottom: 8px;
    left: 8px;
    font-size: 10px;
  }

  /* Murmurs: smaller on mobile */
  .murmur {
    font-size: 11px;
    max-width: 120px;
  }

  .murmur .like-btn {
    opacity: 1;
    font-size: 9px;
  }

  /* Landing */
  .landing button {
    font-size: 13px;
    padding: 10px 24px;
  }

  .landing-whisper {
    max-width: 70vw;
    white-space: normal;
    word-break: keep-all;
  }
}
