:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e5e7eb;
  --muted: #9aa0a6;
  --primary: #22c55e;
  --primary-contrast: #0b1e12;
  --overlay: rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #1f2937;
  background: #0b1220;
}
.topbar h1 { font-size: 20px; margin: 0; }

.primary {
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.primary:active { transform: translateY(1px); }
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid #334155;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}

main {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  flex: 1 1 auto;
}

.map-container {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
#mapImage { display: block; width: 100%; height: 100%; object-fit: contain; }
.zoom-wrap { position: relative; will-change: transform; transform-origin: 50% 50%; width: 100%; height: 100%; }
.zoom-wrap { position: relative; will-change: transform; transform-origin: 50% 50%; }
.krathong-layer { position: absolute; inset: 0; pointer-events: auto; }

.krathong {
  position: absolute;
  width: 20px;
  height: 20px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
}
.krathong-img, .user-photo {
  width: 20px;
  height: 20px;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.krathong-img {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.user-photo {
  border-radius: 50%;
  border: 2px solid #ffffffaa;
  box-shadow: 0 6px 16px rgba(0,0,0,0.6);
  transform: translate(-50%, -50%);
  top: calc(50% - 20px);
}

/* Raft picker */
.picker-section { margin: 10px 0; }
.picker-title { font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.raft-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.raft-option {
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
}
.raft-option img { display: block; width: 100%; height: auto; }
.raft-option.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(34,197,94,0.3) inset; }

.modal.hidden { display: none; }
.modal {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-content {
  width: 100%;
  max-width: 520px;
  background: var(--panel);
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 16px;
}
.modal-content h2, .modal-content h3 { margin: 0 0 12px; }
.modal-content label { display: block; margin: 10px 0; font-size: 14px; }
.modal-content input[type="text"],
.modal-content textarea,
.modal-content input[type="file"] {
  width: 100%;
  margin-top: 6px;
  background: #0b1220;
  color: var(--text);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px;
}
.modal-content .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.wish-body { white-space: pre-wrap; line-height: 1.6; }
.wish-header { display: flex; align-items: center; gap: 12px; }
.profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff66;
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}
.wish-info { display: flex; flex-direction: column; gap: 4px; }
.wish-name { font-weight: 600; }
.wish-text { color: var(--text); opacity: 0.95; }

.toast.hidden { display: none; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: #111827;
  color: var(--text);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}