/* =====================================================================
   beach.css — home screen: sunset beach + wooden signpost menu.
   Pure CSS/SVG. Only transform/opacity animate. Owned by the home screen.
   The beach scenery is the fallback behind the three.js scene (#home3d):
   it shows while html[data-home3d] is 'loading'/'off' and fades out when
   'on' (css/landing.css). The signpost is the APP view of #home.
   ===================================================================== */

#home.beach {
  --horizon: 38%;
  --shore: 66%;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg,
    #3e8fd6 0%, #74b0e4 12%, #a9c9e6 22%, #f1bfa6 30%, #ffcf9c 35%, #ffe1a8 38%, #ffe1a8 100%);
}
#home.beach > .water { display: none; }

/* ---------------------------------------------------------------- scene */
.beach-scene { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.beach-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.beach .sun {
  position: absolute; left: 80%; top: 13%; width: 86px; height: 86px; margin: -43px 0 0 -43px;
  border-radius: 50%;
  background: radial-gradient(circle at 46% 42%, #fffdf0 0 34%, #ffeb9a 52%, #ffc95a 70%, #ffb04a 100%);
  box-shadow: 0 0 0 10px rgba(255, 226, 150, 0.25), 0 0 46px 22px rgba(255, 214, 128, 0.55);
}
.beach .sun::after {
  content: ""; position: absolute; inset: -70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 160, 0.5) 0, rgba(255, 210, 150, 0.2) 40%, transparent 70%);
  animation: sunGlow 6s ease-in-out infinite alternate;
}
@keyframes sunGlow { from { transform: scale(0.9); opacity: 0.75; } to { transform: scale(1.08); opacity: 1; } }

.beach .cloud {
  position: absolute; width: 170px; height: 44px;
  background:
    radial-gradient(ellipse 26% 38% at 28% 60%, rgba(255, 246, 240, 0.95), rgba(255, 246, 240, 0) 100%),
    radial-gradient(ellipse 24% 46% at 52% 50%, rgba(255, 250, 246, 0.95), rgba(255, 250, 246, 0) 100%),
    radial-gradient(ellipse 22% 34% at 76% 64%, rgba(255, 238, 232, 0.9), rgba(255, 238, 232, 0) 100%);
  animation: cloudDrift 46s ease-in-out infinite alternate;
}
.beach .cloud.c1 { left: 4%; top: 25%; opacity: 0.75; }
.beach .cloud.c2 { left: 58%; top: 29%; width: 120px; height: 30px; opacity: 0.6; animation-duration: 60s; animation-direction: alternate-reverse; }
@keyframes cloudDrift { from { transform: translate3d(-24px, 0, 0); } to { transform: translate3d(28px, 0, 0); } }

/* seagulls */
.beach .gull { position: absolute; left: 0; top: 8%; width: 22px; animation: gullFly 34s linear infinite; }
.beach .gull svg { display: block; width: 100%; overflow: visible; animation: gullFlap 0.55s ease-in-out infinite alternate; transform-origin: 50% 70%; }
.beach .gull path { fill: none; stroke: #36394d; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0.75; }
.beach .gull.g2 { top: 12%; width: 16px; animation-delay: -12s; animation-duration: 40s; }
.beach .gull.g2 svg { animation-duration: 0.45s; }
.beach .gull.g3 { top: 20.5%; width: 13px; animation-delay: -25s; animation-duration: 46s; }
.beach .gull.g3 svg { animation-duration: 0.62s; }
@keyframes gullFly {
  0% { transform: translate3d(-40px, 0, 0); }
  25% { transform: translate3d(150px, -10px, 0); }
  50% { transform: translate3d(300px, 4px, 0); }
  75% { transform: translate3d(450px, -8px, 0); }
  100% { transform: translate3d(620px, 0, 0); }
}
@keyframes gullFlap { from { transform: scaleY(1); } to { transform: scaleY(0.4); } }

/* sea */
.beach .sea {
  position: absolute; left: 0; right: 0; top: var(--horizon); height: calc(var(--shore) - var(--horizon) + 5%);
  overflow: hidden; z-index: 0;
  background: linear-gradient(180deg, #8eaed0 0%, #5aa3cc 10%, #2f93bf 40%, #2a9fc2 100%);
}
.beach .sea::before { /* hazy horizon line */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px;
  background: linear-gradient(180deg, rgba(255, 236, 205, 0.85), rgba(255, 236, 205, 0));
  z-index: 2;
}
.beach .isle {
  position: absolute; left: 7%; top: calc(var(--horizon) - 8px); width: 70px; height: 16px; border-radius: 50% 50% 0 0;
  background: #7d8fa8; opacity: 0.75;
}
.beach .isle::after {
  content: ""; position: absolute; left: 30px; top: -16px; width: 3px; height: 20px; background: #7d8fa8;
  transform: rotate(10deg); border-radius: 2px;
}
.beach .isle::before {
  content: ""; position: absolute; left: 22px; top: -22px; width: 22px; height: 10px; border-radius: 50%;
  border-top: 3px solid #7d8fa8; transform: rotate(8deg);
}
.beach .glare { /* sun glitter path on the water */
  position: absolute; left: calc(80% - 30px); width: 60px; top: 0; height: 55%;
  background: repeating-linear-gradient(180deg, rgba(255, 240, 200, 0.7) 0 1.5px, transparent 1.5px 9px);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent), radial-gradient(closest-side, #000, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, #000, transparent), radial-gradient(closest-side, #000, transparent);
  mask-composite: intersect;
  animation: glare 2.8s ease-in-out infinite alternate;
  z-index: 1;
}
@keyframes glare { from { opacity: 0.45; transform: scaleX(0.85); } to { opacity: 1; transform: scaleX(1.1); } }

.beach .wave {
  position: absolute; left: 0; width: 200%; bottom: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 19px, currentColor 19px);
  animation: waveMove var(--dur, 18s) linear infinite;
  will-change: transform;
}
.beach .wave svg { display: block; width: 100%; height: 20px; }
.beach .wave svg path { fill: currentColor; }
.beach .wave svg path.crest { fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 1.6; }
.beach .wave.w1 { top: 20%; color: #3d9fc6; --dur: 26s; }
.beach .wave.w2 { top: 44%; color: #3fb2cc; --dur: 19s; animation-direction: reverse; }
.beach .wave.w3 { top: 68%; color: #5fcdd3; --dur: 13s; }
@keyframes waveMove {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-12.5%, 3px, 0); }
  50% { transform: translate3d(-25%, 0, 0); }
  75% { transform: translate3d(-37.5%, 3px, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.beach .sparkle {
  position: absolute; left: var(--x); top: var(--y); width: 12px; height: 12px; margin: -6px; z-index: 3;
  background:
    radial-gradient(circle, #fff 0 1.4px, rgba(255, 255, 255, 0) 4px),
    linear-gradient(#fff, #fff) center / 1.3px 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 1.3px no-repeat;
  opacity: 0;
  animation: twinkle 3.6s var(--d, 0s) ease-in-out infinite;
}
@keyframes twinkle {
  0%, 60%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  30% { opacity: 1; transform: scale(1) rotate(45deg); }
}

/* sand */
.beach .sand {
  position: absolute; left: -20%; right: -20%; top: var(--shore); bottom: 0;
  border-radius: 50% 50% 0 0 / 30px 30px 0 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='s'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.29 0 0 0 0 0.1 1.5 0 0 0 -0.62'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23s)'/%3E%3C/svg%3E") 0 0 / 160px 160px,
    radial-gradient(ellipse 60% 40% at 50% 100%, rgba(196, 140, 70, 0.35), transparent 70%),
    linear-gradient(180deg, #c99f69 0, #dcb882 12px, #f0d39f 36px, #f6dba8 60px, #f7dcaa 40%, #eecb90 80%, #e2b778 100%);
}
.beach .foam {
  position: absolute; left: -10%; right: -10%; top: calc(var(--shore) - 9px); height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='16'%3E%3Cpath fill='%23fff' d='M0 11 Q6 4 13 8 Q20 1 29 7 Q36 3 41 8 Q50 0 58 7 Q66 2 72 8 Q76 6 80 11 V13 Q60 10 40 13 Q20 10 0 13Z'/%3E%3Cg fill='%23fff' fill-opacity='.8'%3E%3Ccircle cx='9' cy='14' r='1.2'/%3E%3Ccircle cx='33' cy='14.5' r='.9'/%3E%3Ccircle cx='52' cy='14' r='1.3'/%3E%3Ccircle cx='70' cy='14.6' r='.8'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 80px 16px repeat-x;
  animation: wash 7s ease-in-out infinite;
  will-change: transform, opacity;
}
.beach .foam.f2 { background-position: 37px 0; opacity: 0.7; animation-delay: -3.5s; }
@keyframes wash {
  0% { transform: translate3d(0, -7px, 0); opacity: 0; }
  20% { opacity: 0.95; }
  55% { transform: translate3d(0, 9px, 0); opacity: 0.85; }
  85% { opacity: 0; }
  100% { transform: translate3d(0, 12px, 0); opacity: 0; }
}

.beach .starfish { position: absolute; left: 7%; bottom: 7%; width: 38px; transform: rotate(-18deg); }
.beach .starfish path { fill: #f07f52; stroke: #f07f52; stroke-width: 9; stroke-linejoin: round; }
.beach .starfish .dots { fill: #ffd2a8; }
.beach .shell { position: absolute; right: 9%; bottom: 10%; width: 30px; transform: rotate(14deg); }
.beach .shell path { fill: #fde6d5; stroke: #d8a387; stroke-width: 2; stroke-linejoin: round; }
.beach .shell .ribs { fill: none; stroke: #e0b39a; stroke-width: 1.6; }

/* palms */
.beach .palm { position: absolute; }
.beach .palm .trunk { position: absolute; inset: 0; width: 100%; height: 100%; }
.beach .palm::after { /* sand heaped round the trunk */
  content: ""; position: absolute; left: -4%; bottom: -10px; width: 46%; height: 22px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #f6dcaa 0, #ebc88e 50%, rgba(214, 168, 104, 0) 72%);
}
.beach .palm .crown {
  position: absolute; left: 61%; top: 15%; width: 230px; height: 230px; margin: -115px 0 0 -115px;
  animation: sway 5.5s ease-in-out infinite alternate;
  transform-origin: 50% 50%;
}
.beach .palm .crown svg { display: block; width: 100%; height: 100%; overflow: visible; }
.beach .palm .back use { fill: #1f6a3a; }
.beach .palm .front use { fill: #2f8f4b; }
.beach .palm .rib { stroke: #8fd06a; stroke-width: 1.6; stroke-linecap: round; opacity: 0.55; }
.beach .palm .back .rib { opacity: 0.3; }
.beach .palm .nuts circle { fill: #6b3d17; stroke: #4a2810; stroke-width: 1.5; }
.beach .palm-l { left: -42px; bottom: 26%; width: 150px; height: 66%; }
.beach .palm-r { right: -34px; bottom: 31%; width: 110px; height: 48%; transform: scaleX(-1); }
.beach .palm-r .crown { width: 170px; height: 170px; margin: -85px 0 0 -85px; animation-duration: 6.5s; animation-delay: -2s; }
@keyframes sway { from { transform: rotate(-3.5deg); } to { transform: rotate(3deg); } }

/* ---------------------------------------------------------------- layout (APP view) */
/* Phones: brand up top (fallback only), signpost docked at the bottom within thumb reach. */
#home.beach .home-inner {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: calc(58px + var(--safe-top)) 14px calc(8px + var(--safe-bottom));
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
}
#home.beach .home-inner::-webkit-scrollbar { display: none; }
#home.beach .brand { flex: none; text-align: center; margin: 0 0 clamp(8px, 1.8vh, 18px); transition: opacity 0.6s ease, visibility 0s; }
/* the three.js scene brings its own 3D logo */
html[data-home3d='on'] #home.beach .brand { opacity: 0; visibility: hidden; transition: opacity 0.6s ease, visibility 0s 0.6s; }
#home.beach .brand-cards { height: 54px; margin-bottom: 6px; }
#home.beach .mini-card { width: 36px; height: 50px; border-radius: 5px; }
#home.beach .mini-card b { font-size: 14px; }
#home.beach .mini-card i { font-size: 12px; }
#home.beach .logo { font-size: 64px; position: relative; }
#home.beach .tag { margin-top: 10px; color: #fff; text-shadow: 0 1px 0 rgba(120, 60, 30, 0.6), 0 2px 6px rgba(120, 60, 30, 0.35); }

/* ---------------------------------------------------------------- signpost */
#home .signpost {
  position: relative; flex: none; margin-top: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: clamp(6px, 1.2vh, 12px);
  padding: 6px 0 4px;
}
#home .post {
  position: absolute; left: 50%; top: -8px; bottom: 26px; width: 24px; margin-left: -12px; z-index: 0;
  border-radius: 9px 9px 3px 3px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35 0.008' numOctaves='3' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.25 0 0 0 0 0.12 0 0 0 0 0.03 1.4 0 0 0 -0.5'/%3E%3C/filter%3E%3Crect width='24' height='300' filter='url(%23g)'/%3E%3C/svg%3E") 0 0 / 24px 300px,
    linear-gradient(90deg, #4f2c10, #8b5a2b 18%, #c08a4f 42%, #a26d38 68%, #5a3415);
  box-shadow: 5px 2px 8px rgba(60, 30, 8, 0.3);
}
#home .post::after { /* sand mound where the post is planted */
  content: ""; position: absolute; left: 50%; bottom: -14px; width: 130px; height: 30px; margin-left: -65px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #f8dfae 0, #edca8e 45%, rgba(214, 168, 104, 0.6) 62%, rgba(214, 168, 104, 0) 72%);
}

#home .bplank {
  --w: 252px; --h: clamp(40px, 5.5vh, 48px); --rot: 0deg; --dx: 0px; --tip: 26px;
  --wood-a: #efc386; --wood-b: #d29a57; --wood-c: #a86a32;
  --paint: transparent;
  --shape: polygon(0.6% 9%, 5% 1%, 48% 4%, 94% 0, 100% 11%, 98.8% 52%, 100% 90%, 95% 100%, 52% 96%, 5% 100%, 0 89%, 1.2% 50%);
  position: relative; z-index: 1; flex: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: min(var(--w), 86%); height: var(--h);
  margin: 0; padding: 0 14px;
  color: #4d2508; background: none; border: 0;
  font-family: "Bree Serif", Georgia, serif; font-size: 18px; line-height: 1; letter-spacing: 0.3px;
  text-shadow: 0 1px 0 rgba(255, 230, 185, 0.8), 0 -1px 0 rgba(70, 30, 5, 0.45);
  transform: translateX(var(--dx)) rotate(var(--rot));
  filter: drop-shadow(0 5px 3px rgba(60, 30, 8, 0.38));
  transition:
    translate 0.5s cubic-bezier(0.3, 1.9, 0.45, 1),
    rotate 0.5s cubic-bezier(0.3, 1.9, 0.45, 1),
    scale 0.5s cubic-bezier(0.3, 1.9, 0.45, 1),
    opacity 0.2s;
  animation: plankIn 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) backwards;
  animation-delay: calc(var(--i, 0) * 70ms + 80ms);
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
#home .bplank::before { /* the board: grain, knot, bevel, weathered paint */
  content: ""; position: absolute; inset: 0; z-index: -1;
  clip-path: var(--shape);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='64'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.006 0.26' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.33 0 0 0 0 0.16 0 0 0 0 0.04 1.5 0 0 0 -0.52'/%3E%3C/filter%3E%3Crect width='260' height='64' filter='url(%23g)'/%3E%3C/svg%3E") var(--gx, 0) 0 / 260px 64px,
    radial-gradient(ellipse 13px 5px at var(--kx, 22%) 64%, rgba(90, 42, 10, 0.55), rgba(90, 42, 10, 0.2) 55%, transparent 75%),
    linear-gradient(180deg, rgba(255, 244, 214, 0.38), transparent 26%, transparent 70%, rgba(70, 30, 5, 0.28)),
    linear-gradient(var(--paint), var(--paint)),
    linear-gradient(180deg, var(--wood-a), var(--wood-b) 55%, var(--wood-c));
  box-shadow: inset 0 2px 0 rgba(255, 238, 200, 0.65), inset 0 -3px 0 rgba(80, 36, 8, 0.38);
}
#home .bplank::after { /* nails where the board crosses the post */
  content: ""; position: absolute; top: 0; bottom: 0; width: 10px; left: calc(50% - var(--dx) - 5px);
  pointer-events: none;
  background:
    radial-gradient(circle 3.4px at 50% 7px, #fbf6ea 0, #c1b8a8 1.1px, #6a5f53 2.4px, rgba(40, 20, 5, 0.5) 3px, transparent 3.5px),
    radial-gradient(circle 3.4px at 50% calc(100% - 7px), #fbf6ea 0, #c1b8a8 1.1px, #6a5f53 2.4px, rgba(40, 20, 5, 0.5) 3px, transparent 3.5px);
}
#home .bplank.arrow-r {
  --shape: polygon(0 10%, 3% 1%, calc(100% - var(--tip)) 0, 100% 50%, calc(100% - var(--tip)) 100%, 3% 97%, 0 88%, 1.2% 50%);
  padding-right: calc(var(--tip) + 4px);
}
#home .bplank.arrow-l {
  --shape: polygon(var(--tip) 0, 97% 3%, 100% 13%, 98.8% 50%, 100% 90%, 97% 99%, var(--tip) 100%, 0 50%);
  padding-left: calc(var(--tip) + 4px);
}

/* individual boards */
#home .bplank-name {
  --i: 0; --w: 236px; --h: clamp(44px, 6vh, 52px); --rot: -1.5deg;
  --wood-a: #ecdfc6; --wood-b: #cdb792; --wood-c: #a38862; --kx: 84%;
  justify-content: flex-start; gap: 8px; padding: 0 12px 0 14px;
}
#home .bplank-name label {
  flex: none; font-family: "Caveat", cursive; font-weight: 700; font-size: 22px; color: #4a3014;
  transform: rotate(-4deg);
}
#home .bplank-name input {
  flex: 1; min-width: 0; height: 32px; padding: 0 10px; margin: 0;
  border: 0; border-radius: 5px; outline: none;
  background: rgba(255, 251, 238, 0.62);
  box-shadow: inset 0 2px 3px rgba(70, 40, 10, 0.38), 0 1px 0 rgba(255, 244, 222, 0.7);
  color: #2e1705; font-family: "Caveat", cursive; font-weight: 700; font-size: 25px; line-height: 32px;
  text-shadow: none;
  -webkit-user-select: text; user-select: text;
  transition: box-shadow 0.2s, background 0.2s;
}
#home .bplank-name input::placeholder { color: rgba(74, 48, 20, 0.45); }
#home .bplank-name input:focus { background: rgba(255, 253, 244, 0.9); box-shadow: inset 0 2px 3px rgba(70, 40, 10, 0.3), 0 0 0 2px rgba(255, 196, 64, 0.9); }

#home .bplank-play {
  --i: 1; --w: 300px; --h: clamp(58px, 8.4vh, 76px); --rot: -2.5deg; --dx: 8px; --tip: 34px; --kx: 70%; --gx: -90px;
  --wood-a: #f7cf8a; --wood-b: #e0a55c; --wood-c: #b4733a;
  font-family: Bangers, Impact, sans-serif; font-size: clamp(38px, 5.6vh, 48px); letter-spacing: 5px;
  color: #8a2b0e; padding-left: 18px;
  text-shadow: 0 2px 0 rgba(255, 228, 175, 0.85), 0 -1px 0 rgba(70, 20, 0, 0.6);
  filter: drop-shadow(0 7px 4px rgba(60, 30, 8, 0.42));
  animation: plankIn 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) backwards, playBreathe 3.2s ease-in-out 1.4s infinite;
  animation-delay: 150ms, 1.4s;
}
#home .bplank-play .spinner { font-size: 14px; }
#createBtn.bplank { --i: 2; --w: 248px; --rot: 1.8deg; --dx: -12px; --kx: 78%; --gx: -40px; --paint: rgba(46, 160, 186, 0.22); }
#joinBtn.bplank   { --i: 3; --w: 226px; --rot: -1.2deg; --dx: 14px; --kx: 18%; --gx: -150px; --wood-a: #eab775; --wood-b: #c98a48; --wood-c: #9b5d28; }
#rulesBtn.bplank  { --i: 4; --w: 214px; --rot: 2.2deg; --dx: -16px; --kx: 82%; --gx: -60px; --paint: rgba(236, 110, 80, 0.2); }
#lbBtn.bplank     { --i: 5; --w: 220px; --rot: -1.8deg; --dx: 16px; --kx: 30%; --gx: -200px; --wood-a: #f1c98e; --wood-b: #d7a263; --wood-c: #ad7038; }
#friendsBtnHome.bplank { --i: 6; --w: 182px; --rot: 1.4deg; --dx: -10px; --kx: 74%; --gx: -110px; --paint: rgba(250, 210, 80, 0.22); }
#home .bplank-sm { font-size: 16.5px; --h: clamp(38px, 5.2vh, 44px); }

/* bottom row: three small boards side by side, planted in the sand at the foot of the post */
#home .sp-row {
  position: relative; z-index: 2; display: flex; justify-content: center; gap: 6px;
  width: min(380px, 100%); margin-top: 2px;
}
#home .sp-row .bplank {
  --w: auto; --dx: 0px; --h: clamp(38px, 5vh, 42px);
  flex: 1 1 0; width: auto; min-width: 0; padding: 0 6px;
  font-size: 15px; white-space: nowrap;
}
#home .sp-row .bplank::after { display: none; }
#home .sp-row #lbBtn.bplank { flex-grow: 1.08; }

/* join-code board (shown under "Join code") */
#home #joinRow.bplank-ticket {
  --i: 0; --w: 226px; --h: 46px; --rot: 0.8deg; --dx: 14px;
  --wood-a: #ecdfc6; --wood-b: #cdb792; --wood-c: #a38862;
  margin: -2px 0 0; padding: 0 7px 0 10px; gap: 7px;
  animation: ticketIn 0.45s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
#home #joinRow.bplank-ticket::after { display: none; }
#home #codeInput {
  flex: 1; min-width: 0; height: 32px; padding: 0 6px; margin: 0;
  border: 0; border-radius: 5px; outline: none;
  background: rgba(255, 251, 238, 0.62);
  box-shadow: inset 0 2px 3px rgba(70, 40, 10, 0.38), 0 1px 0 rgba(255, 244, 222, 0.7);
  color: #2e1705; font-family: "Bree Serif", Georgia, serif; font-size: 19px; letter-spacing: 5px; text-align: center; text-transform: uppercase;
  -webkit-user-select: text; user-select: text;
}
#home #codeInput:focus { background: rgba(255, 253, 244, 0.92); box-shadow: inset 0 2px 3px rgba(70, 40, 10, 0.3), 0 0 0 2px rgba(255, 196, 64, 0.9); }
#home #codeInput::placeholder { color: rgba(74, 48, 20, 0.4); letter-spacing: 3px; }
#home .bplank-mini {
  flex: none; height: 32px; padding: 0 14px; border-radius: 5px;
  font-family: "Bree Serif", Georgia, serif; font-size: 15px; color: #fff1d4;
  text-shadow: 0 -1px 0 rgba(40, 15, 0, 0.6);
  background:
    repeating-linear-gradient(90deg, rgba(40, 15, 0, 0.1) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #a8693a, #7d4519 60%, #5f3210);
  box-shadow: inset 0 1px 0 rgba(255, 210, 160, 0.45), 0 2px 0 #4a250a, 0 3px 4px rgba(40, 15, 0, 0.35);
  transition: transform 0.25s cubic-bezier(0.3, 1.8, 0.5, 1);
}
#home .bplank-mini:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 210, 160, 0.3), 0 0 0 #4a250a; transition-duration: 0.05s; }

/* tactile states: boards lift on hover, dip and twist when pressed, spring back */
@media (hover: hover) and (pointer: fine) {
  #home button.bplank:hover { translate: 0 -2px; rotate: -1.2deg; scale: 1.02; }
  #home button.bplank.arrow-l:hover { rotate: 1.2deg; }
}
#home button.bplank:active {
  translate: 0 4px; rotate: 2.4deg; scale: 0.97;
  transition-duration: 0.07s;
  filter: drop-shadow(0 2px 2px rgba(60, 30, 8, 0.4));
}
#home button.bplank.arrow-l:active { rotate: -2.4deg; }
#home button.bplank:disabled { opacity: 0.8; cursor: progress; }
#home button.bplank:focus-visible { outline: none; }
#home button.bplank:focus-visible::before { box-shadow: inset 0 0 0 3px rgba(255, 214, 80, 0.95), inset 0 -3px 0 rgba(80, 36, 8, 0.38); }

@keyframes plankIn {
  from { opacity: 0; translate: 0 -18px; }
}
@keyframes ticketIn {
  from { opacity: 0; transform: translateX(var(--dx)) rotate(-8deg) translateY(-10px); }
}
@keyframes playBreathe {
  0%, 70%, 100% { scale: 1; }
  80% { scale: 1.045; }
  90% { scale: 0.99; }
}

/* nudge: a landing CTA asks for this control next (js/landing.js) */
#home .bplank.lp-nudge { animation: lpNudge 0.75s cubic-bezier(0.3, 1.6, 0.5, 1) 3; }
@keyframes lpNudge { 0%, 100% { scale: 1; } 40% { scale: 1.07; } }
/* PLAY pressed: a short squash while the 3D camera starts its dive */
#home .bplank.is-launching { animation: lpLaunch 0.35s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
@keyframes lpLaunch { 0% { scale: 1; } 35% { scale: 0.94; } 100% { scale: 1.05; } }

/* footnote on the sand */
#home.beach .footnote {
  position: relative; flex: none; margin: 10px 0 0; padding: 0 20px;
  color: rgba(92, 56, 22, 0.62); font-size: 9.5px; line-height: 1.45; text-align: center; text-shadow: 0 1px 0 rgba(255, 240, 210, 0.6);
}
#home.beach .footnote .fine { color: rgba(92, 56, 22, 0.8); font-size: 10.5px; font-weight: 600; margin: 0; letter-spacing: 0.3px; }
html[data-home3d='on'] #home.beach .footnote,
html[data-home3d='on'] #home.beach .footnote .fine { color: rgba(255, 255, 255, 0.86); text-shadow: 0 1px 2px rgba(30, 10, 0, 0.7), 0 0 10px rgba(30, 10, 0, 0.35); }

/* ---------------------------------------------------------------- sizes */
@media (max-height: 760px) {
  #home.beach .brand-cards { display: none; }
  #home.beach .logo { font-size: 56px; }
}
@media (max-height: 640px) {
  #home.beach .logo { font-size: 46px; }
  #home.beach .tag { margin-top: 6px; }
  #home .bplank-sm { font-size: 15px; }
  #home.beach .footnote br, #home.beach .footnote .fine { display: none; }
  .beach .starfish, .beach .shell { display: none; }
}
@media (max-height: 560px) {
  #home.beach .brand { display: none; }
}
@media (min-width: 480px) and (min-height: 800px) {
  #home .signpost { gap: 13px; }
  #home .bplank { --w: 290px; font-size: 20px; }
  #home .bplank-name { --w: 270px; }
  #home .bplank-play { --w: 340px; font-size: 54px; }
  #createBtn.bplank { --w: 290px; }
  #joinBtn.bplank, #home #joinRow.bplank-ticket { --w: 262px; }
  #rulesBtn.bplank { --w: 246px; }
  #lbBtn.bplank { --w: 252px; }
  #friendsBtnHome.bplank { --w: 214px; }
  #home .bplank-sm { font-size: 18px; }
  #home .sp-row { width: min(420px, 100%); gap: 8px; }
  #home .sp-row .bplank { font-size: 16.5px; }
  #home.beach .logo { font-size: 74px; }
  .beach .palm-l { left: -20px; width: 180px; }
  .beach .palm-r { right: -20px; width: 130px; }
}

/* desktop: pitch copy on the left, the signpost on the right over the 3D scene */
@media (min-width: 900px) {
  #home.beach .home-inner {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); grid-template-rows: auto 1fr auto;
    column-gap: 5vw; align-items: center;
    padding: calc(84px + var(--safe-top)) clamp(32px, 6vw, 110px) calc(18px + var(--safe-bottom));
  }
  #home.beach .brand { grid-column: 1; grid-row: 1; justify-self: start; align-self: start; text-align: left; margin: 0; }
  #home.beach .brand-cards { justify-content: flex-start; }
  #home .app-pitch { grid-column: 1; grid-row: 2; align-self: end; padding-bottom: 4vh; }
  #home .signpost { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; padding-top: 14px; }
  #home.beach .footnote { grid-column: 1 / -1; grid-row: 3; text-align: left; padding: 0; margin-top: 12px; }
}

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  #home.beach *, #home.beach *::before, #home.beach *::after { animation: none !important; }
  #home .bplank { transition-duration: 0.01s; }
  .beach .sparkle { opacity: 0.7; }
  .beach .foam.f1 { opacity: 0.8; }
}
