* {
  box-sizing: border-box;
}

body {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 20px;
  background: #FFFDE7;
  color: #222;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
}

h1 {
  font-size: 2.5rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000;
}

.back-link {
  font-size: 1.1rem;
  color: #0057FF;
  text-decoration: none;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.back-link:hover {
  text-decoration: underline;
}

/* Idea-first front door */
#idea-hero {
  background: white;
  border: 3px solid #000;
  border-radius: 20px;
  box-shadow: 6px 6px 0 #000;
  padding: 28px 28px 20px;
  margin-bottom: 36px;
}

.idea-hero-title {
  margin: 0 0 14px;
  font-size: 1.6rem;
  text-transform: none;
  letter-spacing: 0;
  color: #000;
}

.idea-input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

#idea-input {
  flex: 1;
  padding: 14px 16px;
  border: 3px solid #000;
  border-radius: 14px;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 1.05rem;
  resize: none;
  line-height: 1.4;
}

#idea-input:focus {
  outline: none;
  border-color: #0057FF;
}

.idea-input-nudge {
  animation: idea-nudge 0.5s;
}

@keyframes idea-nudge {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

#idea-go-btn {
  font-size: 1.25rem;
  padding: 12px 28px;
  cursor: pointer;
  border: 3px solid #000;
  border-radius: 14px;
  background: #6A1B9A;
  color: white;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: inherit;
  flex-shrink: 0;
}

#idea-go-btn:hover {
  background: #9C27B0;
}

.idea-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.idea-examples-label {
  font-size: 0.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
}

.idea-example-chip {
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.85rem;
  padding: 6px 12px;
  background: #FFF9C4;
  border: 2px solid #000;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s;
}

.idea-example-chip:hover {
  background: #FFEB3B;
}

.idea-advanced-links {
  margin: 18px 0 0;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.9rem;
  color: #666;
}

.idea-advanced-links a {
  color: #0057FF;
  font-weight: bold;
  text-decoration: none;
}

.idea-advanced-links a:hover {
  text-decoration: underline;
}

.idea-link-sep {
  margin: 0 4px;
  color: #bbb;
}

/* Messages */
#loading-message {
  font-size: 1.25rem;
  color: #666;
  text-align: center;
  margin: 60px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#error-message {
  font-size: 1.25rem;
  color: #FF2D2D;
  text-align: center;
  font-weight: 900;
  margin: 40px 0;
  text-transform: uppercase;
}

.empty-message {
  font-size: 1.25rem;
  color: #666;
  text-align: center;
  margin: 60px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Game cards layout — flow container that holds section headings + sub-grids */
#games-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.games-section-heading {
  font-size: 1.5rem;
  margin: 8px 0 0 0;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 3px solid #000;
  padding-bottom: 8px;
}

.games-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* Individual game card */
.game-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  transition: background 0.15s;
  border: 3px solid #000;
  display: flex;
  flex-direction: column;
}

.game-card:hover {
  background: #BBDEFB;
}

/* Card actions — real links/buttons so keyboard and screen-reader users get
   the same affordances (2026-07-26 UI review). Host is the primary action. */
.game-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.game-card-actions a,
.game-card-actions button {
  text-decoration: none;
  border-radius: 10px;
  border: 2px solid #000;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 900;
  cursor: pointer;
  color: #000;
  background: white;
}

.game-card-host {
  background: #0057FF !important;
  color: #fff !important;
  text-transform: uppercase;
}

.game-card-host:hover { background: #0041CC !important; }
.game-card-edit:hover,
.game-card-preview:hover { background: #FFF3C4; }

.game-card-actions .game-card-delete {
  margin-top: 0;
  margin-left: auto;
}

.game-card-actions a:focus-visible,
.game-card-actions button:focus-visible,
.owner-link:focus-visible,
.owner-bar-exit:focus-visible {
  outline: 3px solid #0057FF;
  outline-offset: 2px;
}

/* Subtle visual differentiation between built-in (curated) and user-made */
.game-card-built-in {
  background: #FFF9E6;
}
.game-card-built-in:hover {
  background: #FFEFA8;
}

.game-card-name {
  font-size: 1.5rem;
  margin: 0 0 8px 0;
  color: #000;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-card-description {
  font-size: 1rem;
  color: #555;
  margin: 0 0 16px 0;
  line-height: 1.4;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
}

.game-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.game-card-meta-badge,
.game-card-phases,
.game-card-players {
  font-size: 0.85rem;
  color: #000;
  background: white;
  padding: 4px 10px;
  border-radius: 8px;
  border: 2px solid #000;
  font-weight: 900;
}

.game-card-phases {
  background: #FFF9C4;
}

.game-card-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.game-card-tags-icon {
  font-size: 1rem;
}

.game-card-tag {
  font-size: 0.8rem;
  background: #E1F5FE;
  border: 2px solid #000;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 900;
  text-transform: lowercase;
}

.game-card-recommended {
  font-size: 0.85rem;
  color: #333;
  font-style: italic;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
  margin: 4px 0 10px 0;
  line-height: 1.3;
}

.game-card-delete {
  margin-top: 12px;
  padding: 6px 14px;
  background: white;
  color: #FF2D2D;
  border: 2px solid #FF2D2D;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  font-family: inherit;
}

.game-card-delete:hover {
  background: #FF2D2D;
  color: white;
}

/* ---- Library controls (search + goal chips) ---- */
#library-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

#library-search {
  flex: 1 1 220px;
  max-width: 320px;
  padding: 10px 14px;
  border: 2.5px solid #000;
  border-radius: 12px;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.95rem;
  background: white;
}

#library-search:focus {
  outline: none;
  border-color: #0057FF;
}

#goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.goal-chip {
  padding: 7px 14px;
  border: 2px solid #000;
  border-radius: 999px;
  background: white;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.goal-chip:hover { background: #FFF3C4; }

.goal-chip.active {
  background: #0057FF;
  color: white;
}

.goal-chip:focus-visible,
#library-search:focus-visible,
.game-card-fav:focus-visible {
  outline: 3px solid #0057FF;
  outline-offset: 2px;
}

.game-card-fav {
  border: 2px solid #000;
  border-radius: 10px;
  background: white;
  padding: 7px 12px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  color: #E91E63;
}

.game-card-fav:hover { background: #FCE4EC; }

.game-card-fav.is-fav {
  background: #E91E63;
  color: white;
  border-color: #000;
}

/* ---- Prompt-deck picker (library-first: teachers pick, not write) ---- */
.prompt-deck-btn {
  margin-top: 6px;
  padding: 7px 14px;
  border: 2px solid #000;
  border-radius: 10px;
  background: #E1F5FE;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
}

.prompt-deck-btn:hover { background: #B3E5FC; }

.deck-picker-modal { max-width: 640px; }

.deck-heading {
  margin: 18px 0 4px;
  font-size: 1rem;
}

.deck-description {
  margin: 0 0 10px;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.82rem;
  color: #555;
}

.deck-prompt {
  display: block;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
  padding: 10px 14px;
  border: 2px solid #000;
  border-radius: 10px;
  background: white;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
}

.deck-prompt:hover { background: #FFF3C4; }

.deck-prompt:focus-visible {
  outline: 3px solid #0057FF;
  outline-offset: 2px;
}

.deck-prompt-text { display: block; }

.deck-prompt-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #777;
}

/* ---- Owner mode (curated public list controls) ---- */
.owner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 16px;
  background: #FFF3C4;
  border: 3px solid #000;
  border-radius: 12px;
  font-weight: 900;
  font-size: 0.9rem;
}

.owner-bar-exit {
  padding: 6px 14px;
  background: white;
  border: 2px solid #000;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 900;
  font-family: inherit;
}

.owner-bar-exit:hover {
  background: #000;
  color: white;
}

.owner-link {
  display: block;
  margin: 28px auto 0;
  padding: 6px 12px;
  background: none;
  border: none;
  color: #999;
  font-size: 0.78rem;
  font-family: 'Nunito', Arial, sans-serif;
  cursor: pointer;
  text-decoration: underline;
}

.owner-link:hover {
  color: #000;
}

.game-card-no-winner {
  display: inline-block;
  align-self: flex-start;
  margin-top: 10px;
  padding: 4px 12px;
  border: 2px solid #000;
  border-radius: 999px;
  background: #E1F5FE;
  font-size: 0.75rem;
  font-weight: 900;
}

.game-card-star {
  margin-top: 8px;
  padding: 6px 14px;
  background: white;
  color: #B8860B;
  border: 2px solid #B8860B;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
  font-family: inherit;
}

.game-card-star.is-featured {
  background: #FFD600;
  color: #000;
  border-color: #000;
}

.game-card-star:hover {
  background: #FFF3C4;
}

/* ---- Template picker modal ---- */
.template-picker-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.template-picker-modal {
  background: #FFD600;
  border-radius: 16px;
  padding: 28px 32px;
  max-width: 620px;
  width: 90%;
  border: 4px solid #000;
  max-height: 90vh;
  overflow-y: auto;
  position: relative; /* anchors the dialog × */
}

/* Dialog × (added by shared/dialog.js) */
.dialog-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 2.5px solid #000;
  border-radius: 50%;
  background: white;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.dialog-close-btn:hover {
  background: #000;
  color: #fff;
}

.dialog-close-btn:focus-visible,
.template-card:focus-visible,
.template-picker-modal:focus-visible {
  outline: 3px solid #0057FF;
  outline-offset: 2px;
}

.template-picker-title {
  font-size: 1.3rem;
  color: #000;
  margin-bottom: 8px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.template-picker-subtitle {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 20px;
  text-align: center;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
}

.template-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.template-card {
  padding: 16px;
  border: 3px solid #000;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  background: white;
  /* Cards are real/semantic buttons now — undo browser button styling. */
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  display: block;
  width: 100%;
}

.template-card:hover {
  background: #BBDEFB;
}

.template-card-icon {
  font-size: 1.8rem;
  display: block;
  margin-bottom: 8px;
}

.template-card-name {
  font-weight: 900;
  font-size: 1rem;
  color: #000;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.template-card-desc {
  font-size: 0.8rem;
  color: #555;
  line-height: 1.3;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
}

/* ---- Recipe button + picker (R2) ---- */

#use-recipe-btn {
  font-size: 1.25rem;
  padding: 12px 28px;
  cursor: pointer;
  border: 3px solid #000;
  border-radius: 14px;
  background: #FFD600;
  color: #000;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: inherit;
  margin-right: 12px;
  /* Slightly larger to draw the eye — recipes are the recommended path */
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

#use-recipe-btn:hover {
  background: #FFEB3B;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
}

#use-recipe-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.recipe-picker-modal {
  background: #FFEB3B;
  max-width: 720px !important;
}

.recipe-picker-grid {
  grid-template-columns: 1fr 1fr !important;
}

.recipe-card {
  background: #FFF !important;
  position: relative;
  padding-bottom: 24px !important;
}

.recipe-card:hover {
  background: #C5E1A5 !important;
}

.recipe-card-tagline {
  font-size: 0.75rem;
  color: #555;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: bold;
  margin-top: 8px;
  font-style: italic;
}

/* R6 — recipe sections + delete + broken badge */

.recipe-section-heading {
  font-size: 1rem;
  margin: 16px 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000;
  border-bottom: 3px solid #000;
  padding-bottom: 4px;
}

.recipe-section-heading:first-of-type {
  margin-top: 4px;
}

.recipe-card {
  position: relative;
}

.recipe-card-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border: 2px solid #000;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 900;
  font-family: inherit;
  padding: 0;
  line-height: 1;
}

.recipe-card-delete:hover {
  background: #FF2D2D;
  color: white;
}

.recipe-card-broken {
  background: #FFF3E0 !important;
  border-color: #FF6D00 !important;
}

.recipe-card-broken-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 8px;
  background: #FF6D00;
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-family: 'Nunito', Arial, sans-serif;
  cursor: help;
}

.recipe-loading {
  text-align: center;
  font-size: 1.1rem;
  padding: 40px;
  color: #555;
}

/* ---- Recipe parameter form ---- */

.recipe-form-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.recipe-back-btn {
  padding: 8px 16px;
  border: 3px solid #000;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.85rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-back-btn:hover {
  background: #BBDEFB;
}

.recipe-form-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.recipe-form-icon {
  font-size: 2.2rem;
}

.recipe-form-title {
  font-size: 1.4rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.recipe-form-description {
  font-size: 0.9rem;
  color: #444;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
  margin: 0 0 20px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #000;
}

.recipe-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.recipe-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-field-label {
  font-weight: 900;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-field-required {
  color: #FF2D2D;
}

.recipe-field-helper {
  font-size: 0.8rem;
  color: #555;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
  margin-bottom: 4px;
}

.recipe-field-input {
  padding: 10px 12px;
  border: 3px solid #000;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: 'Nunito', Arial, sans-serif;
  background: white;
  font-weight: normal;
}

.recipe-field-input:focus {
  outline: none;
  background: #FFF9C4;
}

textarea.recipe-field-input {
  resize: vertical;
  min-height: 60px;
}

select.recipe-field-input {
  cursor: pointer;
  font-family: inherit;
  font-weight: 900;
}

.recipe-field-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
}

.recipe-field-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
}

/* Array repeater */

.recipe-field-array-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recipe-field-array-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.recipe-field-array-row .recipe-field-input {
  flex: 1;
}

.recipe-field-array-remove {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid #000;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 1rem;
  font-weight: bold;
  font-family: inherit;
  flex-shrink: 0;
}

.recipe-field-array-remove:hover {
  background: #FFCDD2;
}

/* Object array items (e.g. quiz-show questions): card per item with one
   labeled input per field. */
.recipe-field-array-row-object {
  align-items: flex-start;
}

.recipe-object-card {
  flex: 1;
  border: 3px solid #000;
  border-radius: 12px;
  background: white;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recipe-object-field-label {
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
  margin-top: 6px;
}

.recipe-object-field-label:first-child {
  margin-top: 0;
}

.recipe-object-card .recipe-field-input {
  border-width: 2px;
}

.recipe-field-array-add {
  margin-top: 6px;
  padding: 8px 16px;
  border: 3px solid #000;
  border-radius: 8px;
  background: #C5E1A5;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.85rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.recipe-field-array-add:hover:not(:disabled) {
  background: #AED581;
}

.recipe-field-array-add:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Form bottom controls */

.recipe-form-status {
  margin-bottom: 12px;
  min-height: 0;
  padding: 0;
}

.recipe-form-status-error {
  background: #FFCDD2;
  border: 3px solid #000;
  border-radius: 8px;
  padding: 12px;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
}

.recipe-form-status-error strong {
  display: block;
  margin-bottom: 6px;
  font-family: inherit;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-form-diagnostic-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  color: #B71C1C;
}

.recipe-form-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.recipe-cancel-btn {
  padding: 10px 24px;
  border: 3px solid #000;
  border-radius: 8px;
  background: white;
  color: #000;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.95rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-cancel-btn:hover {
  background: #eee;
}

.recipe-create-btn {
  padding: 10px 28px;
  border: 3px solid #000;
  border-radius: 8px;
  background: #00C853;
  color: white;
  cursor: pointer;
  font-weight: 900;
  font-size: 0.95rem;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.recipe-create-btn:hover:not(:disabled) {
  background: #00E676;
}

.recipe-create-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---- AI Generate flow (R4) ---- */

.ai-match-params {
  background: white;
  border: 3px solid #000;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-match-param-row {
  display: flex;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.ai-match-param-row:last-child {
  border-bottom: none;
}

.ai-match-param-label {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
  flex-shrink: 0;
  width: 120px;
  color: #555;
}

.ai-match-param-value {
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
  font-size: 0.95rem;
  flex: 1;
  word-break: break-word;
}

.ai-no-match-reason,
.ai-no-match-suggestion {
  background: white;
  border: 3px solid #000;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.ai-no-match-suggestion {
  background: #FFF9C4;
}

.ai-no-match-label {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.8rem;
  margin-bottom: 6px;
  color: #555;
}

.ai-no-match-text {
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: normal;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 600px) {
  body {
    padding: 20px 15px;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  h1 {
    font-size: 2rem;
  }

  .games-section-grid {
    grid-template-columns: 1fr;
  }

  .template-picker-grid {
    grid-template-columns: 1fr;
  }

  .recipe-picker-grid {
    grid-template-columns: 1fr !important;
  }

  .toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  #use-recipe-btn,
  #create-new-btn,
  #ai-generate-btn {
    margin: 0 !important;
    width: 100%;
  }
}

/* Create-page pointer back to the one shelf (the grid moved to /library). */
.idea-library-link {
  text-align: center;
  margin-top: 28px;
  font-family: 'Nunito', Arial, sans-serif;
  color: #555;
}

.idea-library-link a {
  color: #0057FF;
  font-weight: 800;
}

/* ════════════════════════════════════════════════════════════════
   PASTE-UP SKIN (docs/paper-layout-test/) — Create page re-theme.
   Cut paper on a grained gesso ground, ink text, one vermillion for
   primary actions, 2px radii, hard paste shadows, 90ms snaps.
   Appended last so it wins every earlier rule it repeats.
   ════════════════════════════════════════════════════════════════ */

:root { --focus-ring: 3px solid #221E1C; }

body {
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 600;
  background: #EFE9DC;
  color: #221E1C;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(rgba(120,105,80,0.35) 0.5px, transparent 0.6px),
    radial-gradient(rgba(80,70,55,0.22) 0.5px, transparent 0.6px);
  background-size: 4px 4px, 7px 7px;
  background-position: 0 0, 2px 3px;
}

h1 {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: #221E1C;
}

.back-link {
  color: #6E6353;
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
}

.back-link:hover { color: #221E1C; text-decoration: none; }

a { color: #AE3A16; }

/* The idea box is the pasted sheet; its title is the spoken line */
#idea-hero {
  background: #FBF7EC;
  border: none;
  border-radius: 2px;
  transform: rotate(-0.25deg);
  box-shadow: 5px 6px 0 rgba(34,30,28,0.10);
}

.idea-hero-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.9rem;
  text-shadow: 1.5px 0 0 rgba(217,72,28,0.26), -1.5px 0 0 rgba(0,165,196,0.20);
}

#idea-input {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: inset 2px 2px 0 rgba(34,30,28,0.10), 0 0 0 1px rgba(34,30,28,0.16);
  font-weight: 600;
}

#idea-input:focus {
  border: none;
  box-shadow: inset 2px 2px 0 rgba(34,30,28,0.10), 0 0 0 2px #221E1C;
}

#idea-go-btn {
  border: none;
  border-radius: 2px;
  background: #D9481C;
  color: #FFF6EA;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
  transform: rotate(-0.8deg);
  box-shadow: 3px 3px 0 rgba(34,30,28,0.18);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

#idea-go-btn:hover {
  background: #D9481C;
  transform: rotate(-0.8deg) translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.18);
}

.idea-examples-label { color: #6E6353; letter-spacing: 0.1em; }

.idea-example-chip {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14);
  font-weight: 700;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.idea-example-chip:nth-child(odd) { transform: rotate(-0.7deg); }
.idea-example-chip:nth-child(even) { transform: rotate(0.6deg); }

.idea-example-chip:hover {
  background: #FFFDF6;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.14);
}

.idea-advanced-links { color: #55503F; }
.idea-advanced-links a { color: #AE3A16; }
.idea-advanced-links a:hover { color: #221E1C; text-decoration: none; }
.idea-library-link { color: #55503F; }

#loading-message { color: #6E6353; font-weight: 700; text-transform: none; letter-spacing: 0; }
#error-message { color: #AE3A16; text-transform: none; }
.empty-message { color: #6E6353; text-transform: none; letter-spacing: 0; }

/* ---- Modals (template picker, recipe picker/forms, concierge) ---- */
.template-picker-overlay { background: rgba(34, 30, 28, 0.5); }

.template-picker-modal {
  background: #FBF7EC;
  border: none;
  border-radius: 2px;
  box-shadow: 6px 7px 0 rgba(34,30,28,0.25);
}

.recipe-picker-modal { background: #FBF7EC; }

.dialog-close-btn {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.18);
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 800;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.dialog-close-btn:hover {
  background: #FFFDF6;
  color: #221E1C;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.18);
}

.template-picker-title {
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 1.7rem;
  text-transform: none;
  letter-spacing: 0;
  text-shadow: 1.5px 0 0 rgba(217,72,28,0.26), -1.5px 0 0 rgba(0,165,196,0.20);
}

.template-picker-subtitle { color: #55503F; font-weight: 600; }

.template-card {
  border: none;
  border-radius: 2px;
  background: #FFFDF6 !important;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.template-card:hover {
  background: #FFFDF6 !important;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.14);
}

.template-card-name {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.template-card-desc { color: #55503F; font-weight: 600; }

.recipe-card { background: #FFFDF6 !important; }
.recipe-card:hover { background: #FFFDF6 !important; }
.recipe-card-tagline { color: #6E6353; }

.recipe-section-heading {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgba(34,30,28,0.18);
}

.recipe-card-delete {
  border: none;
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.16);
}

.recipe-card-delete:hover { background: #221E1C; color: #FBF7EC; }

.recipe-card-broken {
  background: #FFFDF6 !important;
  border: none !important;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14), 0 0 0 2px #AE3A16;
}

.recipe-card-broken-badge { background: #AE3A16; border-radius: 2px; }

.recipe-loading { color: #6E6353; }

/* ---- Recipe form ---- */
.recipe-back-btn {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.16);
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.recipe-back-btn:hover {
  background: #FFFDF6;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.16);
}

.recipe-form-title {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.recipe-form-description {
  color: #55503F;
  font-weight: 600;
  border-bottom: 1px solid rgba(34,30,28,0.18);
}

.recipe-field-label {
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: #55503F;
}

.recipe-field-required { color: #AE3A16; }
.recipe-field-helper { color: #6E6353; font-weight: 600; }

.recipe-field-input {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: inset 2px 2px 0 rgba(34,30,28,0.10), 0 0 0 1px rgba(34,30,28,0.16);
  font-weight: 600;
}

.recipe-field-input:focus {
  background: #FFFDF6;
  box-shadow: inset 2px 2px 0 rgba(34,30,28,0.10), 0 0 0 2px #221E1C;
}

select.recipe-field-input { font-family: 'Nunito', Arial, sans-serif; font-weight: 800; }

.recipe-object-card {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.12), 0 0 0 1px rgba(34,30,28,0.08);
}

.recipe-object-field-label { color: #6E6353; }

.recipe-object-card .recipe-field-input {
  box-shadow: inset 2px 2px 0 rgba(34,30,28,0.08), 0 0 0 1px rgba(34,30,28,0.14);
}

.recipe-field-array-remove {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14);
}

.recipe-field-array-remove:hover { background: #FFFDF6; color: #AE3A16; }

.recipe-field-array-add {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14);
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.recipe-field-array-add:hover:not(:disabled) {
  background: #FFFDF6;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.14);
}

.recipe-form-status-error {
  background: #FFFDF6;
  border: none;
  border-radius: 2px;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14), 0 0 0 2px #AE3A16;
  font-weight: 600;
}

.recipe-form-diagnostic-list { color: #AE3A16; }

.recipe-cancel-btn {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.16);
  font-family: 'Nunito', Arial, sans-serif;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0;
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.recipe-cancel-btn:hover {
  background: #FFFDF6;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.16);
}

.recipe-create-btn {
  border: none;
  border-radius: 2px;
  background: #D9481C;
  color: #FFF6EA;
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  transform: rotate(-0.8deg);
  box-shadow: 3px 3px 0 rgba(34,30,28,0.18);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.recipe-create-btn:hover:not(:disabled) {
  background: #D9481C;
  transform: rotate(-0.8deg) translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.18);
}

.recipe-create-btn:disabled {
  background: #D8D2C4;
  color: #857A66;
  box-shadow: none;
  transform: none;
  opacity: 1;
}

#use-recipe-btn {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  color: #221E1C;
  box-shadow: 3px 3px 0 rgba(34,30,28,0.18);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

#use-recipe-btn:hover {
  background: #FFFDF6;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.18);
}

/* ---- Prompt-deck picker ---- */
.prompt-deck-btn {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.14);
  transition: transform 90ms steps(2, end), box-shadow 90ms steps(2, end);
}

.prompt-deck-btn:hover {
  background: #FFFDF6;
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 rgba(34,30,28,0.14);
}

.deck-heading {
  font-family: 'Archivo Black', 'Arial Black', Arial, sans-serif;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}

.deck-description { color: #6E6353; font-weight: 600; }

.deck-prompt {
  border: none;
  border-radius: 2px;
  background: #FFFDF6;
  box-shadow: 2px 2px 0 rgba(34,30,28,0.12), 0 0 0 1px rgba(34,30,28,0.08);
  font-weight: 600;
}

.deck-prompt:hover { background: #FFFDF6; box-shadow: 1px 1px 0 rgba(34,30,28,0.12), 0 0 0 2px #221E1C; }
.deck-prompt-meta { color: #857A66; }

/* Blue focus rings go ink on this surface */
:focus-visible { outline-color: #221E1C !important; }

/* Skin follow-up: the library link sits below the first skin block */
.idea-library-link a { color: #AE3A16; }
.idea-library-link a:hover { color: #221E1C; }
