/* The floating island hero on the home page (js/island/main.js). */
.island [hidden] { display: none !important; }
.island {
  --sky-top: #4d9ee6; --sky-bottom: #cfe9ff; --flash: 0;
  position: relative; overflow: hidden;
  height: clamp(560px, 86vh, 860px);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  transition: background 1.2s ease;
  color: var(--ink);
  isolation: isolate;
}
.island::after { /* lightning */
  content: ""; position: absolute; inset: 0; background: #fff; opacity: var(--flash); pointer-events: none; z-index: 4; transition: opacity 0.05s;
}
.island-stage { position: absolute; inset: 0; z-index: 1; }
.island-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.island-stage canvas:active { cursor: grabbing; }
.island-pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* the welcome tag: small, top left, so the map stays the star */
.island-intro {
  position: absolute; z-index: 3; left: max(20px, calc((100vw - var(--max)) / 2 + 20px)); top: 22px;
  max-width: 330px; padding: 14px 18px 13px; border-radius: 16px;
  background: rgba(251, 246, 238, 0.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.16);
}
.island-intro .kicker { margin: 0 0 2px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green); }
.island-intro h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.05; margin: 0 0 6px; }
.island-intro .lead { font-size: 0.95rem; line-height: 1.45; color: #3A2A22; margin: 0; }
.island-intro .intro-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 9px 0 0; font-size: 0.9rem; font-weight: 700; }
.island-intro .intro-links a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.island-intro .intro-links a:first-child { color: #b5532c; }
@media (max-width: 600px) {
  .island-intro { left: 12px; right: 12px; top: 12px; max-width: none; padding: 10px 14px; }
  .island-intro .kicker { display: none; }
  .island-intro h1 { font-size: 1.5rem; margin-bottom: 3px; }
  .island-intro .lead { font-size: 0.86rem; }
  .island-intro .intro-links { margin-top: 6px; font-size: 0.84rem; }
}

/* status chips: pool, weather, holiday */
.island-status {
  position: absolute; z-index: 3; left: max(20px, calc((100vw - var(--max)) / 2 + 20px)); bottom: 22px;
  display: flex; flex-wrap: wrap; gap: 8px; max-width: min(560px, calc(100% - 210px));
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.9); box-shadow: 0 3px 12px rgba(20, 30, 50, 0.16);
  font-size: 0.9rem; font-weight: 600; color: var(--ink); line-height: 1.2;
}
.chip b { font-weight: 400; }
.chip[data-state="open"] { background: #e3f6ec; color: #1d5b3c; }
.chip[data-state="open"]::before, .chip[data-state="closed"]::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #9a4a2c; flex: none; }
.chip[data-state="open"]::before { background: #2fa866; box-shadow: 0 0 0 3px rgba(47, 168, 102, 0.25); }

/* round buttons on the right */
.island-controls {
  position: absolute; z-index: 3; right: max(16px, calc((100vw - var(--max)) / 2 + 16px)); bottom: 22px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
.island-controls .row { display: flex; gap: 8px; }
.ibtn {
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, 0.94); color: var(--ink); font: inherit; font-weight: 700; font-size: 1rem;
  box-shadow: 0 3px 12px rgba(20, 30, 50, 0.18); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.ibtn:hover { background: #fff; transform: translateY(-1px); }
.ibtn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.ibtn.big { background: var(--green); color: #fff; padding: 0 18px; }
.ibtn.big:hover { background: var(--green-dark); }
.ibtn[aria-pressed="true"] { background: var(--green); color: #fff; }
.island-hint {
  position: absolute; z-index: 3; left: 62%; top: 22px; transform: translateX(-50%);
  background: rgba(43, 36, 32, 0.72); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 0.85rem;
  pointer-events: none; transition: opacity 0.6s;
}
.island-hint.is-gone { opacity: 0; }

/* street names: little green street signs over each street (js/island/labels.js) */
.street-tag {
  position: absolute; left: 0; top: 0; translate: -50% -50%; white-space: nowrap; pointer-events: none;
  padding: 2px 7px 3px; border-radius: 4px; border: 1.5px solid rgba(255, 255, 255, 0.95);
  background: #1e6b45; color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; line-height: 1.25;
  box-shadow: 0 2px 6px rgba(10, 25, 20, 0.3); visibility: hidden;
}
@media (max-width: 600px) { .street-tag { font-size: 0.66rem; padding: 1px 6px 2px; } }

/* pins floating over the map */
.pin {
  position: absolute; left: 0; top: 0; pointer-events: auto; white-space: nowrap;
  translate: -50% -100%; will-change: transform;
}
.pin-event { display: none; }
.island.show-events .pin-event {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 2px solid #fff;
  background: var(--sand); color: var(--ink); font: inherit; cursor: pointer;
  box-shadow: 0 4px 12px rgba(20, 30, 50, 0.28);
}
.pin-event::after { /* the little stem */
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 9px; height: 9px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 1px; z-index: -1;
}
.pin-event:focus-visible { outline: 3px solid var(--gold); }
.pin-emoji { font-size: 1.25rem; line-height: 1; background: none; width: auto; height: auto; }
/* the name shows only on hover or keyboard focus */
.pin-text {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  display: none; line-height: 1.15; background: #fff; padding: 6px 11px; border-radius: 10px; text-align: left;
  box-shadow: 0 6px 16px rgba(20, 30, 50, 0.25); white-space: nowrap;
}
.pin-event:hover .pin-text, .pin-event:focus-visible .pin-text { display: grid; }
.pin-event:hover { z-index: 2000 !important; transform-origin: bottom; }
.pin-text strong { font-size: 0.86rem; }
.pin-text small { font-size: 0.75rem; color: var(--ink-soft); }
.chip-btn { border: 0; cursor: pointer; font: inherit; font-size: 0.9rem; font-weight: 600; }
.chip-btn:hover { background: #fff; }
.chip-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.pin-spot {
  padding: 3px 9px; border-radius: 999px; background: rgba(43, 36, 32, 0.72); color: #fff; font-size: 0.78rem; font-weight: 600;
  pointer-events: none;
}

/* the event card */
.island-card {
  position: absolute; z-index: 5; right: max(16px, calc((100vw - var(--max)) / 2 + 16px)); top: 40px; width: min(360px, calc(100% - 32px));
  background: #fff; border-radius: 18px; padding: 20px 22px; box-shadow: 0 16px 40px rgba(20, 30, 50, 0.3);
}
.island-card .em { font-size: 2rem; line-height: 1; }
.island-card h2 { font-size: 1.35rem; margin: 8px 0 4px; }
.island-card .when { font-weight: 700; color: var(--sunset-dark); margin-bottom: 2px; }
.island-card .place { color: var(--ink-soft); font-size: 0.95rem; }
.island-card .x { position: absolute; right: 10px; top: 10px; }
.island-card .btn-row { margin-top: 12px; }

/* "Try it" panel */
.island-looks {
  position: absolute; z-index: 5; right: max(16px, calc((100vw - var(--max)) / 2 + 16px)); bottom: 84px; width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 120px); overflow: auto;
  background: #fff; border-radius: 18px; padding: 16px 18px; box-shadow: 0 16px 40px rgba(20, 30, 50, 0.3);
}
.island-looks h2 { font-size: 1.1rem; margin: 0 0 4px; }
.island-looks p { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 6px; }
.island-looks fieldset { border: 0; padding: 0; margin: 10px 0 0; }
.island-looks legend { font-weight: 700; font-size: 0.85rem; margin-bottom: 5px; }
.island-looks .opts { display: flex; flex-wrap: wrap; gap: 6px; }
.island-looks .opts button {
  border: 1px solid var(--line); background: var(--cream); border-radius: 999px; padding: 5px 11px; font: inherit; font-size: 0.85rem; cursor: pointer; color: var(--ink);
}
.island-looks .opts button[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.island-looks .x { position: absolute; right: 10px; top: 10px; }

/* full screen */
html.island-open, html.island-open body { overflow: hidden; }
.island.is-full { position: fixed; inset: 0; height: auto; z-index: 200; }
.island .full-only { display: none; }
.island.is-full .full-only { display: inline-flex; }
.island.is-full .hero-only { display: none !important; }
.island-topbar {
  position: absolute; z-index: 3; left: 16px; right: 16px; top: 14px; display: none; align-items: center; justify-content: space-between; gap: 10px;
}
.island.is-full .island-topbar { display: flex; }
.island-topbar .name { background: rgba(255, 255, 255, 0.92); padding: 8px 16px; border-radius: 999px; font-family: var(--font-head); font-weight: 700; box-shadow: 0 3px 12px rgba(20, 30, 50, 0.18); }
.island.is-full .island-status { left: 16px; }
.island.is-full .island-controls, .island.is-full .island-looks { right: 16px; }
.island.is-full .island-card { top: 70px; right: 16px; }

/* walking */
.island-walkhud { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.island-walkhud > * { pointer-events: auto; }
.island-walkhud .street { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); background: rgba(43, 36, 32, 0.78); color: #fff; padding: 7px 16px; border-radius: 999px; font-weight: 700; pointer-events: none; }
.island-walkhud .acts { position: absolute; right: 16px; top: 14px; display: flex; gap: 8px; }
.island-walkhud .keys { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); background: rgba(43, 36, 32, 0.6); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; pointer-events: none; }
.stick {
  position: absolute; left: 22px; bottom: 26px; width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.35); border: 2px solid rgba(255, 255, 255, 0.8); touch-action: none; display: none;
  box-shadow: 0 4px 14px rgba(20, 30, 50, 0.2);
}
.stick span { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(20, 30, 50, 0.3); }
@media (pointer: coarse) { .stick { display: block; } .island-walkhud .keys { display: none; } }
.island.is-walking .island-status, .island.is-walking .island-controls, .island.is-walking .island-topbar, .island.is-walking .island-hint { display: none; }

/* loading and fallback */
.island-fallback { display: none; }
.island.island-failed .island-fallback { display: block; position: absolute; inset: auto 0 0 0; height: 170px; }
.island.island-failed .island-controls, .island.island-failed .island-status, .island.island-failed .island-hint { display: none; }
.island.island-failed { background: linear-gradient(180deg, #F6C9A8 0%, #F2B98F 35%, #E9A07A 65%, #D98466 100%); height: auto; min-height: 460px; }
.island-loading .island-stage::before {
  content: "Building Sweet Briar…"; position: absolute; right: 30%; top: 50%; color: #fff; font-weight: 700; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

@media (max-width: 900px) {
  .island { height: clamp(620px, 92vh, 820px); }
  .island-status { left: 14px; right: 14px; bottom: 78px; max-width: none; }
  .island-controls { left: 14px; right: 14px; bottom: 16px; flex-direction: row; justify-content: space-between; align-items: center; }
  .island-card, .island-looks { left: 14px; right: 14px; width: auto; top: auto; bottom: 16px; max-height: 70%; }
  .island.is-full .island-card { top: auto; bottom: 16px; left: 14px; right: 14px; }
  .chip { font-size: 0.82rem; padding: 6px 11px; }
  .island-hint { display: none; }
  .island-loading .island-stage::before { right: auto; left: 50%; transform: translateX(-50%); top: 60%; }
}
@media (max-width: 520px) {
  .island-controls .lbl { display: none; }
  .island:not(.is-full) [data-zoom] { display: none; }
  .island-controls .row { gap: 6px; }
  .ibtn.big { padding: 0 14px; }
  .island-walkhud .street { left: 14px; transform: none; top: 74px; }
}
@media (prefers-reduced-motion: reduce) {
  .island, .island-hint { transition: none; }
}
