/* css/home-island.css: the home island (index.html and island-preview.html).
   The labels are HTML over a canvas; see js/home-island/main.js. */
.isl { position: relative; margin: 0 auto; }
/* The island takes the whole screen: the stage is as tall as the window allows and
   the camera fits the island into whatever shape that is (js/home-island/scene.js). */
.isl-stage { position: relative; width: 100%; height: clamp(420px, calc(100vh - 6.5rem), 1200px); height: clamp(420px, calc(100svh - 6.5rem), 1200px); margin: 0 auto; }
.isl-stage canvas, .isl-poster { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.isl-stage canvas { touch-action: pan-y; outline: none; }
.isl-poster { object-fit: contain; transition: opacity .4s; }
.isl[data-mode="3d"] .isl-poster { opacity: 0; pointer-events: none; }
.isl-overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.isl-overlay > * { pointer-events: auto; }

/* A place's name is a link; the small button beside it grows the place. */
.isl-place { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: .35rem; white-space: nowrap; will-change: transform; }
.isl-place.is-big { display: none; }
.isl-name {
  font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 800; font-size: clamp(.8rem, 1.5vw, 1.1rem); letter-spacing: .02em;
  color: #0d0d2b; background: #fff; border-radius: 999px; padding: .32rem .85rem; text-decoration: none;
  box-shadow: 0 3px 0 rgba(0,0,0,.35); border: 2px solid transparent;
}
.isl-place[data-place="gym"] .isl-name { background: #ffe07a; }
.isl-place[data-place="playground"] .isl-name { background: #4df0ff; }
.isl-place[data-place="lounge"] .isl-name { background: #d5c6f8; }
.isl-zoom {
  width: 2rem; height: 2rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); background: rgba(13,13,43,.8); color: #fff;
  font-size: 1rem; line-height: 1; cursor: pointer; padding: 0;
}
.isl-name:hover, .isl-name:focus-visible, .isl-chip:hover, .isl-chip:focus-visible { border-color: #fff; outline: 3px solid #4df0ff; outline-offset: 2px; }
.isl-zoom:hover, .isl-zoom:focus-visible { outline: 3px solid #4df0ff; outline-offset: 2px; }
/* Before the 3D is up (and wherever it cannot run) the names sit over the still picture. */
.isl:not([data-mode="3d"]) .isl-place { transform: translate(-50%, -100%); }
.isl:not([data-mode="3d"]) .isl-place[data-place="gym"] { left: 24%; top: 37%; }
.isl:not([data-mode="3d"]) .isl-place[data-place="playground"] { left: 76%; top: 35%; }
.isl:not([data-mode="3d"]) .isl-place[data-place="lounge"] { left: 50%; top: 9%; }
.isl:not([data-mode="3d"]) .isl-zoom, .isl:not([data-mode="3d"]) .isl-hint { display: none; }

.isl-chip {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
  font-weight: 800; font-size: clamp(.72rem, 1.25vw, .95rem); color: #fff; background: rgba(13,13,43,.88);
  border: 2px solid #4df0ff; border-radius: 10px; padding: .22rem .6rem; text-decoration: none;
}
.isl-chip[hidden], .isl-back[hidden], .isl-enter[hidden], .isl-zoom[hidden] { display: none; }
.isl-back, .isl-enter {
  position: absolute; top: .6rem; font-family: 'Baloo 2', system-ui, sans-serif; font-weight: 800; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-size: clamp(.85rem, 1.6vw, 1.1rem); padding: .45rem 1rem;
}
.isl-back { left: .6rem; background: rgba(13,13,43,.85); color: #fff; border: 2px solid rgba(255,255,255,.5); }
.isl-enter { right: .6rem; background: #4df0ff; color: #0d0d2b; border: 2px solid #4df0ff; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.isl[data-state="gym"] .isl-enter { background: #ffe07a; border-color: #ffe07a; }
.isl[data-state="lounge"] .isl-enter { background: #d5c6f8; border-color: #d5c6f8; }
.isl-back:focus-visible, .isl-enter:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.isl-hint { text-align: center; color: var(--muted, #aab4c8); font-weight: 700; margin: .4rem 0 0; min-height: 1.4em; }
.isl-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (max-width: 640px) {
  /* The clover is about as tall as it is wide: a stage much taller than that would be empty. */
  .isl-stage { height: min(calc(100vh - 6.5rem), 128vw); height: min(calc(100svh - 6.5rem), 128vw); }
  .isl-name { font-size: .68rem; padding: .22rem .55rem; }
  .isl-zoom { width: 1.55rem; height: 1.55rem; font-size: .8rem; }
  .isl-chip { font-size: .62rem; padding: .1rem .35rem; border-width: 1.5px; }
  .isl-back, .isl-enter { font-size: .78rem; padding: .35rem .7rem; }
  /* The two places that are not grown shrink to islets at the back; on a phone their
     names would collide, so they tuck into the top corners under the buttons. */
  .isl[data-mode="3d"]:not([data-state="overview"]) .isl-place:not(.is-big) { transform: none !important; top: 2.6rem; }
  .isl[data-mode="3d"]:not([data-state="overview"]) .isl-place:not(.is-big) ~ .isl-place:not(.is-big) { left: auto; right: 0; }
}
