/* CrawlerCreator's page shell: the header, the styled dialog, and the few site-wide
   variables the game templates expect. Stone/amber, dark only. */

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --cc-header-h: 3.5rem;
  --cc-bg: #1c1917;
  --cc-surface: #292524;
  --cc-line: rgba(120, 113, 108, 0.35);
  --cc-ink: #e7e5e4;
  --cc-ink-dim: #a8a29e;
  --cc-gold: #f59e0b;
  --cc-gold-hi: #fbbf24;
}

body {
  background: var(--cc-bg);
  color: var(--cc-ink);
  font-family: Inter, system-ui, sans-serif;
}

/* ---- Header ------------------------------------------------------------------------ */
.cc-header {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: calc(var(--cc-header-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: rgba(28, 25, 23, 0.85);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--cc-line);
}
.cc-brand {
  font-family: Cinzel, Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--cc-gold-hi);
  text-decoration: none;
  white-space: nowrap;
}
.cc-nav {
  display: flex;
  gap: 1.25rem;
}
.cc-nav a {
  color: var(--cc-ink-dim);
  text-decoration: none;
  font-size: 0.95rem;
}
.cc-nav a:hover,
.cc-nav a:focus-visible {
  color: var(--cc-gold-hi);
}

/* ---- Buttons ----------------------------------------------------------------------- */
.cc-btn {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  border: 1px solid transparent;
  background: #d97706;
  color: #1c1917;
  cursor: pointer;
}
.cc-btn:hover {
  background: var(--cc-gold);
}
.cc-btn-quiet {
  font-weight: 500;
  background: rgba(68, 64, 60, 0.7);
  color: var(--cc-ink);
  border-color: rgba(87, 83, 78, 0.5);
}
.cc-btn-quiet:hover {
  background: #44403c;
}
.cc-btn-primary.is-danger {
  background: #dc2626;
  color: #fff;
}
.cc-btn-primary.is-danger:hover {
  background: #ef4444;
}

/* ---- The styled dialog (static/js/dialogs.js) --------------------------------------- */
.cc-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cc-dialog[hidden] {
  display: none;
}
.cc-dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
}
.cc-dialog-panel {
  position: relative;
  width: 100%;
  max-height: 90%;
  overflow-y: auto;
  padding: 1.25rem 1.5rem calc(1.5rem + var(--safe-bottom));
  background: var(--cc-surface);
  border-top: 1px solid rgba(120, 53, 15, 0.35);
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}
@media (min-width: 640px) {
  .cc-dialog {
    align-items: center;
    padding: 1rem;
  }
  .cc-dialog-panel {
    max-width: 24rem;
    border: 1px solid rgba(120, 53, 15, 0.35);
    border-radius: 1rem;
    padding-bottom: 1.5rem;
  }
  .cc-dialog-panel.is-wide {
    max-width: 28rem;
  }
}
.cc-dialog-title {
  font-family: Cinzel, Georgia, serif;
  font-size: 1.125rem;
  color: var(--cc-gold-hi);
  margin: 0 0 0.75rem;
  overflow-wrap: anywhere;
}
.cc-dialog-message {
  font-size: 0.875rem;
  color: #d6d3d1;
  margin: 0 0 1.25rem;
  white-space: pre-line;
}
.cc-dialog-field {
  margin-bottom: 1.25rem;
}
.cc-dialog-field[hidden] {
  display: none;
}
.cc-dialog-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #78716c;
  margin-bottom: 0.25rem;
}
.cc-dialog-field input {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  background: var(--cc-bg);
  border: 1px solid #57534e;
  border-radius: 0.5rem;
  color: #f5f5f4;
}
.cc-dialog-field input:focus {
  outline: 2px solid var(--cc-gold);
  border-color: transparent;
}
.cc-dialog-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.cc-dialog-buttons [hidden] {
  display: none;
}
