/* ═══════════════════════════════════════════════════════════════
   OYUN KUR — Uzman Oyun Alanı
   Tek tasarım sistemi, tüm sayfalar ve oyunlar
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&display=swap');

:root {
  --bg: #0b0e14;
  --bg-soft: #11151d;
  --surface: #161c26;
  --surface-hover: #1a212c;
  --card: #151a24;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.1);
  --text: #f0f4f8;
  --text-soft: #94a3b8;
  --muted: #64748b;
  --accent: #00c9a7;
  --accent-dim: rgba(0,201,167,0.15);
  --accent-glow: rgba(0,201,167,0.25);
  --danger: #f43f5e;
  --success: #22c55e;
  --warn: #eab308;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0,201,167,0.08), transparent);
}

/* ─── Header (tüm sayfalar) ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,14,20,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-link {
  display: inline-flex;
  text-decoration: none;
  flex-shrink: 0;
}

.logo {
  width: 44px;
  height: 44px;
  padding: 6px;
  background: #fff;
  border-radius: var(--radius-sm);
  object-fit: cover;
  object-position: left center;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.logo:hover { transform: scale(1.04); }

.title-wrap { flex: 1; min-width: 0; }
.title-wrap h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}
.title-wrap .tag {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-soft);
  font-weight: 500;
}

.header-badge {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

/* ─── Container & Layout ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
}

/* ─── Hub: Hero ─── */
.hub-hero {
  text-align: center;
  padding: 40px 20px 36px;
  margin-bottom: 8px;
}
.hub-hero h2 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}
.hub-hero p {
  margin: 0;
  font-size: 1rem;
  color: var(--text-soft);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Hub: Kategori blokları ─── */
.games-section {
  margin-bottom: 32px;
}
.games-section h3 {
  margin: 0 0 14px 4px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* ─── Hub: Oyun kartı ─── */
.game-card {
  display: block;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.game-card:hover {
  border-color: var(--accent-dim);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}
.game-card .card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}
.game-card .card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}
.game-card .card-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}
.game-card .card-sub {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin-top: 2px;
}
.game-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.game-card .card-diff {
  font-size: 0.75rem;
  color: var(--muted);
  padding: 4px 8px;
  background: var(--surface);
  border-radius: 6px;
  font-weight: 500;
}
.game-card .btn-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.2s, transform 0.1s;
}
.game-card .btn-play:hover { filter: brightness(1.1); }
.game-card .btn-play:active { transform: scale(0.98); }

/* ─── Footer note ─── */
.footer-note {
  text-align: center;
  padding: 24px 20px;
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ─── Oyun sayfası: shell ─── */
.game-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.game-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.game-header .logo {
  width: 40px;
  height: 40px;
  padding: 4px;
}
.game-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}
.game-desc {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 4px;
}
.game-area { margin-top: 20px; }

.container.game-centered {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}

/* ─── Butonlar & Kontroller ─── */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.btn {
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent;
  color: var(--text-soft);
}
.btn-ghost:hover { color: var(--accent); background: var(--accent-dim); }
.back-link {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 0;
  transition: color 0.2s;
}
.back-link:hover { color: var(--accent); }

/* ─── Tam ekran butonu ─── */
.fullscreen-btn {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 99;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: background 0.2s;
}
.fullscreen-btn:hover { background: var(--surface-hover); }
body.fullscreen-mode .site-header,
body.fullscreen-mode .fullscreen-btn { display: none; }
body.fullscreen-mode .container { max-width: 100%; padding: 16px; }
body.fullscreen-mode .game-shell { max-width: 96%; }

/* ─── Tic Tac Toe ─── */
.board-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 320px;
  margin: 0 auto;
}
.cell-ttt {
  aspect-ratio: 1;
  min-height: 90px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.cell-ttt:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.cell-ttt.win { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ─── Pong / Canvas oyunları ─── */
.canvas-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}
.canvas-wrap canvas {
  max-width: 100%;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-soft);
  display: block;
}

/* ─── 2048 ─── */
.grid-2048 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 340px;
  margin: 0 auto;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius);
}
.tile-2048 {
  aspect-ratio: 1;
  min-height: 70px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  transition: transform 0.1s;
}
.tile-2048.empty { background: rgba(255,255,255,0.04); }

/* ─── Memory kartları ─── */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}
.mem-card {
  aspect-ratio: 1;
  min-height: 80px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--surface);
  color: transparent;
  position: relative;
  overflow: hidden;
  perspective: 600px;
  font-family: inherit;
}
.mem-card .face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  border-radius: var(--radius);
}
.mem-card .back { transform: rotateY(180deg); background: var(--accent); color: var(--bg); }
.mem-card.flipped .inner { transform: rotateY(180deg); }
.mem-card .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  transform-style: preserve-3d;
}
.mem-card.matched { opacity: 0; pointer-events: none; transform: scale(0.9); transition: 0.3s; }

/* ─── Minesweeper ─── */
.ms-grid {
  display: grid;
  gap: 4px;
  margin: 0 auto;
  max-width: max-content;
}
.ms-cell {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.2s;
}
.ms-cell:hover { background: var(--surface-hover); }
.ms-cell.revealed { cursor: default; background: var(--bg-soft); }
.ms-cell.mine { background: var(--danger); }

/* ─── Simon ─── */
.simon-pads {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 280px;
  margin: 0 auto;
}
.simon-pad {
  aspect-ratio: 1;
  min-height: 120px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  font-family: inherit;
  transition: transform 0.15s, filter 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.simon-pad:hover { transform: scale(1.02); }
.simon-pad:active, .simon-pad.lit { filter: brightness(1.3); transform: scale(0.98); }

/* ─── Whack-a-Mole ─── */
.wam-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 340px;
  margin: 0 auto;
}
.wam-hole {
  aspect-ratio: 1;
  min-height: 90px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 2px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: 0.2s;
}
.wam-hole.up { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }

/* ─── Reaction ─── */
.reaction-box {
  width: 200px;
  height: 120px;
  margin: 24px auto;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.2s;
  border: 2px solid var(--border);
}
.reaction-box.wait { background: var(--warn); color: var(--bg); }
.reaction-box.go { background: var(--success); color: #fff; }

/* ─── 15 Puzzle ─── */
.slide-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 320px;
  margin: 0 auto;
  padding: 10px;
  background: var(--surface);
  border-radius: var(--radius);
}
.slide-tile {
  aspect-ratio: 1;
  min-height: 68px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}
.slide-tile:hover { background: var(--surface-hover); }
.slide-tile.empty { visibility: hidden; cursor: default; }

/* ─── Guess / Typing: input ─── */
.input-group {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.input-group input {
  width: 100px;
  padding: 12px 16px;
  font-size: 1.1rem;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.input-group input:focus {
  outline: none;
  border-color: var(--accent);
}
.game-status { font-weight: 600; margin: 12px 0; color: var(--accent); min-height: 1.5em; }

/* ─── Typing test ─── */
.phrase-box {
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 100px;
  white-space: pre-wrap;
  margin: 12px 0;
}
.typing-input {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  resize: vertical;
}
.typing-input:focus { outline: none; border-color: var(--accent); }
.keyboard-row { display: flex; justify-content: center; gap: 4px; margin-bottom: 4px; }
.key-cap {
  min-width: 32px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  font-family: inherit;
}

/* ─── Clicker ─── */
.clicker-display { font-size: 3rem; font-weight: 800; text-align: center; color: var(--accent); margin: 8px 0; }
.clicker-timer { text-align: center; color: var(--text-soft); margin-bottom: 12px; }
.clicker-btn { padding: 20px 48px; font-size: 1.25rem; margin: 8px auto; display: block; }
.meter-bar {
  height: 8px;
  background: var(--surface);
  border-radius: 4px;
  overflow: hidden;
  max-width: 200px;
  margin: 12px auto;
}
.meter-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.15s; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .games-grid { grid-template-columns: 1fr; }
  .game-shell { padding: 18px; }
  .cell-ttt { min-height: 72px; font-size: 1.8rem; }
  .tile-2048 { min-height: 60px; font-size: 1.2rem; }
  .memory-grid { grid-template-columns: repeat(3, 1fr); max-width: 280px; }
  .simon-pad { min-height: 100px; }
  .fullscreen-btn { top: 64px; right: 12px; width: 38px; height: 38px; }
}
