/* ── The Workshop — Dark Industrial Theme ───────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0d1a;
  --sidebar: #12121f;
  --card: #1a1a2e;
  --accent: #e94560;
  --accent-hover: #ff6b81;
  --blue: #0f3460;
  --blue-light: #16458a;
  --text: #e0e0e8;
  --text-dim: #8888a0;
  --text-muted: #555570;
  --border: #2a2a40;
  --success: #2ecc71;
  --danger: #e74c3c;
  --radius: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'Cascadia Code', 'Fira Code', 'JetBrains Mono', Consolas, monospace;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow: hidden;
}

/* ── Scrollbar ──────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--sidebar);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Launcher Layout ────────────────────────────────────────── */

.launcher {
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-columns: 260px 1fr;
  height: 100vh;
}

/* ── Header ─────────────────────────────────────────────────── */

.header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header-brand svg {
  width: 28px;
  height: 28px;
  fill: var(--accent);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ── Sidebar ────────────────────────────────────────────────── */

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 12px;
}

.sidebar-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-left: 8px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 4px;
}

.game-card:hover {
  background: var(--card);
}

.game-card.active {
  background: var(--blue);
}

.game-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.game-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card-icon .placeholder-icon {
  font-size: 1.2rem;
}

.game-card-info {
  min-width: 0;
}

.game-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card-version {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* ── Main Content ───────────────────────────────────────────── */

.main {
  overflow-y: auto;
  padding: 24px 32px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  fill: var(--text-muted);
  opacity: 0.4;
}

/* ── Splash Image ───────────────────────────────────────────── */

.splash-container {
  width: 100%;
  max-height: 300px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  margin-bottom: 24px;
}

.splash-container img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  display: block;
}

.splash-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Game Info Header ───────────────────────────────────────── */

.game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 16px;
  flex-wrap: wrap;
}

.game-title {
  font-size: 1.8rem;
  font-weight: 700;
}

.game-developer {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.game-description {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 24px;
  max-width: 600px;
  line-height: 1.6;
}

.game-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--mono);
  margin-bottom: 24px;
}

.game-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Download Button ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  color: #fff;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--blue);
}

.btn-secondary:hover {
  background: var(--blue-light);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.btn-ghost:hover {
  background: var(--card);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #c0392b;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.download-section {
  margin-bottom: 32px;
}

/* ── Panels Grid (News + Update Notes) ──────────────────────── */

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-body {
  padding: 16px 18px;
  max-height: 300px;
  overflow-y: auto;
}

/* ── News Items ─────────────────────────────────────────────── */

.news-item {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.news-title {
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 2px;
}

.news-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.news-body {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Update Notes ───────────────────────────────────────────── */

.update-item {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.update-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.update-version {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
}

.update-date {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 8px;
}

.update-changes {
  list-style: none;
  margin-top: 6px;
}

.update-changes li {
  font-size: 0.84rem;
  color: var(--text-dim);
  padding: 2px 0 2px 16px;
  position: relative;
}

.update-changes li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}

/* ── Feedback Buttons ───────────────────────────────────────── */

.feedback-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Modal ──────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.modal label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 4px;
  margin-top: 14px;
}

.modal label:first-of-type {
  margin-top: 0;
}

.modal input,
.modal textarea,
.modal select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
}

.modal input:focus,
.modal textarea:focus,
.modal select:focus {
  outline: none;
  border-color: var(--accent);
}

.modal textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* ── Footer ─────────────────────────────────────────────────── */

.footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 24px;
  background: var(--sidebar);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  margin-left: 6px;
}

.status-dot.offline {
  background: var(--danger);
}

/* ── Empty / No data ────────────────────────────────────────── */

.no-data {
  color: var(--text-muted);
  font-size: 0.84rem;
  font-style: italic;
  padding: 8px 0;
}

/* ══════════════════════════════════════════════════════════════ */
/*  ADMIN PANEL STYLES                                          */
/* ══════════════════════════════════════════════════════════════ */

.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: var(--sidebar);
  border-bottom: 1px solid var(--border);
}

.admin-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.admin-header h1 span {
  color: var(--accent);
  font-weight: 400;
  margin-left: 8px;
  font-size: 0.85rem;
}

.admin-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

/* ── Login Form ─────────────────────────────────────────────── */

.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 36px;
  width: 360px;
  text-align: center;
}

.login-box h1 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.login-box p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.login-box input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 16px;
  text-align: center;
}

.login-box input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-error {
  color: var(--danger);
  font-size: 0.82rem;
  margin-bottom: 12px;
  display: none;
}

/* ── Admin Game Cards ───────────────────────────────────────── */

.admin-game {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.admin-game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-game-header h2 {
  font-size: 1.15rem;
}

.admin-game-header .actions {
  display: flex;
  gap: 8px;
}

.admin-game-meta {
  display: flex;
  gap: 24px;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-game-meta strong {
  color: var(--text);
}

.admin-section {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.admin-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.admin-list-item:last-child {
  border-bottom: none;
}

/* ══════════════════════════════════════════════════════════════ */
/*  LANDING PAGE STYLES                                          */
/* ══════════════════════════════════════════════════════════════ */

.landing-banner {
  background: linear-gradient(135deg, var(--blue) 0%, var(--card) 100%);
  border-radius: var(--radius);
  padding: 40px 36px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.landing-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(233, 69, 96, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.landing-banner h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
}

.landing-banner p {
  color: var(--text-dim);
  font-size: 0.95rem;
  position: relative;
}

.landing-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.featured-games {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.featured-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.featured-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
}

.featured-card-content {
  position: relative;
  padding: 24px;
  background: linear-gradient(180deg, transparent 0%, var(--card) 40%);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.featured-card-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.featured-card-content .featured-developer {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.featured-card-content .featured-description {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.featured-card--active {
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.featured-card--active:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.featured-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.featured-version-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(233, 69, 96, 0.15);
  color: var(--accent);
  border: 1px solid rgba(233, 69, 96, 0.3);
}

.featured-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.featured-download-btn {
  margin-left: auto;
  padding: 4px 14px !important;
  font-size: 0.75rem !important;
}

.featured-website-btn {
  padding: 4px 14px !important;
  font-size: 0.75rem !important;
}

.featured-card--coming-soon {
  opacity: 0.5;
  filter: grayscale(60%);
  pointer-events: none;
}

.featured-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.featured-badge--beta {
  background: rgba(233, 69, 96, 0.2);
  color: var(--accent);
  border: 1px solid rgba(233, 69, 96, 0.4);
}

.featured-badge--soon {
  background: rgba(85, 85, 112, 0.3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.landing-news {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 32px;
}

.landing-news-item {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.landing-news-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.landing-news-game-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(15, 52, 96, 0.5);
  color: var(--text-dim);
  border: 1px solid var(--blue-light);
  margin-right: 6px;
}

.quick-links {
  display: flex;
  gap: 16px;
  margin-bottom: 32px;
}

.quick-link-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.quick-link-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.quick-link-card svg {
  width: 28px;
  height: 28px;
  fill: var(--accent);
  flex-shrink: 0;
}

.quick-link-card .quick-link-text {
  min-width: 0;
}

.quick-link-card .quick-link-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.quick-link-card .quick-link-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Home Sidebar Item ───────────────────────────────────────── */

.home-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--text-dim);
}

.game-card.active .home-icon svg {
  fill: var(--text);
}

/* ══════════════════════════════════════════════════════════════ */
/*  HELP PAGE STYLES                                             */
/* ══════════════════════════════════════════════════════════════ */

.help-page {
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 24px;
}

.help-section {
  margin-bottom: 32px;
}

.help-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

.help-section p {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 10px;
}

.help-section ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.help-section ol li {
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 4px;
}

.help-section code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.help-warning {
  color: var(--danger);
  font-weight: 600;
}

/* ── Responsive ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .launcher {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .panels {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 16px;
  }

  .featured-games {
    grid-template-columns: 1fr;
  }

  .quick-links {
    flex-direction: column;
  }
}
