@font-face {
  font-family: "Lilita One";
  src: url("assets/fonts/LilitaOne-Regular.ttf?v=f5b641c45c69") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: "Lilita One", "Trebuchet MS", sans-serif;
  font-synthesis: none;
  color: #482c19;
  background: #19252a;
  --viewport-height: 100vh;
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --app-height: calc(var(--viewport-height) - var(--safe-top) - var(--safe-bottom));
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --scene-width: min(100vw, 480px);
  --stage-width: calc(var(--scene-width) - var(--safe-left) - var(--safe-right));
  --card-width: min(calc(var(--stage-width) * .70), 36svh);
  --brand-height: calc(var(--stage-width) * .47);
  --nav-size: calc(var(--stage-width) * .32);
  --ink: #482c19;
  --deep-sea: #192f3a;
  --cream: #fff0ce;
  --focus: #fff0b6;
  scrollbar-color: #ad8354 #19252a;
  scrollbar-width: thin;
}
* { box-sizing: border-box; }
/* Lilita One covers Latin only. For the CJK languages hub-i18n.js serves, name the
   platform fonts explicitly so every glyph of a string falls back to the same face
   instead of the browser default, which may be serif. */
:root:lang(ja) { font-family: "Lilita One", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Noto Sans CJK JP", sans-serif; }
/* Japanese never breaks a line before a small kana or a prolonged sound mark. */
:root:lang(ja) { line-break: strict; }
:root:lang(ko) { font-family: "Lilita One", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
:root:lang(zh-Hans) { font-family: "Lilita One", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
:root:lang(zh-Hant) { font-family: "Lilita One", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", sans-serif; }
@supports (height: 100dvh) { :root { --viewport-height: 100dvh; } }
/* The portal is an app viewport. Its layouts must fit; overflow is not navigation. */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: pan-x pan-y; }
body { margin: 0; height: var(--viewport-height); background: #192f3a; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: #19252a; }
*::-webkit-scrollbar-thumb { background: #ad8354; border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: #d4a973; }
@media (forced-colors: active) { :root { scrollbar-color: auto; } }
a { color: inherit; }
button, input { font: inherit; }
a, button, input { -webkit-tap-highlight-color: transparent; touch-action: pan-x pan-y; }
a:focus-visible, button:focus-visible { outline: 3px solid #fff0b6; outline-offset: 3px; }
img { display: block; max-width: 100%; }
/* Android Chrome opens its image menu on a held press. In the shell the picture
   is decoration; the link behind it still receives the tap. */
html.shell img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}
h1, h2, h3, p { margin: 0; font-weight: 400; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 20; padding: 12px 20px; background: #fff3d3; }
.skip-link:focus { top: 12px; }

/* Layout follows the generated portrait lobby. Text sits on modeled faces. */
.voyage {
  --stage-width: calc(var(--scene-width) - var(--safe-left) - var(--safe-right));
  --picker-top: max(calc(var(--brand-height) + 12px), calc(46svh - var(--card-height) * .5));
  --card-height: calc(var(--card-width) * 1.2);
  --play-height: calc(var(--card-width) * 1.04 * 338 / 900);
  position: relative;
  isolation: isolate;
  width: var(--scene-width);
  height: var(--viewport-height);
  min-height: 0;
  margin-inline: auto;
  overflow: clip;
  background: #795033 url("assets/lobby/lobby-scene.webp?v=e77a4c9026a2") center bottom / cover no-repeat;
  box-shadow: 0 0 64px #07151e80;
}
/* Phone scenery reaches the display edges; wide windows retain the portrait scene.
   The frame always covers the full height, while only controls avoid cutouts. */
.app-content {
  position: relative;
  z-index: 1;
  top: var(--safe-top);
  left: calc((var(--safe-left) - var(--safe-right)) / 2);
  width: var(--stage-width);
  height: var(--app-height);
  margin-inline: auto;
}
/* hub-reveal.js adds .js before first paint and .is-loaded after every layer decodes. */
.js .voyage { opacity: 0; pointer-events: none; visibility: hidden; }
.js .voyage:not(.is-loaded) .card { visibility: hidden !important; }
.js .voyage.is-loaded { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .25s ease; }
.harbor-loader { display: none; }
.js .harbor-loader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; color: var(--cream); background: radial-gradient(ellipse at 50% 44%, #315566, var(--deep-sea) 65%); transition: opacity .28s ease, visibility .28s; }
html.shell .js .harbor-loader { background: #041422 var(--shell-splash) center / cover no-repeat; }
.loader-compass { position: relative; width: 166px; height: 166px; display: grid; place-items: center; }
.loader-compass::before, .loader-compass::after { content: ""; position: absolute; inset: -14px; border: 1px solid #d4ae7040; border-radius: 50%; }
.loader-compass::after { inset: -25px; border-style: dashed; opacity: .5; }
.loader-compass img { width: 150px; height: 150px; filter: drop-shadow(0 10px 6px #07151e77); animation: helm-turn 3.4s ease-in-out infinite; }
.harbor-loader p { font-size: 19px; letter-spacing: .04em; }
.js .harbor-loader.is-finished { opacity: 0; visibility: hidden; pointer-events: none; }
.harbor-loader.is-finished .loader-compass img { animation: none; }
@keyframes helm-turn { 0% { transform: rotate(-22deg); } 45% { transform: rotate(155deg); } 70% { transform: rotate(133deg); } 100% { transform: rotate(338deg); } }
.masthead { position: relative; height: var(--brand-height); z-index: 2; }
.lobby-scenery, .ship-foreground { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; pointer-events: none; user-select: none; }
.lobby-scenery { z-index: -2; }
.lobby .masthead { position: absolute; inset: 0 0 auto; }
.brand { position: relative; display: block; width: 100%; height: 100%; background: url("assets/lobby/treasure-bay-title.webp?v=ccc35263945f") center / contain no-repeat; text-decoration: none; filter: drop-shadow(0 6px 3px #37261755); }
.lobby {
  --brand-height: min(calc(var(--stage-width) * .47), calc(var(--app-height) * .24));
  --card-width: min(calc(var(--stage-width) * .70), calc(var(--app-height) * .32));
  --nav-size: min(calc(var(--stage-width) * .32), calc(var(--app-height) * .16));
  --picker-top: max(calc(var(--brand-height) + var(--app-height) * .014), calc(var(--app-height) * .46 - var(--card-height) * .5));
  overflow: clip;
}
.lobby::after { content: ""; position: absolute; inset: 35% 0 0; z-index: 0; pointer-events: none; background: linear-gradient(transparent, #19252a24 42%, #17263070); }
.catalog { position: relative; z-index: 3; padding-top: var(--picker-top); padding-bottom: 0; }
.shelf-empty { margin: 24px auto 0; width: min(78%, 460px); text-align: center; color: #fff0ce; font-size: clamp(15px, calc(var(--stage-width) * .042), 19px); line-height: 1.35; text-shadow: 0 2px 3px #10202c; }
.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; width: var(--card-width); margin: auto; }
.card { position: relative; display: block; width: 100%; aspect-ratio: 5 / 6; text-decoration: none; cursor: pointer; -webkit-user-drag: none; user-select: none; }
.art { position: absolute; left: 18%; top: 17%; width: 64%; height: 54%; background: #7ca7bd var(--game-art, url("assets/lobby/lobby-scene.webp?v=e77a4c9026a2")) center 38% / cover no-repeat; }
.card[data-game-id="harbor-rush-2d"] .art { background-color: #758d80; background-position: center top; }
/* The build still writes the frame element into every card; no page draws it any more. */
.card-sculpt { display: none; }
/* Center on the plaque's flat face (79.5% of the frame), excluding its lower bevel. */
.title { position: absolute; left: 18%; top: 73%; width: 64%; height: 13%; display: flex; align-items: center; justify-content: center; text-align: center; font-size: calc(var(--card-width) * .078); line-height: .95; text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; color: #482914; text-shadow: 0 1px #ffe0a4; }

/* The status plaque rides the card's upper-right fitting and never intercepts swipes. */
.card-beta { position: absolute; z-index: 2; top: 7%; right: 0; width: 34%; aspect-ratio: 9 / 4; background: url("assets/lobby/beta-card-badge.webp?v=977a29e01a47") center / contain no-repeat; transform: rotate(8deg); filter: drop-shadow(0 2px 1px #21180b66); pointer-events: none; user-select: none; }
/* Staging-only playtest serial, on the opposite fitting from the beta plaque so
   a beta game under test still shows both. Red so it reads as a tester's mark,
   not part of the cover, and stays legible over any art. */
/* Notion numbers these, so a serial is often a single digit. The minimum keeps
   the plaque square instead of collapsing onto the number. */
.card-serial { position: absolute; z-index: 2; top: 8%; left: 6%; min-width: calc(var(--card-width) * .075); padding: 2px 9px 3px; text-align: center; border: 2px solid #d4ad70; border-radius: 7px; background: linear-gradient(#c9372a, #8f1d14); color: #ffeec7; font-size: calc(var(--card-width) * .052); line-height: 1.15; letter-spacing: .04em; white-space: nowrap; text-shadow: 0 1px 2px #3b0a05; box-shadow: 0 2px 0 #654323, inset 0 1px 0 #e9786b; transform: rotate(-6deg); pointer-events: none; user-select: none; }
/* The exposed neighbors are the affordance. Stable edge buttons make their
   entire strip tappable, without relying on hit testing a rotating 3D plane. */
/* The original generation is preserved. Clip its residual exterior haze at the solid plaque edge. */

/* Separate deck objects, with generous touch targets and no app tab bar. */
.rail { position: absolute; bottom: min(16px, calc(var(--app-height) * .028)); left: 50%; transform: translateX(-50%); width: min(100%, var(--stage-width)); z-index: 30; display: flex; justify-content: space-between; padding-inline: 14px; pointer-events: none; }
.item { position: relative; display: block; width: var(--nav-size); height: var(--nav-size); filter: drop-shadow(0 6px 0 #172e42) drop-shadow(0 15px 5px #101a20a0); text-decoration: none; pointer-events: auto; transition: transform .16s ease, filter .16s ease; transform: translateY(-7px); cursor: pointer; }
.item img { width: 100%; height: 100%; object-fit: contain; }
.item .nav-base { position: absolute; inset: 0; pointer-events: none; }
/* The prop's label sits on the chin band of the text-free plaque (rows 58-88% of the art). */
.nav-label { position: absolute; left: 12%; right: 12%; top: 59%; height: 27%; display: flex; align-items: center; justify-content: center; color: #f3e3c3; font-size: calc(var(--nav-size) * .19); line-height: 1; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-shadow: 0 2px 0 #6b3f17, 0 3px 2px #2a180a66; pointer-events: none; }
.item[data-nav="discord"] .nav-label { left: 20%; right: 4%; }
:root:is(:lang(ja), :lang(ko), :lang(zh-Hans), :lang(zh-Hant)) .nav-label { letter-spacing: 0; font-weight: 800; font-synthesis: weight; }
.nav-mechanism { position: absolute; display: block; pointer-events: none; filter: drop-shadow(0 3px 1px #15202c88); }
.nav-compass { left: 17%; top: -1%; width: 68%; height: 68%; transform: perspective(320px) rotateY(13deg) rotateX(10deg) rotateZ(5deg); }
/* The rail holds two deck objects: the Discord prop on the left (a plaque under the Clyde mark, opening the community invite in a new tab; the invite comes from portal/community-links.json at build time) and Profile on the right. */
.nav-clyde { left: 28%; top: 12%; width: 44%; height: 44%; transform: perspective(320px) rotateY(-6deg) rotateX(9deg); }
.nav-clyde svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 4px 0 #8c6a3f); }
.nav-rotor { transform-origin: center; }
.voyage.is-loaded .nav-compass .nav-rotor { animation: profile-bearings 7.6s ease-in-out infinite; animation-delay: -2.4s; }
.voyage.is-loaded .nav-clyde .nav-rotor { animation: discord-nod 5.2s ease-in-out infinite; animation-delay: -1.1s; }
.voyage.is-loaded .item:active .nav-rotor { animation-play-state: paused; }
@keyframes discord-nod { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-4%) rotate(-5deg); } 62% { transform: translateY(0) rotate(4deg); } }
@keyframes profile-bearings { 0%, 16%, 100% { transform: rotate(-12deg); } 38% { transform: rotate(34deg); } 55% { transform: rotate(-23deg); } 70%, 84% { transform: rotate(2deg); } }
.item[aria-current="page"] { transform: translateY(-12px); }
.item:active { transform: translateY(2px) scale(.94); filter: drop-shadow(0 2px 0 #172e42) drop-shadow(0 5px 2px #101a2077); }

.profile-main { padding: 2px 22px 0; margin: auto; }
.profile-intro { text-align: center; margin-bottom: 18px; }
.profile-portrait { width: 82px; height: 82px; overflow: hidden; margin: 0 auto 9px; border: 6px ridge #bb8954; border-radius: 7px; box-shadow: 0 5px 4px #2a1d1588; }
.profile-portrait img { width: 100%; height: 100%; object-fit: cover; transform: scale(2); transform-origin: 36% 43%; }
.profile-intro h1 { color: #fff0d4; font-size: 32px; -webkit-text-stroke: 1px #603b20; paint-order: stroke fill; text-shadow: 0 3px #603b20, 0 4px 3px #392316; }
.panel { background: linear-gradient(110deg, #f1d5a6, #dfba84); border: 7px ridge #ae7c48; border-radius: 7px; box-shadow: 0 5px 0 #67432c, 0 8px 8px #30211666, inset 0 2px 5px #885c3944; padding: 15px; margin-bottom: 18px; color: #482d1b; }
.panel h2 { font-size: 19px; margin-bottom: 8px; }
.muted { font-size: 14px; line-height: 1.5; color: #4a3525; }
.id { font: 12px/1.6 ui-monospace, Consolas, monospace; overflow-wrap: anywhere; color: #4a3525; }
.usage-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
.usage-head h2 { margin: 0; }
.switch { position: relative; display: block; width: 55px; height: 44px; flex: none; }
.switch input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track { display: block; position: absolute; top: 7px; width: 55px; height: 30px; border-radius: 5px; background: #88745d; border: 2px solid #644c37; box-shadow: inset 0 2px 3px #37251688; }
.switch .track::before { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 3px; background: #f8dab0; border: 3px outset #f1c993; box-shadow: 0 2px 2px #211d1888; transition: transform .15s ease; }
.switch input:checked + .track { background: #325677; border-color: #25445f; }
.switch input:checked + .track::before { transform: translateX(25px); }
.switch input:focus-visible + .track { outline: 3px solid #264f69; outline-offset: 3px; }
#usage-note { margin-top: 6px; }
.profile-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; color: #284e6b; margin-top: 7px; text-underline-offset: 4px; font-size: 15px; }
.site-footer { display: flex; justify-content: center; padding: 0 20px calc(var(--nav-size) + 20px + var(--safe-bottom)); }
.site-footer a { padding: 12px 18px; background: #ebcca1; border: 3px ridge #aa794c; border-radius: 4px; font-size: 12px; text-underline-offset: 3px; box-shadow: 0 3px 3px #3a231b88; }
/* The mobile affordance is idle motion + contact feedback; a pointer also gets a lift. */
@media (hover: hover) {
  .item:hover { transform: translateY(-10px); }
  .item[aria-current="page"]:hover { transform: translateY(-12px); }
}
@media (max-width: 359px) {
  .profile-main { padding-inline: 15px; }
  .panel { padding: 12px; }
}
/* Shared art surface: source-pixel slices; one corner scale preserves modeled bevels.
   Transparent source margins are compensated by the owning asset's insets. */
.art-panel { position: relative; isolation: isolate; }
.art-panel::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: var(--art-inset, 0);
  border-style: solid; border-color: transparent;
  border-width: 0;
  border-image-source: var(--art-source);
  border-image-slice: var(--art-slices) fill;
  border-image-width: var(--art-border-width); border-image-repeat: stretch;
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Star button (the lobby and feed.html): one look in both views. Pages place and
   size it; it always sits on the lower right corner of the cover. */
.fav-btn { position: absolute; z-index: 3; aspect-ratio: 1; border-radius: 50%; border: 2px solid #d9b27c; padding: 0; display: grid; place-items: center; background: linear-gradient(#f8e7c6, #dfbb86); color: #8a5a30; opacity: .78; box-shadow: 0 2px 0 #6b3f17, 0 4px 4px #21180b66; cursor: pointer; }
.fav-btn svg { width: 58%; height: 58%; fill: none; stroke: currentColor; stroke-width: 2.4; }
.fav-btn[aria-pressed="true"] { color: #f5b301; opacity: 1; }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; stroke: #8a5200; }
.fav-btn:focus-visible { outline: 3px solid #fff0b6; outline-offset: 2px; }
/* Catalog view switch (the lobby and feed.html): two live-text tabs on a
   blue deck plaque. The lobby does not carry it. Pages place it; this is the look. */
.view-switch { position: absolute; z-index: 40; display: flex; gap: 2px; padding: 3px; border: 2px solid #d9b27c; border-radius: 999px; background: #0b1a22c8; box-shadow: 0 3px 0 #5a3a1c, 0 6px 8px #00000080; }
.view-switch a { display: flex; align-items: center; min-height: 32px; padding: 0 calc(var(--stage-width) * .03); border-radius: 999px; color: #f3e3c3; font-size: calc(var(--stage-width) * .03); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; text-shadow: 0 1px 0 #3a2616; white-space: nowrap; }
.view-switch a[aria-current="page"] { background: linear-gradient(#4a86c9, #2b5a93 60%, #1f4574); box-shadow: inset 0 1px 0 #bcd8ff, 0 1px 0 #112c46; }
.view-switch a:focus-visible { outline: 3px solid #fff0b6; outline-offset: 2px; }
/* Without a connection the shell app shows the lobby from the device (its list says "offline").
   A game whose files are not on the device is marked "away": greyed, with a no-connection
   mark over its cover. The card keeps its title, dimmed, so the game can still be told apart;
   nothing is written on it about the connection. A tap says why (hub-shelf.js, dvOfflineHint). */
.card[data-away] .art, .f-page.is-away .f-art { filter: grayscale(1) brightness(.5); }
.card[data-away] .title, .f-page.is-away .f-title { opacity: .55; }
.card[data-away] .card-beta, .f-page.is-away .card-beta { opacity: .35; }
.card[data-away]::after, .f-page.is-away .f-cover::after { content: ""; position: absolute; z-index: 3; left: 50%; top: 50%; width: 38%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #12242ecc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3e3c3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 8.5a15 15 0 0 1 5-3M22 8.5a15 15 0 0 0-9.500-3.900M5.500 12.500a10 10 0 0 1 4-2.400M18.500 12.500a10 10 0 0 0-3-2M9 16.200a5 5 0 0 1 6 0M12 19.500h.01M3 3l18 18'/%3E%3C/svg%3E") center / 62% no-repeat; box-shadow: 0 0 0 2px #f3e3c3; pointer-events: none; }
.offline .rail a[data-nav="discord"] { display: none; }
.hub-hint { position: absolute; z-index: 60; left: 50%; bottom: 24%; transform: translateX(-50%); max-width: 84%; margin: 0; padding: 10px 16px; border-radius: 14px; background: #12242ef2; box-shadow: 0 0 0 2px #7a4e26, 0 0 0 3.5px #f3e3c3, 0 8px 18px #0008; color: #fff0ce; font-size: 15px; line-height: 1.3; text-align: center; text-wrap: balance; pointer-events: none; }
.hub-hint[hidden] { display: none; }
/* The shell app asks once before it updates games over mobile data (hub-updates.js). It sits
   over the lobby above the rail and does not cover the games: a player may leave it unanswered. */
.hub-updates { position: absolute; z-index: 61; left: 50%; bottom: calc(var(--nav-size) + 22px); transform: translateX(-50%); box-sizing: border-box; width: min(86%, 380px); padding: 14px 16px 12px; border-radius: 16px; background: #12242ef5; box-shadow: 0 0 0 2px #7a4e26, 0 0 0 3.5px #f3e3c3, 0 10px 22px #0009; color: #fff0ce; text-align: center; }
.hub-updates[hidden] { display: none; }
.hub-updates p { margin: 0; line-height: 1.3; text-wrap: balance; }
.hub-updates-title { font-size: 16px; font-weight: 800; }
.hub-updates-question { margin-top: 4px !important; font-size: 14px; color: #f3e3c3; }
.hub-updates-actions { display: flex; gap: 10px; margin-top: 12px; }
.hub-updates-actions button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 8px 10px; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 800; line-height: 1.15; cursor: pointer; }
.hub-updates-later { color: #f3e3c3; background: #0b1a22; border: 2px solid #7a4e26; }
.hub-updates-go { color: #3a2408; background: linear-gradient(#ffe29a, #f0b64a); border: 2px solid #7a4e26; box-shadow: inset 0 1px 0 #fff6d8; }
