/* Created by Graaphix */
/* Designed by Graaphix */

:root {
  --bg-dark: #07070d;
  --bg-panel: #110e1e;
  --bg-card: rgba(22, 18, 38, 0.7);
  --border-glow: rgba(168, 85, 247, 0.25);
  --border-card: rgba(255, 255, 255, 0.08);
  --primary: #a855f7;
  --secondary: #ec4899;
  --cyan: #06b6d4;
  --green: #10b981;
  --orange: #f97316;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-heading: 'Space Grotesk', -apple-system, sans-serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Header */
.arcade-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 9, 20, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glow);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
  transition: transform 0.2s ease;
}

.brand:hover .brand-logo {
  transform: scale(1.08) rotate(-3deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-title .accent {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--cyan);
  text-transform: uppercase;
}

/* Navigation Tabs */
.arcade-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(22, 18, 38, 0.6);
  padding: 0.3rem;
  border-radius: 9999px;
  border: 1px solid var(--border-card);
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.8), rgba(236, 72, 153, 0.8));
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.35);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #34d399;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-dot 2s infinite ease-in-out;
}

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

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glow);
}

/* Main Content Views */
.arcade-main {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.tab-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-view.active {
  display: block;
}

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

/* Hero Section */
.hero-section {
  text-align: center;
  max-width: 800px;
  margin: 2rem auto 3rem auto;
}

.hero-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(6, 182, 212, 0.2));
  border: 1px solid var(--border-glow);
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--cyan);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.game-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.game-card:hover {
  transform: translateY(-6px);
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 16px 40px rgba(168, 85, 247, 0.2);
}

.card-media {
  height: 160px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-media.ragdoll-bg {
  background: radial-gradient(circle at center, #3b0764 0%, #1e1136 100%);
}

.card-media.word-bg {
  background: radial-gradient(circle at center, #022c22 0%, #061e1b 100%);
}

.card-media.bingo-bg {
  background: radial-gradient(circle at center, #172554 0%, #0c142c 100%);
}

.card-media.travian-bg {
  background: radial-gradient(circle at center, #451a03 0%, #221206 100%);
}

.card-icon {
  font-size: 4rem;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s;
}

.game-card:hover .card-icon {
  transform: scale(1.15) rotate(5deg);
}

.card-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.card-badge.action { background: rgba(236, 72, 153, 0.2); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); }
.card-badge.word { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.card-badge.classic { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.card-badge.strategy { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.game-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.card-version {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.game-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex: 1;
}

.game-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: #cbd5e1;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 500;
}

.card-actions {
  display: flex;
  gap: 0.6rem;
}

.btn-play {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.btn-play:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.45);
}

.btn-link {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  width: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  transition: all 0.2s;
}

.btn-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-glow);
}

/* Game Viewport Container */
.game-view {
  display: none;
  flex-direction: column;
  height: calc(100vh - 120px);
}

.game-view.active {
  display: flex;
}

.game-bar {
  background: rgba(17, 14, 30, 0.95);
  border: 1px solid var(--border-card);
  border-radius: 14px 14px 0 0;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.game-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-back {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.12);
}

.game-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.game-tag {
  font-size: 0.75rem;
  color: var(--cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.game-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s;
}

.btn-ctrl:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-glow);
}

.frame-container {
  flex: 1;
  position: relative;
  background: #000;
  border: 1px solid var(--border-card);
  border-top: none;
  border-radius: 0 0 14px 14px;
  overflow: hidden;
}

.frame-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.frame-loader {
  position: absolute;
  inset: 0;
  background: #090812;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  z-index: 10;
  transition: opacity 0.3s;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Universal Footer */
.arcade-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(7, 7, 13, 0.8);
}

.arcade-footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.arcade-footer a:hover {
  color: var(--primary);
}

/* Responsive Design */
@media (max-width: 900px) {
  .header-inner {
    flex-wrap: wrap;
    justify-content: center;
  }
  .arcade-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding: 0.4rem;
    justify-content: flex-start;
  }
  .hero-title {
    font-size: 2rem;
  }
  .game-view {
    height: calc(100vh - 170px);
  }
}
