* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #0a0f1a;
  color: #f8fafc;
  font-family: Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.game-platform-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.platform-header h1,
.game-shell-header h1 {
  margin: 0 0 8px;
}

.platform-header p,
.game-shell-header p {
  margin: 0;
  color: #94a3b8;
}

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

.game-card {
  display: block;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, #131c2e 0%, #0f172a 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.5);
}

.game-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.game-card p {
  margin: 0 0 14px;
  color: #94a3b8;
  line-height: 1.4;
}

.game-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  margin-bottom: 12px;
}

.game-card-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: #2563eb;
  font-weight: 700;
}

.game-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-shell-header {
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.back-link {
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  white-space: nowrap;
}

.game-title-wrap {
  min-width: 0;
}

.game-root {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 16px 16px;
  border-radius: 18px;
  overflow: hidden;
  background: #020617;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.game-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 12px;
  text-transform: lowercase;
}
.badge.public {
  background: #14532d;
  color: #bbf7d0;
}

#game-ui,
.game-stage {
  width: 100%;
  height: 100%;
}

.game-root,
.game-ui {
  min-height: 100vh;
  position: relative;
}

.game-placeholder {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: #cbd5e1;
}

@media (max-width: 640px) {
  .game-platform-page {
    padding: 16px;
  }

  .game-shell-header {
    flex-direction: column;
    align-items: stretch;
  }

  .game-root {
    margin: 0 12px 12px;
  }
}


.pig-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.pig-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #6d5efc, #3b82f6);
  color: #fff;
  box-shadow: 0 10px 24px rgba(109, 94, 252, 0.32);
  font-weight: 800;
}

.platform-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.platform-topbar-title {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.platform-topbar-spacer {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
}

.game-shell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.game-title-wrap {
  flex: 1;
  text-align: center;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}

@media (max-width: 720px) {
  .platform-topbar,
  .game-shell-header {
    flex-wrap: wrap;
  }

  .platform-topbar-title,
  .game-title-wrap {
    order: 3;
    width: 100%;
    text-align: left;
  }

  .platform-topbar-spacer {
    display: none;
  }
}
