/* KOZMOS BİRLEŞTİR — tüm arayüz stilleri */

/* ---------- tema değişkenleri ---------- */
:root {
  --bg-0: #05030f;
  --bg-1: #0d0622;
  --surface: #160d31;
  --surface-2: #221448;
  --overlay: rgba(9, 4, 24, 0.86);
  --violet: #7c3aed;
  --cyan: #22d3ee;
  --magenta: #f043c8;
  --amber: #ffb020;
  --solar: #ffe45e;
  --success: #34d399;
  --danger: #ff3b5c;
  --text: #efeaff;
  --muted: #9a94b8;
  --warm: #f5ead9;
  --line: rgba(124, 58, 237, 0.35);
  --font-d: "Orbitron", "Segoe UI", sans-serif;
  --font-b: "Space Grotesk", "Segoe UI", sans-serif;
}
/* ---------- temel sıfırlama & kaydırma çubukları ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--violet) var(--bg-1);
}
html,
body {
  height: 100%;
}
body {
  font-family: var(--font-b);
  color: var(--text);
  background: var(--bg-0);
  background-image:
    radial-gradient(
      1100px 600px at 85% -10%,
      rgba(240, 67, 200, 0.14),
      transparent 60%
    ),
    radial-gradient(
      900px 700px at -10% 30%,
      rgba(34, 211, 238, 0.1),
      transparent 60%
    ),
    radial-gradient(
      1000px 800px at 50% 110%,
      rgba(124, 58, 237, 0.2),
      transparent 65%
    ),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 70%);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  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='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-1);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--violet), var(--magenta));
  border-radius: 8px;
  border: 2px solid var(--bg-1);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--cyan), var(--violet));
}
/* ---------- üst çubuk ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px clamp(12px, 3vw, 28px);
  background: linear-gradient(
    180deg,
    rgba(13, 6, 34, 0.92),
    rgba(13, 6, 34, 0.78)
  );
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-d);
  font-weight: 900;
  letter-spacing: 0.06em;
  font-size: clamp(15px, 2.4vw, 20px);
}
.logo .orb {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 30%,
    #fff8d0,
    var(--solar) 35%,
    var(--amber) 62%,
    #b45309 100%
  );
  box-shadow:
    0 0 18px rgba(255, 176, 32, 0.7),
    0 0 40px rgba(240, 67, 200, 0.35);
  animation: orbPulse 3.2s ease-in-out infinite;
}
@keyframes orbPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
}
.logo em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.chips {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
}
.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 96px;
}
.chip small {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.chip b {
  font-family: var(--font-d);
  font-size: 18px;
  color: var(--solar);
  line-height: 1.1;
}
.chip.best b {
  color: var(--cyan);
}
.hbtns {
  display: flex;
  gap: 8px;
}
button {
  font-family: var(--font-b);
  cursor: pointer;
  border: none;
  color: var(--text);
}
.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition:
    transform 0.15s,
    box-shadow 0.2s,
    background 0.2s;
}
.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4);
  background: #2c1a5e;
}
.icon-btn:active {
  transform: scale(0.94);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn.warn svg {
  stroke: var(--amber);
}
.icon-btn.danger svg {
  stroke: var(--danger);
}
.icon-btn.muted svg {
  stroke: var(--muted);
}

/* ---------- ana yerleşim ---------- */
main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 20px clamp(12px, 3vw, 28px) 40px;
  align-items: start;
}
@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
  }
}

/* ---------- oyun sahnesi ---------- */
.stage-wrap {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.stage {
  position: relative;
  width: 100%;
  aspect-ratio: 480/700;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 20px 60px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(124, 58, 237, 0.25);
  background: var(--bg-1);
}
canvas#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.toasts {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  z-index: 20;
  width: 90%;
}
.toast {
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(34, 211, 238, 0.18),
    rgba(240, 67, 200, 0.18)
  );
  border: 1px solid rgba(34, 211, 238, 0.5);
  color: var(--warm);
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation:
    toastIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1),
    toastOut 0.4s ease 2.4s forwards;
}
.toast.gold {
  border-color: var(--amber);
  background: linear-gradient(
    90deg,
    rgba(255, 176, 32, 0.25),
    rgba(255, 228, 94, 0.2)
  );
  color: var(--solar);
}
.toast.epic {
  border-color: var(--magenta);
  background: linear-gradient(
    90deg,
    rgba(240, 67, 200, 0.3),
    rgba(124, 58, 237, 0.3)
  );
  font-size: 15px;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}
.hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  pointer-events: none;
  font-size: 13px;
  color: var(--warm);
  padding: 8px 16px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(9, 4, 24, 0.7);
  border: 1px solid var(--line);
  animation: hintPulse 1.8s ease-in-out infinite;
}
@keyframes hintPulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.35);
  }
}
.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  place-items: center;
  background: var(--overlay);
  backdrop-filter: blur(6px);
}
.overlay.show {
  display: grid;
  animation: ovIn 0.3s ease;
}
@keyframes ovIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.ov-card {
  text-align: center;
  padding: 30px 34px;
  border-radius: 20px;
  max-width: 88%;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(240, 67, 200, 0.15);
}
.ov-card h2 {
  font-family: var(--font-d);
  font-size: clamp(20px, 4vw, 28px);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ov-card h2.red {
  background: linear-gradient(90deg, var(--danger), var(--amber));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ov-card p {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 16px;
}
.ov-stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ov-stat {
  padding: 10px 18px;
  border-radius: 14px;
  background: rgba(5, 3, 15, 0.5);
  border: 1px solid var(--line);
}
.ov-stat small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.ov-stat b {
  font-family: var(--font-d);
  font-size: 22px;
  color: var(--solar);
}
.ov-stat.cy b {
  color: var(--cyan);
}
.record {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  font-family: var(--font-d);
  font-size: 12px;
  color: #052e1c;
  background: linear-gradient(90deg, var(--success), var(--cyan));
  font-weight: 700;
  animation: orbPulse 1.4s infinite;
}
.btn-primary {
  font-family: var(--font-d);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
  padding: 13px 30px;
  border-radius: 14px;
  color: #0b0620;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  box-shadow: 0 8px 26px rgba(240, 67, 200, 0.4);
  transition:
    transform 0.15s,
    box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.5);
}
.btn-primary:active {
  transform: scale(0.96);
}

/* ---------- yan panel ---------- */
.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.card h3 {
  font-family: var(--font-d);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.evo {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.evo-item {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(5, 3, 15, 0.55);
  border: 1px solid rgba(124, 58, 237, 0.2);
  opacity: 0.32;
  filter: grayscale(0.9);
  transition: all 0.4s;
}
.evo-item.found {
  opacity: 1;
  filter: none;
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.25);
}
.evo-item.found.pop {
  animation: evoPop 0.6s cubic-bezier(0.2, 1.6, 0.4, 1);
}
@keyframes evoPop {
  0% {
    transform: scale(0.4);
  }
  60% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}
.evo-item canvas {
  width: 82%;
  height: 82%;
}
.evo-item span {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.evo-item.found span {
  color: var(--warm);
}
select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(5, 3, 15, 0.6);
  color: var(--text);
  border: 1px solid var(--line);
  font-family: var(--font-b);
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.2);
}
.diff-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}
.diff-note b {
  color: var(--amber);
}
.combo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
#comboBadge {
  font-family: var(--font-d);
  font-weight: 900;
  font-size: 20px;
  color: var(--magenta);
  min-width: 64px;
  text-shadow: 0 0 16px rgba(240, 67, 200, 0.6);
  transition: opacity 0.3s;
}
#comboBadge.idle {
  opacity: 0.25;
  color: var(--muted);
  text-shadow: none;
}
.combo-bar {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: rgba(5, 3, 15, 0.6);
  overflow: hidden;
  border: 1px solid var(--line);
}
#comboFill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta), var(--amber));
  transition: width 0.1s linear;
}
.legend {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.9;
}
.legend kbd {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(5, 3, 15, 0.7);
  border: 1px solid var(--line);
  font-family: var(--font-b);
  font-size: 11px;
  color: var(--cyan);
  margin: 0 2px;
}
.legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
/* ---------- alt bilgi ---------- */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 16px 30px;
  color: var(--muted);
  font-size: 12px;
}
footer b {
  color: var(--violet);
  font-family: var(--font-d);
  letter-spacing: 0.1em;
}
/* ---------- mobil ---------- */
@media (max-width: 860px) {
  .chips {
    margin-left: 0;
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .chip {
    flex: 1;
    align-items: center;
  }
  .evo-item span {
    display: none;
  }
}
/* ---------- odak görünürlüğü & hareket azaltma ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
#game:focus-visible {
  outline-offset: -3px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
