/* ==========================================================
   OYUN MERKEZİ — piksel art teması
   Palet: Sweetie 16 (GrafxKid)
   ========================================================== */

:root {
  --ink: #0f101c;
  --night: #1a1c2c;
  --panel: #29366f;
  --panel-dark: #333c57;
  --slate: #566c86;
  --mist: #94b0c2;
  --paper: #f4f4f4;
  --plum: #5d275d;
  --red: #b13e53;
  --orange: #ef7d57;
  --gold: #ffcd75;
  --lime: #a7f070;
  --green: #38b764;
  --teal: #257179;
  --blue: #3b5dc9;
  --sky: #41a6f6;
  --cyan: #73eff7;

  --px: 4px; /* bir "piksel" */
  --font-title: "Pixelify Sans", "Courier New", monospace;
  --font-body: "VT323", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { background: var(--night); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 22px;
  line-height: 1.25;
  background-color: var(--night);
  /* yıldızlı gökyüzü */
  background-image:
    radial-gradient(var(--paper) 1px, transparent 1.5px),
    radial-gradient(var(--mist) 1px, transparent 1.5px),
    radial-gradient(var(--cyan) 1px, transparent 1.5px);
  background-size: 160px 160px, 220px 220px, 340px 340px;
  background-position: 0 0, 60px 110px, 150px 40px;
  -webkit-font-smoothing: none;
  font-smooth: never;
}

img, canvas { image-rendering: pixelated; }

a { color: var(--cyan); }

h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.04em;
  margin: 0;
}

.wrap {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 16px 64px;
}

/* ---------- Piksel çerçeve ---------- */
.px-box {
  position: relative;
  background: var(--panel-dark);
  border: var(--px) solid var(--ink);
  box-shadow:
    inset var(--px) var(--px) 0 rgba(255, 255, 255, 0.12),
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 rgba(0, 0, 0, 0.3),
    calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--ink);
}

/* ---------- Üst bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--paper);
  text-decoration: none;
}

.brand-icon { width: 48px; height: 48px; flex: none; }

.brand-name {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 600;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--ink);
}

.brand-sub { color: var(--mist); font-size: 20px; }

.nav { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  background: var(--gold);
  border: var(--px) solid var(--ink);
  box-shadow:
    inset calc(var(--px) * -1) calc(var(--px) * -1) 0 rgba(0, 0, 0, 0.25),
    inset var(--px) var(--px) 0 rgba(255, 255, 255, 0.35),
    var(--px) var(--px) 0 var(--ink);
  text-decoration: none;
  cursor: pointer;
  user-select: none;
}

.btn:hover { filter: brightness(1.1); }

.btn:active {
  transform: translate(var(--px), var(--px));
  box-shadow:
    inset var(--px) var(--px) 0 rgba(0, 0, 0, 0.25);
}

.btn:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.card-link:focus-visible {
  outline: var(--px) solid var(--cyan);
  outline-offset: 2px;
}

.btn--green { background: var(--lime); }
.btn--red { background: var(--red); color: var(--paper); }
.btn--ghost { background: var(--panel); color: var(--paper); }
.btn--small { min-height: 36px; padding: 4px 12px; font-size: 15px; }
.btn[aria-current="page"] { background: var(--cyan); }

/* ---------- Hero ---------- */
.hero {
  padding: 28px 24px;
  margin-bottom: 32px;
  background: var(--panel);
  text-align: center;
}

.hero h1 {
  font-size: clamp(30px, 6vw, 52px);
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--ink);
}

.hero p {
  margin: 14px auto 0;
  max-width: 44ch;
  color: var(--paper);
  font-size: 24px;
}

.blink { animation: blink 1.1s steps(1) infinite; color: var(--lime); }
@keyframes blink { 50% { opacity: 0; } }

.section-title {
  font-size: 20px;
  color: var(--cyan);
  margin: 0 0 18px;
  text-shadow: 2px 2px 0 var(--ink);
}

/* ---------- Merkez kartları ---------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  min-height: 250px;
}

.card-icon { width: 64px; height: 64px; }

.card h3 { font-size: 21px; color: var(--gold); }

.card p { margin: 0; color: var(--mist); flex: 1; }

.card-meta {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 15px;
  color: var(--lime);
}

.card--locked { background: #262b40; }
.card--locked .card-icon { opacity: 0.55; filter: grayscale(0.6); }
.card--locked h3 { color: var(--mist); }
.card--locked .card-meta { color: var(--orange); }

a.card-link {
  color: inherit;
  text-decoration: none;
  transition: none;
}

a.card-link:hover {
  transform: translate(-2px, -2px);
  background: var(--panel);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
  background: var(--mist);
  border: 2px solid var(--ink);
  white-space: nowrap;
}

.tag--ps { background: var(--sky); }
.tag--pc { background: var(--mist); }
.tag--switch { background: var(--red); color: var(--paper); }
.tag--xbox { background: var(--green); }
.tag--other { background: var(--gold); }
.tag--genre { background: var(--plum); color: var(--paper); }
.tag--date { background: var(--night); color: var(--cyan); border-color: var(--slate); }

/* ---------- Wishlist ---------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.page-head h1 {
  font-size: clamp(28px, 5vw, 42px);
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--ink);
}

.page-head p { margin: 8px 0 0; color: var(--mist); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat { padding: 12px 16px; background: var(--panel); }
.stat b {
  display: block;
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--lime);
}
.stat span { color: var(--mist); }

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.field label,
.field .label {
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 15px;
  color: var(--cyan);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--paper);
  background: var(--night);
  border: var(--px) solid var(--ink);
  border-radius: 0;
  box-shadow: inset var(--px) var(--px) 0 rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

.field textarea { min-height: 88px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--slate); }

.game-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

.game {
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: 1fr auto;
  gap: 14px;
  padding: 16px;
}

.game-cover {
  width: 72px;
  height: 72px;
  border: var(--px) solid var(--ink);
  background: var(--night);
}

.game-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }

.game-title {
  font-size: 19px;
  color: var(--paper);
  overflow-wrap: anywhere;
}

.game-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.game-note {
  margin: 0;
  color: var(--mist);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.hearts { letter-spacing: 2px; font-size: 22px; line-height: 1; white-space: nowrap; }
.hearts .on { color: var(--red); text-shadow: 2px 2px 0 var(--ink); }
.hearts .off { color: var(--slate); }

.game-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  border-top: var(--px) dashed var(--slate);
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--mist);
}

.empty h2 { font-size: 22px; color: var(--gold); margin-bottom: 12px; }
.empty canvas { width: 96px; height: 96px; margin-bottom: 16px; }
.empty .btn { margin-top: 16px; }

.data-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 40px;
  color: var(--slate);
}

/* ---------- Diyalog ---------- */
dialog.px-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  color: var(--paper);
  background: var(--panel-dark);
  border: var(--px) solid var(--ink);
  box-shadow:
    inset var(--px) var(--px) 0 rgba(255, 255, 255, 0.12),
    calc(var(--px) * 2) calc(var(--px) * 2) 0 var(--ink);
  overflow: auto;
}

dialog.px-dialog::backdrop {
  background: rgba(15, 16, 28, 0.8);
}

.dialog-head {
  padding: 14px 18px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  background: var(--gold);
  border-bottom: var(--px) solid var(--ink);
}

.dialog-body { display: grid; gap: 14px; padding: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.prio { display: flex; gap: 8px; flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
.prio input { position: absolute; opacity: 0; pointer-events: none; }
.prio label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 22px;
  color: var(--mist);
  background: var(--night);
  border: var(--px) solid var(--ink);
  cursor: pointer;
}
.prio input:checked + label { color: var(--paper); background: var(--plum); border-color: var(--gold); }
.prio input:focus-visible + label { outline: var(--px) solid var(--cyan); outline-offset: 2px; }

.dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: var(--green);
  color: var(--ink);
  border: var(--px) solid var(--ink);
  box-shadow: var(--px) var(--px) 0 var(--ink);
  z-index: 10;
  max-width: calc(100vw - 32px);
}
.toast[hidden] { display: none; }
.toast--error { background: var(--red); color: var(--paper); }

.footer {
  margin-top: 56px;
  text-align: center;
  color: var(--slate);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  body { font-size: 20px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .field:first-child { grid-column: 1 / -1; }
  .row-2 { grid-template-columns: 1fr; }
  .stats { gap: 12px; }
  .stat { padding: 10px; }
  .stat span { font-size: 18px; }
  .game-list { grid-template-columns: 1fr; }
  .page-head .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
  a.card-link:hover { transform: none; }
}
