:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  color: #29352c;
  background: #171c17;
  --visible-height: 100dvh;
  --visible-top: 0px;
}
* { box-sizing: border-box }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none }
main { position: fixed; inset: 0; isolation: isolate; overflow: hidden; background: #171c17 }
video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; pointer-events: none }
button, input { font: inherit }
button { cursor: pointer }
[hidden] { display: none !important }
#start { position:absolute; inset:0; width:100%; height:100%; display:grid; place-items:center; background:none; border:0; color:#fff; padding:0; -webkit-tap-highlight-color:transparent }
#play-symbol { display:grid; place-items:center; width:58px; height:58px; border-radius:50%; padding-left:3px; background:#17201988; font-size:24px; line-height:1; backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
#start[data-playing="true"] #play-symbol { opacity:0 }
#start[data-playing="true"]:focus-visible #play-symbol { opacity:1 }
#start:focus-visible { outline-offset:-5px }
dialog {
  position: fixed; inset: auto 0 auto; margin: 0 auto;
  top: calc(var(--visible-top) + var(--visible-height) - max(23px, calc(env(safe-area-inset-bottom) + 10px)));
  transform: translateY(-100%); width: min(calc(100% - 32px), 360px);
  max-width: none; max-height: calc(var(--visible-height) - 40px); overflow: auto;
  padding: 3px; border: 0; outline: 0; background: transparent; color: #354636;
  text-align: center; overscroll-behavior: contain;
}
dialog[open] { animation: rise .64s cubic-bezier(.16,.78,.22,1) both }
dialog::backdrop { background: transparent }
@keyframes rise { from { opacity: 0; transform: translateY(calc(-100% + 54px)); } to { opacity: 1; transform: translateY(-100%); } }
.companion-row { display:grid; grid-template-columns:minmax(0,1fr) 64px; gap:8px; align-items:center }
.companion-qr { margin:0; display:grid; justify-items:center; gap:1px; color:#50614d; font-size:10px; line-height:1.25 }
.companion-qr img { width:64px; height:64px; display:block; border-radius:5px; image-rendering:pixelated; box-shadow:0 1px 6px #394e3a18 }
@media (max-width:350px) {
  .companion-row { gap:5px }
  #invite-form input { padding-inline:9px }
  #invite-form .primary { padding-inline:8px; min-width:49px }
}
.ripple-shell {
  position: relative; isolation: isolate; border-radius: 32px;
  background: linear-gradient(112deg, #fffdf64d, #f5f6df25 56%, #e6eddb42);
  box-shadow: inset 0 1px 0 #fffdf1a6, 0 4px 12px #4457450b;
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.waterline { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; pointer-events: none; }
.waterline-base { stroke: url(#shell-line); stroke-width: 1; opacity: .94 }
.waterline-shimmer { stroke: #a6bda4; stroke-width: 2; stroke-linecap: round; opacity:.76; stroke-dasharray: 10 90; animation: current 6.4s linear infinite; }
.waterline-crest { stroke: #fffdf1; stroke-width: 1.25; stroke-linecap: round; stroke-dasharray: 5 95; stroke-dashoffset: -3; animation: crest 6.4s linear infinite; }
@keyframes current { to { stroke-dashoffset: -100; } }
@keyframes crest { to { stroke-dashoffset: -103; } }
#invite-form { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1fr) auto 44px; align-items:center; gap: 5px; padding: 9px 8px 9px 9px; min-height: 64px }
input { min-width:0; width:100%; height:44px; border:1px solid #8c9a802f; border-radius:24px; background:#fffdf26b; padding: 8px 13px; font-size:16px; color:#314332; }
input::placeholder { color:#5b6657 }
.primary { height:44px; min-width:58px; border:1px solid #869b7a70; border-radius:24px; padding:8px 12px; background:linear-gradient(126deg,#fffef57d 4%,#e8edd79c 60%,#c5d7b78f); box-shadow:inset 0 1px 0 #fffef5b2; color:#344a36; font-size:14px; }
.primary:disabled { opacity:.65 }
.replay { display:grid; place-items:center; width:44px; height:44px; border:0; border-radius:50%; padding:0; background:transparent; color:#576b57; -webkit-tap-highlight-color:transparent }
.replay:hover { color:#243f2a }
#status { margin:7px 0 0; color:#374538; font-size:12px; line-height:1.5; background:#fffaf0e8; border-radius:12px; padding:3px 7px; }
#status:empty { display:none }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap }
:focus-visible { outline: 2px solid #536b4e; outline-offset: 2px }
dialog:focus-visible { outline: none }
@media (min-aspect-ratio: 4/5) and (min-width: 660px) {
  main::before { content:""; position:absolute; inset:-60px; background:#201f1b url('./assets/poster.jpg') center/cover no-repeat; filter:blur(44px) brightness(.55) }
  body:has(dialog[open]) main::before { background:#eee6d6; filter:none }
  video { object-fit:contain; object-position:center }
}
@media (prefers-reduced-motion:reduce) { dialog[open], .waterline-shimmer, .waterline-crest { animation:none } }
