@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-core: #0a0b0d;
  --bg-surface: #15191d;
  --bg-module: rgba(255, 255, 255, 0.02);
  --primary: #f59e0b;
  /* Amber */
  --primary-glow: rgba(245, 158, 11, 0.15);
  --accent-red: #f43f5e;
  --accent-teal: #2dd4bf;
  --text-main: #e2e8f0;
  --text-dim: #94a3b8;
  --text-mono: 'JetBrains Mono', monospace;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 12px;
  --transition: cubic-bezier(0.19, 1, 0.22, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--bg-core);
  color: var(--text-main);
  background-image:
    linear-gradient(rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  overflow-x: hidden;
  min-height: 100vh;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  background-size: 100% 3px, 3px 100%;
  pointer-events: none;
  z-index: 100;
  opacity: 0.1;
}

.portal-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 100px 40px 40px 40px;
}

header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}

.logo-section h1 {
  font-size: 4rem;
  font-weight: 700;
  letter-spacing: -2px;
  margin: 0;
  text-transform: uppercase;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
}

.system-status {
  font-family: var(--text-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.status-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-teal);
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: 0 0 10px var(--accent-teal);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.3;
  }

  100% {
    opacity: 1;
  }
}

/* Ticker Bar */
.ticker-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 1px solid var(--primary);
  z-index: 1000;
  display: flex;
  align-items: center;
  overflow: hidden;
  font-family: var(--text-mono);
  font-size: 0.8rem;
  color: var(--primary);
}

.ticker-label {
  background: var(--primary);
  color: var(--bg-core);
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  font-weight: 700;
  z-index: 1001;
  white-space: nowrap;
}

.ticker-content {
  white-space: nowrap;
  padding-left: 100%;
  animation: ticker 30s linear infinite;
}

.ticker-item {
  display: inline-block;
  padding: 0 40px;
}

@keyframes ticker {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

/* Auth Section */
.auth-nav {
  display: flex;
  gap: 15px;
  align-items: center;
}

.auth-btn {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 8px 16px;
  font-family: var(--text-mono);
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.3s;
  border-radius: 4px;
}

.auth-btn:hover {
  background: var(--primary-glow);
  box-shadow: 0 0 10px var(--primary-glow);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  font-family: var(--text-mono);
  font-size: 0.8rem;
}

/* Modal Styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--primary);
  width: 90%;
  max-width: 400px;
  padding: 40px;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
  font-size: 1.5rem;
  margin-bottom: 25px;
  text-transform: uppercase;
  color: var(--primary);
}

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

.form-group label {
  display: block;
  font-family: var(--text-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.form-group input {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  color: white;
  border-radius: 4px;
  font-family: inherit;
}

.form-group input:focus {
  border-color: var(--primary);
  outline: none;
}

.primary-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: var(--bg-core);
  border: none;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 10px;
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Bento Grid Resized - Even More Compact */
.game-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 130px;
  gap: 12px;
}

.game-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 15px;
  text-decoration: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: all 0.4s var(--transition);
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('cyber_tech_grid_bg.png');
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: 0;
  transition: 0.5s;
}

.game-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, transparent 20%, rgba(0, 0, 0, 0.9) 100%);
  z-index: 1;
}

.game-card:hover::before {
  opacity: 0.3;
  transform: scale(1.05);
}

/* Category Color Overlays */
.game-card[data-id="balance"],
.game-card[data-id="prediction"] {
  background-color: rgba(245, 158, 11, 0.05);
}

/* Amber */
.game-card[data-id="gacha"],
.game-card[data-id="fortune"] {
  background-color: rgba(99, 102, 241, 0.05);
}

/* Indigo */
.game-card[data-id="quiz"],
.game-card[data-id="geo"] {
  background-color: rgba(244, 63, 94, 0.05);
}

/* Crimson */
.game-card[data-id="clicker"],
.game-card[data-id="billboard"] {
  background-color: rgba(45, 212, 191, 0.05);
}

/* Teal */
.game-card[data-id="plant"],
.game-card[data-id="time"] {
  background-color: rgba(168, 85, 247, 0.05);
}

/* Purple */

.game-card.hero.large {
  grid-column: span 2;
  grid-row: span 2;
}

.game-card.wide {
  grid-column: span 2;
}

.game-card.tall {
  grid-row: span 2;
}

.card-number {
  position: absolute;
  top: 10px;
  left: 15px;
  font-family: var(--text-mono);
  font-size: 0.6rem;
  color: var(--primary);
  opacity: 0.7;
  z-index: 2;
}

.card-icon {
  font-size: 1.8rem;
  margin-bottom: auto;
  z-index: 2;
  transition: 0.5s var(--transition);
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2));
}

.game-card:hover .card-icon {
  transform: scale(1.1) rotate(-5deg);
  filter: grayscale(0) brightness(1) drop-shadow(0 0 10px var(--primary-glow));
}

.card-content {
  position: relative;
  z-index: 2;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 2px 0;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card-description {
  font-size: 0.725rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.3;
  opacity: 0.8;
  transition: 0.3s var(--transition);
}

.game-card:hover .card-description {
  opacity: 1;
  color: white;
}

.game-card.locked {
  background: #0f1115;
  cursor: not-allowed;
  opacity: 0.6;
}

.game-card.locked::before {
  background: repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1) 10px, rgba(255, 255, 255, 0.02) 10px, rgba(255, 255, 255, 0.02) 20px);
}

/* Responsive */
@media (max-width: 1100px) {
  .game-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .portal-container {
    padding: 40px 20px;
  }

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

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .logo-section h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .game-grid {
    grid-template-columns: 1fr;
  }

  .game-card.hero.large,
  .game-card.wide,
  .game-card.tall {
    grid-column: span 1;
    grid-row: span 1;
  }
}