/* Game design create / edit / show — layered glass, high-energy */

.game-design-page {
  --gd-accent: #7c5cff;
  --gd-accent-2: #00d4aa;
  --gd-glow: rgba(124, 92, 255, 0.35);
  --gd-panel: rgba(18, 22, 32, 0.75);
  --gd-border: rgba(255, 255, 255, 0.08);
}

.game-design-hero {
  position: relative;
  border-radius: 1.25rem;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12) 0%, rgba(0, 212, 170, 0.08) 50%, rgba(18, 22, 32, 0.4) 100%);
  border: 1px solid var(--gd-border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset, 0 20px 50px -20px var(--gd-glow);
  overflow: hidden;
}

.game-design-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 20% 0%, rgba(124, 92, 255, 0.2), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(0, 212, 170, 0.15), transparent 50%);
  pointer-events: none;
}

.game-design-hero h1,
.game-design-hero .lead {
  position: relative;
  z-index: 1;
}

.game-design-pulse {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gd-accent-2);
  box-shadow: 0 0 12px var(--gd-accent-2);
  animation: gd-pulse 2s ease-in-out infinite;
}

@keyframes gd-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.1);
  }
}

.game-design-glass {
  background: var(--gd-panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--gd-border);
  border-radius: 1rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

.game-design-workspace {
  align-items: flex-start;
}

.gd-main-panel {
  padding: 1.5rem;
}

.gd-side-panel {
  /* No max-height/overflow: content flows with the page so long AI tools aren’t stuck in a small inner scroll. */
  position: static;
  padding: 1.25rem;
}

.gd-side-panel h2 {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #e8eef5;
}

.gd-visual-slot {
  position: relative;
  border-radius: 0.75rem;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.gd-visual-slot img {
  width: 100%;
  object-fit: cover;
  max-height: 200px;
}

.gd-scenario-wrap {
  position: relative;
}

.gd-scenario-wrap textarea {
  padding-bottom: 3.75rem;
}

/* Speech: browser default + compact lang next to mic */
.gd-voice-controls {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  max-width: min(16rem, 92%);
}

@media (max-width: 420px) {
  .gd-voice-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

.gd-speech-lang {
  width: auto;
  min-width: 5.25rem;
  max-width: 8.5rem;
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.2rem 1.5rem 0.2rem 0.35rem;
  height: auto;
  min-height: 1.9rem;
  background: rgba(10, 14, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8eef5;
  border-radius: 0.45rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}

.gd-speech-lang:focus {
  border-color: rgba(124, 92, 255, 0.5);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.2);
}

.gd-mic-btn {
  position: static;
  flex-shrink: 0;
  z-index: 2;
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gd-accent), #5a3fd4);
  color: #fff;
  box-shadow: 0 4px 20px var(--gd-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gd-mic-btn:hover {
  transform: scale(1.05);
  color: #fff;
  box-shadow: 0 6px 24px var(--gd-glow);
}

.gd-mic-btn.gd-mic-on {
  background: linear-gradient(135deg, #e04040, #ff6b6b);
  animation: gd-pulse 1s ease-in-out infinite;
}

.gd-mic-aux.gd-mic-on {
  color: #ff6b6b !important;
}

.gd-char-hint {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* Tree: structured fields */
.gd-tree {
  --gd-line: rgba(124, 92, 255, 0.4);
  position: relative;
  padding-left: 0.5rem;
}

.gd-tree-group {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid var(--gd-line);
}

.gd-tree-group:last-child {
  margin-bottom: 0;
}

.gd-tree-group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a8b4c4;
  margin: 0 0 0.75rem 0.25rem;
}

.gd-tree-nodes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 1rem;
}

@media (max-width: 991.98px) {
  .gd-tree-nodes {
    grid-template-columns: 1fr;
  }
}

.gd-node {
  position: relative;
  padding: 0.5rem 0.65rem 0.55rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gd-node::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 50%;
  width: 0.65rem;
  height: 2px;
  background: var(--gd-line);
  opacity: 0.6;
}

.gd-node:focus-within {
  border-color: rgba(124, 92, 255, 0.45);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.15);
}

.gd-node .form-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.gd-node textarea {
  min-height: 2.75rem;
  font-size: 0.875rem;
  resize: vertical;
}

/* Edit: title + quick visibility / status next to the field */
.gd-basics-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  align-items: end;
}

@media (max-width: 991.98px) {
  .gd-basics-top {
    grid-template-columns: 1fr;
  }
}

.gd-title-state .btn-group .btn {
  min-width: 2.25rem;
}

.gd-subgrid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

@media (max-width: 1199.98px) {
  .gd-subgrid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Show page — wider layout, hero actions */
.gd-show-page .game-design-glass {
  padding: 1.35rem 1.5rem;
}

.gd-show-hero .gd-show-hero__top {
  align-items: flex-start;
}

.gd-show-hero__meta {
  line-height: 1.65;
}

.gd-by-wrap {
  white-space: nowrap;
}

.gd-author-link {
  color: #6bcf3e !important;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(107, 207, 62, 0.45);
  margin-left: 0.15rem;
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.gd-author-link:hover {
  color: #8ade6b !important;
  border-bottom-color: rgba(141, 234, 107, 0.85);
  text-shadow: 0 0 12px rgba(107, 207, 62, 0.35);
}

.gd-btn-backlist {
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  letter-spacing: 0.02em;
}

.gd-date-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem 0.45rem;
  border-radius: 0.4rem;
  background: linear-gradient(165deg, rgba(42, 52, 68, 0.95) 0%, rgba(22, 28, 40, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow:
    0 2px 0 rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.25);
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #cbd5e1;
  flex-shrink: 0;
}

.gd-date-stamp i {
  color: #94a3b8;
  font-size: 1rem;
  filter: drop-shadow(0 0 4px rgba(148, 163, 184, 0.35));
}

.gd-date-stamp__text {
  color: #e2e8f0;
}

.gd-show-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 576px) {
  .gd-show-gallery {
    grid-template-columns: 1fr;
  }
}

.gd-show-gallery figure {
  margin: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--gd-border);
  position: relative;
}

.gd-show-page .gd-show-gallery img {
  height: min(42vw, 320px);
}

.gd-show-gallery img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.gd-section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9aa8b6;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gd-section-label i {
  color: var(--gd-accent-2);
}

/* Create page — teaser column */
.gd-create-teaser {
  text-align: center;
  padding: 2rem 1rem;
}

.gd-stat-badges .badge {
  font-weight: 500;
  padding: 0.45em 0.65em;
}

/* Edit sidebar — text AI tool cards (below upload) */
.gd-ai-text-section {
  margin-top: 0.15rem;
}

.gd-ai-tool-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--gd-border);
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.75rem;
}

/* Full-viewport AI loading overlay (AJAX text tools) */
.gd-ai-loader-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 18, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 1rem;
}

.gd-ai-loader-overlay.gd-ai-loader-overlay--show {
  display: flex;
}

.gd-ai-loader-box {
  max-width: 20rem;
  background: rgba(18, 22, 32, 0.95);
  border: 1px solid var(--gd-border);
  border-radius: 1rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* --- Scenario show: ## sections as cards (mind-map lite) --- */
.gd-scenario-map {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 288px), 1fr));
  gap: 1rem 1.15rem;
  align-items: start;
  position: relative;
}

.gd-scenario-map::before {
  content: "";
  position: absolute;
  inset: -0.25rem;
  background: radial-gradient(circle at 15% 5%, rgba(124, 92, 255, 0.1), transparent 42%),
    radial-gradient(circle at 88% 95%, rgba(0, 212, 170, 0.08), transparent 48%);
  pointer-events: none;
  z-index: 0;
  border-radius: 1rem;
}

.gd-scb {
  position: relative;
  z-index: 1;
  border-radius: 1rem;
  border: 1px solid var(--gd-border);
  background: linear-gradient(165deg, rgba(22, 28, 42, 0.92) 0%, rgba(14, 18, 28, 0.96) 100%);
  padding: 1rem 1.1rem 1.15rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.gd-scb:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
}

.gd-scb--wide {
  grid-column: 1 / -1;
}

/* Before "AI developed" split: always full width, stacked. After split: auto columns, height = content. */
.gd-scb--pre-ai {
  grid-column: 1 / -1;
  align-self: start;
}
.gd-scb--post-ai {
  align-self: start;
}

.gd-scb--rail {
  padding: 0.65rem 1rem;
  text-align: center;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.12), rgba(0, 212, 170, 0.1), rgba(124, 92, 255, 0.12));
  border-style: dashed;
}

.gd-scb-rail-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4b5fd;
}

.gd-scb__head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.gd-scb__icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(124, 92, 255, 0.15);
  color: var(--gd-accent-2);
}

.gd-scb__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #e8ecf4;
  line-height: 1.35;
}

.gd-scb__title--muted {
  color: #9aa8bc;
  font-weight: 600;
  font-size: 0.95rem;
}

.gd-scb__body {
  color: #b4c0d4;
  font-size: 0.95rem;
  line-height: 1.65;
  margin: 0;
  padding-left: 0.15rem;
}

.gd-scenario-en-wrap .gd-scb__body {
  font-size: 0.9rem;
}

.gd-scb--a0 {
  border-left: 3px solid #7c5cff;
}
.gd-scb--a0 .gd-scb__icon {
  color: #c4b5fd;
  background: rgba(124, 92, 255, 0.2);
}

.gd-scb--a1 {
  border-left: 3px solid #00d4aa;
}
.gd-scb--a1 .gd-scb__icon {
  color: #5eead4;
  background: rgba(0, 212, 170, 0.15);
}

.gd-scb--a2 {
  border-left: 3px solid #38bdf8;
}
.gd-scb--a2 .gd-scb__icon {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.15);
}

.gd-scb--a3 {
  border-left: 3px solid #fbbf24;
}
.gd-scb--a3 .gd-scb__icon {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.12);
}

.gd-scb--a4 {
  border-left: 3px solid #f472b6;
}
.gd-scb--a4 .gd-scb__icon {
  color: #f9a8d4;
  background: rgba(244, 114, 182, 0.12);
}

.gd-scb--a5 {
  border-left: 3px solid #a78bfa;
}
.gd-scb--a5 .gd-scb__icon {
  color: #ddd6fe;
  background: rgba(167, 139, 250, 0.15);
}

