
:root {
  --primary: #4f46e5;
  --danger: #dc2626;
  --primary-dark: #2563eb;
  --green: #15803d;
  --cyan: #0891b2;
  --red: #dc2626;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.site-header {
  height: 72px;
  padding: 0 32px;
  background: white;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer {
  text-align: center;
  padding: 20px 12px;
  color: var(--muted);
  font-size: 14px;
}

.logo {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 24px;
  align-items: center;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 32px;
}

.errors {
  margin: 20px 20px;
}

.alert-error {
    border: 2px solid var(--danger);
    background: #fee2e2;
    color: #991b1b;
}

.hero {
  display: flex;
  gap: 32px;
  align-items: center;
  margin-bottom: 40px;
}

.hero-icon {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: #ede9fe;
  display: grid;
  place-items: center;
  font-size: 56px;
}

.hero h1 {
  font-size: 52px;
  margin: 0 0 12px;
  line-height: 1;
}

.hero p {
  font-size: 22px;
  margin: 0;
  color: #334155;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.theme-card {
  padding: 36px 48px;
  margin-bottom: 36px;
}

.theme-card.featured {
  background: linear-gradient(135deg, #ffffff, #f3e8ff);
}

.status-badge {
  display: inline-block;
  background: var(--red);
  color: white;
  font-weight: 800;
  font-size: 15px;
  padding: 7px 14px;
  border-radius: 7px;
  margin-bottom: 20px;
}

.theme-title {
  font-size: 38px;
  color: var(--primary);
  margin: 0 0 16px;
}

.theme-description {
  color: #334155;
  font-size: 18px;
  margin: 0 0 24px;
}

.theme-row {
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
  /* gap: 24px; */
}

.theme-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-weight: 800;
  border-radius: 7px;
  padding: 8px 14px;
}

.badge.plays {
  background: var(--cyan);
}

.badge.bingos {
  background: var(--green);
}

.theme-actions {
  display: flex;
  gap: 24px;
  align-items: center;
}

.create-theme {
  border: 2px dashed #c4b5fd;
  border-radius: 18px;
  padding: 48px;
  text-align: center;
  background: white;
}

.create-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: #ede9fe;
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 44px;
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.btn-outline {
  background: white;
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.section-card {
  padding: 28px;
  margin-bottom: 28px;
}

.section-header {
  /* display: flex; */
  align-items: center;
  /* justify-content: space-between; */
  gap: 24px;
  margin-bottom: 24px;
}

.my-game-card {
  min-height: 130px;
}

.thumbnail {
  height: 200px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e2e8f0, #f8fafc);
  display: grid;
  place-items: center;
  font-size: 48px;
  color: #94a3b8;
  overflow: hidden;
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-info h3 {
  font-size: 28px;
  margin: 0 0 12px;
}

.content-info p {
  font-size: 17px;
  line-height: 1.55;
  color: #334155;
}

.content-actions {
  display: grid;
  gap: 12px;
}

.custom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.custom-card {
  padding: 36px;
  min-height: 220px;
  background: linear-gradient(135deg, #ffffff, #f0fdf4);
}

.custom-card.purple {
  background: linear-gradient(135deg, #ffffff, #f3e8ff);
}

.counts-data {
  display: inline-flex;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  
  align-items: center;
  gap: 6px;
}

.counts-data > i {
  font-size: 20px;
}

.counts-data.total-plays {
  background: #e0f2fe;
}

.counts-data.total-plays i {
  color: #0891b2;
}

.counts-data.total-bingos {
  background: #dcfce7;
}

.counts-data.total-bingos i {
  color: #15803d;
}

.theme-action {
  padding: 8px 14px;
  border: 2px solid var(--primary);
  height: 45px;
}

.theme-action-alert {
  border: 2px solid var(--danger);
}

.theme-action-alert i {
  color: var(--danger);
}


.form-section {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.form-control-custom {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 17px;
}

.settings-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin: 28px 0;
  background: #f8fafc;
}

.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 0;
  font-size: 16px;
}

.card-size-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.card-size-input {
  display: none;
}

.card-size-option {
  border: 1px solid var(--primary-dark);
  color: var(--primary-dark);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  font-weight: 800;
  cursor: pointer;
  background: white;
}

.card-size-input:checked + .card-size-option {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
}

.alert-card {
  background: #e0f2fe;
  border-radius: 12px;
  padding: 16px;
  font-weight: 700;
}

.form-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 32px;
}

.btn-success {
  background: var(--green);
  color: white;
}

.btn-danger {
  background: var(--red);
  color: white;
}

.cue-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.cue-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: white;
  padding: 22px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.cue-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 18px;
  line-height: 1.4;
}

.cue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.status-pill.muted {
  background: #e2e8f0;
  color: #475569;
}

.status-pill.approve {
  background: #dcfce7;
  color: #166534;
}

.status-pill.edit {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.delete {
  background: #fee2e2;
  color: #b91c1c;
}

.requirement-grid {
  display: grid;
  gap: 14px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  border: 2px dashed #c4b5fd;
  border-radius: 18px;
  background: white;
}

.play-page {
  max-width: 920px;
}

.play-card {
  position: relative;
}

.bingo-board-shell {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

#bingo-board {
  width: 100%;
  max-width: 720px;
  gap: 10px;
  padding: 16px; 
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.bingo-cell {
  min-height: clamp(72px, 13vw, 120px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  color: var(--text);
  font-size: clamp(0.72rem, 1.7vw, 1rem);
  font-weight: 800;
  line-height: 1.2;
  padding: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.bingo-cell:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.bingo-cell.marked {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

/* .bingo-cell.marked::after {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  border-radius: 999px;
  background: #15803d;
  color: white;
  font-size: 14px;
  flex-shrink: 0;
} */

.bingo-cell.free {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: var(--primary);
}

.bingo-overlay {
  inset: 0;
  justify-content: center;
  padding: 24px;
}

.bingo-overlay.active {
  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(4px);
}

.bingo-modal {
  width: min(100%, 760px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

.bingo-text {
  font-size: clamp(3rem, 12vw, 7rem);
  color: var(--primary);
  margin: 0 0 8px;
}

.bingo-subtitle {
  color: #334155;
  font-size: 18px;
  margin-bottom: 24px;
}

.bingo-answers {
  max-width: 100%;
  margin: 0 auto 24px;
}

.bingo-answer-cell {
  min-height: 72px;
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.bingo-controls {
  width: 100%;
  gap: 14px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
}

.bingo-controls button {
  min-height: 48px;
  padding: 0 24px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  color: var(--primary-dark);
  font-size: 17px;
  font-weight: 800;
}

.play-actions {
  justify-content: center;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 74px;
  height: 38px;
  background: #e2e8f0;
  border-radius: 999px;
  transition: background 0.25s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  transition: transform 0.25s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(36px);
}

.toggle-labels {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: #475569;
}

.toggle-labels i {
  margin-right: 4px;
}

.public-label {
  color: var(--green);
}

.private-label {
  color: var(--danger);
}

@media (max-width: 850px) {
  .play-page {
    padding: 20px 12px;
  }

  .play-card {
    padding: 18px;
  }

  #bingo-board {
    padding: 10px;
    gap: 6px;
  }

  .bingo-cell {
    border-radius: 10px;
    padding: 6px;
  }

  .bingo-modal {
    padding: 20px;
  }

  .bingo-controls {
    flex-direction: column;
  }

  .bingo-controls .btn,
  .bingo-controls button {
    width: 100%;
  }
}

@media (max-width: 850px) {
  .cue-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .content-card,
  .custom-actions {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 40px;
  }

  .play-page {
    max-width: none;
    padding: 0;
  }

  .play-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 5px;
    margin: 0;
  }

  .play-card .section-header {
    margin-bottom: 12px;
  }

  .bingo-board-shell {
    margin-top: 12px;
  }

  #bingo-board {
    border-radius: 12px;
    padding: 6px;
    gap: 5px;
    box-shadow: none;
  }

  .bingo-cell {
    min-height: clamp(58px, 18vw, 92px);
    padding: 5px;
    font-size: clamp(0.62rem, 2.7vw, 0.82rem);
    border-radius: 8px;
  }

  .form-actions.play-actions {
    margin-top: 16px;
  }
}

@media (max-width: 768px) {
  .page {
    padding: .5rem;
  }
  .play-page {
    padding: 0;
  }

  .play-card {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 10px;
  }

  #bingo-board {
    padding: 6px;
    gap: 5px;
  }
}






/******* END OF NEW DESIGNS ******/


/* page layout */
header, footer {
  text-align: left;
  flex-shrink: 0;
}

/* bingo board styles */
#bingo-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 700px;
  position: relative;
}

.bingo-cell {
  width: 100%;
  min-width: 0;
  min-height: 100px;
  box-sizing: border-box;
  padding: 2px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  cursor: pointer;

  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .7em;
  
}

.winning-square {
  border-color: #ff1744;
  box-shadow: 0 0 10px rgba(255, 23, 68, 0.5);
}

/* Highlighted state */
.bingo-cell.marked {
  background: #ecf6ed;
  border-color: #4caf50;
}

.bingo-cell.fading-enabled {
  animation: markedPulse 1.2s ease-in-out infinite;
}

/* Free space styling */
.bingo-cell.free {
  font-weight: bold;
}

.bingo-cell.free:hover {
  cursor: default;
}

.bingo-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column; 
  align-items: center;

  pointer-events: none;
  
}

.bingo-overlay.hidden {
  display: none;
}

.bingo-overlay.active {
  display: flex;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.7);
}

.bingo-overlay.active .bingo-text {
  animation: bingoPop 0.5s ease-out;
}

.bingo-text {
  font-size: clamp(3em, 10vw, 10em);
  font-weight: 900;
  color: #ff1744;
  transform: rotate(-15deg);
  text-shadow: 2px 2px 8px rgba(0,0,0,0.3);
  margin: auto 0;
}

.bingo-controls {
  display: flex;
  justify-content: space-evenly;
  margin-top: auto; /* 👈 pushes to bottom */
  font-size: 1.2em;
  color: #333;
  width: 100%;
}

.bingo-controls button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background: #4caf50;
  color: white;
  font-size: 1em;
  cursor: pointer;
}

.bingo-answers {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 700px;
  /* padding: 0 20px; */
  box-sizing: border-box;
}

.bingo-answer-cell {
  background: #ecf6ed;
  border-color: #4caf50;
  cursor: default;
}

.bingo-answer-cell.free {
  font-weight: bold;
}

.qr-modal {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.play-with-friends {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
}

.play-with-friends a {
  padding: 10px 20px;
  color: rgb(47, 172, 31);
  font-weight: 600;
  border-radius: 5px;
  text-decoration: none;
}

.play-with-friends a:hover {
  background: rgba(47, 172, 31, 0.1);
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
}

.video-container > :first-child {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.theme-card {
  padding: 15px;
}

.theme-card-dark {
  background: #e9e9e9;
}

.theme-header h2 a {
  text-decoration: none;
}

.video-card {
  padding: 15px;
}

.video-card-dark {
  background: #e9e9e9;
}

.card-controls {
  width:100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.theme-cue {
  border-bottom: 2px solid #eee;
  margin: .3em;
}

.my-games-tabs {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.my-games-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 10px;
  border: 1px solid var(--primary-dark);
  background: white;
  color: var(--primary-dark);
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
}

.my-games-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}

.invite-modal {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.invite-modal.hidden {
  display: none;
}

.invite-modal-card {
  position: relative;
  width: min(100%, 560px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

.invite-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: #e2e8f0;
  color: #334155;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.qr-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.theme-search-form {
    margin-bottom: 1.5rem;
}

.theme-search-control {
    display: flex;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.theme-search-input {
    flex: 1;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid #d1d5db;
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-size: 1rem;
    outline: none;
}

.theme-search-input:focus {
    border-color: #3273dc;
    box-shadow: 0 0 0 3px rgba(50, 115, 220, 0.15);
}

.theme-search-button {
    width: 56px;
    height: 48px;
    border: 1px solid #3273dc;
    border-radius: 0 10px 10px 0;
    background: #3273dc;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
}

.theme-search-button:hover {
    background: #275fb8;
}

.theme-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.theme-search-control {
    display: flex;
    width: 100%;
    max-width: 520px;
    border: 1px solid #d6d6d6;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.theme-search-input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
}

.theme-search-button {
    border: none;
    padding: 0 1.1rem;
    background: #485fc7;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
}

.theme-search-button:hover {
    background: #3e56c4;
}

.theme-filter-checkboxes {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    cursor: pointer;
}

@media (max-width: 768px) {
  .bingo-text {
    font-size: 6em;
  }
}

@keyframes bingoPop {
  0% {
    transform: scale(0.3) rotate(-15deg);
    opacity: 0;
  }

  60% {
    transform: scale(1.2) rotate(-15deg);
    opacity: 1;
  }

  100% {
    transform: scale(1) rotate(-15deg);
  }
}

@keyframes markedPulse {
  0% {
    background: white;
    border-color: #ccc;
  }
  50% {
    background: #ecf6ed;
    border-color: #4caf50;
  }
  100% {
    background: white;
    border-color: #ccc;
  }
}
