:root {
  --bg: #060a10;
  --surface: #0d1624;
  --raised: #152338;
  --accent: #0865e5;
  --focus: #62c7ff;
  --text: #f5f8ff;
  --secondary: #b0bed1;
  --muted: #899bb3;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.75 "Noto Sans Thai", Tahoma, sans-serif; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.wrap { width: min(1280px, calc(100% - 80px)); margin-inline: auto; }
.crumb { color: var(--muted); font-size: 14px; padding: 16px 0 25px; overflow-wrap: anywhere; }
.crumb a:hover, .provider:hover, .source a:hover { text-decoration: underline; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.game-main, .layout aside { min-width: 0; }

.player { height: 510px; background: var(--surface); border-radius: 16px; position: relative; overflow: hidden; overflow: clip; display: grid; place-items: center; }
.player:fullscreen { height: 100dvh; border-radius: 0; }
.backdrop { position: absolute; width: 100%; height: 100%; object-fit: cover; filter: blur(24px); opacity: .24; transform: scale(1.1); }
.shade { position: absolute; inset: 0; background: linear-gradient(0deg, #060a10de, transparent); }
.start { position: relative; text-align: center; padding: 24px; }
.cover { display: block; width: 190px; aspect-ratio: 334/410; object-fit: cover; border-radius: 12px; margin: 0 auto 24px; box-shadow: 0 15px 40px #0005; }
.cover--wide { width: min(245px, 100%); aspect-ratio: 245/150; }
.start h2 { font: 600 27px/1.3 "Space Grotesk", sans-serif; max-width: 300px; margin: 0 auto 9px; }
.start p { color: var(--secondary); font-size: 14px; margin: 0 0 18px; }
.start .demo-unavailable, .start .small { margin: 12px 0 0; }
.demo-unavailable { background: var(--surface); display: inline-block; padding: 8px 16px; border-radius: 8px; }
.primary, .app-download { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border-radius: 8px; font-weight: 600; }
.primary { min-height: 48px; padding: 10px 26px; }
.app-download { min-height: 44px; padding: 8px 15px; font-size: 14px; }
.primary:hover, .app-download:hover { background: #0756c5; }
.small { font-size: 14px; color: var(--muted); }
.loading, .player-error { position: absolute; inset: 0; background: var(--bg); display: grid; place-items: center; text-align: center; padding: 24px; z-index: 2; }
.loading-brand { animation: ezgo-brand-in .28s ease-out both; }
.loading .ez-site-brand { font-size: clamp(44px, 8vw, 70px); }
@keyframes ezgo-brand-in { from { opacity: .25; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.bar { width: 176px; height: 3px; background: var(--raised); border-radius: 3px; overflow: hidden; margin: 22px auto 12px; }
.bar::after { content: ""; display: block; background: var(--focus); width: 45%; height: 100%; animation: game-loading 1.2s infinite ease-in-out; }
@keyframes game-loading { from { transform: translateX(-100%); } to { transform: translateX(330%); } }
.frame-host iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; z-index: 1; }
.frame-host iframe[inert] { visibility: hidden; }
.player-controls { position: absolute; top: 12px; right: 12px; z-index: 3; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin: 20px 0 28px; }
.toolbar > div:first-child { min-width: 0; }
.toolbar h1 { font: 600 clamp(22px, 2vw, 27px)/1.3 "Space Grotesk", "Noto Sans Thai", sans-serif; overflow-wrap: anywhere; margin: 0 0 5px; }
.provider { font: 14px "Space Grotesk", sans-serif; color: var(--focus); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; background: var(--raised); border-radius: 8px; }
.icon:hover { background: #203452; }
.icon:disabled { opacity: .45; cursor: default; }
.icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon[aria-pressed="true"] { color: var(--focus); }
.icon[aria-pressed="true"] svg { fill: currentColor; }

.label { font: 13px "Space Grotesk", sans-serif; letter-spacing: .07em; color: var(--muted); margin: 0 0 12px; }
.article { padding: 30px 0; border-top: 1px solid #1b2939; }
.article h2 { font-size: 27px; line-height: 1.5; margin: 0 0 16px; }
.article p { color: var(--secondary); margin: 0 0 18px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 24px 0 0; }
.feature { background: var(--surface); border-radius: 10px; padding: 22px; }
.num { font: 14px "Space Grotesk", sans-serif; color: var(--focus); }
.feature h3 { font-size: 17px; margin: 10px 0; }
.feature p { font-size: 14px; margin: 0; }
.game-screenshots { display: grid; gap: 16px; }
.game-screenshots img { display: block; width: 100%; height: auto; border-radius: 10px; }
.source { font-size: 14px; color: var(--muted); }
.source a { color: var(--focus); }

.insight-panel, .sidebox { background: var(--surface); padding: 24px; border-radius: 12px; }
.insight-panel h3 { font-size: 17px; margin: 0 0 18px; }
.insight-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.insight-stats > div { background: var(--bg); padding: 14px; border-radius: 9px; }
.insight-stats small, .recommended-game small { display: block; font-size: 13px; color: var(--muted); }
.insight-stats strong { display: block; font: 600 25px/1.5 "Space Grotesk", sans-serif; overflow-wrap: anywhere; }
.insight-stats > div:first-child strong, .recommended-game .recommendation-score { color: var(--focus); }
.insight-stats progress { width: 100%; height: 5px; accent-color: var(--focus); display: block; margin: 5px 0 8px; }
.insight-panel .recommendation-title { margin-top: 22px; }
.recommendations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.recommended-game { display: flex; align-items: center; gap: 10px; background: var(--bg); padding: 10px; border-radius: 8px; }
.recommended-game:hover, .tags a:hover { background: #203452; }
.recommended-game img { flex: none; border-radius: 5px; object-fit: cover; }
.recommended-game b { font: 500 14px/1.4 "Space Grotesk", sans-serif; display: block; overflow-wrap: anywhere; }

.sidebox { margin-bottom: 24px; }
.aside-title { font-size: 19px; font-weight: 600; margin: 0 0 14px; }
.stat { padding: 13px 0; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #1a2839; font-size: 14px; }
.stat b { font: 600 18px "Space Grotesk", sans-serif; text-align: right; }
.tags { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 16px; }
.tags a, .tags span { background: var(--raised); padding: 3px 9px; border-radius: 4px; font-size: 14px; color: var(--secondary); }
.rating-row { padding: 16px 0; border-bottom: 1px solid #1a2839; font-size: 14px; }
.rating-row > span { display: block; color: var(--secondary); }
.rating-row b { font: 600 20px "Space Grotesk", sans-serif; margin-left: 7px; }
.stars, #rating-buttons button { color: #ffc85c; }
.stars { letter-spacing: 2px; }
#rating-count, .rate-box small { display: block; font-size: 13px; color: var(--muted); }
.rate-box { padding-top: 18px; font-size: 14px; }
#rating-buttons { display: flex; flex-wrap: wrap; margin: 8px 0; }
#rating-buttons button { font-size: 25px; min-width: 44px; min-height: 44px; padding: 0; background: transparent; }
#rating-buttons button[aria-pressed="true"] { background: #183357; border-radius: 6px; }
#rating-buttons .rating-star-muted { color: #899bb3; }
#rating-buttons button:disabled { opacity: .5; }
.other-game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.other-game { display: block; border-radius: 8px; overflow: hidden; background: var(--raised); }
.other-game img { display: block; width: 100%; height: auto; aspect-ratio: 334/410; object-fit: cover; transition: transform .2s; }
.other-game:hover img { transform: scale(1.04); }

@media (max-width: 1100px) {
  .insight-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recommendations { grid-template-columns: 1fr; }
}
@media (max-width: 950px) {
  .wrap { width: calc(100% - 48px); }
  .layout { grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; }
  .player { height: 460px; }
  .sidebox { padding: 20px; }
  .features { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 36px); }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .player { height: 420px; }
  .crumb { padding: 10px 0 18px; }
  .actions { gap: 6px; }
  .article h2 { font-size: 24px; }
  .insight-panel { padding: 16px; }
  .insight-stats { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-brand { animation: none; }
  .bar::after { animation: none; width: 100%; }
  .other-game img { transition: none; }
}

.loading-sponsor-slot { min-height: 142px; margin-top: 18px; display: grid; align-items: start; justify-items: center; }
.loading-sponsor { display: flex; align-items: center; gap: clamp(12px, 3vw, 22px); width: fit-content; max-width: min(460px, 100%); text-align: start; }
.loading-sponsor > img { display: block; width: 74px; height: 90px; flex: none; object-fit: contain; border-radius: 5px; }
.loading-sponsor-copy { display: grid; gap: 5px; min-width: 0; color: var(--secondary); overflow-wrap: anywhere; }
.loading-sponsor-copy strong { color: var(--text); line-height: 1.35; }
.loading-sponsor-copy p { margin: 0; font-size: 14px; line-height: 1.45; }
.loading-sponsor-button { display: inline-flex; align-items: center; justify-content: center; justify-self: start; min-height: 44px; padding: 4px 13px; margin-top: 3px; border-radius: 7px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 700; }
.loading-sponsor-button:hover { background: #0756c5; }

