.home-arcade-rail {
  scroll-margin-top: 76px;
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 44px;
  padding: 24px;
  border: 1px solid #cfd9d5;
  border-radius: 26px;
  background: #f7f8f3;
}

.home-arcade-rail > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.home-arcade-rail > header small,
.home-game-card > p {
  display: block;
  margin: 0;
  color: #168ba0;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.home-arcade-rail h2 {
  margin: 5px 0 4px;
  color: #102638;
  font: 850 clamp(28px, 3.2vw, 42px)/1.02 Manrope, system-ui, sans-serif;
  letter-spacing: -1.5px;
}

.home-arcade-rail > header p {
  margin: 0;
  color: #667b83;
  font-size: 12px;
}

.home-arcade-rail > header > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 1px solid #b9cac6;
  border-radius: 999px;
  color: #102638;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.home-game-showcase,
.home-arcade-grid { display: grid; gap: 13px; }
.home-game-showcase { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-arcade-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 13px 13px; }
.home-game-swipe { display: none; }

.home-game-card {
  position: relative;
  box-sizing: border-box;
  min-width: 0;
  min-height: 255px;
  display: block;
  padding: 24px;
  border: 1px solid #315465;
  border-radius: 21px;
  background: linear-gradient(145deg, #0b3040, #071f2f);
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.home-game-card::after {
  content: "";
  position: absolute;
  inset: auto -35px -55px auto;
  z-index: -1;
  width: 180px;
  height: 180px;
  border: 1px solid #a9f0f233;
  border-radius: 50%;
}

.home-game-card .tile-number {
  position: absolute;
  top: 18px;
  right: 20px;
  color: #8fe5ed;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 1px;
}

.home-game-card > p { position: relative; z-index: 2; color: #72d9e8; }
.home-game-card h3 { position: relative; z-index: 2; max-width: 70%; margin: 8px 0; font: 850 clamp(24px, 2.2vw, 34px)/1.02 Manrope, system-ui, sans-serif; letter-spacing: -1px; }
.home-game-card > strong { position: relative; z-index: 2; display: block; max-width: 58%; color: #b8cdd2; font-size: 11px; line-height: 1.45; }
.home-game-card > em { position: absolute; left: 24px; bottom: 22px; z-index: 3; color: #d5ff5f; font-size: 10px; font-style: normal; font-weight: 900; }
.home-game-card:hover,
.home-game-card:focus-visible { transform: translateY(-4px); border-color: #79d7df; box-shadow: 0 17px 30px #10263820; }

.cast-together-tile { background: linear-gradient(155deg, #071f2f 0 58%, #087f9b 59% 100%); }
.beach-tile { background: linear-gradient(155deg, #0d829c 0 57%, #e3c77f 58% 100%); }
.beach-tile > em { left: 18px; bottom: 16px; padding: 6px 9px; border-radius: 999px; background: #fff9d8dd; color: #073c50; }
.tank-tile { background: linear-gradient(145deg, #0b7183, #064052); }
.tank-tile > strong { max-width: 118px; }
.boat-tile { background: linear-gradient(145deg, #126e84, #07435d); }
.flap-tile { background: linear-gradient(145deg, #0b5670, #063348); }
.sampah-tile { background: linear-gradient(160deg, #0e7896, #064765); }
.puff-tile { border-color: #e0a846; background: linear-gradient(145deg, #ffeeb5, #ffcf6c); color: #102638; }
.puff-tile > p, .puff-tile .tile-number { color: #a85a15; }
.puff-tile > strong { color: #7b5b33; }
.puff-tile > em { color: #0a667b; }
.scale-tile { background: linear-gradient(145deg, #0a4d60, #071f2f); }
.home-arcade-grid .scale-tile { grid-column: 1 / -1; }

.cast-together-preview { position: absolute; right: 18px; bottom: 25px; width: 155px; height: 94px; border-radius: 18px; background: linear-gradient(#f1c57a 0 27%, #36b4c6 28% 55%, #08748e 56%); box-shadow: inset 0 0 0 1px #bff4f252; overflow: hidden; }
.cast-together-preview::before { content: ""; position: absolute; left: 15px; right: 15px; top: 18px; height: 13px; background: #8b5b36; box-shadow: 0 4px #603a27; }
.cast-together-preview::after { content: ""; position: absolute; left: 10px; right: 10px; top: 56px; height: 26px; border-top: 2px solid #c8fbfa99; border-radius: 50%; }
.cast-together-preview i,
.cast-together-preview b,
.cast-together-preview span,
.cast-together-preview em { position: absolute; z-index: 2; top: 30px; width: 7px; height: 7px; border: 2px solid #fff; border-radius: 50%; background: #69d2e7; box-shadow: 0 -20px 0 -3px #fff; animation: homeCastBob 1.8s ease-in-out infinite alternate; }
.cast-together-preview i { left: 25px; }
.cast-together-preview b { left: 59px; background: #ff806b; animation-delay: -.45s; }
.cast-together-preview span { left: 94px; background: #d5ff5f; animation-delay: -.9s; }
.cast-together-preview em { left: 127px; background: #ffd166; animation-delay: -1.35s; }
@keyframes homeCastBob { to { transform: translateY(7px); } }

.beach-preview { position: absolute; right: 16px; bottom: 25px; width: 145px; height: 82px; }
.beach-preview .preview-wave { position: absolute; left: 0; top: 3px; width: 145px; height: 34px; border-top: 4px solid #efffff; border-radius: 50%; filter: drop-shadow(0 7px 0 #58cfdfaa); animation: homeBeachWave 2.8s ease-in-out infinite; }
.beach-preview .preview-wave::after { content: ""; position: absolute; left: 12px; top: 15px; width: 118px; height: 20px; border-top: 2px solid #f4ffffb8; border-radius: 50%; }
.beach-preview .preview-bottle { position: absolute; left: 25px; bottom: 2px; width: 12px; height: 32px; border-radius: 4px 4px 7px 7px; background: #3e9e85; transform: rotate(55deg); }
.beach-preview .preview-can { position: absolute; right: 22px; bottom: 6px; width: 20px; height: 27px; border-radius: 5px; background: #ed6c58; transform: rotate(-18deg); }
.beach-preview .preview-starfish { position: absolute; left: 71px; bottom: 0; width: 25px; height: 25px; background: #f59b59; clip-path: polygon(50% 0,61% 35%,98% 27%,69% 51%,88% 82%,56% 65%,34% 100%,34% 62%,0 72%,27% 47%,6% 18%,43% 33%); }
@keyframes homeBeachWave { 50% { transform: translateX(8px) translateY(3px); } }

.tank-preview { position: absolute; right: 18px; bottom: 24px; width: 170px; height: 103px; border-radius: 11px 11px 22px 22px; background: linear-gradient(#1597ae, #07526a); box-shadow: inset 0 -16px #073c50; overflow: hidden; }
.tank-preview::before { content: ""; position: absolute; z-index: 4; inset: 0; border: 4px solid #7bd8e3; border-top-width: 7px; border-radius: 11px 11px 22px 22px; pointer-events: none; }
.tank-preview::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 13px; background: radial-gradient(circle,#e2c589 0 2px,transparent 3px) 0 0/13px 9px,#8a7156; }
.tank-preview canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; }

.boat-preview { position: absolute; right: 7%; bottom: 22%; width: 126px; height: 102px; }
.boat-preview::before { content: ""; position: absolute; left: 7px; top: 25px; border-left: 56px solid transparent; border-right: 56px solid transparent; border-bottom: 54px solid #fff8e7; filter: drop-shadow(0 10px 8px #00253566); }
.boat-preview::after { content: ""; position: absolute; left: 27px; top: 50px; width: 74px; height: 33px; background: #6bd9e5; clip-path: polygon(0 0,100% 0,77% 100%,23% 100%); }
.boat-preview i { position: absolute; z-index: 2; left: 62px; top: 8px; width: 3px; height: 50px; background: #fff5d3; }
.boat-preview i::after { content: ""; position: absolute; left: 3px; top: 1px; border-top: 22px solid transparent; border-bottom: 22px solid transparent; border-left: 35px solid #d5ff5f; }
.boat-preview b { position: absolute; right: -5px; top: 12px; width: 36px; height: 39px; background: repeating-conic-gradient(from 250deg at 8% 92%,#ff7065 0 10deg,#ffd8a8 11deg 21deg); clip-path: polygon(0 100%,12% 72%,30% 45%,52% 21%,74% 7%,100% 0,85% 42%,65% 72%,42% 94%); animation: homeFan .65s ease-in-out infinite; }
@keyframes homeFan { 50% { transform: rotate(-13deg); } }

.flap-preview { position: absolute; right: 22px; bottom: 35px; width: 112px; height: 75px; filter: drop-shadow(0 12px 13px #001d2c55); }
.flap-preview canvas,
.puff-preview canvas,
.scale-preview canvas { display: block; width: 100%; height: 100%; }

.sampah-preview { position: absolute; right: 20px; bottom: 48px; width: 150px; height: 82px; border-bottom: 3px solid #8ce5f1; }
.sampah-preview canvas { position: absolute; left: -8px; top: 10px; width: 70px; height: 50px; }
.sampah-preview i { position: absolute; font-size: 18px; font-style: normal; }
.sampah-preview i:nth-child(2) { left: 75px; top: 2px; }
.sampah-preview i:nth-child(3) { right: 0; top: 31px; }
.sampah-preview i:nth-child(4) { left: 65px; bottom: 0; }

.puff-preview { position: absolute; right: 24px; bottom: 35px; width: 118px; height: 98px; filter: drop-shadow(0 12px 16px #b16d2145); }
.scale-preview { position: absolute; right: 26px; bottom: 30px; width: 155px; height: 98px; filter: drop-shadow(0 12px 16px #001d2966); }

.home-arcade-drawer { margin-top: 14px; border: 1px solid #c8d7d3; border-radius: 17px; background: #fff; overflow: clip; }
.home-arcade-drawer summary { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; color: #102638; cursor: pointer; list-style: none; font-size: 12px; font-weight: 850; }
.home-arcade-drawer summary::-webkit-details-marker { display: none; }
.home-arcade-drawer summary b { font-size: 24px; font-weight: 500; transition: transform .18s ease; }
.home-arcade-drawer[open] summary b { transform: rotate(45deg); }

html.theme-night .home-arcade-rail { border-color: #35535e; background: #0b2632; }
html.theme-night .home-arcade-rail h2,
html.theme-night .home-arcade-rail > header > a,
html.theme-night .home-arcade-drawer summary { color: #edf7f7; }
html.theme-night .home-arcade-rail > header p { color: #a9bec5; }
html.theme-night .home-arcade-rail > header > a,
html.theme-night .home-arcade-drawer { border-color: #35535e; background: #102d39; }

@media (max-width: 800px) {
  .home-arcade-rail { width: auto; margin: 18px 12px 32px; padding: 17px 14px; border-radius: 20px; }
  .home-arcade-rail > header { align-items: center; }
  .home-arcade-rail h2 { font-size: 29px; }
  .home-arcade-rail > header p { max-width: 235px; line-height: 1.4; }
  .home-arcade-rail > header > a { padding-inline: 13px; }
  .home-game-showcase { display: flex; gap: 11px; margin-inline: -2px; padding: 2px 2px 7px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .home-game-showcase::-webkit-scrollbar { display: none; }
  .home-game-showcase .home-game-card { flex: 0 0 min(76vw, 285px); scroll-snap-align: start; }
  .home-game-swipe { display: block; margin: 3px 3px 0; color: #657b83; font-size: 9px; font-weight: 800; text-align: right; }
  .home-arcade-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 10px 10px; }
  .home-arcade-grid .scale-tile { grid-column: auto; }
  .home-game-card { min-height: 235px; padding: 21px; }
  .home-game-card h3 { max-width: 72%; font-size: 27px; }
  .home-game-card > strong { max-width: 58%; }
  .home-game-card > em { left: 21px; bottom: 19px; }
}

@media (max-width: 430px) {
  .home-arcade-rail > header { align-items: start; }
  .home-arcade-rail > header > a { min-width: 88px; justify-content: center; }
  .home-arcade-rail > header > a span { display: none; }
  .home-game-showcase .home-game-card { flex-basis: 76vw; }
  .cast-together-preview { right: 13px; transform: scale(.86); transform-origin: right bottom; }
  .beach-preview { right: 10px; transform: scale(.86); transform-origin: right bottom; }
  .tank-preview { right: 10px; transform: scale(.82); transform-origin: right bottom; }
  .tank-tile > strong { max-width: 46%; }
  .boat-preview { right: 2%; transform: scale(.82); transform-origin: right bottom; }
  .sampah-preview { right: 9px; transform: scale(.86); transform-origin: right bottom; }
  .scale-preview { right: 8px; width: 132px; height: 84px; }
  .home-game-card h3 { max-width: 62%; font-size: 25px; }
  .home-game-card > strong { max-width: 52%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .home-game-card::after { right: -18px; bottom: -38px; width: 145px; height: 145px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-game-card { transition: none; }
  .home-game-card:hover,
  .home-game-card:focus-visible { transform: none; }
  .cast-together-preview > *,
  .beach-preview .preview-wave,
  .boat-preview b { animation: none; }
  .home-arcade-drawer summary b { transition: none; }
}
