/*
 * Daily Hub — board, completion panel, confetti.
 * Uses the design tokens from style.css :root so dark mode works automatically.
 */

/* ---------- daily board ---------- */

[data-daily-board] {
  width: 100%;
  min-width: 0;
}

.dh-board {
  min-width: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #EDE4D3);
  border-radius: 16px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
  padding: 18px 20px;
  margin: 18px auto;
  max-width: 980px;
}

.dh-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dh-board-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink, #2A2118);
}

.dh-board-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dh-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted, #7A6A52);
  background: var(--comb-wash, rgba(245, 166, 35, 0.08));
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.dh-chip--streak {
  color: #C0392B;
  background: rgba(231, 76, 60, 0.08);
}

[data-theme="dark"] .dh-chip--streak {
  color: #FF9B8E;
}

.dh-tiles {
  overflow: hidden;
  position: relative;
  /* soften the edges so tiles fade in/out rather than clip hard */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.dh-track {
  display: flex;
  width: max-content;
  animation: dh-marquee 38s linear infinite;
  will-change: transform;
}
/* Pause so the tiles are easy to read and tap. */
.dh-tiles:hover .dh-track,
.dh-tiles:focus-within .dh-track {
  animation-play-state: paused;
}
/* Spacing lives on the tile (not a flex gap) so translateX(-50%) loops seamlessly. */
.dh-track .dh-tile {
  flex: 0 0 auto;
  width: 104px;
  margin-right: 10px;
}
@keyframes dh-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.dh-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 10px;
  border: 1.5px solid var(--border, #EDE4D3);
  border-radius: 12px;
  background: var(--elevated, #FDFAF5);
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.dh-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.08));
  border-color: var(--comb, #F5A623);
}

.dh-tile-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.dh-tile-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted, #7A6A52);
  text-align: center;
}

.dh-tile--done {
  background: var(--comb-wash, rgba(245, 166, 35, 0.1));
  border-color: var(--comb, #F5A623);
}

.dh-tile--done .dh-tile-name {
  color: var(--ink, #2A2118);
}

.dh-tile--current {
  outline: 2px solid var(--comb, #F5A623);
  outline-offset: 1px;
}

.dh-tile-check {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success, #2ecc71);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

@media (max-width: 720px) {
  .dh-board {
    padding: 14px;
    margin: 14px 10px;
  }
}

/* ---------- completion panel ---------- */

.dh-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 22, 12, 0.55);
  opacity: 0;
  transition: opacity 0.25s ease;
  padding: 16px;
  overflow-y: auto;
}

.dh-overlay--show {
  opacity: 1;
}

.dh-panel {
  position: relative;
  width: 100%;
  max-width: 430px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface, #fff);
  color: var(--ink, #2A2118);
  border-radius: 20px;
  box-shadow: var(--shadow-lg, 0 18px 50px rgba(0, 0, 0, 0.3));
  padding: 26px 24px 22px;
  text-align: center;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.25s ease;
}

.dh-overlay--show .dh-panel {
  transform: translateY(0) scale(1);
}

.dh-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-light, #B0A48E);
  cursor: pointer;
  padding: 6px;
}

.dh-panel-emoji {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 6px;
}

.dh-panel-title {
  margin: 0 0 4px;
  font-size: 1.5rem;
  font-weight: 800;
}

.dh-panel-sub {
  margin: 0 0 6px;
  color: var(--ink-muted, #7A6A52);
  font-size: 0.95rem;
}

.dh-result {
  margin: 12px 0;
  padding: 12px;
  border-radius: 12px;
  background: var(--elevated, #FDFAF5);
  border: 1px solid var(--border-subtle, #F2EADB);
  font-size: 0.95rem;
}

.dh-streak-line {
  margin: 12px 0 8px;
  font-size: 0.95rem;
}

.dh-rank-line {
  margin: 10px 0 0;
  font-size: 0.95rem;
  min-height: 1.2em;
}

.dh-rank-line strong {
  color: var(--comb-deep, #D4891A);
}

.dh-muted {
  color: var(--ink-muted, #7A6A52);
  font-size: 0.85rem;
}

.dh-push-link {
  border: none;
  background: none;
  color: var(--ink-muted, #7A6A52);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
  margin: 2px 0 6px;
  padding: 4px 8px;
}

.dh-push-link:hover {
  color: var(--ink, #2A2118);
}

.dh-mini-board {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}

.dh-dot {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid var(--border, #EDE4D3);
  background: var(--elevated, #FDFAF5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.dh-dot:hover {
  transform: translateY(-2px);
  border-color: var(--comb, #F5A623);
}

.dh-dot--done {
  background: var(--comb-wash, rgba(245, 166, 35, 0.12));
  border-color: var(--comb, #F5A623);
}

.dh-dot--current {
  outline: 2px solid var(--comb, #F5A623);
  outline-offset: 1px;
}

.dh-dot i {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success, #2ecc71);
  color: #fff;
  font-size: 0.6rem;
  font-style: normal;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dh-next-btn {
  display: block;
  width: 100%;
  text-decoration: none;
  background: var(--comb, #F5A623);
  color: #2A2118;
  border-radius: 14px;
  padding: 13px 16px;
  margin: 6px 0 12px;
  box-shadow: 0 3px 0 var(--comb-deep, #D4891A);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.dh-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 0 var(--comb-deep, #D4891A);
}

.dh-next-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--comb-deep, #D4891A);
}

.dh-next-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.dh-next-game {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}

.dh-alldone {
  margin: 8px 0 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--comb-wash, rgba(245, 166, 35, 0.12));
  font-size: 0.95rem;
}

.dh-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 8px;
}

.dh-premium-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 8px;
  padding: 11px 13px;
  border: 1px solid var(--comb, #F5A623);
  border-radius: 8px;
  background: var(--comb-wash, rgba(245, 166, 35, 0.12));
  color: var(--ink, #2A2118);
  text-align: left;
  text-decoration: none;
}

.dh-premium-offer strong,
.dh-premium-offer small {
  display: block;
}

.dh-premium-offer strong {
  font-size: 0.9rem;
}

.dh-premium-offer small {
  margin-top: 2px;
  color: var(--ink-muted, #7A6A52);
  font-size: 0.76rem;
}

.dh-premium-arrow {
  font-size: 1.2rem;
  font-weight: 800;
}

.dh-share-btn {
  border: 1.5px solid var(--border, #EDE4D3);
  background: var(--elevated, #FDFAF5);
  color: var(--ink, #2A2118);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.dh-share-btn:hover {
  border-color: var(--comb, #F5A623);
}

.dh-stats-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-muted, #7A6A52);
  text-decoration: none;
}

.dh-stats-link:hover {
  color: var(--ink, #2A2118);
  text-decoration: underline;
}

.dh-countdown-line {
  font-size: 0.85rem;
  color: var(--ink-muted, #7A6A52);
  margin: 6px 0 0;
}

.dh-email {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border, #EDE4D3);
}

.dh-email-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink-muted, #7A6A52);
}

.dh-email-form {
  display: flex;
  gap: 8px;
}

.dh-email-form input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--border, #EDE4D3);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.9rem;
  background: var(--elevated, #FDFAF5);
  color: var(--ink, #2A2118);
}

.dh-email-form input:focus {
  outline: none;
  border-color: var(--comb, #F5A623);
}

.dh-email-form button {
  border: none;
  background: var(--comb, #F5A623);
  color: #2A2118;
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}

@media (max-width: 480px) {
  .dh-panel {
    padding: 22px 16px 18px;
  }
  .dh-dot {
    width: 34px;
    height: 34px;
  }
}

/* ---------- in-game hint button ---------- */

.wb-hint-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--border, #EDE4D3);
  background: var(--elevated, #FDFAF5);
  color: var(--ink, #2A2118);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.wb-hint-btn:hover {
  border-color: var(--comb, #F5A623);
  transform: translateY(-1px);
}

.wb-hint-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 10002;
  background: var(--ink, #2A2118);
  color: var(--base, #FDFAF5);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.3));
  max-width: 90vw;
  text-align: center;
}

/* ---------- hints-page capture ---------- */

.dh-capture {
  align-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: 980px;
  margin: 24px auto;
  padding: 0 10px;
}

.dh-capture-email {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #EDE4D3);
  border-radius: 16px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.06));
  padding: 22px 24px;
  margin: 16px auto;
  text-align: center;
}

.dh-capture-email h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--ink, #2A2118);
}

.dh-capture-email p {
  margin: 0 0 14px;
  color: var(--ink-muted, #7A6A52);
  font-size: 0.92rem;
}

.dh-capture-form {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}

.dh-capture-form input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--border, #EDE4D3);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 0.95rem;
  background: var(--elevated, #FDFAF5);
  color: var(--ink, #2A2118);
}

.dh-capture-form input:focus {
  outline: none;
  border-color: var(--comb, #F5A623);
}

.dh-capture-form button {
  border: none;
  background: var(--comb, #F5A623);
  color: #2A2118;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--comb-deep, #D4891A);
}

.dh-capture-form button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--comb-deep, #D4891A);
}

@media (max-width: 480px) {
  .dh-capture-form {
    flex-direction: column;
  }
}

/* ---------- confetti ---------- */

.dh-confetti {
  position: fixed;
  inset: 0;
  z-index: 10001;
  pointer-events: none;
  overflow: hidden;
}

.dh-confetto {
  position: absolute;
  top: -16px;
  display: block;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: dh-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.dh-spin-a {
  animation-name: dh-fall-a;
}

.dh-spin-b {
  animation-name: dh-fall-b;
}

@keyframes dh-fall-a {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(540deg); opacity: 0.7; }
}

@keyframes dh-fall-b {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(-720deg); opacity: 0.7; }
}

@media (prefers-reduced-motion: reduce) {
  .dh-confetti {
    display: none;
  }
  .dh-overlay,
  .dh-panel,
  .dh-tile,
  .dh-dot {
    transition: none;
  }
  /* No marquee: fall back to a static, manually scrollable row and drop the
     duplicate tile set that only existed to make the loop seamless. */
  .dh-track {
    animation: none;
    width: auto;
  }
  .dh-tiles {
    overflow-x: auto;
  }
  .dh-track .dh-tile[aria-hidden="true"] {
    display: none;
  }
}
