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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0a0a0f;
  color: #e0e0e0;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 30px 0;
  border-bottom: 2px solid #0f3460;
  text-align: center;
}

header h1 {
  font-size: 2.5rem;
  color: #e94560;
  margin-bottom: 5px;
}

header .subtitle {
  color: #888;
  font-size: 1.1rem;
}

main {
  padding: 40px 0;
}

.search-box {
  margin: 40px 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.search-box input {
  padding: 15px 25px;
  font-size: 1.1rem;
  border: 2px solid #0f3460;
  border-radius: 10px;
  background: #1a1a2e;
  color: #fff;
  width: 400px;
  outline: none;
  transition: border-color 0.3s;
}

.search-box input:focus {
  border-color: #e94560;
}

.search-box select {
  padding: 15px 20px;
  font-size: 1rem;
  border: 2px solid #0f3460;
  border-radius: 10px;
  background: #1a1a2e;
  color: #fff;
  cursor: pointer;
  outline: none;
}

.search-box button {
  padding: 15px 40px;
  font-size: 1.1rem;
  border: none;
  border-radius: 10px;
  background: #e94560;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s, transform 0.1s;
}

.search-box button:hover {
  background: #c73e54;
  transform: translateY(-2px);
}

.search-box button:active {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.game-list-title {
  color: #e94560;
  font-size: 1.3rem;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.game-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.game-card {
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: #e94560;
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.2);
}

.game-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
  background: #16213e;
}

.game-card .game-card-title {
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #e0e0e0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card .game-card-noimg {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #16213e;
  color: #555;
  font-size: 2.5rem;
}

.back-btn {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 20px;
  background: transparent;
  color: #e94560;
  border: 1px solid #e94560;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.back-btn:hover {
  background: #e94560;
  color: #fff;
}

#loading {
  text-align: center;
  padding: 40px;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #0f3460;
  border-top: 4px solid #e94560;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#error {
  text-align: center;
  padding: 20px;
  color: #e94560;
  font-size: 1.1rem;
}

#results {
  background: #1a1a2e;
  border-radius: 15px;
  padding: 30px;
  margin-bottom: 40px;
  border: 1px solid #0f3460;
}

.game-header {
  display: flex;
  gap: 25px;
  margin-bottom: 25px;
  align-items: center;
}

.game-header img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid #0f3460;
}

.game-header-info h2 {
  font-size: 1.6rem;
  color: #e94560;
  margin-bottom: 8px;
}

.game-header-info {
  font-size: 0.9rem;
  color: #aaa;
  line-height: 1.6;
}

.steam-price-card {
  background: linear-gradient(135deg, #1b2838 0%, #2a475e 100%);
  border-radius: 12px;
  padding: 25px;
  margin-bottom: 25px;
  border: 1px solid #66c0f4;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.steam-price-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #66c0f4;
}

.steam-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #66c0f4;
  margin-bottom: 8px;
  font-weight: 600;
}

.steam-amount {
  font-size: 2.5rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 5px;
}

.steam-regular {
  font-size: 0.95rem;
  color: #8f98a0;
}

.steam-lowest {
  font-size: 0.85rem;
  color: #4ade80;
  margin-top: 5px;
}

.price-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 15px;
  text-align: left;
  border-bottom: 1px solid #0f3460;
}

th {
  background: #16213e;
  color: #e94560;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

tr:hover {
  background: rgba(233, 69, 96, 0.05);
}

tr.row-steam {
  background: rgba(102, 192, 244, 0.08);
}

td.price {
  font-size: 1.1rem;
  font-weight: bold;
  color: #4ade80;
}

td.diff {
  font-size: 0.9rem;
}

.diff-cheaper {
  color: #4ade80;
  font-weight: 600;
}

.diff-expensive {
  color: #ef4444;
  font-weight: 600;
}

.diff-same {
  color: #facc15;
  font-weight: 600;
}

.diff-steam {
  color: #66c0f4;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

td.discount {
  color: #e94560;
  font-weight: bold;
}

td a {
  color: #e94560;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid #e94560;
  border-radius: 6px;
  transition: all 0.3s;
  font-size: 0.9rem;
}

td a:hover {
  background: #e94560;
  color: #fff;
}

.best-deal {
  margin-top: 25px;
  padding: 20px;
  background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
  border-radius: 10px;
  border-left: 4px solid #4ade80;
}

.best-deal h3 {
  color: #4ade80;
  margin-bottom: 10px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.best-deal p {
  font-size: 1.1rem;
}

.grey-market-section {
  margin-top: 30px;
  padding-top: 25px;
  border-top: 1px solid #0f3460;
}

.grey-market-section .section-title {
  color: #facc15;
  font-size: 1.2rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.grey-market-section .section-subtitle {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 15px;
}

.grey-message {
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.grey-message.info {
  background: rgba(250, 204, 21, 0.08);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.2);
}

.grey-message.error {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.grey-badge {
  display: inline-block;
  background: #facc15;
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.voucher-badge {
  display: inline-block;
  background: rgba(233, 69, 96, 0.15);
  color: #e94560;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  border: 1px solid rgba(233, 69, 96, 0.3);
}

.price-usd {
  color: #888;
  font-size: 0.8rem;
  font-weight: normal;
}

.spinner.small {
  width: 30px;
  height: 30px;
  border-width: 3px;
  margin: 10px auto;
}

footer {
  background: #1a1a2e;
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid #0f3460;
  color: #666;
}

footer a {
  color: #e94560;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  .search-box {
    flex-direction: column;
    align-items: center;
  }

  .search-box input {
    width: 100%;
    max-width: 400px;
  }

  .search-box select {
    width: 100%;
    max-width: 400px;
  }

  .game-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .game-header img {
    width: 120px;
    height: 120px;
  }

  .steam-amount {
    font-size: 2rem;
  }
}
