/* Aliran pembukaan Taman Main Hoomey — intro/muat, ajakan, kenali kawan, pilih pemain */
.confetti { z-index: 130; }
body.ix-open { overflow: hidden; }

.ix { position: fixed; inset: 0; z-index: 100; overflow: hidden; background: #9ED8F2; touch-action: none; }
.ix.bye { animation: ix-fade-out .5s ease-in forwards; pointer-events: none; }
@keyframes ix-fade-out { to { opacity: 0; transform: scale(1.04); } }

/* ---------- latar ---------- */
.ix-sky { position: absolute; inset: 0; background: #9ED8F2; }
.ix-sun { position: absolute; right: 5%; top: max(84px, 11%); width: clamp(100px, 13vw, 160px); }
.ix-sun svg { width: 100%; display: block; }
.ix-rays { animation: ix-spin 24s linear infinite; transform-origin: 0 0; }
@keyframes ix-spin { to { transform: rotate(360deg); } }
.ix-cloud { position: absolute; width: clamp(110px, 14vw, 180px); animation: ix-drift 28s linear infinite; }
.ix-cloud svg { width: 100%; display: block; }
.ix-cloud.c1 { top: 15%; left: -20%; }
.ix-cloud.c2 { top: 30%; left: -20%; width: clamp(80px, 10vw, 130px); animation-duration: 38s; animation-delay: -20s; }
.ix-cloud.c3 { top: 8%; left: -20%; width: clamp(90px, 11vw, 150px); animation-duration: 46s; animation-delay: -34s; }
@keyframes ix-drift { to { transform: translateX(140vw); } }
.ix-wau { position: absolute; left: 6%; top: max(96px, 14%); width: clamp(70px, 8vw, 110px); animation: ix-wau 5s ease-in-out infinite; transform-origin: 50% 100%; }
.ix-wau svg { width: 100%; display: block; }
@keyframes ix-wau { 0%,100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-14px); } }
.ix-bunting { position: absolute; left: 0; top: 0; width: 100%; height: clamp(72px, 11vh, 110px); }
.ix-flag { transform-box: fill-box; transform-origin: 50% 0; animation: ix-sway 2.6s ease-in-out infinite; }
@keyframes ix-sway { 0%,100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.ix-hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 46%; }

/* ---------- skrin (pertukaran) ---------- */
.ix-screen { position: absolute; inset: 0; }
.ix-screen.in-f { animation: ix-in-f .45s ease-out both; }
.ix-screen.in-r { animation: ix-in-r .45s cubic-bezier(.3,1.3,.5,1) both; }
.ix-screen.in-l { animation: ix-in-l .45s cubic-bezier(.3,1.3,.5,1) both; }
.ix-screen.out-f { animation: ix-out-f .4s ease-in both; }
.ix-screen.out-l { animation: ix-out-l .4s ease-in both; }
.ix-screen.out-r { animation: ix-out-r .4s ease-in both; }
@keyframes ix-in-f { from { opacity: 0; transform: scale(.94); } }
@keyframes ix-in-r { from { opacity: 0; transform: translateX(40%); } }
@keyframes ix-in-l { from { opacity: 0; transform: translateX(-40%); } }
@keyframes ix-out-f { to { opacity: 0; } }
@keyframes ix-out-l { to { opacity: 0; transform: translateX(-40%); } }
@keyframes ix-out-r { to { opacity: 0; transform: translateX(40%); } }

/* ---------- 1. tajuk / muat ---------- */
.ix-title { display: flex; flex-direction: column; align-items: center; padding-top: max(9vh, 64px); }
.ix-logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: .86; font-weight: 800; }
.ix-logo .l1 { font-size: min(10.5vw, 12.5vh); }
.ix-logo .l2 { font-size: min(15vw, 18vh); margin-top: -.02em; }
.ix-sp { display: inline-block; width: .3em; }
.ix-ch { display: inline-block; color: var(--c); letter-spacing: -.01em;
  text-shadow: 0 -.055em 0 var(--ink), .04em -.04em 0 var(--ink), .055em 0 0 var(--ink), .04em .04em 0 var(--ink),
    0 .055em 0 var(--ink), -.04em .04em 0 var(--ink), -.055em 0 0 var(--ink), -.04em -.04em 0 var(--ink),
    .02em -.05em 0 var(--ink), -.02em -.05em 0 var(--ink), .05em .02em 0 var(--ink), -.05em .02em 0 var(--ink),
    0 .12em 0 var(--ink), .04em .1em 0 var(--ink), -.04em .1em 0 var(--ink);
  animation: ix-drop .7s cubic-bezier(.3,1.6,.5,1) both, ix-wave 2.6s ease-in-out infinite;
  animation-delay: calc(var(--i) * 75ms), calc(1.4s + var(--i) * 110ms); }
@keyframes ix-drop { 0% { opacity: 0; transform: translateY(-120%) scale(.5) rotate(-12deg); } 60% { opacity: 1; transform: translateY(8%) scale(1.1, .9); } 100% { transform: none; } }
@keyframes ix-wave { 0%,100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-7%) rotate(-3deg); } 50% { transform: translateY(0) rotate(0); } }

.ix-action { position: relative; width: min(560px, 82vw); height: clamp(150px, 24vh, 210px); margin-top: clamp(10px, 3vh, 34px);
  display: flex; align-items: center; justify-content: center; }
.ix-load { width: 100%; transition: opacity .35s, transform .35s; }
.ix-load.done { opacity: 0; transform: scale(.7); pointer-events: none; }
.ix-track { position: relative; height: 40px; border: var(--outline); border-radius: 999px; background: #fff; box-shadow: 0 6px 0 rgba(51,38,43,.22); margin: 0 30px; }
.ix-fill { position: absolute; left: 4px; top: 4px; bottom: 4px; width: 24px; max-width: calc(100% - 8px); border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--orange) 14px 28px); background-size: 40px 40px; animation: ix-stripes 1s linear infinite; }
@keyframes ix-stripes { to { background-position: 40px 0; } }
.ix-walker { position: absolute; bottom: 14px; left: 0; width: 76px; margin-left: -38px; transition: none; }
.ix-walker svg { width: 100%; display: block; animation: ix-walk .42s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes ix-walk { from { transform: rotate(-5deg) translateY(0); } to { transform: rotate(5deg) translateY(-6px); } }
.ix-star { position: absolute; right: -36px; top: 50%; width: 70px; margin-top: -40px; animation: ix-twinkle 1.2s ease-in-out infinite; }
.ix-star svg { width: 100%; display: block; }
@keyframes ix-twinkle { 50% { transform: scale(1.15) rotate(10deg); } }

.ix-play { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; cursor: pointer;
  animation: tma-pop-in .5s cubic-bezier(.3,1.6,.5,1) both; }
.ix-play[hidden] { display: none; }
.ix-play-c { width: clamp(124px, 17vh, 150px); height: clamp(124px, 17vh, 150px); border-radius: 50%; background: var(--green); border: 6px solid var(--ink);
  display: flex; align-items: center; justify-content: center; box-shadow: 0 9px 0 rgba(51,38,43,.3), 0 0 0 0 rgba(255,255,255,.8);
  animation: ix-pulse 1.1s ease-in-out infinite; }
.ix-play-c svg { width: 58%; margin-left: 9%; }
.ix-play-l { font-size: clamp(28px, 4vh, 36px); font-weight: 800; color: #fff; background: var(--pink); border: 5px solid var(--ink); border-radius: 999px;
  padding: 0 22px; line-height: 1.5; box-shadow: 0 5px 0 rgba(51,38,43,.25); margin-top: -18px; position: relative; }
.ix-play:active .ix-play-c { transform: translateY(5px); }
.ix-play.gone { animation: ix-out-f .3s forwards; pointer-events: none; }
@keyframes ix-pulse { 0%,100% { transform: scale(1); box-shadow: 0 9px 0 rgba(51,38,43,.3), 0 0 0 0 rgba(255,255,255,.85); }
  50% { transform: scale(1.08); box-shadow: 0 9px 0 rgba(51,38,43,.3), 0 0 0 18px rgba(255,255,255,0); } }

.ix-peek { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: clamp(0px, 1vw, 14px); pointer-events: none; }
.ix-pk { width: min(15vw, 19vh, 175px); transform: translateY(58%); transition: transform .55s cubic-bezier(.3,1.7,.5,1); }
.ix-pk:nth-child(odd) { transform: translateY(62%); }
.ix-pk svg { width: 100%; display: block; }
.ix-pk .rig:not(.jump) { animation-delay: calc(var(--d) * -.3s); }
.ix-pk.up { transform: translateY(4%); }
.ix-title.party .ix-logo { animation: ix-logo-party .6s ease-in-out 2; }
@keyframes ix-logo-party { 50% { transform: scale(1.06) rotate(-2deg); } }

/* ---------- panel umum ---------- */
.ix-x, .ix-small { position: absolute; z-index: 3; top: calc(16px + var(--safe-t)); right: 16px; display: flex; align-items: center; gap: 8px;
  min-height: 72px; padding: 6px 20px 6px 12px; border-radius: 999px; border: var(--outline); font-size: 22px; font-weight: 800; cursor: pointer;
  box-shadow: 0 5px 0 rgba(51,38,43,.25); }
.ix-x { background: var(--pink); color: #fff; }
.ix-x svg { width: 40px; height: 40px; }
.ix-small { background: #fff; color: var(--ink); }
.ix-small svg { width: 48px; height: 48px; }
.ix-x:active, .ix-small:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(51,38,43,.25); }

/* ---------- 3. kenali kawan ---------- */
.ix-kenal { --navh: 96px; display: flex; flex-direction: column; padding: calc(98px + var(--safe-t)) 4vw 70px; }
.kn-panel { flex: 1; min-height: 0; display: grid; grid-template-columns: 44% 1fr; gap: 2vw; background: #FFFDF7; border: 6px solid var(--ink);
  border-radius: 40px; box-shadow: 0 10px 0 rgba(51,38,43,.22); padding: 2.5vh 2.5vw; position: relative; overflow: hidden; }
.kn-panel::before { content: ''; position: absolute; left: -10%; top: -20%; width: 58%; height: 140%; background: var(--bg2); border-radius: 0 50% 50% 0; }
.kn-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; }
.kn-glow { position: absolute; width: 86%; aspect-ratio: 1; max-height: 92%; border-radius: 50%; background: var(--acc); opacity: .28;
  animation: ix-glow 3s ease-in-out infinite; }
@keyframes ix-glow { 50% { transform: scale(1.06); opacity: .38; } }
.kn-char { position: relative; height: 96%; max-width: 100%; aspect-ratio: 240 / 300; cursor: pointer; }
.kn-char svg { width: 100%; height: 100%; display: block; }
.kn-info { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 0; }
.kn-name { font-size: clamp(54px, 8.5vh, 84px); font-weight: 800; line-height: .95; color: var(--acc);
  text-shadow: 0 -4px 0 var(--ink), 3px -3px 0 var(--ink), 4px 0 0 var(--ink), 3px 3px 0 var(--ink), 0 4px 0 var(--ink), -3px 3px 0 var(--ink), -4px 0 0 var(--ink), -3px -3px 0 var(--ink), 0 8px 0 var(--ink);
  animation: tma-pop-in .5s .1s cubic-bezier(.3,1.6,.5,1) both; }
.kn-spc { align-self: flex-start; font-size: clamp(20px, 3vh, 28px); font-weight: 800; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 18px; margin: 8px 0 1.6vh;
  animation: tma-pop-in .5s .2s both; }
.kn-chips { display: flex; flex-direction: column; gap: 1.4vh; }
.kn-chip { position: relative; display: flex; align-items: center; gap: 14px; background: var(--cb); border: 5px solid var(--ink); border-radius: 28px;
  padding: 1vh 18px 1vh 46px; min-height: 96px; text-align: left; cursor: pointer; box-shadow: 0 6px 0 rgba(51,38,43,.2);
  animation: ix-chip-in .55s cubic-bezier(.3,1.6,.5,1) both; animation-delay: calc(.35s + var(--j) * .18s); }
@keyframes ix-chip-in { from { opacity: 0; transform: translateX(60px) scale(.8); } }
.kn-chip:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(51,38,43,.2); }
.kn-chip.talk { animation: ix-talk .5s ease-in-out infinite alternate; border-color: var(--bd); }
@keyframes ix-talk { to { transform: scale(1.04); } }
.kn-badge { position: absolute; left: -16px; top: 50%; margin-top: -28px; width: 56px; height: 56px; border-radius: 50%; background: var(--bd); border: 4px solid var(--ink);
  display: flex; align-items: center; justify-content: center; }
.kn-badge svg { width: 34px; height: 34px; }
.kn-pic { flex: none; width: clamp(80px, 12.5vh, 112px); margin: -10px 0; }
.kn-pic svg { width: 100%; display: block; }
.kn-lbl { font-size: clamp(24px, 4vh, 36px); font-weight: 800; line-height: 1.05; }

.kn-nav { height: var(--navh); margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kn-btn { display: flex; align-items: center; gap: 8px; min-height: 92px; padding: 0 28px; border-radius: 999px; border: var(--outline); color: #fff;
  font-size: 28px; font-weight: 800; cursor: pointer; box-shadow: 0 7px 0 rgba(51,38,43,.25); }
.kn-btn svg { width: 46px; height: 46px; }
.kn-btn.prev { background: var(--blue); }
.kn-btn.prev:disabled { visibility: hidden; }
.kn-btn.next { background: var(--green); padding: 0 24px 0 34px; min-width: 200px; justify-content: center; }
.kn-btn.next.nudge { animation: ix-nudge 1s ease-in-out infinite; }
@keyframes ix-nudge { 0%,100% { transform: translateX(0) scale(1); } 50% { transform: translateX(8px) scale(1.06); } }
.kn-btn:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(51,38,43,.25); }
.kn-dots { display: flex; gap: 10px; background: #fff; border: 4px solid var(--ink); border-radius: 999px; padding: 9px 14px; }
.kn-dot { width: 22px; height: 22px; border-radius: 50%; background: #E7DCCD; border: 3px solid var(--ink); transition: transform .3s; }
.kn-dot.seen { background: var(--dc); opacity: .55; }
.kn-dot.on { background: var(--dc); transform: scale(1.35); }

/* ---------- 4. pilih pemain ---------- */
.ix-pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; padding: calc(96px + var(--safe-t)) 3vw 70px; }
.pk-head span { display: inline-block; font-size: clamp(30px, 5vh, 44px); font-weight: 800; background: #fff; border: var(--outline); border-radius: 999px; padding: 0 28px;
  box-shadow: 0 6px 0 rgba(51,38,43,.22); animation: tma-pop-in .5s cubic-bezier(.3,1.6,.5,1) both; }
.pk-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(10px, 1.6vw, 20px); width: min(1100px, 100%); }
.pk-card { position: relative; display: flex; flex-direction: column; align-items: center; background: #fff; border: var(--outline); border-radius: 30px;
  padding: 10px 6px 6px; min-height: 160px; cursor: pointer; box-shadow: 0 7px 0 rgba(51,38,43,.22); transition: transform .2s, background .2s;
  animation: tma-pop-in .45s cubic-bezier(.3,1.6,.5,1) both; }
.pk-card:nth-child(2) { animation-delay: .06s } .pk-card:nth-child(3) { animation-delay: .12s } .pk-card:nth-child(4) { animation-delay: .18s }
.pk-card:nth-child(5) { animation-delay: .24s } .pk-card:nth-child(6) { animation-delay: .3s }
.pk-art { width: 100%; max-width: 150px; }
.pk-art svg { width: 100%; height: auto; display: block; }
.pk-card b { font-size: clamp(22px, 3.2vh, 30px); line-height: 1.1; margin-top: 2px; }
.pk-card.on { background: #FFE7EC; border-color: var(--pink); transform: translateY(-10px) scale(1.06); box-shadow: 0 0 0 6px #fff, 0 14px 0 rgba(51,38,43,.2); }
.pk-tick { position: absolute; top: -18px; right: -14px; width: 50px; display: none; animation: ix-twinkle 1.2s ease-in-out infinite; }
.pk-tick svg { width: 100%; display: block; }
.pk-card.on .pk-tick { display: block; }
.ix-main { display: inline-flex; align-items: center; gap: 12px; min-height: 104px; padding: 0 48px 0 36px; border-radius: 999px; border: 6px solid var(--ink);
  background: var(--green); color: #fff; font-size: 44px; font-weight: 800; cursor: pointer; box-shadow: 0 9px 0 rgba(51,38,43,.28);
  animation: tma-pop-in .5s .35s cubic-bezier(.3,1.6,.5,1) both, ix-breathe 1.4s 1s ease-in-out infinite; }
.ix-main svg { width: 54px; height: 54px; }
.ix-main:active { transform: translateY(6px); box-shadow: 0 3px 0 rgba(51,38,43,.28); }
@keyframes ix-breathe { 50% { transform: scale(1.06); } }

/* ---------- potret ---------- */
@media (orientation: portrait) {
  .ix-title { padding-top: max(13vh, 110px); }
  .ix-action { margin-top: 5vh; }
  .ix-pk { width: min(16vw, 150px); }
  .ix-kenal { padding-top: calc(100px + var(--safe-t)); }
  .kn-panel { grid-template-columns: 1fr; grid-template-rows: 44% 1fr; padding: 2vh 4vw; }
  .kn-panel::before { left: -20%; top: -10%; width: 140%; height: 56%; border-radius: 0 0 50% 50%; }
  .kn-info { justify-content: flex-start; align-items: center; }
  .kn-name { text-align: center; }
  .kn-spc { align-self: center; }
  .kn-chips { flex-direction: row; gap: 2.4vw; width: 100%; }
  .kn-chip { flex: 1; flex-direction: column; justify-content: center; text-align: center; padding: 34px 8px 16px; min-height: 0; gap: 8px; }
  .kn-badge { left: 50%; top: -22px; margin: 0 0 0 -28px; }
  .kn-pic { width: min(21vw, 160px); }
  .kn-lbl { font-size: clamp(22px, 2.8vh, 30px); }
  .kn-btn { padding: 0 22px; }
  .kn-btn.next { min-width: 0; }
  .ix-pick { gap: 3vh; }
  .pk-grid { grid-template-columns: repeat(3, 1fr); width: min(720px, 100%); gap: 22px 20px; }
  .pk-art { max-width: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .ix-rays, .ix-cloud, .ix-wau, .ix-flag, .ix-ch, .ix-play-c, .ix-main { animation: none !important; }
}

/* butang Langkau — sentiasa kanan atas, jauh dari butang lain */
.ix-skip { position: absolute; z-index: 30; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px));
  display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 8px 20px 8px 14px; border-radius: 999px;
  border: 4px solid #33262B; background: rgba(51,38,43,.78); color: #fff; font: 800 22px 'Baloo 2', ui-rounded, sans-serif;
  box-shadow: 0 5px 0 rgba(51,38,43,.25); cursor: pointer; animation: tma-pop-in .4s .8s both; }
.ix-skip svg { width: 32px; height: 32px; }
.ix-skip:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(51,38,43,.25); }
