.bottle-panel[hidden], .bottle-map-layer[hidden], .bottle-panel [hidden], #tabBody[hidden] { display: none; }
.bottle-mode :is(.building-layer, .site-labels, .completion-marks) { display: none; }
.bottle-mode:not(.bottle-coordinate) :is(.coord-layer, .coord-readout, .coord-toggle) { display: none; }
.bottle-letter :is(.map-companions, .map-role-button, .map-reveal-layer) { display: none; }
.bottle-coordinate :is(.coord-toggle, .coord-readout) { z-index: 16; }
.bottle-dialog select { color: #493621; background: #fffdf5; border: 1px solid #ab8b61; border-radius: 4px; padding: 6px; font: inherit; }
.bottle-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bottle-choices:has(+ select) { margin-bottom: 10px; }
.bottle-choices button[aria-pressed="true"] { background: #e4efd8; border-color: #6a994e; font-weight: 700; }
.bottle-reply { margin-top: 6px; }
.bottle-comment { padding: 4px 8px; background: #f5ecd9; }
.bottle-map-layer { position: absolute; inset: 0; z-index: 15; cursor: default; }
.bottle-map-layer.is-picking { cursor: crosshair; }
.bottle-heading, .bottle-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.bottle-heading h2, .bottle-dialog h2 { font-size: 19px; color: #35552b; }
.bottle-heading p, .bottle-legend { color: #66513a; font-size: 13px; }
.bottle-heading p { margin: 4px 0 12px; }
.bottle-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 12px; padding: 14px; background: #f5ecd9; border: 1px solid #c8aa82; border-radius: 7px; }
.bottle-form label { display: grid; gap: 5px; color: #493621; font-weight: 600; font-size: 14px; }
.bottle-form .bottle-anonymous { display: flex; align-items: center; }
.bottle-form :is(input:not([type=checkbox]), select, textarea) { width: 100%; border: 1px solid #ab8b61; background: #fffdf5; color: #3d2c1e; border-radius: 4px; padding: 8px; font: inherit; font-weight: 400; }
.bottle-form textarea { resize: vertical; }
.bottle-wide { grid-column: 1 / -1; }
.bottle-reply-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bottle-reply-actions .bottle-anonymous { flex: 0 0 auto; white-space: nowrap; }
.bottle-reply-buttons { display: flex; flex: 1 1 260px; justify-content: flex-end; gap: 8px; margin-inline-start: auto; }
.bottle-reply-buttons button { min-block-size: 40px; }
.bottle-reply-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bottle-actions { justify-content: flex-start; }
.bottle-actions span { flex: 1 1 130px; overflow-wrap: anywhere; font-size: 13px; }
.bottle-panel button, .bottle-dialog > button { border: 1px solid #96714a; border-radius: 4px; padding: 7px 12px; background: #f5e6c8; box-shadow: 0 2px #c8aa82; color: #3d2c1e; font: inherit; cursor: pointer; }
.bottle-panel .bottle-submit, .bottle-dialog > button { background: #e4efd8; color: #35552b; border-color: #6a994e; box-shadow: 0 2px #6a994e; font-weight: 700; }
.bottle-panel button:hover, .bottle-dialog > button:hover { filter: brightness(.95); }
.bottle-panel .bottle-mode-switch { margin: 12px 0 8px; }
.bottle-panel .bottle-mode-switch .mode-btn { flex: 1; border: 0; border-radius: 5px; padding: 7px 3px; box-shadow: none; background: transparent; font-weight: 700; }
.bottle-panel .bottle-mode-switch .mode-btn.active { background: #e8833a; }
.bottle-status { min-height: 1.4em; margin: 10px 0 4px; font-size: 14px; color: #35552b; }
.bottle-legend span { display: inline-block; margin-right: 10px; font-weight: bold; color: #8e471a; }
.bottle-legend span + span { color: #35552b; }
.bottle-drops, .bottle-building, .bottle-target { position: absolute; translate: -50% -50%; }
.bottle-drops { display: flex; gap: 2px; pointer-events: none; }
.bottle-drops.bottle-edge-left { translate: 2px -50%; }
.bottle-drops.bottle-edge-right { translate: calc(-100% - 2px) -50%; }
.bottle-drops.bottle-edge-top { transform: translateY(50%); }
.bottle-drops.bottle-edge-bottom { transform: translateY(-50%); }
.bottle-drop {
  pointer-events: auto; cursor: pointer; isolation: isolate; position: relative;
  min-width: clamp(16px, 2.5vw, 28px); height: clamp(21px, 3vw, 33px); padding: 0 3px 4px;
  border: 0; background: transparent; color: #3d2c1e; font: 800 clamp(10px, 1.15vw, 14px)/1 system-ui;
  filter: drop-shadow(0 2px 0 #4f3928aa);
}
.bottle-drop::before, .bottle-drop::after { content: ""; position: absolute; z-index: -1; clip-path: polygon(30% 0,70% 0,70% 7%,87% 7%,87% 17%,100% 17%,100% 57%,84% 57%,84% 70%,68% 70%,68% 83%,56% 83%,56% 100%,44% 100%,44% 83%,32% 83%,32% 70%,16% 70%,16% 57%,0 57%,0 17%,13% 17%,13% 7%,30% 7%); }
.bottle-drop::before { inset: 0; background: #4c3422; }
.bottle-drop::after { inset: 2px; background: linear-gradient(#ffe2a6, #e8833a); }
.bottle-voice::after { background: linear-gradient(#edf5be, #83aa5c); }
.bottle-drop:hover, .bottle-drop:focus-visible { z-index: 2; scale: 1.15; }
.bottle-building {
  cursor: pointer; width: clamp(20px, 3vw, 30px); aspect-ratio: 1; border: 2px solid #5a4632;
  border-radius: 4px; box-shadow: 0 2px #5a4632; background: #fff8e7; color: #3d2c1e;
  display: grid; place-items: center; padding: 0;
}
.bottle-building::before { content: ''; width: 70%; height: 70%; background: #986134; clip-path: polygon(50% 0,100% 37%,100% 48%,84% 48%,84% 100%,59% 100%,59% 65%,41% 65%,41% 100%,16% 100%,16% 48%,0 48%,0 37%); }
.bottle-building:hover, .bottle-building:focus-visible { z-index: 2; background: #ffe2a6; }
.bottle-building-label { position: absolute; bottom: calc(100% + 4px); padding: 3px 6px; white-space: nowrap; border-radius: 3px; font-size: 12px; color: #fff8e7; background: #4f3928; visibility: hidden; pointer-events: none; }
.bottle-building:is(:hover, :focus-visible) .bottle-building-label { visibility: visible; }
.bottle-map-hint { position: absolute; z-index: 3; top: 6px; left: 50%; translate: -50%; width: max-content; max-width: 96%; text-align: center; color: #3d2c1e; background: #fff8e7; border: 2px solid #ab8b61; border-radius: 4px; padding: 4px 8px; font-size: 13px; pointer-events: none; }
.bottle-target { width: 10px; height: 10px; translate: -50% 110%; border: 2px solid #fff8e7; background: #e8833a; box-shadow: 0 0 0 1px #5a4632; border-radius: 50%; pointer-events: none; }
.bottle-dialog { position: fixed; inset: 0; margin: auto; max-width: min(92vw, 480px); width: 100%; max-height: 85vh; overflow: auto; padding: 18px; border: 3px solid #a98258; border-radius: 8px; color: #3d2c1e; background: #fff8e7; box-shadow: 0 4px #5a4632; }
.bottle-dialog::backdrop { background: #30211399; }
.bottle-dialog > button { margin-top: 12px; }
.bottle-intro p { margin: 12px 0 0; }

.bottle-list { margin-top: 12px; }
.bottle-list article { padding: 9px 0; border-bottom: 1px solid #e5d4b4; overflow-wrap: anywhere; }
.bottle-list h3 { font-size: 16px; }
.bottle-list small { color: #66513a; }
.bottle-list p { white-space: pre-wrap; margin-top: 4px; }
.bottle-success p { margin: 6px 0 8px; color: #35552b; font-weight: 700; }
.bottle-success small { color: #66513a; line-height: 1.6; }
@media (max-width: 500px) {
  .bottle-form { grid-template-columns: minmax(0,1fr); }
  .bottle-drops { gap: 0; }
}
.bottle-river {
  position: relative;
  height: clamp(130px, 31vw, 190px);
  overflow: hidden;
  margin-top: 12px;
  border: 3px solid #ab8b61;
  border-radius: 4px;
  background: linear-gradient(#293d47, #527b76 63%, #7eb3a1);
  box-shadow: none;
  isolation: isolate;
}
.bottle-moon {
  position: absolute;
  left: 50%;
  top: 8%;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f7ecc3;
  box-shadow: 0 0 26px #ffe2a270;
}
.bottle-water {
  position: absolute;
  inset: 54% -35% 0;
  background:
    radial-gradient(ellipse 34px 3px at 45px 8px, #c5e7c3aa 75%, transparent 85%) 0 0 / 92px 23px,
    radial-gradient(ellipse 47px 3px at 64px 13px, #e8edb68c 75%, transparent 85%) 0 0 / 145px 32px,
    linear-gradient(#629e92, #437a7b);
  animation: bottle-water-flow 9s linear infinite;
}
.bottle-current {
  position: absolute;
  left: 44%;
  top: 39%;
  width: clamp(112px, 35%, 155px);
  animation: bottle-arrive 2.7s cubic-bezier(.17,.54,.33,1) both;
}
.bottle-current img {
  display: block;
  width: 100%;
  filter: drop-shadow(0 7px 3px #244b4a70);
  transform-origin: 50% 70%;
  animation: bottle-bob 4.3s ease-in-out infinite;
}
.bottle-stars { position: absolute; top: 18%; left: 13%; color: #fff0bc; font-size: 15px; }
@keyframes bottle-water-flow { to { background-position: 92px 0, 145px 0, 0 0; } }
@keyframes bottle-arrive { from { transform: translateX(-145%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes bottle-bob {
  0%, 100% { transform: translateY(0) rotate(-9deg); }
  38% { transform: translateY(-8px) rotate(2deg); }
  74% { transform: translateY(4px) rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .bottle-water, .bottle-current, .bottle-current img { animation: none; }
}
