.screen:has(.home) { padding-top: 0; }
.panel.home { margin: 0 auto; max-width: 980px; gap: 16px; padding-top: max(16px, env(safe-area-inset-top)); padding-bottom: 136px; }
.view { display: flex; flex-direction: column; gap: 18px; }
.shelf { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home h2 { display: flex; align-items: center; gap: 8px; margin: 0; }
.home h2::before { content: ""; width: 4px; height: 14px; background: var(--hot); border-radius: 2px; }
.shelf[data-cat="pengembaraan"] { --accent: #5fd08a; }
.shelf[data-cat="belajar"] { --accent: #5db8ff; }
.shelf[data-cat="arked"] { --accent: var(--sun); }
.shelf[data-cat="bersama"] { --accent: var(--hot); }
.home .shelf h2, .home .picks h2 { color: var(--ink); font-size: 19px; font-style: italic; font-weight: 900; letter-spacing: -.01em; line-height: 1.15; text-transform: none; }
.home .shelf h2::before, .home .picks h2::before { width: 5px; height: 18px; background: var(--accent); border-radius: 3px; box-shadow: 0 0 10px var(--accent); }

.top-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.home .logo { font-size: 30px; line-height: 1; white-space: nowrap; }
.home .logo span { display: inline; margin-left: .18em; }
.now { display: flex; align-items: baseline; gap: 7px; min-width: 0; white-space: nowrap; }
.now b { font-size: 12px; font-weight: 800; color: var(--sun); font-variant-numeric: tabular-nums; }
.now small { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 12px; }
.live-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; color: var(--muted); font-size: 12px; }
.live-stats span { display: inline-flex; align-items: center; gap: 5px; }
.live-stats i { font-style: normal; }
.live-stats b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; }
.live-names { display: flex; flex-direction: column; gap: 8px; margin-top: -6px; padding: 10px 12px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; }
.live-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.live-group h3 { margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.live-group ul { display: flex; flex-wrap: wrap; gap: 5px; max-height: 64px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.live-group li { display: inline-flex; align-items: baseline; gap: 5px; max-width: 100%; padding: 3px 9px; background: rgba(255, 255, 255, .07); border-radius: 999px; font-size: 12px; white-space: nowrap; }
.live-group li b { overflow: hidden; color: var(--ink); text-overflow: ellipsis; font-weight: 700; }
.live-group li small { color: var(--sun); font-size: 11px; }
.live-group li.extra { background: none; padding-left: 2px; }
.live-group li.extra b { color: var(--muted); font-weight: 600; }
.top-row .account { flex: none; max-width: 46%; }
.profile-link {
  max-width: 100%;
  overflow: hidden;
  padding: 9px 13px;
  color: var(--ink);
  font-size: 14px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.gold-slot {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  background: linear-gradient(115deg, rgba(255, 194, 61, .18), rgba(255, 194, 61, .05)), var(--panel);
  border: 1px solid rgba(255, 194, 61, .4);
  border-radius: 16px;
}
.focused .gold-slot, .focused .shop-link, .focused .picks { display: none; }
.picks { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.picks-row { --accent: var(--sun); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.picks .art { object-fit: cover; }
/* Kad Kedai Emas: banner emas berkilat dengan rak contoh barang */
.shop-link {
  position: relative; overflow: hidden; display: grid; gap: 10px; padding: 12px; color: inherit; text-decoration: none;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255, 220, 120, .35), transparent 55%),
    linear-gradient(135deg, #4a3210, #2f2140 58%, #231a38);
  border: 1px solid rgba(255, 194, 61, .6); border-radius: 16px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .35), 0 0 18px rgba(255, 194, 61, .18), inset 0 1px 0 rgba(255, 255, 255, .1);
  transition: transform .15s;
}
.shop-link:active { transform: scale(.98); }
.shop-link:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.shop-link-shine {
  position: absolute; top: 0; bottom: 0; left: -50%; width: 35%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 240, 190, .25), transparent); transform: skewX(-18deg);
  animation: shop-link-kilau 4s ease-in-out infinite;
}
@keyframes shop-link-kilau { 0%, 50% { left: -50%; } 100% { left: 130%; } }
.shop-link-coins { position: absolute; inset: 0; pointer-events: none; }
.shop-link-coins i {
  position: absolute; top: -14px; width: 10px; height: 10px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle at 35% 30%, #fff6c8, #ffd34d 45%, #c27b00);
  animation: shop-link-jatuh 5s linear infinite;
}
.shop-link-coins i:nth-child(1) { right: 22%; }
.shop-link-coins i:nth-child(2) { right: 9%; animation-delay: 1.7s; transform: scale(.7); }
.shop-link-coins i:nth-child(3) { right: 36%; animation-delay: 3.4s; transform: scale(.8); }
@keyframes shop-link-jatuh { 0% { transform: translateY(0) rotateY(0); opacity: 0; } 15% { opacity: .85; } 100% { transform: translateY(170px) rotateY(540deg); opacity: 0; } }
.shop-link-head { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.shop-link-icon {
  display: grid; place-items: center; width: 46px; height: 46px; font-size: 26px; line-height: 1; border-radius: 14px;
  background: radial-gradient(circle at 50% 35%, rgba(255, 214, 102, .45), rgba(0, 0, 0, .25)); box-shadow: inset 0 0 0 1.5px rgba(255, 194, 61, .55);
  animation: shop-link-angguk 2.8s ease-in-out infinite;
}
@keyframes shop-link-angguk { 0%, 100% { transform: rotate(0); } 10% { transform: rotate(-9deg) scale(1.06); } 20% { transform: rotate(7deg); } 30% { transform: none; } }
.shop-link-text { display: grid; gap: 2px; min-width: 0; }
.shop-link-text b {
  font-size: 19px; font-style: italic; font-weight: 900; letter-spacing: .01em; line-height: 1.1;
  color: transparent; background: linear-gradient(180deg, #fff3b0, #ffc23d 50%, #e08a00); -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 2px 0 rgba(107, 63, 0, .8));
}
.shop-link-text small { overflow: hidden; color: #f0e2c4; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.shop-link-go { padding: 7px 12px; color: #2a1a05; font-size: 13px; font-weight: 900; white-space: nowrap; background: linear-gradient(180deg, #ffd65c, var(--sun)); border-radius: 999px; box-shadow: 0 3px 10px rgba(255, 194, 61, .35); }
.shop-link-shelf { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.shop-link-shelf:empty { display: none; }
.shop-shelf-item {
  --c: #8c86a0;
  display: grid; place-items: center; min-width: 0; height: 52px; overflow: hidden; padding: 4px; font-size: 13px;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px;
  border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: inset 0 0 12px color-mix(in srgb, var(--c) 25%, transparent);
}
.shop-shelf-item.jarang { --c: #4fa3ff; }
.shop-shelf-item.epik { --c: #b56bff; }
.shop-shelf-item.legenda { --c: #ffb42a; }
.shop-shelf-item .shelf-emoji { font-size: 28px; line-height: 1; }
.shop-shelf-item b { font-size: 14px; font-weight: 900; }
.shop-shelf-item .title-tag { margin: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.shop-shelf-item img { width: 40px; height: 40px; }
.shop-link-daily { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 10px; font-size: 12px; color: #f0e2c4; background: rgba(0, 0, 0, .3); border-radius: 10px; }
.shop-link-daily[hidden] { display: none; }
.shop-link-daily b { overflow: hidden; color: #fff6e6; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.shop-daily-chip { flex: none; margin-left: auto; padding: 1px 7px; font-size: 10px; font-style: normal; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: #6d6780; border-radius: 999px; }
.shop-daily-chip.jarang { background: #2f7fe0; }
.shop-daily-chip.epik { background: linear-gradient(90deg, #8b3dff, #c46bff); }
.shop-daily-chip.legenda { color: #3b2200; background: linear-gradient(90deg, #ffd34d, #ff9d1c); }
@media (prefers-reduced-motion: reduce) {
  .shop-link-shine, .shop-link-coins { display: none; }
  .shop-link-icon { animation: none; }
}
.gold-coin {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #8a5a08;
  font-size: 22px;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc23d 55%, #b9780a);
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px rgba(138, 90, 8, .35), 0 3px 10px rgba(255, 194, 61, .3);
}
.gold-coin::after { content: "✦"; }
.gold-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.gold-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gold-head b { font-size: 15px; font-style: italic; font-weight: 900; white-space: nowrap; }
.gold-head strong { overflow: hidden; color: var(--sun); font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.gold-head strong.gained { animation: gold-gain .6s ease-out; }
.gold-slot .progress { margin-top: 0; }
.gold-slot .progress i { background: linear-gradient(90deg, #c8920f, #ffd66a); transition: width .4s linear; }
.gold-info small { overflow: hidden; color: #d0c7db; font-size: 12px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.gold-collect {
  flex: none;
  min-width: 66px;
  min-height: 44px;
  padding: 0 12px;
  color: #1d0f0a;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  background: var(--sun);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.gold-collect:disabled { color: var(--muted); background: var(--line); cursor: default; }
.gold-collect:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.gold-slot.ready .gold-collect { animation: gold-ready 1.4s ease-in-out infinite; }
@keyframes gold-ready {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 194, 61, .55); }
  50% { box-shadow: 0 0 14px 3px rgba(255, 214, 90, .75); }
}
@keyframes gold-gain {
  40% { color: #fff6c4; transform: scale(1.18); }
}
@media (prefers-reduced-motion: reduce) {
  .gold-slot.ready .gold-collect, .gold-head strong.gained { animation: none; }
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(115deg, #5a2238, #3a2752 58%, #2a2140);
  border: 1px solid rgba(255, 194, 61, .35);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
}
.hero-art { flex: none; display: block; width: 92px; height: 92px; overflow: hidden; border-radius: 12px; }
.hero-art > * { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; border-radius: 0; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hero-text em { color: var(--sun); font-size: 11px; font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-text b { display: -webkit-box; overflow: hidden; font-size: 21px; font-style: italic; font-weight: 900; line-height: 1.08; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hero-text small { display: -webkit-box; overflow: hidden; color: #d8cfe2; font-size: 13px; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.hero-play { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: 4px; background: var(--hot); border-radius: 50%; box-shadow: 0 5px 14px rgba(255, 90, 54, .42); animation: hero-pulse 2.2s ease-out infinite; }
.hero-play svg { width: 24px; height: 24px; fill: #1d0f0a; }
@keyframes hero-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 54, .55); }
  70%, 100% { box-shadow: 0 0 0 13px rgba(255, 90, 54, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-play { animation: none; }
}

.toolbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -16px;
  padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  background: rgba(24, 20, 34, .9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.search { position: relative; display: block; }
.search svg { position: absolute; top: 50%; left: 13px; width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 2.2; transform: translateY(-50%); pointer-events: none; }
.search input { min-height: 44px; padding-left: 41px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.search input:focus { border-color: var(--sun); }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: 1 0 auto;
  min-height: 38px;
  padding: 0 10px;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}
.filter.on { color: #1d0f0a; background: var(--sun); border-color: var(--sun); }
.filter:focus-visible, .search input:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }

.rail {
  display: flex;
  gap: 10px;
  margin: 0 -16px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scroll-padding-inline: 16px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.focused .rail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; padding: 0; overflow: visible; }

.game-card, .arcade-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
  background: linear-gradient(165deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .01)), var(--panel);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .24);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
  animation: card-in .32s ease-out both;
  animation-delay: calc(min(var(--i, 0), 12) * 22ms);
}
.game-card { flex: 0 0 148px; gap: 8px; padding: 7px; scroll-snap-align: start; }
.focused .game-card { flex-basis: auto; }
.arcade-card { gap: 2px; padding: 6px; }
.game-card:focus-visible, .arcade-card:focus-visible, .hero:focus-visible, .dock a:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
.game-card:active, .arcade-card:active, .hero:active { transform: scale(.975); }
@media (hover: hover) {
  .game-card:hover, .arcade-card:hover { transform: translateY(-3px); border-color: var(--accent, var(--sun)); box-shadow: 0 10px 22px rgba(0, 0, 0, .36); }
  .hero:hover { border-color: var(--sun); }
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .game-card, .arcade-card { animation: none; transition: none; }
}

.art { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 9px; }
.text { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 3px 3px; }
.text b { font-size: 16px; font-style: italic; font-weight: 900; line-height: 1.12; }
.text small { display: -webkit-box; overflow: hidden; color: #d0c7db; font-size: 12.5px; line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.arcade-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.arcade-card .tile { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; margin-bottom: 5px; border-radius: 8px; }
.shelf[data-cat="belajar"] img.tile { object-fit: cover; }
.arcade-card b { padding: 0 2px; font-size: 13.5px; font-weight: 800; line-height: 1.15; }
.arcade-card small { padding: 0 2px 2px; color: #d0c7db; font-size: 12px; font-variant-numeric: tabular-nums; }

.empty { margin: 0; padding: 36px 12px; color: var(--muted); text-align: center; }

.playtime ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.playtime li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; background: var(--panel); border-radius: 8px; font-variant-numeric: tabular-nums; }
.playtime #playTotal { color: var(--sun); letter-spacing: 0; text-transform: none; }
.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  padding: 0 14px 14px;
  text-align: center;
  background: linear-gradient(165deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .01)), var(--panel);
  border: 1px solid rgba(255, 194, 61, .38);
  border-radius: 20px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
}
.profile-banner {
  align-self: stretch;
  height: 84px;
  margin: 0 -14px;
  background:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 22px),
    linear-gradient(115deg, var(--hot), #b0357a 52%, #3a2752);
}
.profile-avatar {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin-top: -44px;
  font-size: 48px;
  line-height: 1;
  background: var(--night);
  border: 3px solid var(--sun);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 194, 61, .45);
}
.profile-name { max-width: 100%; margin-top: 8px; overflow: hidden; font-size: 25px; font-style: italic; font-weight: 900; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.profile-tag { color: #d0c7db; font-size: 13px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-self: stretch; margin-top: 13px; }
.profile-stats div { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 4px; background: rgba(255, 255, 255, .06); border-radius: 12px; }
.profile-stats b { overflow: hidden; color: var(--sun); font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.profile-stats small { color: #d0c7db; font-size: 12px; }
#accountActions { align-self: stretch; margin-top: 10px; }
#accountActions .btn { flex: 1 1 0; justify-content: center; }
.settings .field { margin-top: 8px; }

.badge { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; padding: 10px 12px; background: var(--panel); border-radius: 10px; }
.badge b { align-self: flex-start; font-size: 20px; font-weight: 900; font-style: italic; }
.badge small { color: var(--muted); font-size: 13px; line-height: 1.35; }
a.badge { color: inherit; text-decoration: none; }
.progress { height: 7px; margin-top: 5px; overflow: hidden; background: var(--line); border-radius: 4px; }
.progress i { display: block; width: 0; height: 100%; background: var(--sun); border-radius: 4px; }

.signature-wrap { display: flex; justify-content: center; padding: 8px 0 0; }
.signature { width: 170px; height: auto; transform: rotate(-3deg); animation: signature-glow 2.4s ease-in-out infinite; }
.signature text {
  font-family: "Snell Roundhand", "Segoe Script", "Brush Script MT", "Dancing Script", cursive;
  font-size: 58px;
  font-weight: 700;
}
.signature .initial { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 60px; font-weight: 400; }
.signature path { stroke-width: 2.5; stroke-linecap: round; }
.signature stop { stop-color: #f2c230; animation: signature-shine 2.4s linear infinite; }
.signature stop:nth-child(2) { animation-delay: .3s; }
.signature stop:nth-child(3) { animation-delay: .6s; }
.signature stop:nth-child(4) { animation-delay: .9s; }
.signature stop:nth-child(5) { animation-delay: 1.2s; }
@keyframes signature-shine {
  0%, 50%, 100% { stop-color: #c8920f; }
  18% { stop-color: #fff6c4; }
  32% { stop-color: #f2c230; }
}
@keyframes signature-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(242, 194, 48, .35)); }
  50% { filter: drop-shadow(0 0 9px rgba(255, 214, 90, .9)); }
}
@media (prefers-reduced-motion: reduce) {
  .signature, .signature stop { animation: none; }
}

.dock {
  position: fixed;
  z-index: 30;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2px;
  max-width: 460px;
  margin: 0 auto;
  padding: 3px;
  background: rgba(35, 30, 49, .95);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
}
.dock a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  min-width: 0;
  color: #d0c7db;
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 800;
  text-decoration: none;
  border-radius: 15px;
  transition: color .15s, background-color .15s;
}
.dock a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 420px) { .dock a span { letter-spacing: -.03em; } }
@media (max-width: 340px) { .dock a span { letter-spacing: -.04em; } }
.dock-ico { position: relative; display: block; flex: none; width: 36px; height: 36px; transition: transform .18s cubic-bezier(.3, 1.6, .5, 1), filter .18s; }
.dock-ico img { display: block; width: 100%; height: 100%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.dock a:active .dock-ico { transform: scale(.9); }
.dock a[aria-current="page"] { color: var(--sun); background: rgba(255, 194, 61, .13); box-shadow: inset 0 0 0 1px rgba(255, 194, 61, .42); }
.dock a[aria-current="page"] .dock-ico { transform: translateY(-1px) scale(1.1); filter: drop-shadow(0 0 7px rgba(255, 194, 61, .65)); }
@media (prefers-reduced-motion: reduce) {
  .dock-ico { transition: none; }
}

.music-toggle { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 80px); }
/* Butang muzik di halaman utama: bulat kecil (♫ sahaja) supaya tidak menutup kad game. Nama lagu ada dalam menunya. */
.music-toggle {
  width: 44px; height: 44px; padding: 0; overflow: hidden; white-space: nowrap;
  font-size: 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .45);
}
.music-toggle::before { content: "♫"; font-size: 19px; line-height: 40px; }
/* Lencana bilangan pada ikon menu */
.dock-badge {
  position: absolute; top: -4px; right: -9px; min-width: 18px; height: 18px; padding: 0 5px;
  font: 900 11px/18px system-ui, sans-serif; font-style: normal; color: #fff; text-align: center;
  background: #ff4d4f; border: 2px solid #231e31; border-radius: 999px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
  animation: dock-badge-masuk .35s cubic-bezier(.3, 1.6, .5, 1);
}
.dock-badge[hidden] { display: none; }
@keyframes dock-badge-masuk { from { transform: scale(0); } to { transform: scale(1); } }
/* Penanda halaman semasa: garis kecil di atas ikon */
.dock a { position: relative; }
.dock a[aria-current="page"]::before {
  content: ""; position: absolute; top: 2px; left: 50%; width: 18px; height: 3px; margin-left: -9px;
  background: var(--sun); border-radius: 3px; box-shadow: 0 0 8px rgba(255, 194, 61, .8);
}
@media (prefers-reduced-motion: reduce) { .dock-badge { animation: none; } }
.music-menu { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 126px); }

@media (min-width: 640px) {
  .home .logo { font-size: 38px; }
  .rail, .focused .rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 0; padding: 0; overflow: visible; }
  .game-card { flex-basis: auto; }
  .arcade-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .arcade-card b { font-size: 15px; }
  .arcade-card small { font-size: 12px; }
  .hero-art { width: 120px; height: 120px; }
  .hero-text b { font-size: 30px; }
  .hero-play { width: 52px; height: 52px; margin-right: 12px; }
  .toolbar { flex-direction: row; align-items: center; margin: 0; padding: 8px 0; }
  .search { flex: 1; }
}

.profile-vip { margin-top: 4px; text-decoration: none; }
.profile-vip .vip-tag { margin-left: 0; font-size: 12px; }
.vip-badge { flex-direction: row; align-items: center; gap: 12px; }
.vip-badge .progress { display: block; }
.vip-badge img { flex: none; width: 52px; height: 52px; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
.vip-badge img.locked { filter: grayscale(1) brightness(.6); }
.vip-badge > span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
/* Avatar kepala: petak, bingkai VIP lebih besar. Nama dipotong sendiri supaya bingkai tidak terpotong. */
.profile-link { display: inline-flex; align-items: center; gap: 12px; overflow: visible; padding: 8px 14px 8px 8px; }
.head-avatar { position: relative; display: grid; flex: none; place-items: center; width: 34px; height: 34px; font-size: 22px; line-height: 1; background: var(--night); border-radius: 8px; }

/* Bingkai VIP kepala: petak besar dengan jalur kilauan berputar, permata di 4 penjuru dan lencana tahap.
   Gangsa statik, Perak berkilau perlahan, Emas berputar, Berlian berputar laju + permata berkelip. */
.profile-link.head-vip { flex-direction: column; gap: 4px; padding: 20px 22px 8px; text-align: center; border-radius: 18px; }
.head-vip .head-name { max-width: 100%; margin-top: 20px; font-weight: 800; }
.head-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pasang app (PWA) */
.app-pasang { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 10px 8px 10px 10px;
  background: linear-gradient(120deg, rgba(255, 90, 54, .18), rgba(255, 194, 61, .12)); border: 1px solid rgba(255, 194, 61, .35); border-radius: 14px;
  animation: app-pasang-masuk .45s ease-out; }
.app-pasang-ikon { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.app-pasang-teks { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-pasang-teks b { font-size: 14px; }
.app-pasang-teks small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.app-pasang-btn { min-height: 36px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--sun); color: #2a1a05; font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.app-pasang-tanda { font-size: 24px; line-height: 1; padding-right: 4px; }
.app-pasang.dipasang { background: rgba(126, 224, 129, .1); border-color: rgba(126, 224, 129, .4); }
.app-pasang.dipasang .app-pasang-teks b { color: #9ff0a2; }
@keyframes app-pasang-masuk { from { opacity: 0; transform: translateY(-6px); } }
