@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@property --bg { syntax: "<color>"; inherits: true; initial-value: #e6e4e0; }
@property --aksen { syntax: "<color>"; inherits: true; initial-value: #8a8f9c; }

:root { --bg: #e6e4e0; --aksen: #8a8f9c; --tinta: #23232b; transition: --bg 1.1s ease, --aksen .8s ease; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #e6e4e0; color: var(--tinta); font-family: "Fredoka", ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif; font-weight: 500;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

/* seamless studio cove: no horizon, only a soft pool of light where the floor would be */
#bg { position: fixed; inset: 0; z-index: 0; background:
  radial-gradient(ellipse 62% 42% at 50% 70%, rgba(255,255,255,.62) 0%, rgba(255,255,255,.2) 45%, rgba(255,255,255,0) 72%),
  linear-gradient(180deg, color-mix(in srgb, var(--bg) 84%, #5c6074) 0%, var(--bg) 40%, color-mix(in srgb, var(--bg) 92%, #fff) 66%, color-mix(in srgb, var(--bg) 86%, #6a6460) 100%); }
#vig { position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at 50% 48%, rgba(255,255,255,0) 52%, rgba(40,34,52,.13) 100%); }
canvas#layar { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 3; touch-action: none; }
#veil { position: fixed; inset: 0; z-index: 9; background: #f6f5f2; pointer-events: none; opacity: 1; transition: opacity 1.6s ease; }
#veil.buka { opacity: 0; }

/* the buddy's name, huge and soft, BEHIND the buddy */
#bigname { position: fixed; left: 0; right: 0; top: 13%; z-index: 1; text-align: center; font-weight: 700; line-height: .9; letter-spacing: -.02em; white-space: nowrap; color: var(--aksen); pointer-events: none; }
#bigname span { display: inline-block; opacity: 0; transform: translateY(.28em) scale(.86); filter: blur(10px); transition: opacity .55s ease, transform .7s cubic-bezier(.2,.9,.3,1.25), filter .55s ease; }
#bigname.ada span { opacity: .26; transform: none; filter: blur(0); }
#bigname.terang span { opacity: .92; }
#bigname.pergi span { opacity: 0; transform: translateY(-.16em) scale(1.04); filter: blur(8px); transition-duration: .28s; }

/* floating panel: lives in the 3D space behind the buddy, swoops in, flies away */
#ruang { position: fixed; inset: 0; z-index: 2; perspective: 1500px; perspective-origin: 50% 40%; pointer-events: none; }
.apung { position: absolute; left: 50%; top: 4.5%; width: min(88vw, 1000px); height: 53%; transform: translateX(-50%); transform-style: preserve-3d; animation: apung 6s ease-in-out infinite; }
@keyframes apung { 0%, 100% { transform: translateX(-50%) translateY(0) rotateX(2.5deg) rotateY(-1.2deg); } 50% { transform: translateX(-50%) translateY(-9px) rotateX(1.2deg) rotateY(1.2deg); } }
.panel { position: absolute; inset: 0; border-radius: 34px; padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(160deg, rgba(255,255,255,.9), rgba(255,255,255,.66)); border: 1.5px solid rgba(255,255,255,.95);
  box-shadow: 0 40px 80px -30px rgba(40,34,60,.38), 0 8px 22px -10px rgba(40,34,60,.2), inset 0 0 0 1px rgba(30,30,50,.04);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  opacity: 0; transform: translate3d(-34vw, -44vh, -1500px) rotateX(58deg) rotateY(-46deg) rotateZ(-8deg) scale(.5); transform-origin: 50% 60%;
  transition: transform .95s cubic-bezier(.16,.95,.22,1.08), opacity .45s ease; pointer-events: none; }
.panel.masuk { opacity: 1; transform: none; pointer-events: auto; }
.panel.pergi { opacity: 0; transform: translate3d(38vw, -52vh, -1700px) rotateX(-46deg) rotateY(58deg) rotateZ(10deg) scale(.42); transition: transform .7s cubic-bezier(.5,0,.8,.4), opacity .5s ease .15s; }
.panel-judul { text-align: center; font-size: 13px; letter-spacing: .26em; text-transform: uppercase; opacity: .5; font-weight: 700; }
.kisi { flex: 1; min-height: 0; display: flex; flex-wrap: wrap; justify-content: center; align-content: space-evenly; }
.kisi button { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 12.5%; min-height: 0; transition: transform .16s; }
.kisi button:active { transform: scale(.92); }
.kisi i { display: block; height: min(8.2vh, 9vw); aspect-ratio: 1; border-radius: 50%; background-size: 118%; background-position: 50% 42%; box-shadow: 0 6px 14px -6px rgba(30,30,50,.35), inset 0 0 0 3px rgba(255,255,255,.9); }
.kisi button.kini i { box-shadow: 0 6px 14px -6px rgba(30,30,50,.35), inset 0 0 0 3px rgba(255,255,255,.9), 0 0 0 4px var(--aksen); }
.kisi b { font-size: clamp(11px, 1.5vh, 15px); font-weight: 700; opacity: .78; }

/* quiet controls at the edges */
#ui { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
#ui > * , #ui button { pointer-events: auto; }
.atas { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 18px; right: 18px; height: 40px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; pointer-events: none !important; }
.label { position: absolute; left: 0; right: 0; text-align: center; font-size: 13px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; opacity: 0; transform: translateY(-8px); transition: opacity .7s, transform .7s; pointer-events: none !important; }
.bulat { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.8);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 16px -8px rgba(30,30,50,.3); color: #3a3a46; transition: transform .15s, opacity .5s, background .2s; }
.bulat svg { width: 22px; height: 22px; fill: currentColor; }
.bulat:active { transform: scale(.9); }
.bulat.kecil { width: 40px; height: 40px; opacity: .7; } .bulat.kecil svg { width: 19px; height: 19px; }
#tSuara .off { display: none; } #tSuara.bisu .on { display: none; } #tSuara.bisu .off { display: block; }
.panah { position: absolute; top: 50%; margin-top: -24px; opacity: 0; }
.panah.kiri { left: max(16px, env(safe-area-inset-left)); } .panah.kanan { right: max(16px, env(safe-area-inset-right)); }
.bawah { position: absolute; left: 0; right: 0; bottom: max(20px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0 18px; pointer-events: none !important; }
.info { display: flex; align-items: center; gap: 10px; font-size: 15px; opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; pointer-events: none !important; }
.info.ada { opacity: .78; transform: none; }
.langka { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #fff; padding: 4px 11px; border-radius: 999px; background: #8c97a6; }
.langka.rare { background: #2f8cff; } .langka.epic { background: linear-gradient(100deg, #f0a020, #ff5a7a 60%, #9a5cff); }
.langka.legendary { background: linear-gradient(100deg, #18d6c0, #4d8dff 22%, #b86bff 44%, #ff6fb0 62%, #ffcf4a 80%, #18d6c0) 0 50% / 200% 100%; animation: kilau 3.2s linear infinite; }
@keyframes kilau { to { background-position: 200% 50%; } }
/* captions like our video subtitles: short chunk, big, bold, outlined so it reads on any backdrop, spoken word in yellow */
.cap { min-height: 2.4em; max-width: min(720px, 94vw); display: flex; flex-wrap: wrap; align-items: center; align-content: flex-end; justify-content: center; gap: 0 .3em; text-align: center;
  font-weight: 700; font-size: clamp(25px, 2.4vmin + 15px, 40px); line-height: 1.16; letter-spacing: .01em; color: #fff; opacity: 0; transition: opacity .25s; pointer-events: none !important;
  text-shadow: 2.5px 0 0 #23232b, -2.5px 0 0 #23232b, 0 2.5px 0 #23232b, 0 -2.5px 0 #23232b, 1.8px 1.8px 0 #23232b, -1.8px 1.8px 0 #23232b, 1.8px -1.8px 0 #23232b, -1.8px -1.8px 0 #23232b, 0 5px 0 rgba(35,35,43,.9), 0 9px 14px rgba(20,20,40,.28); }
.cap.ada { opacity: 1; }
.cap.pop { animation: capPop .16s cubic-bezier(.3,1.4,.5,1); } @keyframes capPop { from { transform: scale(.9); } }
.cap span { display: inline-block; transition: color .06s, transform .1s; } .cap span.kini { color: #ffd84a; transform: scale(1.1); }
.baris { display: flex; align-items: center; gap: 14px; opacity: 0; transform: translateY(14px); transition: opacity .6s, transform .6s cubic-bezier(.2,.9,.3,1.2); }
.pilih { height: 56px; padding: 0 30px; border-radius: 999px; font-size: 20px; font-weight: 700; color: #fff; background: var(--tinta); box-shadow: 0 14px 26px -12px rgba(20,20,40,.55); transition: transform .15s; }
.pilih:active { transform: scale(.94); }
.hitung { width: 48px; text-align: center; font-size: 13px; font-weight: 700; opacity: .45; letter-spacing: .04em; white-space: nowrap; }
body.pilihan .label, body.pilihan .baris { opacity: .62; transform: none; } body.pilihan .baris { opacity: 1; }
body.pilihan .panah { opacity: .85; }
body:not(.pilihan) .baris, body:not(.pilihan) .panah { pointer-events: none !important; } body:not(.pilihan) .baris button { pointer-events: none; }
body.panelbuka .panah, body.panelbuka .info, body.panelbuka .cap, body.panelbuka .label { opacity: 0 !important; }
#tGanti { display: none; } body.rumah #tGanti { display: flex; }

/* talk to the buddy: type (always there) or hold the mic */
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
.bawah { bottom: calc(max(20px, env(safe-area-inset-bottom)) + var(--kb, 0px)); }
.obrol { display: none; align-items: center; justify-content: center; gap: 10px; width: min(620px, 100%); pointer-events: auto; }
.obrol input, .obrol #tKirim { display: none; } .obrol.ketik input { display: block; } .obrol.ketik #tKirim { display: flex; }
.anak { display: none; max-width: min(560px, 88vw); min-height: 1.3em; text-align: center; font-size: 16px; font-style: italic; color: rgba(35,35,43,.62); opacity: 0; transition: opacity .25s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; pointer-events: none !important; }
body.rumah .anak { display: block; } .anak.ada { opacity: 1; }
body.rumah .obrol { display: flex; } body.rumah .baris { display: none; }
.obrol input { flex: 1; min-width: 0; height: 52px; padding: 0 20px; border-radius: 999px; font-size: 18px; background: rgba(255,255,255,.72); border: 1px solid rgba(255,255,255,.95); outline: none;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 6px 16px -8px rgba(30,30,50,.3); }
.obrol input::placeholder { color: rgba(40,40,60,.42); }
.obrol input:focus { background: rgba(255,255,255,.94); }
.mik { flex: none; width: 86px; height: 86px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--tinta); box-shadow: 0 14px 26px -12px rgba(20,20,40,.55); transition: transform .15s, background .2s, box-shadow .2s; touch-action: none; }
.mik svg { width: 38px; height: 38px; fill: currentColor; pointer-events: none; }
.mik.dengar { background: #e8384f; transform: scale(1.12); animation: denyut 1s ease-in-out infinite; }
@keyframes denyut { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,56,79,.45); } 50% { box-shadow: 0 0 0 18px rgba(232,56,79,0); } }
.mik.tiada { display: none; }
.foto { flex: none; width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--tinta); background: rgba(255,255,255,.78); border: 1px solid rgba(255,255,255,.95); box-shadow: 0 10px 20px -12px rgba(20,20,40,.5); transition: transform .15s; }
.foto svg { width: 28px; height: 28px; fill: currentColor; pointer-events: none; } .foto:active { transform: scale(.92); }
.fotoimb { flex: none; width: 56px; height: 1px; } .obrol.ketik .fotoimb, .foto.tiada, .fotoimb.tiada { display: none; }
.fotoin { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
body.mikir .foto { opacity: .4; pointer-events: none; }
@media (max-height: 520px) { .foto { width: 44px; height: 44px; } .foto svg { width: 22px; height: 22px; } .fotoimb { width: 44px; } }
body.mikir .mik, body.mikir #tKirim { opacity: .4; pointer-events: none; }
.petunjuk { display: none; height: 1.2em; font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .5; pointer-events: none !important; }
body.rumah .petunjuk { display: block; }

/* name your pet */
.namai { display: none; align-items: center; gap: 12px; width: min(560px, 100%); pointer-events: auto; }
body.kasihnama .namai { display: flex; } body.kasihnama .baris { display: none; }
.namai input { flex: 1; min-width: 0; height: 68px; padding: 0 22px; text-align: center; font-size: 30px; font-weight: 700; border-radius: 24px; background: rgba(255,255,255,.9); border: 2px solid rgba(30,30,50,.12); outline: none; box-shadow: 0 10px 24px -12px rgba(30,30,50,.35); }
.namai input:focus { border-color: rgba(30,30,50,.4); background: #fff; }
.namai input::placeholder { color: rgba(40,40,60,.3); font-weight: 500; }
.namai .pilih { height: 68px; border-radius: 24px; padding: 0 28px; font-size: 24px; }
.namai .pilih:disabled { opacity: .3; box-shadow: none; }

/* hang out mode (hands free) */
.hang { display: none; height: 40px; padding: 0 16px; white-space: nowrap; border-radius: 999px; font-size: 14px; font-weight: 700; color: #33333f; background: rgba(255,255,255,.6); border: 1px solid rgba(255,255,255,.9); box-shadow: 0 6px 16px -8px rgba(30,30,50,.3); pointer-events: auto; }
body.rumah .hang { display: block; } .hang.tiada, body.rumah .hang.tiada { display: none; }
body.hangon .hang { background: #1f9d6b; color: #fff; border-color: #1f9d6b; }
body.hangon .mik { background: #1f9d6b; } body.hangdengar .mik { animation: hangDenyut 1.6s ease-in-out infinite; }
@keyframes hangDenyut { 0%, 100% { box-shadow: 0 0 0 0 rgba(31,157,107,.5); } 50% { box-shadow: 0 0 0 20px rgba(31,157,107,0); } }

/* access code, once per device */
#gerbang { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 20px; background: #f1f0ec; }
#gerbang[hidden] { display: none; }
.kartu { display: flex; flex-direction: column; align-items: center; gap: 16px; width: min(360px, 100%); }
.gj { font-size: 14px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; opacity: .55; }
#kode { width: 100%; height: 64px; text-align: center; font-size: 28px; font-weight: 700; letter-spacing: .08em; border-radius: 22px; border: 2px solid rgba(30,30,50,.12); background: #fff; outline: none; }
#kode:focus { border-color: rgba(30,30,50,.4); }
.kartu.salah { animation: geleng .4s; } @keyframes geleng { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.gp { height: 1.3em; font-size: 15px; opacity: .6; }

@media (orientation: portrait) {
  .kisi button { width: 20%; } .kisi i { height: min(6.6vh, 13vw); }
  .apung { height: 56%; width: 92vw; } #bigname { top: 19%; }
  .panah { top: auto; bottom: 30%; }
}
@media (max-height: 520px) { .cap { font-size: 22px; min-height: 2.3em; } .pilih { height: 46px; font-size: 17px; } .bawah { gap: 7px; bottom: calc(10px + var(--kb, 0px)); } .mik { width: 56px; height: 56px; } }
