/* Admin Panel Styles */
.admin-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #667eea;
}

.admin-header h1 {
  margin: 0;
  color: #667eea;
}

.notice {
  background: #48c774;
  color: white;
  padding: 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.errors {
  background: #f14668;
  color: white;
  padding: 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.errors ul {
  margin: 0.5rem 0 0 1.5rem;
}

/* Table Styles */
.bingos-table {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

thead {
  background: #667eea;
  color: white;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

tbody tr:hover {
  background: #f5f5f5;
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
}

.form-control-small {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
}

.form-control-small:focus {
  outline: none;
  border-color: #667eea;
}

small {
  display: block;
  margin-top: 0.25rem;
  color: #666;
  font-size: 0.875rem;
}

.help-text {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

/* Cells Grid */
.cells-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  background: #f9f9f9;
  border-radius: 5px;
}

.cell-input {
  display: flex;
  flex-direction: column;
}

.cell-input label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #667eea;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.btn-primary {
  background: #667eea;
  color: white;
}

.btn-primary:hover {
  background: #5568d3;
}

.btn {
  background: #e0e0e0;
  color: #333;
}

.btn:hover {
  background: #d0d0d0;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-small:hover {
  background: #5568d3;
}

.btn-danger {
  background: #f14668;
}

.btn-danger:hover {
  background: #e03456;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #667eea;
}

.header h1 {
  margin: 0;
  color: #667eea;
}

.back-link {
  padding: 0.75rem 1.5rem;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
}

.back-link:hover {
  background: #5568d3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Live Preview Styles */
.preview-and-settings-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.color-settings-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  order: 1;
}

.settings-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
}

.settings-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.settings-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #667eea;
  margin: 0 0 1rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #667eea;
}

.settings-card .form-group {
  margin-bottom: 1rem;
}

.settings-card .form-group:last-child {
  margin-bottom: 0;
}

.settings-card label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

.settings-card small {
  font-size: 12px;
  color: #666;
}

.preview-section {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 12px;
  position: sticky;
  top: 20px;
  order: 2;
}

.preview-container {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

.preview-card {
  background: #f8f9ff;
  border-radius: 20px;
  padding: 20px;
  width: 100%;
  max-width: 340px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

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

.preview-image-placeholder {
  flex-shrink: 0;
  width: 80px;
  height: 100px;
}

.preview-image-placeholder svg {
  width: 100%;
  height: 100%;
}

.preview-header-text {
  flex: 1;
  text-align: center;
}

.preview-title {
  font-size: 20px;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.preview-subtitle {
  font-size: 12px;
  color: #666;
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.preview-cell {
  aspect-ratio: 1;
  background: #f9f9f9;
  border: 2px solid #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  color: #333;
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.preview-cell span {
  z-index: 1;
  position: relative;
}

.preview-cell.scratched span {
  opacity: 0;
}

.preview-cell.scratched::before,
.preview-cell.scratched::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 6px;
}

.preview-cell.scratched::before {
  background: rgba(102, 126, 234, 0.4);
  background-image: linear-gradient(45deg, rgba(102, 126, 234, 0.3) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(102, 126, 234, 0.3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(102, 126, 234, 0.3) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(102, 126, 234, 0.3) 75%);
  background-size: 8px 8px;
  z-index: 2;
}

.preview-cell.scratched::after {
  background: rgba(102, 126, 234, 0.2);
  background-image: linear-gradient(-45deg, rgba(102, 126, 234, 0.2) 25%, transparent 25%),
    linear-gradient(45deg, rgba(102, 126, 234, 0.2) 25%, transparent 25%);
  background-size: 10px 10px;
  z-index: 3;
}

.preview-progress-section {
  text-align: center;
}

.preview-progress-label {
  font-size: 14px;
  font-weight: 900;
  color: #667eea;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.preview-progress-wrapper {
  display: flex;
  align-items: center;
  padding-left: 20px;
}

.preview-progress-circle {
  width: 36px;
  height: 36px;
  background: white;
  border: 3px solid #667eea;
  border-radius: 50%;
  margin-right: -18px;
  z-index: 1;
  transition: border-color 0.3s ease;
}

.preview-progress-bar-container {
  flex: 1;
  height: 24px;
  background: white;
  border: 3px solid #667eea;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.preview-progress-bar {
  height: 100%;
  width: 12%;
  background: #667eea;
  border-radius: 10px;
  transition: background 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-container {
    margin: 0;
    padding: 1rem;
    border-radius: 0;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

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

  table {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.5rem;
  }

  .actions {
    flex-direction: column;
  }
}

/* Color Picker Component Styles */
.color-picker {
  position: relative;
}
.color-picker-dropdown {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.color-picker-dropdown:hover {
  border-color: #667eea;
}
.color-picker-dropdown.open {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}
.color-picker-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}
.color-label {
  flex: 1;
  font-size: 14px;
  color: #333;
}
.color-picker-arrow {
  font-size: 10px;
  color: #666;
  transition: transform 0.2s;
}
.color-picker-dropdown.open .color-picker-arrow {
  transform: rotate(180deg);
}
.color-picker-options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  margin-top: 4px;
}
.color-picker-options.open {
  display: block;
}
.color-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.color-option:hover {
  background: #f5f5f5;
}
.color-option.selected {
  background: #e8eeff;
}
.color-option .color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.color-option .color-label {
  font-size: 14px;
}
.color-option-custom {
  border-top: 1px solid #eee;
  padding: 12px;
  background: #fafafa;
}
.custom-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid #ddd;
}
.custom-color-input {
  width: 50px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.custom-color-btn {
  flex: 1;
  padding: 8px 12px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.custom-color-btn:hover {
  background: #5568d3;
}

/* Publish Status Toggle */
.publish-status-group {
  background: #e8f5e9;
  border: 2px solid #4caf50;
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.publish-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.publish-toggle .form-check-input {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.publish-toggle .form-check-label {
  font-weight: 600;
  font-size: 1.1rem;
  color: #2e7d32;
  cursor: pointer;
  margin: 0;
}

.publish-status-group small {
  display: block;
  margin-top: 0.5rem;
  color: #666;
}
/*
 * Shared components. Built only from tokens.css — no literal colour, radius or
 * shadow values below this line.
 *
 * One interaction idiom, "the press", is shared by every raised element and is
 * the only motion in the design.
 */

.kb-page {
  min-height: 100vh;
  /*
   * body keeps its legacy 20px padding (application.css) because dashboard and
   * admin still depend on it, so a dark wrapper placed inside it renders as a
   * purple frame with a colour seam at the viewport fold. Cancel the gutter
   * with a negative margin — never `width: 100%`, which adds the 40px straight
   * back and produces a horizontal scrollbar. The wrappers that are not
   * .kb-page (.bingos-index, .lp) do the same in their own view <style>
   * blocks, because application.css's `require_self` puts its legacy
   * `.bingos-index { margin: 0 auto }` after this file and would win at equal
   * specificity.
   */
  margin: calc(var(--kb-body-gutter) * -1);
  background: var(--kb-canvas);
  color: var(--kb-body);
  font-family: var(--kb-font-body);
  line-height: var(--kb-leading-body);
}

.kb-container {
  max-width: var(--kb-container);
  margin: 0 auto;
  padding: 0 var(--kb-space-4);
}

.kb-page h1,
.kb-page h2,
.kb-page h3 {
  font-family: var(--kb-font-display);
  color: var(--kb-ink);
  line-height: var(--kb-leading-display);
}

/* --- The press -------------------------------------------------------- */

.kb-raised {
  border: 2px solid var(--kb-primary-deep);
  box-shadow: var(--kb-shadow);
  transition: var(--kb-transition);
}

.kb-raised:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--kb-shadow-hover);
}

.kb-raised:active {
  transform: translate(2px, 2px);
  box-shadow: var(--kb-shadow-active);
}

.kb-raised:focus-visible,
.kb-btn:focus-visible,
.kb-chip:focus-visible,
.kb-search input:focus-visible {
  outline: 2px solid var(--kb-cta);
  outline-offset: 2px;
}

/* --- Buttons ---------------------------------------------------------- */

.kb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--kb-space-2);
  padding: var(--kb-space-3) var(--kb-space-5);
  border: 2px solid var(--kb-primary-deep);
  border-radius: var(--kb-radius-sm);
  box-shadow: var(--kb-shadow);
  transition: var(--kb-transition);
  font-family: var(--kb-font-body);
  font-size: var(--kb-text-sm);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--kb-surface);
  color: var(--kb-ink);
}

.kb-btn:hover { transform: translate(-1px, -1px); box-shadow: var(--kb-shadow-hover); }
.kb-btn:active { transform: translate(2px, 2px); box-shadow: var(--kb-shadow-active); }

.kb-btn--primary { background: var(--kb-primary); color: #fff; }
.kb-btn--cta { background: var(--kb-cta); color: var(--kb-canvas); }
.kb-btn--ghost { background: transparent; border-color: var(--kb-muted); color: var(--kb-body); box-shadow: none; }
.kb-btn--ghost:hover { transform: none; box-shadow: none; border-color: var(--kb-ink); color: var(--kb-ink); }

/*
 * Ghost button for light surfaces — the creator's bingo card. --kb-body is
 * tuned for the dark canvas and drops to ~2:1 on every card_background_value,
 * so this variant takes dark ink and borrows the creator's accent for its
 * border, which is what the card was designed around.
 */
.kb-btn--ghost-light {
  background: transparent;
  border-color: var(--main-color, var(--kb-primary-deep));
  color: var(--kb-canvas);
  box-shadow: none;
}

.kb-btn--ghost-light:hover {
  transform: none;
  box-shadow: none;
  background: rgba(var(--main-color-rgb, 98, 72, 201), 0.08);
}

.kb-btn--block { display: flex; width: 100%; }

/* --- Cards ------------------------------------------------------------ */

.kb-card {
  background: var(--kb-surface);
  border: 2px solid var(--kb-primary-deep);
  border-radius: var(--kb-radius-md);
  box-shadow: var(--kb-shadow);
  padding: var(--kb-space-5);
}

.kb-card--tinted { background: var(--kb-accent, var(--kb-primary-bright)); }

.kb-character-card {
  display: flex;
  flex-direction: column;
  gap: var(--kb-space-3);
  background: var(--kb-surface);
  border: 2px solid var(--kb-primary-deep);
  border-radius: var(--kb-radius-md);
  box-shadow: var(--kb-shadow);
  padding: var(--kb-space-3);
  transition: var(--kb-transition);
  text-decoration: none;
}

.kb-character-card:hover { transform: translate(-1px, -1px); box-shadow: var(--kb-shadow-hover); }

/*
 * Uploaded artwork often has a white or light background, which glares on a
 * dark card. Seating every image in its own light tile makes inconsistent
 * source images look deliberate and needs no reprocessing of uploads.
 */
.kb-character-card__tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--kb-radius-sm);
  background: #F3E9FF;
  overflow: hidden;
}

.kb-character-card__tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/*
 * text-align is declared here deliberately. Until now the only thing centring
 * this text was the legacy `.bingos-index { text-align: center }` in
 * application.css, which reads as dead and would take the whole grid with it
 * if someone deleted it.
 */
.kb-character-card__name,
.kb-character-card__meta {
  text-align: center;
}

.kb-character-card__name {
  font-family: var(--kb-font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--kb-ink);
  margin: 0;
}

.kb-character-card__meta {
  font-size: var(--kb-text-xs);
  color: var(--kb-muted);
  margin: 0;
}

/* --- Badge, chip, stat ------------------------------------------------ */

.kb-badge {
  position: absolute;
  top: var(--kb-space-2);
  right: var(--kb-space-2);
  padding: var(--kb-space-1) var(--kb-space-2);
  border-radius: var(--kb-radius-pill);
  background: var(--kb-badge);
  color: var(--kb-canvas);
  font-size: 0.6875rem;
  font-weight: 700;
}

.kb-chip {
  display: inline-flex;
  align-items: center;
  padding: var(--kb-space-2) var(--kb-space-4);
  border: 1px solid var(--kb-muted);
  border-radius: var(--kb-radius-pill);
  background: var(--kb-surface);
  color: var(--kb-body);
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
}

.kb-chip.is-active {
  background: var(--kb-primary);
  border-color: var(--kb-primary);
  color: #fff;
}

.kb-chiprow {
  display: flex;
  gap: var(--kb-space-2);
  overflow-x: auto;
  padding-bottom: var(--kb-space-2);
  scrollbar-width: none;
}

.kb-chiprow::-webkit-scrollbar { display: none; }

.kb-stat {
  display: inline-flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: var(--kb-space-2) var(--kb-space-4);
  border: 1px solid var(--kb-primary-deep);
  border-radius: var(--kb-radius-pill);
  background: var(--kb-surface);
  font-size: var(--kb-text-sm);
  color: var(--kb-body);
}

.kb-stat strong { color: var(--kb-ink); font-weight: 700; }

/* --- Search ----------------------------------------------------------- */

.kb-search {
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
  padding: var(--kb-space-2);
  padding-left: var(--kb-space-4);
  border: 2px solid var(--kb-primary-deep);
  border-radius: var(--kb-radius-pill);
  background: var(--kb-surface);
}

.kb-search svg { flex: none; color: var(--kb-muted); }

.kb-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--kb-ink);
  font-family: var(--kb-font-body);
  font-size: var(--kb-text-base);
  padding: var(--kb-space-2);
}

.kb-search input::placeholder { color: var(--kb-muted); }
/*
 * Suppress only the UA ring for pointer focus. Plain `:focus` here would
 * outrank `.kb-search input:focus-visible` above at equal specificity by
 * source order and cancel the brand ring for keyboard users.
 */
.kb-search input:focus:not(:focus-visible) { outline: none; }

.kb-search button {
  flex: none;
  border: 0;
  border-radius: var(--kb-radius-pill);
  background: var(--kb-primary);
  color: #fff;
  font-family: var(--kb-font-body);
  font-weight: 600;
  font-size: var(--kb-text-sm);
  padding: var(--kb-space-3) var(--kb-space-5);
  cursor: pointer;
}

/* --- Nav and footer --------------------------------------------------- */

/*
 * Both nav and footer set their own font-family: bingos/show.html.erb renders
 * them as direct children of <body>, outside any .kb-page / .bingos-index /
 * .lp wrapper, so anything they inherit from a wrapper is missing there.
 */
.kb-nav {
  display: flex;
  font-family: var(--kb-font-body);
  align-items: center;
  justify-content: space-between;
  gap: var(--kb-space-4);
  max-width: var(--kb-container);
  margin: 0 auto var(--kb-space-6);
  padding: var(--kb-space-3) var(--kb-space-5);
  background: var(--kb-surface);
  border: 2px solid var(--kb-primary-deep);
  border-radius: var(--kb-radius-md);
}

.kb-nav__brand {
  display: flex;
  align-items: center;
  gap: var(--kb-space-3);
  color: var(--kb-ink);
  text-decoration: none;
  font-family: var(--kb-font-display);
  font-weight: 700;
}

.kb-nav__tagline {
  display: block;
  font-family: var(--kb-font-body);
  font-weight: 400;
  font-size: var(--kb-text-xs);
  color: var(--kb-muted);
}

.kb-navgroup {
  display: flex;
  gap: var(--kb-space-1);
  padding: var(--kb-space-1);
  border: 1px solid var(--kb-primary-deep);
  border-radius: var(--kb-radius-pill);
}

.kb-navgroup a {
  padding: var(--kb-space-2) var(--kb-space-4);
  border-radius: var(--kb-radius-pill);
  color: var(--kb-body);
  text-decoration: none;
  font-size: var(--kb-text-sm);
  font-weight: 500;
}

.kb-navgroup a.is-active { background: var(--kb-primary); color: #fff; }

.kb-nav__actions { display: flex; gap: var(--kb-space-2); align-items: center; }

.kb-footer {
  background: var(--kb-canvas);
  font-family: var(--kb-font-body);
  max-width: var(--kb-container);
  margin: var(--kb-space-8) auto 0;
  padding: var(--kb-space-5) var(--kb-space-4);
  border-top: 1px solid var(--kb-primary-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kb-space-4);
  color: var(--kb-muted);
  font-size: var(--kb-text-sm);
}

.kb-footer__social { display: flex; gap: var(--kb-space-2); }

.kb-footer__social a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--kb-radius-pill);
  background: var(--kb-surface);
  color: var(--kb-body);
}

/* --- Section heading -------------------------------------------------- */

.kb-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--kb-space-4);
  margin: var(--kb-space-7) 0 var(--kb-space-4);
}

.kb-section-head h2 {
  display: flex;
  align-items: center;
  gap: var(--kb-space-2);
  margin: 0;
  font-size: var(--kb-text-xl);
}

/* --- Responsive ------------------------------------------------------- */

@media (max-width: 900px) {
  .kb-nav { flex-wrap: wrap; justify-content: center; text-align: center; }
  .kb-navgroup { order: 3; width: 100%; justify-content: center; }
  .kb-nav__tagline { display: none; }
}

@media (max-width: 560px) {
  .kb-footer { flex-direction: column; text-align: center; }
  .kb-search { flex-wrap: wrap; border-radius: var(--kb-radius-md); }
  .kb-search button { width: 100%; }
}

/* --- Reduced motion --------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .kb-raised,
  .kb-btn,
  .kb-character-card {
    transition: none;
  }

  .kb-raised:hover,
  .kb-btn:hover,
  .kb-character-card:hover,
  .kb-raised:active,
  .kb-btn:active {
    transform: none;
  }
}
/*
 * Design tokens. Values only — no selectors beyond :root.
 *
 * The --kb- prefix is load-bearing: bingos/show.html.erb injects creator-chosen
 * colours as --main-color, --card-background and --scratch-color-rgb into its
 * own :root block. The prefix keeps design-system values and creator values in
 * separate namespaces.
 */
:root {
  /* Surfaces */
  --kb-canvas: #0D0F1F;
  --kb-surface: #1A1D3E;

  /* Text */
  --kb-ink: #F5F3FF;
  --kb-body: #A9A3C0;
  --kb-muted: #8D88A8;

  /* Brand */
  --kb-primary: #6248C9;
  --kb-primary-bright: #785AF3; /* FILL ONLY — 4.12:1 on canvas, unsafe as text */
  --kb-primary-deep: #4A38A0;
  --kb-link: #9179F8;           /* link text: 5.70:1 canvas, 4.88:1 surface */
  --kb-cta: #FBD34C;
  --kb-badge: #E4B044;

  /* Hero glow. Needs alpha, so it cannot be derived from the opaque tokens. */
  --kb-glow-purple: rgba(120, 90, 243, 0.28);
  --kb-glow-teal: rgba(63, 185, 169, 0.18);

  /* Card accents */
  --kb-accent-green: #3DA963;
  --kb-accent-teal: #3FB9A9;
  --kb-accent-magenta: #B362B8;
  --kb-accent-coral: #BB4F51;
  --kb-accent-gold: #E4B044;

  /* Type */
  --kb-font-display: 'Fredoka', system-ui, sans-serif;
  --kb-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --kb-text-xs: 0.75rem;    /* 12 */
  --kb-text-sm: 0.875rem;   /* 14 */
  --kb-text-base: 1rem;     /* 16 */
  --kb-text-lg: 1.25rem;    /* 20 */
  --kb-text-xl: 1.5625rem;  /* 25 */
  --kb-text-2xl: 1.9375rem; /* 31 */
  --kb-text-3xl: 2.4375rem; /* 39 */
  --kb-text-4xl: 3.5rem;    /* 56 */
  --kb-leading-body: 1.6;
  --kb-leading-display: 1.15;
  --kb-measure: 65ch;

  /* Space, 4px base */
  --kb-space-1: 4px;
  --kb-space-2: 8px;
  --kb-space-3: 12px;
  --kb-space-4: 16px;
  --kb-space-5: 24px;
  --kb-space-6: 32px;
  --kb-space-7: 48px;
  --kb-space-8: 64px;

  /* Radius */
  --kb-radius-sm: 10px;
  --kb-radius-md: 14px;
  --kb-radius-pill: 999px;

  /* The signature device: a hard, unblurred offset shadow. */
  --kb-shadow: 4px 4px 0 var(--kb-primary-deep);
  --kb-shadow-hover: 5px 5px 0 var(--kb-primary-deep);
  --kb-shadow-active: 2px 2px 0 var(--kb-primary-deep);

  --kb-transition: transform 0.12s ease, box-shadow 0.12s ease;

  --kb-container: 1200px;

  /*
   * Mirrors the legacy `body { padding: 20px }` in application.css, which
   * dashboard and admin still rely on. The dark public wrappers cancel it with
   * a negative margin of this size so the canvas reaches the viewport edge.
   */
  --kb-body-gutter: 20px;
}
/*


 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-height: -webkit-fill-available;
  background: #667eea;
  overscroll-behavior: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--screenshot-background, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding: 20px;
  color: #333;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Hide nav in screenshot mode */
body.screenshot-mode .kb-nav {
  display: none !important;
}

/* Index Page */
.bingos-index {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  color: white;
}

/*
 * Legacy. The restyled hero overrides font-size in the view; the text-shadow
 * this rule used to carry was still landing on the new headline and has been
 * removed rather than left to be inherited by accident.
 */
.bingos-index h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.bingos-index > p {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  opacity: 0.9;
}

.bingos-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.bingo-card {
  background: white;
  border-radius: 15px;
  padding: 2rem;
  text-decoration: none;
  color: #333;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.bingo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.bingo-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.bingo-card h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--main-color, #667eea);
}

/* Bingo Show Page */
.bingo-container {
  max-width: 800px;
  margin: 0 auto;
  background: var(--card-background, #f8f9ff);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.bingo-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.character-image {
  width: 300px;
  height: 300px;
  object-fit: cover;
  flex-shrink: 0;
}

.bingo-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.bingo-header h1 {
  font-size: 3rem;
  color: var(--main-color, #667eea);
  margin-bottom: 0.5rem;
  margin-top: 0;
}

.bingo-header p {
  margin: 0;
  /*
   * Derived per card: card_color accepts custom:#hex, so this text can land on
   * a dark or mid-luminance surface. Bingo#card_ink_muted keeps #666 wherever
   * it already meets AA and only substitutes where it does not, so cards that
   * were already legible are unchanged. The fallback matches the old value.
   */
  color: var(--card-ink-muted, #666);
  font-size: 1.1rem;
}

/* Layout: Classic centered (header_centered) */
.layout-header-centered .bingo-header {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.layout-header-centered .character-image {
  margin-bottom: 1.5rem;
}

/* Layout: Sidebar layouts (sidebar_left and sidebar_right) */
.layout-sidebar-left .bingo-container,
.layout-sidebar-right .bingo-container {
  display: flex;
  position: relative;
}

.layout-sidebar-left .bingo-main,
.layout-sidebar-right .bingo-main {
  flex: 1;
  position: relative;
  z-index: 2;
}

.layout-sidebar-left .character-image,
.layout-sidebar-right .character-image {
  width: 400px;
  height: 600px;
  object-fit: cover;
  object-position: top;
  position: sticky;
  top: 20px;
  flex-shrink: 0;
  z-index: 1;
}

/* Screenshot mode - colorful background wrapper with fixed aspect ratio */
body.screenshot-mode > div:not(.screenshot-loading) {
  background: var(--screenshot-background, linear-gradient(135deg, #667eea 0%, #764ba2 100%)) !important;
  padding: 2rem !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 940px !important;
  min-height: 1175px !important;
  box-sizing: border-box !important;
}

/* Ensure loading overlay stays full screen even in screenshot mode */
body.screenshot-mode .screenshot-loading {
  width: 100vw !important;
  height: 100vh !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

/* Screenshot mode - white card */
body.screenshot-mode .bingo-container {
  width: 900px !important;
  max-width: 900px !important;
  min-width: 900px !important;
  padding: 2rem !important;
  position: relative !important;
  display: block !important;
  background: #f8f9ff !important;
  border-radius: 20px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
  margin: 0 !important;
}

/* Reset all positioning */
body.screenshot-mode .bingo-header,
body.screenshot-mode .character-image,
body.screenshot-mode .bingo-main,
body.screenshot-mode .bingo-grid,
body.screenshot-mode .progress-section {
  position: relative !important;
}

/* Header - default horizontal layout */
body.screenshot-mode .bingo-header {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 2rem !important;
  margin-bottom: 2rem !important;
}

body.screenshot-mode .character-image {
  width: 300px !important;
  height: auto !important;
  max-height: 400px !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
}

body.screenshot-mode .bingo-header-text {
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  text-align: center !important;
}

body.screenshot-mode .bingo-header h1 {
  font-size: 3rem !important;
  line-height: 1.2 !important;
  margin: 0 0 0.5rem 0 !important;
}

body.screenshot-mode .bingo-header p {
  font-size: 1.1rem !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

/* Grid */
body.screenshot-mode .bingo-grid {
  display: grid !important;
  gap: 10px !important;
  margin-bottom: 2rem !important;
}

body.screenshot-mode .bingo-cell {
  min-height: 100px !important;
  padding: 8px !important;
}

body.screenshot-mode .cell-text {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
}

/* Progress section */
body.screenshot-mode .progress-section {
  margin-bottom: 0 !important;
}

body.screenshot-mode .progress-label {
  font-size: 1.8rem !important;
  font-weight: 900 !important;
}

body.screenshot-mode .progress-text {
  font-size: 1.1rem !important;
}

body.screenshot-mode .progress-bar-wrapper {
  position: relative !important;
  padding-left: 30px !important;
}

body.screenshot-mode .progress-bar {
  position: relative !important;
  height: 40px !important;
}

body.screenshot-mode .progress-bar::before {
  position: absolute !important;
  left: -30px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 60px !important;
  height: 60px !important;
}

body.screenshot-mode .progress-fill::before {
  left: -30px !important;
  width: 60px !important;
  height: 60px !important;
}

body.screenshot-mode .breakpoint-marker {
  height: 50px !important;
}

body.screenshot-mode .progress-status-label {
  font-size: 1.1rem !important;
  top: 68% !important;
}

/* Left sidebar: Image overlaps 50% into grid area */
.layout-sidebar-left .bingo-container {
  flex-direction: row;
}

.layout-sidebar-left .character-image {
  margin-right: -200px; /* 50% of image width */
}

.layout-sidebar-left .bingo-main {
  padding-left: 2rem;
}

/* Right sidebar: Image overlaps 50% into grid area */
.layout-sidebar-right .bingo-container {
  flex-direction: row-reverse;
}

.layout-sidebar-right .character-image {
  margin-left: -200px; /* 50% of image width */
}

.layout-sidebar-right .bingo-main {
  padding-right: 2rem;
}

.layout-sidebar-left .bingo-header,
.layout-sidebar-right .bingo-header {
  flex-direction: column;
  text-align: center;
}

/* Bingo Grid */
.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-bottom: 2rem;
}

.bingo-cell {
  aspect-ratio: 1;
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f9f9f9;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.bingo-cell:hover {
  background: #f0f0f0;
  transform: scale(1.05);
  border-color: var(--main-color, #667eea);
}

.bingo-cell.selected {
  background: #f9f9f9;
  border-color: var(--main-color, #667eea);
}

.scratch-layer-1,
.scratch-layer-2 {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-out;
  background-size: 10px 10px;
  background-repeat: repeat;
  z-index: 1;
}

/* Diagonal Stripes Pattern (Default) */
.scratch-layer-1 {
  background-image:
    linear-gradient(45deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px 0px, 0px 0px;
}

.scratch-layer-2 {
  background-image:
    linear-gradient(-45deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 25%, transparent 25%),
    linear-gradient(45deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 25%, transparent 25%),
    linear-gradient(-45deg, transparent 75%, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 75%),
    linear-gradient(45deg, transparent 75%, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px 0px, 0px 0px;
}

.bingo-cell.selected .scratch-layer-1,
.bingo-cell.selected .scratch-layer-2 {
  opacity: 1;
}

.bingo-cell.selected .scratch-layer-1 {
  animation: scratch 0.4s ease-out;
}

.bingo-cell.selected .scratch-layer-2 {
  animation: scratch 0.4s ease-out 0.1s;
}

@keyframes scratch {
  from {
    opacity: 0;
    transform: scale(0.8) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Dots Pattern */
.scratch-style-dots .scratch-layer-1 {
  background-image: radial-gradient(circle, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.4) 2px, transparent 2px);
  background-size: 8px 8px;
  background-position: 0 0;
}

.scratch-style-dots .scratch-layer-2 {
  background-image: radial-gradient(circle, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.25) 1.5px, transparent 1.5px);
  background-size: 8px 8px;
  background-position: 4px 4px;
}

/* Circles Pattern */
.scratch-style-circles .scratch-layer-1 {
  background-image: radial-gradient(circle, transparent 3px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 3px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 5px, transparent 5px);
  background-size: 12px 12px;
  background-position: 0 0;
}

.scratch-style-circles .scratch-layer-2 {
  background-image: radial-gradient(circle, transparent 2px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 2px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 4px, transparent 4px);
  background-size: 12px 12px;
  background-position: 6px 6px;
}

/* Crosshatch Pattern */
.scratch-style-crosshatch .scratch-layer-1 {
  background-image:
    linear-gradient(0deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 1px, transparent 1px);
  background-size: 10px 10px;
  background-position: 0 0;
}

.scratch-style-crosshatch .scratch-layer-2 {
  background-image:
    linear-gradient(45deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 1px, transparent 1px),
    linear-gradient(-45deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 1px, transparent 1px);
  background-size: 8px 8px;
  background-position: 0 0;
}

/* Waves Pattern */
.scratch-style-waves .scratch-layer-1 {
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 3px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.3) 6px);
  background-size: 100% 12px;
}

.scratch-style-waves .scratch-layer-2 {
  background-image:
    repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 3px, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.2) 6px);
  background-size: 12px 100%;
}

/* Grid Pattern */
.scratch-style-grid .scratch-layer-1 {
  background-image:
    linear-gradient(0deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.35) 1px, transparent 1px);
  background-size: 12px 12px;
  background-position: 0 0;
}

.scratch-style-grid .scratch-layer-2 {
  background-image:
    linear-gradient(0deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--scratch-color-rgb, 102, 126, 234), 0.15) 1px, transparent 1px);
  background-size: 6px 6px;
  background-position: 0 0;
}

.cell-text {
  font-size: 1.4rem;
  font-weight: 700;
  z-index: 2;
  line-height: 1.15;
  padding: 0;
  position: relative;
  word-break: keep-all;
  overflow-wrap: normal;
  white-space: normal;
  max-width: 100%;
  max-height: 100%;
  display: block;
  overflow: hidden;
  text-align: center;
}

.cell-text:has(+ *) {
  font-size: clamp(0.9rem, 1.4rem, 1.4rem);
}

@supports not (selector(:has(*))) {
  .bingo-cell {
    font-size: 1.4rem;
  }

  .bingo-cell[data-long-text] .cell-text {
    font-size: 1.1rem;
  }
}

/* Progress Section */
.progress-section {
  margin-bottom: 2rem;
}

.progress-label {
  text-align: center;
  font-weight: 900;
  color: var(--main-color, #667eea);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  text-transform: capitalize;
}

.progress-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  padding-left: 30px;
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 40px;
  background: white;
  border-radius: 20px;
  overflow: visible;
  border: 3px solid var(--main-color, #667eea);
}

.progress-bar::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  border: 3px solid var(--main-color, #667eea);
  z-index: 0;
}

.progress-fill {
  position: relative;
  height: 100%;
  background: var(--main-color, #667eea);
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 18px;
  z-index: 2;
}

.progress-fill::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  border: 3px solid var(--main-color, #667eea);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progress-fill.has-progress::before {
  background: var(--main-color, #667eea);
  opacity: 1;
}

.progress-circle {
  display: none;
}

.progress-breakpoint {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.breakpoint-marker {
  width: 2px;
  height: 50px;
  background: var(--main-color, #667eea);
  margin: 0 auto;
  opacity: 0.3;
}

.progress-status-label {
  position: absolute;
  top: 58%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.1rem;
  font-weight: 900;
  color: white;
  white-space: nowrap;
  z-index: 4;
  pointer-events: none;
  -webkit-text-stroke: 5px var(--main-color, #667eea);
  text-stroke: 5px var(--main-color, #667eea);
  paint-order: stroke fill;
}

.progress-text {
  text-align: center;
  font-weight: bold;
  color: var(--main-color, #667eea);
  font-size: 1.1rem;
}

/* Screenshot Loading Overlay */
.screenshot-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  background: rgb(102, 126, 234);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.loading-content {
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.loading-content p {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 1.5rem 0 0 0;
  animation: pulse 1.5s ease-in-out infinite;
  text-align: center;
  white-space: nowrap;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* Actions */
.actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 5px 15px rgba(var(--main-color-rgb, 102, 126, 234), 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(var(--main-color-rgb, 102, 126, 234), 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-pinterest {
  background: #E60023;
  color: white;
  box-shadow: 0 4px 12px rgba(230, 0, 35, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
}

.btn-pinterest:hover {
  background: #BD081C;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 0, 35, 0.4);
}

.btn-pinterest:active {
  transform: translateY(0);
}

.btn-pinterest:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  background: #E60023;
}

.btn-pinterest svg {
  flex-shrink: 0;
}

.btn-create {
  background: transparent;
  color: rgb(var(--main-color-rgb, 102, 126, 234));
  border: 2px solid rgb(var(--main-color-rgb, 102, 126, 234));
  border-radius: 10px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-create:hover {
  background: rgb(var(--main-color-rgb, 102, 126, 234));
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(var(--main-color-rgb, 102, 126, 234), 0.35);
}

.btn-create:active {
  transform: translateY(0);
}

.btn-create:focus-visible {
  outline: 2px solid rgb(var(--main-color-rgb, 102, 126, 234));
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .bingo-container {
    padding: 1rem;
  }

  .bingo-grid {
    gap: 5px;
  }

  .bingo-cell {
    padding: 4px;
  }

  .cell-text {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.1;
  }

  .bingo-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .character-image {
    width: 200px;
    height: 250px;
    max-height: 250px;
    object-fit: cover;
    object-position: top;
  }

  .bingo-header h1 {
    font-size: 1.5rem;
  }

  /* Mobile: Stack sidebar layouts vertically */
  .layout-sidebar-left .bingo-container,
  .layout-sidebar-right .bingo-container {
    flex-direction: column;
    align-items: center;
  }

  .layout-sidebar-left .character-image,
  .layout-sidebar-right .character-image {
    width: 200px;
    height: auto;
    max-height: 300px;
    margin: 0 0 1.5rem 0;
    position: relative;
  }

  .layout-sidebar-left .bingo-main,
  .layout-sidebar-right .bingo-main {
    padding: 0;
    width: 100%;
  }

  .progress-bar-wrapper {
    padding-left: 20px;
  }

  .progress-bar {
    height: 30px;
  }

  .progress-bar::before {
    left: -20px;
    width: 45px;
    height: 45px;
  }

  .progress-fill::before {
    left: -20px;
    width: 45px;
    height: 45px;
  }

  .progress-label {
    font-size: 1.4rem;
    font-weight: 900;
  }

  .breakpoint-marker {
    height: 35px;
  }

  .progress-status-label {
    font-size: 0.9rem;
  }
}
