/* Layout — app shell, split-pane home, responsive collapse. */

.wu-app {
  min-height: 100vh;
}

.wu-view-root {
  position: relative;
  min-height: 0;
}

/* ── Home — full-width honeycomb with floating calendar overlay ─── */

.wu-home {
  position: relative;
  padding: var(--space-md);
  height: 100%;
  min-height: 100vh;
  box-sizing: border-box;
}

.wu-honeycomb-pane {
  position: relative;
  /* Shows through the hex gaps — quiet padding, not line weight */
  background: var(--colour-grid-bg);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  height: 100%;
  min-height: calc(100vh - 34px);
}

/* HUD — top-left. The ★ pill + its dropdown live in .wu-hud-bar; breadcrumb
   "progression" pills (section / trail) stack VERTICALLY below the pill (better
   on mobile than running sideways). */
.wu-hud {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  z-index: 5;
}

/* The pill row — relative so the dropdown anchors under the pill, not under the
   stacked breadcrumb pills below it. */
.wu-hud-bar {
  position: relative;
  display: flex;
  align-items: center;
}

/* Dropdown the ★ menu collapses/expands (decision #50, restyle #56) — drops
   DOWN below the pill as a flat card of labelled rows. */
.wu-hud-menu {
  position: absolute;
  top: calc(100% + var(--space-sm));
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 224px;
  padding: var(--space-xs);
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.wu-hud[data-collapsed="true"] .wu-hud-menu {
  display: none;
}

/* Flat menu row — icon + text label, no round button, follows the flat flower
   look (decision #56) */
.wu-hud-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: transparent;
  border-radius: var(--radius-button);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.wu-hud-ic {
  flex: 0 0 1.7em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

.wu-hud-lbl {
  white-space: nowrap;
}

/* Profile avatar dot inside its menu row */
.wu-prof-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-family: var(--font-display);
  background: var(--colour-text-secondary);
}

.wu-hud-item:hover {
  background: color-mix(in srgb, var(--colour-brand) 16%, transparent);
}

/* At-a-glance chips BELOW the ★ Menu pill (home only): 🔥 week streak,
   🧾 awaiting parent ✓, ⭐ stars to spend. Separate tappable pills (each opens
   a "what is this?" sheet with a shortcut); each hides at 0. The pill above
   stretches to the row's width so pill + chips read as one block. */
.wu-hud-stats {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.wu-hud > .wu-hud-bar {
  align-self: stretch;
}

.wu-hud .wu-brand-chip {
  width: 100%;
  justify-content: center;
}

.wu-hud-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--colour-border);
  background: var(--colour-surface);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--colour-text-primary);
  white-space: nowrap;
  cursor: pointer;
}

.wu-hud-stat:hover {
  border-color: var(--colour-text-secondary);
}

.wu-hud-stat[hidden] {
  display: none;
}

.wu-stat-streak {
  background: color-mix(in srgb, var(--colour-warning) 14%, var(--colour-surface));
  border-color: color-mix(in srgb, var(--colour-warning) 55%, var(--colour-border));
}

.wu-stat-confirm {
  background: color-mix(in srgb, var(--colour-accent) 12%, var(--colour-surface));
  border-color: color-mix(in srgb, var(--colour-accent) 55%, var(--colour-border));
}

.wu-stat-stars {
  background: color-mix(in srgb, var(--colour-brand) 16%, var(--colour-surface));
  border-color: color-mix(in srgb, var(--colour-brand) 55%, var(--colour-border));
}

/* Brand pill — the ★ menu toggle, amber to match the app icon (decision #56):
   amber fill, white star + wordmark. */
.wu-brand-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  height: 44px;
  padding: 0 var(--space-md);
  border-radius: var(--radius-pill);
  background: var(--colour-brand);
  border: 1px solid var(--colour-brand-deep);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--colour-brand-deep) 32%, transparent);
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast),
              background var(--transition-fast);
}

/* Keep the ★ optically centred with the wordmark */
.wu-brand-chip > span {
  display: block;
  font-size: 17px;
  line-height: 1;
  color: #fff;
}

.wu-brand-chip:hover {
  transform: translateY(-2px);
  background: var(--colour-brand-deep);
  border-color: var(--colour-brand-deep);
}

/* Section badge — identifies the current sub-flower (Maths / Vocab / Settings) */
.wu-hud-section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 var(--space-sm);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--sec-colour) 14%, var(--colour-surface));
  border: 1px solid color-mix(in srgb, var(--sec-colour) 50%, var(--colour-border));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-family: var(--font-display);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--colour-text-primary);
}

.wu-hud-section-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

/* Hide the HUD while a drill / panel layer is up — those have their own ✕ */
.wu-honeycomb-pane:has(.wu-drill-layer:not(.wu-hidden)) .wu-hud {
  display: none;
}

.wu-hud-item[aria-pressed="true"] {
  background: color-mix(in srgb, var(--colour-brand) 22%, transparent);
}

/* Blurred backdrop behind the calendar modal — tap to close */
.wu-cal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--colour-text-primary) 14%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Calendar opens as a centred modal above the blurred backdrop */
.wu-calendar-floating {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 2 * var(--space-lg)));
  max-height: calc(100vh - 2 * var(--space-lg));
  background: var(--colour-surface);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  z-index: 41;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.wu-calendar-floating.wu-hidden,
.wu-cal-backdrop.wu-hidden {
  display: none;
}

/* ── ★ centre-tile menu (decision #63) — sub-flower overlay, blurred home ── */
.wu-centre-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--colour-text-primary) 14%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wu-centre-menu {
  position: relative;
  padding: var(--space-xl);
}

.wu-centre-stage {
  position: relative;
}

/* Empty website slots — faint ➕ pointers to the parent settings */
.wu-centre-add {
  opacity: 0.45;
}

.wu-calendar-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--colour-text-secondary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  padding: 0;
}

.wu-calendar-close:hover {
  color: var(--colour-text-primary);
  background: color-mix(in srgb, var(--colour-text-secondary) 18%, transparent);
}

/* Streak chip — lives inside the calendar modal */
.wu-streak-chip {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin: var(--space-md) var(--space-md) 0;
  padding: var(--space-xs) var(--space-md);
  background: color-mix(in srgb, var(--colour-warning) 14%, var(--colour-surface));
  border: 1px solid color-mix(in srgb, var(--colour-warning) 40%, transparent);
  border-radius: var(--radius-pill);
  width: fit-content;
}

.wu-streak-flame {
  font-size: var(--font-size-md);
  line-height: 1;
}

.wu-streak-count {
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--colour-warning);
  line-height: 1;
}

.wu-streak-label {
  font-size: var(--font-size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--colour-text-secondary);
}

/* ── Responsive — shrink the floating calendar on small viewports ─── */

@media (max-width: 720px) {
  .wu-calendar-floating {
    width: calc(100vw - 2 * var(--space-md));
  }
}

/* Generic hidden utility */
.wu-hidden {
  display: none !important;
}

/* Maths + Vocab + Parent + Games views share the home pane chrome */
.wu-maths,
.wu-vocab,
.wu-parent,
.wu-games {
  position: relative;
  padding: var(--space-md);
  height: 100%;
  min-height: 100vh;
  box-sizing: border-box;
}

/* ── Toast — fade-in/out status message ───────────────── */

.wu-toast {
  position: fixed;
  top: var(--space-lg);
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: color-mix(in srgb, var(--colour-surface) 96%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--colour-border);
  border-radius: var(--radius-pill);
  padding: var(--space-sm) var(--space-lg);
  z-index: 200;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--colour-text-primary);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  opacity: 0;
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
  max-width: calc(100% - var(--space-2xl));
  text-align: center;
  white-space: nowrap;
}

.wu-toast.wu-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
