/* CatGamesHub — launcher + oyun UI */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700&display=swap");

: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.25rem, 3vw, 2rem);
}

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

.hero h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 2.75rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(135deg, #fff 0%, #c4b5fd 42%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  margin: 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  font-weight: 400;
}

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

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 14px;
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(500px 220px at 20% 0%, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(420px 200px at 90% 20%, rgba(34, 211, 238, 0.1), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}

.tile:hover {
  border-color: var(--stroke2);
  transform: translateY(-2px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.tile:active {
  transform: translateY(0) scale(0.99);
}

.tile__viz {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 92px;
}

.tile__viz svg {
  width: 86px;
  height: 86px;
  filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.45));
}

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

.tile__kicker {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted2);
  font-weight: 600;
}

.tile__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.tile__chev {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 0.85rem;
}

.hub footer {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 62ch;
}

.hub footer strong {
  color: #e5e7eb;
  font-weight: 600;
}

/* ——— 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;
}
