@import url('https://fonts.googleapis.com/css2?family=Pinyon+Script&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --bg: rgb(16, 16, 31);
  --nav-h: 56px;
  --blue-dim: #5a72b0;
  --blue-mid: #7a90c4;
  --blue-bright: #aec3f0;
  --blue-hover: #9bb5e8;
  --card-bg: rgba(14, 18, 44, 0.75);
  --card-border: rgba(80, 110, 180, 0.15);
  --card-border-hover: rgba(120, 160, 240, 0.35);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  min-height: 100vh;
  font-family: 'DM Sans', sans-serif;
  overflow-x: hidden;
}

#particles-js {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

nav {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  height: 58px;
  width: calc(100% - 48px);
  max-width: 1400px;
  padding: 0 10px 0 20px;
  background: rgba(10, 12, 28, 0.82);
  border: 1px solid rgba(90, 114, 176, 0.45);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px rgba(60, 90, 180, 0.08), 0 8px 32px rgba(10, 14, 40, 0.45);
}

.nav-logo {
  font-family: 'Pinyon Script', cursive;
  font-size: 36px;
  font-weight: 400;
  color: #ffffff;
  text-decoration: none;
  line-height: 1;
  letter-spacing: 0.01em;
  user-select: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 44px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.16s;
}

.nav-btn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--blue-dim);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.16s;
}

.nav-btn:hover svg {
  stroke: var(--blue-hover);
}

.nav-btn.active {
  background: rgba(100, 140, 220, 0.15);
}

.nav-btn.active svg {
  stroke: var(--blue-bright);
  filter: drop-shadow(0 0 5px rgba(140, 180, 255, 0.55));
}

.dot {
  fill: var(--blue-dim);
  stroke: none;
  transition: fill 0.16s;
}

.nav-btn.active .dot {
  fill: var(--blue-bright);
}

.nav-btn:hover .dot {
  fill: var(--blue-hover);
}

.hero {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  user-select: none;
}

.hero h1 {
  font-family: 'Pinyon Script', cursive;
  font-size: clamp(72px, 12vw, 140px);
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 0.01em;
  animation: fadeUp 0.9s ease both;
}

.hero p {
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 300;
  color: rgba(140, 165, 220, 0.6);
  letter-spacing: 0.12em;
  animation: fadeUp 0.9s 0.18s ease both;
}

.search-bar {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 560px;
  background: rgba(10, 12, 28, 0.82);
  border: 1px solid rgba(90, 114, 176, 0.4);
  border-radius: 999px;
  padding: 0 8px 0 22px;
  backdrop-filter: blur(14px);
  transition: border-color 0.16s, box-shadow 0.16s;
  animation: fadeUp 0.9s 0.28s ease both;
}

.search-bar:focus-within {
  border-color: rgba(140, 180, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(100, 140, 220, 0.1);
}

.search-bar input[type="text"] {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #d0e0ff;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 13px 0;
}

.search-bar input[type="text"]::placeholder { color: rgba(120, 150, 210, 0.35); }

.search-bar button {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(80, 110, 200, 0.22);
  border: 1px solid rgba(100, 140, 220, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s;
  flex-shrink: 0;
}

.search-bar button:hover { background: rgba(100, 140, 220, 0.35); }

.search-bar button svg {
  width: 16px;
  height: 16px;
  stroke: var(--blue-bright);
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sj-error {
  font-size: 12px;
  color: rgba(220, 120, 120, 0.7);
  min-height: 16px;
  animation: fadeUp 0.9s 0.32s ease both;
}

.sj-error-code {
  font-size: 11px;
  color: rgba(200, 100, 100, 0.5);
  font-family: monospace;
}

.games-wrapper {
  position: relative;
  z-index: 10;
  padding: 80px 40px 60px;
  min-height: 100vh;
}

.games-header {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(140, 165, 220, 0.45);
  margin-bottom: 28px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.game-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  animation: cardIn 0.5s ease both;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
  box-shadow: 0 12px 32px rgba(60, 90, 180, 0.2);
}

.game-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: rgba(20, 25, 55, 0.8);
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #c8d8f8;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.card-author {
  font-size: 11px;
  font-weight: 400;
  color: rgba(120, 150, 210, 0.55);
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}

.card-author:hover {
  color: rgba(160, 190, 240, 0.85);
}

.games-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  font-size: 13px;
  color: rgba(120, 150, 210, 0.4);
  letter-spacing: 0.1em;
}

.games-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60vh;
  font-size: 13px;
  color: rgba(220, 120, 120, 0.5);
  letter-spacing: 0.06em;
}

.tools-wrapper {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.tools-wrapper h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--blue-bright);
  letter-spacing: 0.08em;
  animation: fadeUp 0.7s ease both;
}

.tools-wrapper p {
  font-size: 13px;
  color: rgba(140, 165, 210, 0.4);
  letter-spacing: 0.08em;
  animation: fadeUp 0.7s 0.12s ease both;
}

.iframe-wrapper {
  position: relative;
  z-index: 10;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 24px;
}

.iframe-container {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--card-border);
  box-shadow: 0 0 60px rgba(60, 90, 180, 0.12);
  background: rgba(14, 18, 44, 0.6);
  backdrop-filter: blur(8px);
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.iframe-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(120, 150, 210, 0.35);
  letter-spacing: 0.1em;
}

.games-search-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  animation: fadeUp 0.7s 0.1s ease both;
}

.games-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  background: rgba(10,12,28,0.82);
  border: 1px solid rgba(90,114,176,0.3);
  border-radius: 999px;
  padding: 0 18px;
  backdrop-filter: blur(14px);
  transition: border-color 0.16s, box-shadow 0.16s;
}

.games-search-bar:focus-within {
  border-color: rgba(140,180,255,0.5);
  box-shadow: 0 0 0 3px rgba(100,140,220,0.08);
}

.games-search-bar svg {
  width: 15px;
  height: 15px;
  stroke: rgba(120,150,210,0.35);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}

.games-search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #d0e0ff;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  padding: 11px 0;
}

.games-search-bar input::placeholder { color: rgba(120,150,210,0.3); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}