@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}

/* fancy background gradient overlay */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: -1;
  pointer-events: none;
}

/* Featured video - hidden by default, only show on homepage as background */
.featured {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
}

.featured .start-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
}

/* Make homepage sections more transparent to see video background */
#content-home .homepage-sections {
  background: transparent;
}

#content-home .homepage-section {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

#content-home .section-header {
  background: transparent;
}

#content-home .games-grid {
  background: transparent;
}

.relic-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
}

.relic-logo-image {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(91, 158, 255, 0.3));
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.relic-title {
  font-size: 48px;
  font-weight: 700;
  background: linear-gradient(120deg, #5b9eff 0%, #8b7aff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  letter-spacing: -0.5px;
}

.user-counter-container {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.user-counter-content {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  background: rgba(91, 158, 255, 0.08);
  border: 1px solid rgba(91, 158, 255, 0.2);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-color);
  transition: all 0.25s ease;
}

.user-counter-content:hover {
  background: rgba(91, 158, 255, 0.12);
  border-color: rgba(91, 158, 255, 0.4);
  transform: translateY(-1px);
}

.user-counter-icon {
  font-size: 20px;
  animation: userIconBounce 2s ease-in-out infinite;
}

@keyframes userIconBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.user-counter-text {
  display: flex;
  align-items: center;
  gap: 5px;
}

#activeUsers {
  font-size: 18px;
  font-weight: 700;
  color: #5b9eff;
  min-width: 30px;
  text-align: center;
}

.user-counter-pulse {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

#snow-container {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -10px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.8));
  animation-name: fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes fall {
  to { transform: translateY(100vh) rotate(360deg); }
}

.navbar { display: none !important; }

.logo {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  user-select: none;
  cursor: default;
  text-decoration: none;
}

.game-filters {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 28px 0;
  flex-wrap: wrap;
  padding: 0 20px;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover {
  border-color: var(--glass-border);
  background: var(--hover-bg);
  color: var(--text-color);
  transform: translateY(-1px);
}

.filter-btn.active {
  background: var(--hover-bg);
  border-color: var(--accent-color);
  color: white;
}

.favorite-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  padding: 0;
}

.favorite-btn:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.5);
  transform: scale(1.08);
}

.favorite-btn svg {
  color: #ffd700;
  width: 20px;
  height: 20px;
  transition: all 0.2s ease;
}

.favorite-btn.favorited {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

.settings-page-container {
  max-width: 850px;
  margin: 32px auto;
  padding: 0 20px;
}

.settings-page-container .settings-section {
  background: rgba(255, 255, 255, 0.02);
  padding: 28px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 24px;
  transition: border-color 0.2s ease;
}

.settings-page-container .settings-section:hover {
  border-color: var(--glass-border);
}

.settings-page-container .settings-section h3 {
  color: var(--text-color);
  font-size: 20px;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-item {
  margin-bottom: 18px;
}

.setting-item label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--text-color);
  font-size: 14px;
}

.setting-item input[type="text"],
.setting-item input[type="password"],
.setting-item select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-color);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

.setting-item input[type="text"]:focus,
.setting-item input[type="password"]:focus,
.setting-item select:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(0, 0, 0, 0.4);
}

.setting-item input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent-color);
}

.setting-buttons {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.btn-primary, .btn-secondary, .btn-small {
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  flex: 1;
}

.btn-primary:hover {
  background: var(--btn-hover-bg);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: var(--hover-bg);
  border-color: var(--accent-color);
}

.btn-small {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-color);
  padding: 8px 18px;
  margin-left: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-small:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

.settings-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 28px auto;
  max-width: 850px;
  padding: 0 20px;
  flex-wrap: wrap;
}

.settings-tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.settings-tab-btn svg { width: 18px; height: 18px; }

.settings-tab-btn:hover {
  background: var(--hover-bg);
  border-color: var(--glass-border);
  color: var(--text-color);
  transform: translateY(-2px);
}

.settings-tab-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: #fff;
}

.settings-tab-content { display: none; animation: fadeIn 0.3s ease; }
.settings-tab-content.active { display: block; }

.about-info p, .system-info p {
  margin: 8px 0;
  color: var(--text-color);
  line-height: 1.6;
}

.about-info strong { color: var(--accent-color); }
.system-info strong { color: var(--text-color); font-weight: 600; }

.about-info ul {
  margin: 12px 0;
  list-style: none;
  padding-left: 0;
}

.about-info ul li {
  margin: 8px 0;
  color: var(--text-color);
  padding: 8px 0;
}

.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.contributor-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: default;
}

.contributor-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(91, 158, 255, 0.2);
}

.contributor-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: contributorFloat 3s ease-in-out infinite;
}

.contributor-card:nth-child(1) .contributor-icon { animation-delay: 0s; }
.contributor-card:nth-child(2) .contributor-icon { animation-delay: 0.3s; }
.contributor-card:nth-child(3) .contributor-icon { animation-delay: 0.6s; }
.contributor-card:nth-child(4) .contributor-icon { animation-delay: 0.9s; }
.contributor-card:nth-child(5) .contributor-icon { animation-delay: 1.2s; }

@keyframes contributorFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.contributor-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 6px;
}

.contributor-role {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.info-modal {
  display: none;
  position: fixed;
  z-index: 10001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
}

.info-modal-content {
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  margin: 5% auto;
  padding: 0;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow: hidden;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from { transform: translateY(-30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.info-modal-content h2 {
  margin: 0;
  padding: 24px 32px;
  background: var(--hover-bg);
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-color);
}

.info-modal-content h3 {
  color: var(--accent-color);
  font-size: 20px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.info-modal-content h4 {
  color: var(--text-color);
  font-size: 17px;
  font-weight: 600;
  margin-top: 18px;
  margin-bottom: 10px;
}

.info-modal-body {
  padding: 28px 32px;
  overflow-y: auto;
  max-height: calc(85vh - 100px);
}

.info-modal-body::-webkit-scrollbar { width: 8px; }
.info-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}
.info-modal-body::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 8px;
}

.info-modal-body p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 14px;
}

.info-modal-body ul {
  list-style: none;
  padding-left: 0;
  margin: 14px 0;
}

.info-modal-body ul li {
  color: var(--text-color);
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--hover-bg);
  border-left: 2px solid var(--accent-color);
  border-radius: 6px;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.info-modal-body ul li:hover {
  background: var(--hover-bg);
  transform: translateX(4px);
}

.info-modal-body a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.info-modal-body a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.info-close {
  color: var(--text-muted);
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 32px;
  font-weight: bold;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.info-close:hover {
  color: var(--accent-color);
  transform: rotate(90deg);
  background: var(--hover-bg);
}

.homepage-info-buttons {
  position: fixed;
  bottom: 32px;
  left: 95px;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 32px;
  pointer-events: none;
  z-index: 100;
}

.info-btn {
  pointer-events: all;
  padding: 12px 26px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(18, 23, 31, 0.85);
  backdrop-filter: blur(12px);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.info-btn:hover {
  transform: translateY(-3px);
  background: var(--hover-bg);
  border-color: var(--accent-color);
}

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

.container {
  max-width: 1400px;
  margin: 20px auto;
  padding: 20px;
  text-align: center;
}

.content { animation: fadeIn 0.3s ease; }

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

.game-grid, .app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 28px;
  justify-items: center;
  padding: 0 20px;
}

.game-card, .app-card {
  position: relative;
  width: 260px;
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-secondary);
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.game-card:hover, .app-card:hover {
  transform: translateY(-6px);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.game-card img, .app-card img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  transition: transform 0.3s ease;
}

.game-card:hover img, .app-card:hover img { transform: scale(1.04); }

.game-card h3, .app-card h3 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  z-index: 2;
  user-select: none;
}

.search-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 28px auto;
  gap: 10px;
  max-width: 580px;
  padding: 0 20px;
}

.search-container input[type="text"] {
  flex: 1;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-color);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
}

.search-container input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-color);
  background: rgba(0, 0, 0, 0.3);
}

.search-container button {
  padding: 12px 24px;
  border-radius: 10px;
  border: none;
  background: var(--accent-color);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-container button:hover {
  background: var(--btn-hover-bg);
  transform: translateY(-2px);
}

#backToHomeApps, #backToHomeGame, #backToHomeWebsites {
  padding: 12px 28px;
  border-radius: 10px;
  border: none;
  background: var(--accent-color);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 28px;
}

#backToHomeApps:hover, #backToHomeGame:hover, #backToHomeWebsites:hover {
  background: var(--btn-hover-bg);
  transform: translateY(-2px);
}

.game-play-area {
  background: #000;
  border: 2px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px;
  position: relative;
  max-width: 95%;
  margin: 0 auto;
}

.game-iframe {
  width: 100%;
  height: 85vh;
  min-height: 700px;
  border: none;
  border-radius: 8px;
}

.game-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  gap: 12px;
  z-index: 10000;
}

.game-control-btn {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.game-control-btn svg {
  width: 22px;
  height: 22px;
  color: #5a5a5a;
}

.game-control-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.game-control-btn:hover svg { color: #2a2a2a; }

.game-control-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.fullscreen-btn { display: none; }

@media (max-width: 768px) {
  .relic-logo-image { width: 80px; height: 80px; }
  .relic-title { font-size: 32px; }
  .user-counter-content { font-size: 14px; padding: 10px 20px; }
  .user-counter-icon { font-size: 18px; }
  #activeUsers { font-size: 16px; }
  
  .homepage-info-buttons {
    flex-direction: column;
    gap: 10px;
    align-items: center;
    left: 75px;
    padding: 0 20px;
  }
  
  .settings-tabs { flex-direction: column; }
  .settings-tab-btn { width: 100%; justify-content: center; }
  .contributors-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
  }
  .contributor-card { padding: 16px; }
  .contributor-icon { font-size: 36px; }
  .contributor-name { font-size: 14px; }
  .contributor-role { font-size: 12px; }
  .game-controls { top: 14px; right: 14px; gap: 8px; }
  .game-control-btn { width: 40px; height: 40px; }
  .game-control-btn svg { width: 20px; height: 20px; }
}

@media (max-width: 480px) {
  .relic-logo-image { width: 60px; height: 60px; }
  .relic-title { font-size: 24px; }
  .contributors-grid { grid-template-columns: 1fr; gap: 10px; }
  .game-controls { top: 10px; right: 10px; gap: 6px; }
  .game-control-btn { width: 36px; height: 36px; }
  .game-control-btn svg { width: 18px; height: 18px; }
}