/* Demo pages reuse styles.css's custom properties and @font-face rules
   (loaded first in <head>) - nothing here redefines them. */

body { min-height: 100vh; min-height: 100svh; }

.demo-shell {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding: 2.5rem var(--edge) 4rem;
}

/* wide variant: craps needs real horizontal room for the table, and
   more vertical room too since it's the one demo that's an actual
   played game rather than a form or table snippet. Reuses the vh/svh
   fallback pair already established by .hero and .coda. */
.demo-shell.wide { max-width: var(--col); }
.demo-shell.wide .demo-frame-wrap { height: 88vh; height: 88svh; }

.demo-too-narrow {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 2rem;
  text-align: center;
  background: rgba(var(--ink-rgb), 0.85);
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.85rem;
  color: var(--frame);
}
.demo-too-narrow strong { color: var(--title); font-size: 1rem; }

.demo-back {
  display: inline-block;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--frame);
  text-decoration: none;
  margin-bottom: 1.5rem;
}
.demo-back:hover { color: var(--accent); }

.demo-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(var(--panel-blur));
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  padding: 1.8rem 2rem 2rem;
  margin-bottom: 1.5rem;
}

.demo-header h1 {
  color: var(--title);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.demo-header p {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--text);
}
.demo-header p { margin-bottom: 1rem; }
.demo-header p:last-of-type { margin-bottom: 0; }
.demo-header p a {
	color: var(--accent);
	text-decoration: none;
	border-bottom: 1px solid transparent;
}
.demo-header p a:hover { border-bottom-color: var(--accent); }
.demo-header .demo-links {
  margin-top: 1rem;
  display: flex;
  gap: 1.1rem;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.75rem;
}
.demo-header .demo-links a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.demo-header .demo-links a:hover { border-bottom-color: var(--accent); }
.demo-header .demo-links a::after { content: " \2197"; opacity: 0.7; }

/* ---- buttons ---- */
.btn {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--pill-border);
  background: rgba(var(--ink-rgb), 0.4);
  color: var(--title);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--pill-border); color: var(--title); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: rgb(13, 13, 13);
  font-weight: 700;
}
.btn-primary:hover { color: rgb(13, 13, 13); filter: brightness(1.08); border-color: var(--accent); }
.btn-primary:disabled { filter: none; }

.demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}

/* ---- select ---- */
.demo-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.78rem;
  color: var(--frame);
}
.demo-select {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.78rem;
  background: rgba(var(--ink-rgb), 0.4);
  color: var(--title);
  border: 1px solid var(--pill-border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}

/* ---- details/summary generator panel ---- */
.demo-details {
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  margin-bottom: 1.2rem;
  overflow: hidden;
}
.demo-details summary {
  cursor: pointer;
  list-style: none;
  padding: 0.8rem 1rem;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.8rem;
  color: var(--title);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.demo-details summary::-webkit-details-marker { display: none; }
.demo-details summary::before {
  content: "\25B8";
  color: var(--accent);
  transition: transform 0.15s ease;
  display: inline-block;
}
.demo-details[open] summary::before { transform: rotate(90deg); }
.demo-details-body {
  padding: 0 1rem 1.2rem;
  border-top: 1px solid var(--panel-border);
}
.demo-details-body .hint {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0.9rem 0;
}
.demo-details-note {
  font-size: 0.72rem;
  color: var(--frame);
  margin-bottom: 0.6rem;
}

/* ---- sliders ---- */
.demo-range-row { margin-bottom: 1.1rem; }
.demo-range-row:last-child { margin-bottom: 0; }
.demo-range-label {
  display: flex;
  justify-content: space-between;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.78rem;
  color: var(--frame);
  margin-bottom: 0.4rem;
}
.demo-range-label .val {
  color: var(--accent);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
}
.demo-range {
  width: 100%;
  accent-color: var(--accent);
}
.demo-range-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--frame);
  margin-top: 0.2rem;
}

/* ---- delivery table ---- */
.demo-table-wrap {
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
}
.demo-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.78rem;
}
.demo-table th {
  position: sticky;
  top: 0;
  text-align: left;
  background: rgba(var(--ink-rgb), 0.9);
  color: var(--accent);
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--panel-border);
}
.demo-table td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(var(--steel-rgb), 0.15);
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.demo-table tr:last-child td { border-bottom: none; }
.demo-table-note {
  font-size: 0.72rem;
  color: var(--frame);
  margin-top: 0.6rem;
}

/* ---- console drawer ---- */
.demo-console {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60vh;
  z-index: 10;
  background: rgba(var(--ink-rgb), 0.94);
  backdrop-filter: blur(var(--panel-blur));
  border-top: 1px solid var(--panel-border);
  box-shadow: var(--panel-shadow);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.demo-console.open { transform: translateY(0); }
.demo-console-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--panel-border);
}
.demo-console-header h2 {
  color: var(--title);
  font-size: 0.95rem;
  margin-right: auto;
}
.demo-console pre {
  flex: 1;
  margin: 0;
  padding: 1rem 1.2rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.8rem;
  color: var(--text);
}

/* ---- capstone form ---- */
.demo-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.2rem; margin-bottom: 1.2rem; }
.demo-field { display: flex; flex-direction: column; gap: 0.4rem; }
.demo-field.span-2 { grid-column: span 2; }
.demo-field label {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.75rem;
  color: var(--frame);
}
.demo-field input {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.85rem;
  background: rgba(var(--ink-rgb), 0.4);
  color: var(--title);
  border: 1px solid var(--pill-border);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}
.demo-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) {
  .demo-form { grid-template-columns: 1fr; }
  .demo-field.span-2 { grid-column: span 1; }
}

.demo-alert {
  border: 1px solid var(--pill-border);
  border-radius: var(--panel-radius);
  padding: 1rem 1.2rem;
  margin-top: 1rem;
}
.demo-alert.is-error { border-color: rgba(220, 100, 90, 0.6); }
.demo-alert .label {
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.72rem;
  color: var(--frame);
  margin-bottom: 0.3rem;
}
.demo-alert .value {
  color: var(--title);
  font-size: 1.3rem;
  font-weight: 700;
}
.demo-alert.is-error .value { color: rgb(220, 130, 120); font-size: 1rem; font-weight: 500; }
.demo-alert .note {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--frame);
}
.hidden { display: none !important; }

/* ---- craps iframe wrap ---- */
.demo-frame-wrap {
  position: relative;
  width: 100%;
  height: 78vh;
  border-radius: var(--panel-radius);
  overflow: hidden;
  border: 1px solid var(--panel-border);
}
.demo-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: rgb(13, 13, 13);
}
.demo-spinner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  background: rgba(var(--ink-rgb), 0.85);
  font-family: 'Spline Sans Mono', monospace;
  font-size: 0.78rem;
  color: var(--frame);
  transition: opacity 0.2s ease;
}
.demo-spinner-overlay.hidden { opacity: 0; pointer-events: none; }
.demo-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--pill-border);
  border-top-color: var(--accent);
  animation: demoSpin 0.8s linear infinite;
}
@keyframes demoSpin { to { transform: rotate(360deg); } }

/* ---- craps chips ---- */
.chip {
    width: 24px;
    height: 24px;
    border: 2px dashed white;
    margin: 4px;
    font-family: "Broadway", "Times New Roman", Georgia, serif; /* Serif font */
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.6rem;
    font-weight: bold;
    color: white;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
}

.selected-chip {
    outline: 2px solid gold;
    outline-offset: 2px;
}

._1 {
    background-color: rgb(83, 77, 75);
}

._5 {
    background-color: rgb(197, 45, 32);
}

._25 {
    background-color: rgb(0, 115, 77);
}

._100 {
    background-color: rgb(17, 15, 16);
}

._500 {
    background-color: rgb(121, 69, 132);
}

._1000 {
    background-color: rgb(238, 184, 44);
}
.demo-chip-decor .chip-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}
.demo-chip-decor .chip {
	margin: 0 0.4rem 0 0;
	font-size: 0.5rem;
}
