/* CatGamesHub — launcher + oyun UI (fontlar HTML’de link ile yüklenir) */

:root {
  --void: #07080d;
  --bg0: #0b0d14;
  --bg1: #12151f;
  --surface: rgba(255, 255, 255, 0.04);
  --surface2: rgba(255, 255, 255, 0.07);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke2: rgba(255, 255, 255, 0.16);
  --text: #f3f4f6;
  --muted: #9ca3af;
  --muted2: #6b7280;
  --accent: #7c3aed;
  --accent2: #22d3ee;
  --hot: #fb7185;
  --ok: #34d399;
  --game-bg: #05060a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  --radius: 20px;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Outfit", var(--font-sans);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--void);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
}

body.hub {
  background: radial-gradient(1200px 700px at 12% -10%, rgba(124, 58, 237, 0.22), transparent 55%),
    radial-gradient(900px 600px at 92% 8%, rgba(34, 211, 238, 0.12), transparent 50%),
    linear-gradient(180deg, var(--bg0), var(--void));
}

body.hub::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

body {
  padding: max(16px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
}

a {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero {
  margin-bottom: clamp(1.35rem, 3.5vw, 2.25rem);
  text-align: center;
}

.hero__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 600;
}

.hero h1 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.15rem, 7vw, 3.1rem);
  letter-spacing: -0.035em;
  line-height: 1.02;
  background: linear-gradient(120deg, #fff 0%, #e9d5ff 38%, #67e8f9 72%, #a5f3fc 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: hero-shine 7s ease-in-out infinite;
}

@keyframes hero-shine {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero h1 {
    animation: none;
    background-size: 100% auto;
  }

  .tile {
    animation: none !important;
  }

  .tile::before {
    animation: none !important;
  }

  .tile__viz svg {
    transition: none !important;
  }
}

.hero__lead {
  margin: 0 auto;
  max-width: 28ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  font-weight: 450;
}

.launcher {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 16px;
}

.tile {
  --tile-glow: rgba(124, 58, 237, 0.38);
  --tile-viz: rgba(124, 58, 237, 0.16);
  --tile-edge: rgba(255, 255, 255, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 178px;
  padding: 16px 16px 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 42%, var(--tile-glow)) border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.22), 0 22px 50px rgba(0, 0, 0, 0.45), 0 0 48px var(--tile-glow);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.34, 1.2, 0.64, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  animation: tile-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.tile:nth-child(1) {
  animation-delay: 0.03s;
}
.tile:nth-child(2) {
  animation-delay: 0.06s;
}
.tile:nth-child(3) {
  animation-delay: 0.09s;
}
.tile:nth-child(4) {
  animation-delay: 0.12s;
}
.tile:nth-child(5) {
  animation-delay: 0.15s;
}
.tile:nth-child(6) {
  animation-delay: 0.18s;
}
.tile:nth-child(7) {
  animation-delay: 0.21s;
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tile::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: conic-gradient(from 120deg, transparent 0%, var(--tile-glow), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  animation: tile-orbit 10s linear infinite;
}

@keyframes tile-orbit {
  to {
    transform: rotate(360deg);
  }
}

.tile:hover::before {
  opacity: 0.22;
}

.tile:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--tile-edge);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18), 0 32px 70px rgba(0, 0, 0, 0.55), 0 0 64px var(--tile-glow);
}

.tile:active {
  transform: translateY(-2px) scale(0.99);
}

.tile--mouse {
  --tile-glow: rgba(251, 113, 133, 0.42);
  --tile-viz: rgba(251, 113, 133, 0.2);
}
.tile--bird {
  --tile-glow: rgba(56, 189, 248, 0.42);
  --tile-viz: rgba(56, 189, 248, 0.18);
}
.tile--laser {
  --tile-glow: rgba(248, 113, 113, 0.5);
  --tile-viz: rgba(248, 113, 113, 0.22);
}
.tile--dot {
  --tile-glow: rgba(34, 211, 238, 0.42);
  --tile-viz: rgba(34, 211, 238, 0.18);
}
.tile--fish {
  --tile-glow: rgba(59, 130, 246, 0.42);
  --tile-viz: rgba(59, 130, 246, 0.18);
}
.tile--butterfly {
  --tile-glow: rgba(192, 132, 252, 0.42);
  --tile-viz: rgba(192, 132, 252, 0.18);
}
.tile--bugs {
  --tile-glow: rgba(163, 230, 53, 0.35);
  --tile-viz: rgba(163, 230, 53, 0.14);
}

.tile__viz {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 96px;
  border-radius: 16px;
  background: radial-gradient(80% 80% at 50% 18%, var(--tile-viz), transparent 72%);
}

.tile__viz svg {
  width: 92px;
  height: 92px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.5));
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.tile:hover .tile__viz svg {
  transform: scale(1.06) translateY(-2px);
}

.tile__meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
}

.tile__kicker {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 700;
}

.tile__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -0.025em;
  color: #f9fafb;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.tile__chev {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e5e7eb;
  font-size: 0.88rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}

.tile:hover .tile__chev {
  transform: translate(2px, -2px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  border-color: var(--tile-edge);
}

/* ——— Oyun sayfası ——— */
body.game-page {
  padding: 0;
}

.game-page {
  position: fixed;
  inset: 0;
  background: var(--game-bg);
  display: flex;
  flex-direction: column;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.game-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: radial-gradient(900px 500px at 50% -10%, rgba(124, 58, 237, 0.12), transparent 60%), #05060a;
}

.game-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(12, 14, 22, 0.72), rgba(8, 9, 14, 0.92));
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  flex-shrink: 0;
}

.game-bar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.lock-screen {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  background: rgba(6, 7, 12, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
}

.lock-screen[hidden] {
  display: none !important;
}

.lock-screen__text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  max-width: 24rem;
  font-weight: 450;
}

.lock-screen__text strong {
  color: #e5e7eb;
  font-weight: 600;
}

.unlock-hold {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  width: 108px;
  height: 108px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.unlock-hold:active {
  border-color: rgba(34, 211, 238, 0.35);
}

.unlock-hold__fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.65));
  pointer-events: none;
}

.unlock-hold__label {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  text-align: center;
  padding: 8px;
  max-width: 98px;
}

.game-bar a,
.game-bar button {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
  min-height: 44px;
}

.game-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.game-bar button.on {
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.game-bar button:active,
.game-bar a:active {
  transform: translateY(1px);
}

.hint {
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
  flex: 1;
  font-weight: 450;
  min-width: 8rem;
}

.speed {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.speed__label {
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 700;
  width: 100%;
  text-align: center;
}

@media (min-width: 520px) {
  .speed__label {
    width: auto;
    text-align: left;
  }
}

.speed button[data-speed] {
  min-width: auto;
  padding: 8px 10px;
  font-size: 0.72rem;
  opacity: 0.75;
}

.speed button[data-speed].is-active {
  opacity: 1;
  border-color: rgba(124, 58, 237, 0.55);
  color: #e9d5ff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.25) inset;
}

