body.hub-page {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}

.hub {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.hub-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  padding: 22px 24px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-lg);
  background: var(--hub-surface);
  box-shadow: var(--hub-shadow-md);
}

.hub-header h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--hub-ink);
}

.hub-subtitle {
  margin: 0;
  color: var(--hub-muted);
  font-size: 14px;
  line-height: 1.5;
}

.hub-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--hub-muted);
  font-size: 13px;
  font-weight: 600;
}

.hub-user > span {
  padding: 8px 12px;
  border-radius: var(--hub-radius-pill);
  background: var(--hub-surface-muted);
  border: 1px solid var(--hub-border);
}

.hub-user strong {
  color: var(--hub-ink);
}

.hub-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--hub-radius-sm);
  border: 1px solid var(--hub-border);
  background: var(--hub-surface);
  color: var(--hub-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.hub-btn-ghost {
  background: var(--hub-surface);
  color: var(--hub-ink);
}

.hub-btn-ghost.is-active {
  border-color: var(--hub-accent);
  background: color-mix(in srgb, var(--hub-accent) 14%, var(--hub-surface));
  color: var(--hub-accent);
}

.hub-btn:hover {
  background: var(--hub-surface-muted);
  border-color: var(--hub-border-strong);
}

.hub-btn:focus-visible {
  outline: none;
  box-shadow: var(--hub-focus-ring);
}

.hub-game-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-md);
  background: var(--hub-surface);
  box-shadow: var(--hub-shadow-sm);
}

.hub-game-nav[hidden] {
  display: none !important;
}

.hub-game-nav-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--hub-ink);
}

.hub-home-heading {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hub-ink);
}

.hub-home-lead {
  margin: 0 0 28px;
  max-width: 52ch;
  color: var(--hub-muted);
  font-size: 14px;
  line-height: 1.55;
}

.hub-preview-banner {
  margin: -12px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--hub-banner-border);
  border-radius: var(--hub-radius-md);
  background: var(--hub-banner-bg);
  color: var(--hub-banner-text);
  font-size: 13px;
  line-height: 1.5;
}

.hub-preview-banner[hidden] {
  display: none !important;
}

.hub-payment-modal .dev-modal-card {
  width: min(calc(100vw - 40px), 980px);
  max-width: 980px;
  padding: 32px 28px 28px;
}

.hub-payment-card {
  width: 100%;
  text-align: left;
}

.hub-payment-card h3 {
  text-align: center;
  font-size: 26px;
  margin-bottom: 10px;
}

.hub-payment-copy {
  margin: 0 0 24px;
  color: var(--hub-muted);
  font-size: 15px;
  line-height: 1.5;
  text-align: center;
}

.hub-payment-modal .plan-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin: 0 0 24px;
  padding: 0;
}

.hub-payment-modal .plan-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 156px;
  padding: 28px 18px;
  border: 2px solid var(--hub-border);
  border-radius: var(--hub-radius-lg);
  background: var(--hub-surface);
  color: var(--hub-ink);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.hub-payment-modal .plan-option:hover {
  border-color: color-mix(in srgb, var(--hub-accent) 40%, var(--hub-border));
  background: color-mix(in srgb, var(--hub-accent) 6%, var(--hub-surface));
  transform: translateY(-2px);
}

.hub-payment-modal .plan-option.is-selected {
  border-color: var(--hub-accent);
  background: color-mix(in srgb, var(--hub-accent) 12%, var(--hub-surface));
  box-shadow: var(--hub-focus-ring);
}

.hub-payment-modal .plan-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hub-payment-modal .plan-price {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--hub-accent);
  line-height: 1;
}

.hub-payment-modal .dev-modal-actions {
  justify-content: center;
}

@media (max-width: 860px) {
  .hub-payment-modal .plan-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hub-payment-modal .dev-modal-card {
    width: min(calc(100vw - 32px), 560px);
  }
}

@media (max-width: 480px) {
  .hub-payment-modal .plan-list {
    grid-template-columns: 1fr;
  }

  .hub-payment-modal .plan-option {
    min-height: 120px;
    flex-direction: row;
    justify-content: space-between;
    padding: 22px 20px;
  }

  .hub-payment-modal .plan-price {
    font-size: 26px;
  }
}

.game-card-tag-free {
  background: color-mix(in srgb, var(--hub-good) 12%, var(--hub-surface));
  border-color: color-mix(in srgb, var(--hub-good) 28%, var(--hub-border));
  color: var(--hub-good);
}

.game-card-tag-used {
  background: color-mix(in srgb, var(--hub-bad) 10%, var(--hub-surface));
  border-color: color-mix(in srgb, var(--hub-bad) 24%, var(--hub-border));
  color: var(--hub-bad);
}

.game-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.game-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--hub-border);
  border-radius: var(--hub-radius-lg);
  background: var(--hub-surface);
  box-shadow: var(--hub-shadow-md);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  overflow: hidden;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.game-card:hover {
  border-color: color-mix(in srgb, var(--hub-accent) 35%, var(--hub-border));
  box-shadow: var(--hub-shadow-md), 0 12px 28px color-mix(in srgb, var(--hub-ink) 8%, transparent);
  transform: translateY(-3px);
}

.game-card:focus-visible {
  outline: none;
  box-shadow: var(--hub-focus-ring), var(--hub-shadow-md);
}

.game-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--hub-surface-muted);
  border-bottom: 1px solid var(--hub-border);
}

.game-card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 20px 20px;
}

.game-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--hub-ink);
}

.game-card-desc {
  flex: 1;
  margin: 0;
  color: var(--hub-muted);
  font-size: 13px;
  line-height: 1.55;
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.game-card-tag {
  padding: 4px 10px;
  border-radius: var(--hub-radius-pill);
  background: color-mix(in srgb, var(--hub-accent) 12%, var(--hub-surface));
  border: 1px solid color-mix(in srgb, var(--hub-accent) 22%, var(--hub-border));
  color: var(--hub-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub-preview-banner-exhausted {
  border-color: color-mix(in srgb, var(--hub-bad) 35%, var(--hub-banner-border));
  background: color-mix(in srgb, var(--hub-bad) 8%, var(--hub-banner-bg));
  color: var(--hub-ink);
  text-align: center;
}

.hub-preview-banner-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--hub-accent);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.hub-preview-banner-link:hover {
  color: var(--hub-accent-hover);
}

.game-card--trial-used {
  cursor: default;
}

.game-card--trial-used:hover {
  transform: none;
  box-shadow: var(--hub-shadow-md);
  border-color: var(--hub-border);
}

.game-card-play {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--hub-radius-sm);
  background: var(--hub-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

.game-card-play.is-disabled {
  background: #e2e8f0;
  color: #94a3b8;
  box-shadow: none;
}

.hub-panel[hidden] {
  display: none !important;
}

#tab-shape {
  min-height: 720px;
}

#tab-shape .screen-warning {
  position: sticky;
  top: 0;
  z-index: 50;
}

#tab-shape .shape-toolbar {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
}

#tab-shape .shape-work-area {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-height: var(--app-height);
  margin: 0;
  padding: 0;
  transform: scale(var(--app-scale));
  transform-origin: top center;
}

@media (max-width: 1024px) {
  .game-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (max-width: 640px) {
  .hub {
    padding: 16px 14px 32px;
  }

  .hub-header {
    padding: 18px 16px;
  }

  .hub-header h1 {
    font-size: 24px;
  }

  .hub-user > span {
    width: 100%;
  }

  .game-card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}
