/* =========================================================
   MikSoftware Games — sub-site (games/index.html)
   ========================================================= */
html, body.games-page { height: 100%; overflow: hidden; }
body.games-page { background: var(--dark); color: #fff; overscroll-behavior: none; }

/* ---------- Loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 100; background: #07090c; color: #f3efe6;
  display: grid; place-items: center;
  transition: clip-path 0.9s var(--ease) 0.1s;
  clip-path: inset(0 0 0 0);
}
.loader svg { width: 72px; height: 72px; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(0.82); } }
body.is-loaded .loader { clip-path: inset(0 0 100% 0); }

/* ---------- Slider ---------- */
.gslider { position: fixed; inset: 0; touch-action: pan-y; user-select: none; cursor: grab; }
.gslider.is-dragging { cursor: grabbing; }
.gslide { position: absolute; inset: 0; visibility: hidden; overflow: hidden; }
.gslide.is-active, .gslide.is-leaving { visibility: visible; }
.gslide.is-active { z-index: 2; }
.gslide.is-leaving { z-index: 1; }

.gslide-bg { position: absolute; inset: 0; }
.gslide-bg > svg, .gslide-bg > img { width: 100%; height: 100%; object-fit: cover; }
.gslide-bg::after { /* dim + blur feel like the reference */
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14,14,14,0.78) 0%, rgba(14,14,14,0.45) 45%, rgba(14,14,14,0.2) 70%, rgba(14,14,14,0.55) 100%),
    linear-gradient(0deg, rgba(14,14,14,0.6), transparent 35%);
}
.gslide.is-active .gslide-bg { animation: bgIn 1.3s var(--ease) both; }
.gslide.is-active.from-left .gslide-bg { animation-name: bgInLeft; }
@keyframes bgIn { from { clip-path: inset(0 0 0 100%); transform: scale(1.12); } to { clip-path: inset(0 0 0 0); transform: scale(1); } }
@keyframes bgInLeft { from { clip-path: inset(0 100% 0 0); transform: scale(1.12); } to { clip-path: inset(0 0 0 0); transform: scale(1); } }

.gslide-content {
  position: relative; z-index: 2; height: 100%;
  display: flex; flex-direction: column; justify-content: safe center;
  padding: calc(var(--header-h) + 48px) var(--gutter) 110px;
  max-width: min(720px, 100%);
  overflow-y: auto; scrollbar-width: none;
}
.gslide-content::-webkit-scrollbar { display: none; }
.gslide-content > * { flex-shrink: 0; }
.gslide-title { font-size: clamp(44px, min(8.6vw, 14vh), 132px); position: relative; }
.gslide-title .line { display: block; overflow: hidden; }
.gslide-title .line > span { display: inline-block; }
.gbadge {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  margin-left: 0.25em; padding: 0.18em 0.55em; border-radius: 0.4em;
  background: var(--accent); color: #fff; font-size: 0.16em; letter-spacing: 0.04em; transform: translateY(-0.25em);
}
.gslide-genre { margin-top: clamp(28px, 5vh, 60px); font-size: clamp(18px, 2vw, 28px); font-weight: 900; text-transform: uppercase; }
.gslide-desc { margin-top: 10px; color: #cfcfcf; max-width: 460px; font-size: 15px; }
.gslide-thumb {
  margin-top: 26px; width: min(340px, 70vw); aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden;
  box-shadow: 0 0 0 3px var(--accent), 0 30px 60px -20px rgba(0,0,0,0.7);
  transition: transform 0.5s var(--ease);
}
.gslide-thumb:hover { transform: translateY(-4px) rotate(-1deg); }
.gslide-thumb svg, .gslide-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gslide-cta { margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; }
.discover {
  display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  transition: background 0.25s, color 0.25s, transform 0.3s var(--ease);
}
.discover:hover { background: var(--accent); color: #fff; transform: translateY(-2px); }
.discover::before { content: "+"; font-size: 16px; }

/* staggered text-in */
.gslide [data-in] { opacity: 0; transform: translateY(30px); }
.gslide-title .line > span[data-in] { transform: translateY(105%); opacity: 1; }
.gslide.is-active [data-in] { animation: textIn 0.9s var(--ease) both; animation-delay: calc(0.35s + var(--d, 0) * 0.08s); }
@keyframes textIn { to { opacity: 1; transform: none; } }

/* ---------- "Other projects" slide ---------- */
.gslide.is-other .gslide-bg { background: radial-gradient(ellipse at 80% 20%, rgba(255,90,31,0.35), transparent 50%), var(--dark-2); }
.gslide.is-other .gslide-bg::after { display: none; }
.other-grid { margin-top: 30px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 640px; }
.other-grid a { border-radius: 14px; overflow: hidden; aspect-ratio: 9 / 14; position: relative; transition: transform 0.4s var(--ease); box-shadow: 0 20px 40px -20px #000; }
.other-grid a:hover { transform: translateY(-8px); }
.other-grid svg { width: 100%; height: 100%; }

/* ---------- Side list nav ---------- */
.glist {
  position: fixed; z-index: 10; right: 0; bottom: 120px; list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 14px;
}
.glist button {
  display: flex; align-items: center; gap: 14px; padding-right: var(--gutter);
  font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.45);
  transition: color 0.3s;
}
.glist button::after { content: ""; width: 0; height: 2px; background: #fff; transition: width 0.5s var(--ease); margin-right: calc(var(--gutter) * -1); }
.glist button:hover { color: #fff; }
.glist button.is-active { color: #fff; }
.glist button.is-active::after { width: 46px; }

/* ---------- Bottom bar ---------- */
.gbar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; pointer-events: none; }
.gbar .hint { font-size: 11px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.gdots { display: flex; gap: 8px; pointer-events: auto; }
.gdots button { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,0.35); transition: width 0.4s var(--ease), background 0.3s; }
.gdots button.is-active { width: 28px; background: var(--accent); }
.gcounter { position: fixed; z-index: 10; left: var(--gutter); bottom: 30px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; }
.gcounter b { font-size: 22px; }
.gcounter span { color: rgba(255,255,255,0.45); }
.gprogress { position: fixed; z-index: 10; left: 0; bottom: 0; height: 3px; background: var(--accent); width: 0; transition: width 0.8s var(--ease); }

.go-back {
  position: fixed; z-index: 10; left: var(--gutter); top: calc(var(--header-h) + 4px);
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.7);
}
.go-back:hover { color: var(--accent); }
.go-back svg { width: 14px; height: 14px; }

.arrows { position: fixed; z-index: 10; right: var(--gutter); top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 10px; }
.arrows button { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4); transition: 0.25s; }
.arrows button:hover { background: #fff; color: var(--ink); }
.arrows svg { width: 18px; height: 18px; }

/* ---------- Detail drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); opacity: 0; transition: opacity 0.4s; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%); transition: transform 0.6s var(--ease);
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer.is-open .drawer-panel { transform: none; }
.drawer-hero { aspect-ratio: 16 / 10; position: relative; }
.drawer-hero svg, .drawer-hero img { width: 100%; height: 100%; object-fit: cover; }
.drawer-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; display: grid; place-items: center; }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-body { padding: 32px clamp(20px, 4vw, 40px) 48px; }
.drawer-body .eyebrow { color: var(--accent); }
.drawer-body h2 { font-size: clamp(40px, 7vw, 64px); margin: 8px 0 18px; }
.drawer-body > p { color: #555; }
.store-btns { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 36px; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 14px; transition: transform 0.3s var(--ease), background 0.2s; }
.store-btn:hover { transform: translateY(-2px); background: var(--accent); }
.store-btn svg { width: 20px; height: 20px; }
.store-btn small { display: block; font-size: 10px; font-weight: 500; opacity: 0.7; line-height: 1; }
.features { list-style: none; padding: 0; margin: 0 0 36px; display: grid; gap: 10px; }
.features li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: #fff; border-radius: 12px; font-size: 14.5px; }
.features li::before { content: "✦"; color: var(--accent); }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.shots div { aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; }
.shots svg { width: 100%; height: 100%; }
.drawer-body .notice { margin-top: 28px; font-size: 12.5px; color: #888; }
.drawer-body .notice a { text-decoration: underline; }

@media (min-width: 1100px) { .arrows { display: flex; } .glist { right: 70px; } }
@media (max-width: 860px) {
  .glist { display: none; }
  .gslide-content { justify-content: flex-end; padding-bottom: 120px; }
  .gslide-bg::after { background: linear-gradient(0deg, rgba(14,14,14,0.92) 0%, rgba(14,14,14,0.55) 55%, rgba(14,14,14,0.25) 100%); }
  .gslide-thumb { display: none; }
  .gcounter { display: none; }
  .other-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 320px; }
  .other-grid a { aspect-ratio: 4 / 3; }
}
@media (max-height: 640px) and (min-width: 861px) {
  .gslide-thumb { display: none; }
}
@media (max-height: 760px) and (min-width: 861px) {
  .gslide-thumb { width: 220px; margin-top: 16px; }
  .gslide-desc { font-size: 14px; }
  .gslide-genre { margin-top: 20px; }
}

/* ---------- Real game assets (Idle Dino) ---------- */
.discover.is-ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6); }
.discover.is-ghost::before { content: "↗"; font-size: 13px; }
.discover.is-ghost:hover { background: #fff; color: var(--ink); box-shadow: none; }

.other-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 520px; }
.other-grid > a, .other-grid > div { aspect-ratio: 1; border-radius: 22px; position: relative; overflow: hidden; }
.other-grid .is-game { display: block; background: #000; }
.other-grid .is-game img { width: 100%; height: 100%; object-fit: cover; }
.other-grid .is-game span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}
.other-grid .is-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed rgba(255,255,255,0.25); color: rgba(255,255,255,0.5);
}
.other-grid .is-soon span { font-size: 40px; font-weight: 900; line-height: 1; }
.other-grid .is-soon small { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.drawer-hero { aspect-ratio: 1024 / 500; }
.drawer-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.drawer-icon { width: 76px; height: 76px; border-radius: 18px; flex: none; box-shadow: 0 10px 24px -10px rgba(0,0,0,0.5); margin-top: -56px; border: 4px solid var(--paper); }
.drawer-head h2 { font-size: clamp(24px, 4vw, 32px); font-weight: 900; line-height: 1.15; margin: 4px 0 0; }
.features li b { display: block; font-weight: 800; text-transform: uppercase; font-size: 13px; letter-spacing: 0.03em; margin-bottom: 2px; color: var(--ink); }
.features li div { color: #555; }
.shots img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 860px) {
  .other-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 100%; }
  .other-grid > a, .other-grid > div { aspect-ratio: 1; }
  .gslide-cta .is-ghost { padding: 11px 16px; }
}

/* screenshot strip on the slide (replaces the single thumbnail) */
.gslide-shots { margin-top: 24px; display: flex; gap: 10px; width: max-content; max-width: 100%; }
.gslide-shots img {
  width: clamp(58px, 6vw, 84px); aspect-ratio: 9 / 16; object-fit: cover; border-radius: 10px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.85), 0 16px 30px -12px rgba(0,0,0,0.8);
  transition: transform 0.4s var(--ease);
}
.gslide-shots img:nth-child(odd) { transform: rotate(-3deg); }
.gslide-shots img:nth-child(even) { transform: rotate(3deg) translateY(6px); }
.gslide-shots:hover img { transform: translateY(-6px) rotate(0); }
@media (max-height: 760px) { .gslide-shots { display: none; } }
@media (max-width: 860px) { .gslide-shots img { width: 54px; } }

.store-btn.is-soon { background: #8d8d8d; cursor: default; pointer-events: none; }
.discover.is-soon { opacity: 0.7; cursor: default; pointer-events: none; }
.discover.is-soon::before { content: none; }
