/* ============================================================
   Funnyzz Share Modal + Daily Challenge Widget
   Matches site design: dark theme, purple/gold accents
   ============================================================ */

/* ---- Share Modal ---- */
.fz-share-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.3s ease;
}

.fz-share-modal.show {
  background: rgba(0, 0, 0, 0.75);
  pointer-events: auto;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.fz-share-card {
  background: var(--card, #ffffff);
  border-radius: 20px;
  padding: 36px 32px 28px;
  max-width: 380px;
  width: calc(100% - 40px);
  text-align: center;
  border: 1px solid rgba(79, 70, 229, 0.3);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.fz-share-modal.show .fz-share-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.fz-share-emoji {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
}

.fz-share-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--text, #1c1f33);
  margin: 0 0 8px;
}

.fz-share-score {
  font-size: 17px;
  color: var(--accent2, #0f766e);
  font-weight: 600;
  margin-bottom: 4px;
}

.fz-share-best {
  font-size: 14px;
  color: var(--muted, #52525b);
  margin-bottom: 4px;
}

.fz-share-streak {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold, #b45309);
  margin-bottom: 20px;
}

/* ---- Share Buttons ---- */
.fz-share-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.fz-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.12s ease, filter 0.15s ease;
  color: #fff;
  text-decoration: none;
  font-family: inherit;
}

.fz-btn:active {
  transform: scale(0.95);
}

.fz-btn:hover {
  filter: brightness(1.15);
}

.fz-twitter {
  background: #000;
}

.fz-facebook {
  background: #1877f2;
}

.fz-reddit {
  background: #ff4500;
}

.fz-copy {
  background: var(--accent, #4f46e5);
}

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

/* ---- Action Buttons ---- */
.fz-share-actions {
  display: flex;
  gap: 10px;
}

.fz-play-again {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  border: none;
  background: var(--accent, #4f46e5);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, filter 0.15s ease;
}

.fz-play-again:active {
  transform: scale(0.96);
}

.fz-play-again:hover {
  filter: brightness(1.15);
}

.fz-next-game {
  flex: 1;
  padding: 13px;
  border-radius: 12px;
  background: rgba(28, 31, 51, 0.06);
  color: var(--text, #18181b);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(28, 31, 51, 0.10);
  transition: transform 0.12s ease, background 0.15s ease;
}

.fz-next-game:hover {
  background: rgba(28, 31, 51, 0.10);
}

.fz-next-game:active {
  transform: scale(0.96);
}

/* ---- Daily Challenge Widget (Homepage) ---- */
/* Compact horizontal banner: visible, but does not push the game grid below the fold. */
#fz-daily {
  max-width: 960px;
  margin: 14px auto 8px;
  padding: 0;
}
#fz-daily:empty { display: none; }

.fz-daily-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--card, #ffffff) 0%, rgba(79, 70, 229, 0.12) 100%);
  border-radius: 16px;
  padding: 12px 16px;
  text-align: left;
  text-decoration: none;
  border: 1px solid rgba(79, 70, 229, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.fz-daily-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent, #4f46e5);
  box-shadow: 0 8px 22px rgba(79, 70, 229, 0.16);
}

.fz-daily-emoji {
  flex: 0 0 auto;
  font-size: 34px;
  line-height: 1;
}

.fz-daily-meta {
  flex: 1 1 auto;
  min-width: 0;
}

.fz-daily-badge {
  display: inline-block;
  background: var(--gold, #b45309);
  color: #0f1226;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 3px 9px;
  border-radius: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

.fz-daily-same {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent2, #0f766e);
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.22);
  padding: 3px 9px;
  border-radius: 20px;
  vertical-align: middle;
}

.fz-daily-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text, #1c1f33);
  margin: 4px 0 2px;
}

.fz-daily-desc {
  font-size: 13px;
  color: var(--muted, #52525b);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fz-daily-streak,
.fz-daily-streak-new {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-align: right;
}

.fz-daily-streak { color: var(--gold, #b45309); }
.fz-daily-streak-new { color: var(--accent2, #0f766e); }

.fz-daily-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent, #4f46e5), var(--accent2, #0f766e));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 24px;
  margin-left: 4px;
}

.fz-daily-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

@media (max-width: 640px) {
  .fz-daily-card {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  .fz-daily-meta { width: calc(100% - 60px); }
  .fz-daily-right {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    margin-left: 0;
  }
  .fz-daily-streak,
  .fz-daily-streak-new,
  .fz-daily-cta { margin-left: auto; }
  .fz-daily-cta { width: 100%; margin: 0; justify-content: center; }
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .fz-share-card {
    padding: 28px 20px 24px;
  }

  .fz-share-emoji {
    font-size: 44px;
  }

  .fz-share-title {
    font-size: 22px;
  }

  .fz-share-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .fz-btn {
    padding: 10px 12px;
    font-size: 13px;
  }

  .fz-btn span {
    font-size: 13px;
  }
}

/* ---- Room (shared multiplayer challenge) ---- */
.fz-room-join,
.fz-room-active {
  background: var(--card, #ffffff);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0;
}
.fz-room-title { font-weight: 600; margin-bottom: 4px; }
.fz-room-hint { color: var(--muted, #52525b); font-size: 13px; margin: 0 0 12px; }
.fz-room-row { display: flex; gap: 8px; flex-wrap: wrap; }
.fz-room-input {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--bg, #fafafa);
  color: var(--text, #18181b);
  font-size: 14px;
}
.fz-room-code { flex: 0 0 180px; text-transform: uppercase; letter-spacing: 1px; }
.fz-room-email { flex: 1 1 100%; }
.fz-room-actions { margin-top: 10px; display: flex; gap: 8px; }
.fz-room-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: var(--accent, #4f46e5);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.fz-room-btn.small { padding: 6px 12px; font-size: 13px; }
.fz-room-btn:not(.primary) { background: transparent; color: var(--text, #18181b); }
.fz-room-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.fz-room-tag b { letter-spacing: 2px; }
.fz-room-player { color: var(--muted, #52525b); font-size: 13px; margin-right: auto; }
.fz-room-board { min-height: 40px; }
.fz-room-list { list-style: none; margin: 0; padding: 0; }
.fz-room-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; }
.fz-room-list li:nth-child(odd) { background: rgba(28, 31, 51, .03); }
.fz-room-list li.me { background: var(--accent, #4f46e5); color: #fff; }
.fz-room-rank { width: 24px; font-weight: 700; text-align: center; }
.fz-room-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fz-room-score { font-variant-numeric: tabular-nums; font-weight: 600; }
.fz-room-loading,
.fz-room-empty { color: var(--muted, #52525b); font-size: 13px; padding: 8px 0; }
.fz-room-share { display: flex; gap: 8px; margin-top: 10px; }
.fz-room-share .fz-room-input { flex: 1; }

/* visibility badge + public-room controls (shared across room-enabled pages) */
.fz-room-vis {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  margin-left: 6px;
  white-space: nowrap;
}
.fz-room-vis.public { background: rgba(15, 118, 110, .16); color: var(--accent2, #0f766e); }
.fz-room-vis.private { background: rgba(28, 31, 51, .06); color: var(--muted, #52525b); }
.fz-room-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #52525b);
  margin-top: 10px;
  cursor: pointer;
}
.fz-room-check input { width: 16px; height: 16px; accent-color: var(--accent, #4f46e5); }
.fz-room-browse {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--accent, #4f46e5);
  font-weight: 600;
  text-decoration: none;
}
.fz-room-browse:hover { text-decoration: underline; }

/* ---- Achievement Toast Notification ---- */
.fz-achievement-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  max-width: 320px;
}

.fz-achievement-toast.show {
  transform: translateX(0);
  opacity: 1;
}

.fz-ach-icon {
  font-size: 42px;
  line-height: 1;
  flex-shrink: 0;
}

.fz-ach-content {
  flex: 1;
  min-width: 0;
}

.fz-ach-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 4px;
}

.fz-ach-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.2;
}

.fz-ach-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.3;
}

@media (max-width: 480px) {
  .fz-achievement-toast {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
  .fz-ach-icon { font-size: 36px; }
  .fz-ach-title { font-size: 15px; }
  .fz-ach-desc { font-size: 12px; }
}
