h1 {
  font-size: 2.8em;
  color: #5ac8fa;
  font-weight: 700;
}

h2 {
  font-weight: 400;
  font-size: 1.3em;
  color: #c0c0c0;
  min-height: 1.5em;
  position: relative;
}

#random-phrase::after {
  content: '|';
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

nav {
  display: flex;
  justify-content: center;
  gap: 25px;
  background: #16171b;
  padding: 14px;
  box-shadow: inset 0 -1px 0 #222;
  flex-wrap: wrap;
}

nav a {
  color: #e0e0e0;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05em;
  padding: 10px 18px;
  border-radius: 10px;
  transition: all 0.3s ease;
  will-change: transform;
}

nav a:hover {
  background: #5ac8fa33;
  color: #5ac8fa;
  box-shadow: 0 0 12px #5ac8fa44;
  transform: translateY(-2px);
}

.atomlogo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin: 40px auto;
}

.atomlogo {
  max-width: 70px;
  max-height: 70px;
  object-fit: contain;
  transition: transform 0.3s ease;
  cursor: pointer;
  animation: spin 3s linear infinite;
  will-change: transform;
}

.atomlogo:hover {
  transform: rotate(5deg) scale(1.05);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.welcome-section {
  padding: 60px 20px;
  background: rgba(255,255,255,0.03);
  margin: 50px auto;
  max-width: 800px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 25px rgba(0,0,0,0.4);
}

.welcome-section p {
  font-size: 1.25em;
  color: #ccc;
  line-height: 1.6em;
  max-width: 600px;
  margin: 0 auto;
}

.games-section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto 60px;
}

#game-search, #sort-dropdown {
  padding: 10px 14px;
  font-size: 1em;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1a1c22;
  color: #e0e0e0;
  outline: none;
  margin: 20px 10px 20px 0;
  transition: border 0.3s, box-shadow 0.3s;
}

#sort-dropdown {
  padding: 8px;
}

#game-search:focus {
  border-color: #5ac8fa;
  box-shadow: 0 0 8px #5ac8fa55;
}

#sort-alpha-btn, #back-btn {
  padding: 10px 16px;
  font-size: 1em;
  border-radius: 10px;
  border: none;
  background: #5ac8fa;
  color: #000;
  font-weight: bold;
  cursor: pointer;
  margin: 10px 5px;
  transition: background 0.3s, transform 0.2s;
  will-change: transform;
}

#sort-alpha-btn:hover, #back-btn:hover {
  background: #49b7d6;
  transform: scale(1.05);
}

#game-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 18px;
  justify-content: center;
  margin-top: 30px;
}

.game-card {
  background: #1a1c22;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 16px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.game-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(90, 200, 250, 0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.game-card:hover {
  transform: translateY(-8px) scale(1.04);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(90, 200, 250, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background: #272a33;
  border-color: rgba(90, 200, 250, 0.3);
}

.game-card:hover::before {
  opacity: 1;
}

.game-card img.game-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.game-card h3 {
  color: #5ac8fa;
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.game-card p {
  font-size: 0.95em;
  color: #ccc;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}

.game-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.game-buttons button, .game-buttons a {
  padding: 8px 14px;
  background: #5ac8fa !important;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 15px;
  margin-top: 15px;
  will-change: transform;
}

.game-buttons button:hover, .game-buttons a:hover {
  background: #49b7d6 !important;
  transform: translateY(-2px);
  color: #ffffff !important;
}

.game-buttons .play-inside-btn:hover {
  background: #49b7d6 !important;
  color: #ffffff !important;
}

#game-iframe-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}

.iframe-header {
  padding: 10px;
  background: #111;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.iframe-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5em;
  cursor: pointer;
  transition: transform 0.2s;
}

.iframe-header button:hover {
  transform: scale(1.2);
}

#game-iframe-container iframe {
  flex: 1;
  border: none;
  width: 100%;
}

.category {
  background-color: #43a2ce;
  padding: 5px;
  border-radius: 5px;
  display: inline-block;
  margin: 8px 0;
  font-size: 0.85em;
  position: relative;
  z-index: 1;
}

@media (max-width: 700px) {
  h1 { font-size: 2.2em; }
  h2 { font-size: 1.1em; }
  .welcome-section p { font-size: 1.1em; }
  #game-list { gap: 14px; }
}
