/* Steam Color Palette */
:root {
  --steam-dark: #1b2838;
  --steam-darker: #171a21;
  --steam-blue: #1b8acc;
  --steam-light-blue: #66c0f4;
  --steam-gray: #2a475e;
  --steam-light-gray: #c7d5e0;
  --steam-green: #5ba32b;
  --steam-text: #c7d5e0;
  --steam-border: #3d4d5c;
}

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

body {
  font-family: "Motiva Sans", Arial, sans-serif;
  background: linear-gradient(
    to bottom,
    var(--steam-darker),
    var(--steam-dark)
  );
  color: var(--steam-text);
  min-height: 100vh;
  padding: 20px;
}

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

header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 20px;
  background: var(--steam-gray);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

h1 {
  font-size: 2.5em;
  color: var(--steam-light-blue);
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.subtitle {
  font-size: 1.1em;
  color: var(--steam-light-gray);
  opacity: 0.8;
}

.input-section {
  background: var(--steam-gray);
  padding: 30px;
  border-radius: 4px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.info-box {
  background: var(--steam-darker);
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 25px;
  border-left: 4px solid var(--steam-light-blue);
}

.info-box h3 {
  color: var(--steam-light-blue);
  margin-bottom: 15px;
  font-size: 1.1em;
}

.info-box ol {
  margin-left: 20px;
  color: var(--steam-light-gray);
  line-height: 1.8;
}

.info-box a {
  color: var(--steam-light-blue);
  text-decoration: none;
}

.info-box a:hover {
  text-decoration: underline;
}

.input-group {
  margin-bottom: 20px;
}

.search-wrapper {
  position: relative;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
  background: var(--steam-darker);
  border: 1px solid var(--steam-border);
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  scrollbar-width: thin;
  scrollbar-color: var(--steam-border) var(--steam-darker);
}

.search-results::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track {
  background: var(--steam-darker);
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--steam-border);
  border-radius: 3px;
}

.search-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid rgba(61, 77, 92, 0.4);
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover,
.search-item.active {
  background: var(--steam-gray);
}

.search-item-img {
  width: 120px;
  height: 45px;
  object-fit: cover;
  border-radius: 3px;
  margin-right: 12px;
  flex-shrink: 0;
  background: var(--steam-gray);
}

.search-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.search-item-name {
  color: var(--steam-light-gray);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-item-appid {
  color: var(--steam-light-gray);
  opacity: 0.5;
  font-size: 11px;
  margin-top: 2px;
}

.search-empty {
  padding: 16px;
  text-align: center;
  color: var(--steam-light-gray);
  opacity: 0.6;
  font-size: 13px;
}

/* User search avatar (round) */
.search-item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 12px;
  flex-shrink: 0;
  background: var(--steam-gray);
}

.user-search-item .search-item-info {
  min-width: 0;
}

.search-loading {
  padding: 12px 16px;
  text-align: center;
  color: var(--steam-light-gray);
  opacity: 0.5;
  font-size: 12px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--steam-light-blue);
  font-weight: 500;
}

input[type="text"],
input[type="password"],
select {
  width: 100%;
  padding: 12px;
  background: var(--steam-darker);
  border: 1px solid var(--steam-border);
  border-radius: 3px;
  color: var(--steam-text);
  font-size: 14px;
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
  outline: none;
  border-color: var(--steam-light-blue);
}

small {
  display: block;
  margin-top: 5px;
  color: var(--steam-light-gray);
  opacity: 0.7;
  font-size: 12px;
}

small a {
  color: var(--steam-light-blue);
  text-decoration: none;
}

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

.primary-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(to bottom, var(--steam-blue), #156d9e);
  color: white;
  border: none;
  border-radius: 3px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.primary-btn:hover {
  background: linear-gradient(
    to bottom,
    var(--steam-light-blue),
    var(--steam-blue)
  );
  box-shadow: 0 2px 8px rgba(27, 138, 204, 0.4);
}

.primary-btn:active {
  transform: translateY(1px);
}

.primary-btn:disabled {
  background: var(--steam-border);
  cursor: not-allowed;
}

.loading {
  text-align: center;
  padding: 40px;
  background: var(--steam-gray);
  border-radius: 4px;
  margin-bottom: 30px;
}

.spinner {
  border: 4px solid var(--steam-border);
  border-top: 4px solid var(--steam-light-blue);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

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

.error {
  background: #8b1a1a;
  color: white;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 30px;
  border-left: 4px solid #d32f2f;
}

.hidden {
  display: none;
}

.results {
  margin-top: 30px;
}

.stats-summary {
  background: var(--steam-gray);
  padding: 30px;
  border-radius: 4px;
  margin-bottom: 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.stats-summary h2 {
  color: var(--steam-light-blue);
  margin-bottom: 20px;
}

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

.stat-card {
  background: var(--steam-darker);
  padding: 20px;
  border-radius: 4px;
  text-align: center;
  border: 1px solid var(--steam-border);
}

.stat-value {
  display: block;
  font-size: 2.5em;
  color: var(--steam-light-blue);
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-label {
  display: block;
  color: var(--steam-light-gray);
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.achievements-section {
  background: var(--steam-gray);
  padding: 30px;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h3 {
  color: var(--steam-light-blue);
}

.toggle-btn {
  padding: 8px 16px;
  background: var(--steam-darker);
  color: var(--steam-text);
  border: 1px solid var(--steam-border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.toggle-btn:hover {
  background: var(--steam-border);
}

.achievements-list {
  display: grid;
  gap: 15px;
}

.achievement-card {
  display: flex;
  align-items: center;
  background: var(--steam-darker);
  padding: 15px;
  border-radius: 4px;
  border-left: 4px solid transparent;
  transition: all 0.3s;
}

.achievement-card.unlocked {
  border-left-color: var(--steam-green);
  opacity: 0.7;
}

.achievement-card.locked {
  border-left-color: var(--steam-blue);
}

.achievement-card.hidden {
  border-left-color: #b8860b;
}

.achievement-icon {
  width: 64px;
  height: 64px;
  margin-right: 15px;
  border-radius: 4px;
  background: var(--steam-gray);
  object-fit: cover;
}

.achievement-icon.locked {
  filter: grayscale(100%) brightness(0.5);
}

.achievement-info {
  flex: 1;
}

.achievement-name {
  font-size: 1.1em;
  color: var(--steam-light-blue);
  margin-bottom: 5px;
  font-weight: 600;
}

.achievement-description {
  color: var(--steam-light-gray);
  font-size: 0.9em;
  margin-bottom: 5px;
}

.achievement-meta {
  display: flex;
  gap: 15px;
  font-size: 0.85em;
  color: var(--steam-light-gray);
  opacity: 0.8;
}

.achievement-badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
}

.achievement-badge.hidden {
  background: #b8860b;
  color: white;
}

.achievement-badge.unlocked {
  background: var(--steam-green);
  color: white;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2em;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .achievement-card {
    flex-direction: column;
    text-align: center;
  }

  .achievement-icon {
    margin-right: 0;
    margin-bottom: 10px;
  }

  .section-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}
