/* ===========================================
   Family Table Questions Tool Styles
   =========================================== */

.family-table-questions-page {
  --tool-cream: #FFFBF7;
  --tool-warm-gray: #F5F0EB;
  --tool-peach: #FFF5EB;
  --font-display: 'Lora', Georgia, serif;
  background: linear-gradient(160deg, #FFFCFA 0%, #FFF8F2 100%);
}

/* The game sets display on elements that also toggle the hidden attribute */
.family-table-questions-page [hidden] {
  display: none !important;
}

/* The page behind the game must not scroll while it is open */
html.table-game-open,
html.table-game-open body {
  overflow: hidden;
}

/* ===========================================
   Hero Section
   =========================================== */
.family-table-questions-page .tool-hero {
  padding: 80px 24px 60px;
  text-align: center;
}

.family-table-questions-page .tool-hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.family-table-questions-page .tool-hero-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.family-table-questions-page .tool-hero-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 20px;
}

.family-table-questions-page .tool-hero-subtitle {
  font-size: 19px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
}

/* ===========================================
   Main Tool Section
   =========================================== */
.family-table-questions-page .tool-main {
  background: var(--tool-warm-gray);
  padding: 60px 24px 80px;
}

.family-table-questions-page .tool-main-inner {
  max-width: 800px;
  margin: 0 auto;
}

.family-table-questions-page .tool-card {
  background: white;
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.family-table-questions-page .tool-card-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.family-table-questions-page .tool-card-description {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

/* Deck Grid */
.family-table-questions-page .deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.family-table-questions-page .deck-checkbox {
  cursor: pointer;
}

.family-table-questions-page .deck-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.family-table-questions-page .deck-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  height: 100%;
  padding: 24px 16px;
  background: var(--tool-cream);
  border: 2px solid transparent;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.family-table-questions-page .deck-checkbox input:checked + .deck-box {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.family-table-questions-page .deck-checkbox input:focus-visible + .deck-box {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.family-table-questions-page .deck-checkbox:hover .deck-box {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.family-table-questions-page .deck-icon {
  font-size: 32px;
  color: var(--primary);
  margin-bottom: 12px;
}

.family-table-questions-page .deck-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.family-table-questions-page .deck-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.family-table-questions-page .deck-error {
  font-size: 14px;
  font-weight: 600;
  color: var(--error);
  margin-bottom: 16px;
}

.family-table-questions-page .btn-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 30px;
}

.family-table-questions-page .btn-start .mdi {
  font-size: 20px;
}

/* families.css gives .btn-primary and .btn-secondary width: 100% site-wide */
.family-table-questions-page .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  background: var(--tool-warm-gray);
  color: var(--text);
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.family-table-questions-page .btn-secondary:hover {
  background: var(--border);
}

.family-table-questions-page .btn-secondary:disabled {
  opacity: 0.4;
  cursor: default;
}

/* ===========================================
   The Game (full screen)
   =========================================== */
.family-table-questions-page .table-game {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  background: linear-gradient(160deg, var(--tool-cream) 0%, var(--tool-peach) 100%);
  overscroll-behavior: contain;
}

.family-table-questions-page .table-game-inner {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
}

.family-table-questions-page .table-game-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 40px;
}

.family-table-questions-page .table-game-counter {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.family-table-questions-page .table-game-end {
  margin-left: auto;
  background: none;
  border: none;
  padding: 8px 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.family-table-questions-page .table-game-end:hover {
  color: var(--text);
}

.family-table-questions-page .table-game-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding: 24px 0;
}

.family-table-questions-page .table-game-deck {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 6px 16px;
  border-radius: 20px;
}

.family-table-questions-page .table-game-question {
  font-family: var(--font-display);
  font-size: clamp(28px, 6vw, 52px);
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
}

/* Korean breaks lines between syllables by default, splitting words */
html:lang(ko) .family-table-questions-page .table-game-question {
  word-break: keep-all;
}

.family-table-questions-page .table-game-hint {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

.family-table-questions-page .table-game-controls {
  display: flex;
  gap: 12px;
}

.family-table-questions-page .table-game-back {
  flex: 0 0 auto;
  width: auto;
  padding: 18px 24px;
  font-size: 16px;
  border-radius: 30px;
}

.family-table-questions-page .table-game-next {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  padding: 18px 24px;
  font-size: 18px;
  border-radius: 30px;
}

/* Finish screen */
.family-table-questions-page .table-game-finish {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 0;
}

.family-table-questions-page .table-game-finish-icon {
  font-size: 48px;
  color: var(--primary);
  margin-bottom: 16px;
}

.family-table-questions-page .table-game-finish-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.family-table-questions-page .table-game-finish-text {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.family-table-questions-page .table-game-signup {
  width: auto;
  padding: 16px 28px;
  font-size: 17px;
  border-radius: 30px;
  text-decoration: none;
}

.family-table-questions-page .table-game-finish-note {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
}

.family-table-questions-page .table-game-finish-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* ===========================================
   How It Works Section
   =========================================== */
.family-table-questions-page .tool-how-it-works {
  background: white;
  padding: 80px 24px;
}

.family-table-questions-page .tool-how-it-works-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.family-table-questions-page .tool-section-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 48px;
}

.family-table-questions-page .how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}

.family-table-questions-page .how-step {
  text-align: center;
}

.family-table-questions-page .how-step-number {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 auto 16px;
}

.family-table-questions-page .how-step-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.family-table-questions-page .how-step-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===========================================
   Question List Section
   =========================================== */
.family-table-questions-page .tool-question-list {
  background: var(--tool-warm-gray);
  padding: 80px 24px;
}

.family-table-questions-page .tool-question-list-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.family-table-questions-page .question-decks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.family-table-questions-page .question-deck {
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.family-table-questions-page .question-deck-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.family-table-questions-page .question-deck-title .mdi {
  font-size: 24px;
  color: var(--primary);
}

.family-table-questions-page .question-deck-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.family-table-questions-page .question-deck-list li {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===========================================
   FAQ Section
   =========================================== */
.family-table-questions-page .tool-faq {
  background: var(--tool-cream);
  padding: 80px 24px;
}

.family-table-questions-page .tool-faq-inner {
  max-width: 800px;
  margin: 0 auto;
}

.family-table-questions-page .faq-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.family-table-questions-page .faq-item {
  background: white;
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}

.family-table-questions-page .faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s ease;
}

.family-table-questions-page .faq-question:hover {
  background: rgba(0, 0, 0, 0.02);
}

.family-table-questions-page .faq-question .mdi {
  font-size: 24px;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.family-table-questions-page .faq-item.active .faq-question .mdi {
  transform: rotate(180deg);
}

.family-table-questions-page .faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.family-table-questions-page .faq-item.active .faq-answer {
  max-height: 300px;
}

.family-table-questions-page .faq-answer-content {
  padding: 0 24px 24px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===========================================
   Final CTA Section
   =========================================== */
.family-table-questions-page .tool-cta {
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--tool-peach) 50%, var(--tool-cream) 100%);
  padding: 80px 24px;
  text-align: center;
}

.family-table-questions-page .tool-cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

.family-table-questions-page .tool-cta-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.2;
}

.family-table-questions-page .tool-cta-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.family-table-questions-page .btn-large {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  padding: 18px 40px;
  font-size: 17px;
  border-radius: 30px;
}

.family-table-questions-page .tool-cta-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===========================================
   Responsive Design
   =========================================== */
@media (max-width: 1024px) {
  .family-table-questions-page .how-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .family-table-questions-page .tool-hero {
    padding: 60px 20px 40px;
  }

  .family-table-questions-page .tool-hero-title {
    font-size: 32px;
  }

  .family-table-questions-page .tool-hero-subtitle {
    font-size: 17px;
  }

  .family-table-questions-page .tool-main {
    padding: 40px 20px 60px;
  }

  .family-table-questions-page .tool-card {
    padding: 24px;
  }

  .family-table-questions-page .deck-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .family-table-questions-page .deck-box {
    padding: 16px 12px;
  }

  .family-table-questions-page .deck-icon {
    font-size: 28px;
  }

  .family-table-questions-page .btn-start {
    width: 100%;
    justify-content: center;
  }

  .family-table-questions-page .tool-how-it-works,
  .family-table-questions-page .tool-question-list,
  .family-table-questions-page .tool-faq {
    padding: 60px 20px;
  }

  .family-table-questions-page .tool-section-title {
    font-size: 26px;
    margin-bottom: 32px;
  }

  .family-table-questions-page .how-steps {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 320px;
    margin: 0 auto;
  }

  .family-table-questions-page .question-deck {
    padding: 24px;
  }

  .family-table-questions-page .tool-cta {
    padding: 60px 20px;
  }

  .family-table-questions-page .tool-cta-title {
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .family-table-questions-page .deck-grid {
    grid-template-columns: 1fr;
  }

  .family-table-questions-page .deck-box {
    flex-direction: row;
    text-align: left;
    gap: 16px;
    padding: 16px;
  }

  .family-table-questions-page .deck-icon {
    margin-bottom: 0;
  }

  .family-table-questions-page .deck-name {
    margin-bottom: 0;
  }

  .family-table-questions-page .deck-desc {
    display: none;
  }

  .family-table-questions-page .table-game-back {
    padding: 18px;
  }

  .family-table-questions-page .table-game-finish-title {
    font-size: 26px;
  }
}
