/* Secret games — match Wisdom Wit Words dark copper aesthetic */

body.www-game-open {
  overflow: hidden;
}

.www-egg-dot {
  cursor: pointer;
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

.www-egg-dot:hover,
.www-egg-dot:focus-visible {
  color: var(--focus, #e8c98a);
  text-shadow: 0 0 12px rgba(232, 201, 138, 0.35);
  outline: none;
}

.www-game-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  overflow: hidden;
  max-width: 100%;
  background: rgba(10, 8, 6, 0.82);
  backdrop-filter: blur(6px);
}

.www-game-overlay[hidden] {
  display: none !important;
}

.www-game-panel {
  width: min(920px, 100%);
  max-width: 100%;
  max-height: min(92vh, 900px);
  box-sizing: border-box;
  overflow: auto;
  background: var(--bg-sheet, #1c1612);
  border: 1px solid var(--line, rgba(208, 176, 122, 0.28));
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  padding: 1rem 1.15rem 1.25rem;
  color: var(--cream, #f3ead8);
  font-family: var(--font-ui, "Outfit", sans-serif);
}

.www-game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.www-game-head h2 {
  margin: 0;
  font-family: var(--font-display, "Fraunces", serif);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--cream, #f3ead8);
}

.www-game-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--cream-dim, #d4c6ae);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.www-game-close:hover,
.www-game-close:focus-visible {
  color: var(--focus, #e8c98a);
  outline: none;
  background: rgba(208, 176, 122, 0.12);
}

.www-game-sub {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--cream-dim, #d4c6ae);
}

.www-game-sub strong {
  color: var(--copper, #d0b07a);
}

/* —— Wit Search —— */
.www-wit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 200px);
  gap: 1rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 640px) {
  .www-wit-layout {
    grid-template-columns: 1fr;
  }
}

.www-wit-grid {
  --www-wit-size: 12;
  display: grid;
  grid-template-columns: repeat(var(--www-wit-size), minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  user-select: none;
  touch-action: none;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(208, 176, 122, 0.28));
}

.www-wit-cell {
  appearance: none;
  border: 0;
  margin: 0;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-ui, "Outfit", sans-serif);
  font-size: clamp(0.55rem, 1.8vw, 0.85rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--cream, #f3ead8);
  background: rgba(20, 16, 13, 0.9);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
}

.www-wit-cell.is-hover {
  background: rgba(208, 176, 122, 0.35);
  color: #fff;
}

.www-wit-cell.is-found {
  background: rgba(176, 137, 80, 0.55);
  color: #fff;
}

.www-wit-words {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.www-wit-words li {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--copper, #d0b07a);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  border: 1px solid transparent;
}

.www-wit-words li.is-found {
  text-decoration: line-through;
  opacity: 0.55;
  color: var(--cream-dim, #d4c6ae);
}

.www-wit-status {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--cream, #f3ead8);
  min-height: 2.5em;
}

.www-wit-lb {
  margin-top: 0.75rem;
}

/* —— Word Dodge —— */
.www-dodge-panel {
  overflow: hidden;
}

.www-dodge-hud {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--copper, #d0b07a);
  margin-bottom: 0.4rem;
  min-width: 0;
  max-width: 100%;
}

#www-dodge-canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 720 / 420;
  box-sizing: border-box;
  margin-inline: auto;
  background: #120e0b;
  border-radius: 10px;
  border: 1px solid var(--line, rgba(208, 176, 122, 0.28));
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Anti-highlight / long-press callout on mobile D-pad + HUD */
.www-dodge-panel .www-game-head,
.www-dodge-panel .www-game-sub,
.www-dodge-hud,
.www-dodge-touch,
.www-dodge-touch button {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.www-dodge-touch {
  /* Always show larger D-pad (desktop + touch) — UX 2026-10-02c cache-bust */
  display: flex;
  margin-top: 0.75rem;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  touch-action: none;
}

.www-dodge-touch-mid {
  display: flex;
  gap: 0.45rem;
}

.www-dodge-touch button {
  width: 4.75rem;
  height: 4.1rem;
  min-width: 4.75rem;
  min-height: 4.1rem;
  border-radius: 12px;
  border: 1px solid var(--line, rgba(208, 176, 122, 0.28));
  background: rgba(208, 176, 122, 0.16);
  color: var(--cream, #f3ead8);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.www-dodge-touch button:active {
  background: rgba(208, 176, 122, 0.32);
  transform: scale(0.97);
}

/* Larger, easier-to-hit Exit / X (Word Dodge) */
.www-dodge-panel .www-game-close.www-dodge-exit {
  font-size: 2.15rem;
  padding: 0.35rem 0.7rem;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid rgba(208, 176, 122, 0.35);
  background: rgba(208, 176, 122, 0.1);
}

@media (max-width: 720px), (pointer: coarse) {
  .www-dodge-touch {
    display: flex;
  }
}

.www-dodge-end {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line, rgba(208, 176, 122, 0.28));
}

.www-dodge-final {
  margin: 0 0 0.6rem;
  font-family: var(--font-display, "Fraunces", serif);
  font-size: 1.15rem;
}

.www-nick-wrap label,
#www-dodge-nick-wrap label {
  display: block;
  font-size: 0.8rem;
  color: var(--cream-dim, #d4c6ae);
  margin-bottom: 0.35rem;
}

.www-nick-row,
.www-dodge-nick-row {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.www-nick-row input,
#www-dodge-nick,
#www-wit-nick {
  flex: 1;
  min-width: 0;
  background: #14100d;
  border: 1px solid var(--line, rgba(208, 176, 122, 0.28));
  border-radius: 8px;
  color: var(--cream, #f3ead8);
  padding: 0.45rem 0.65rem;
  font: inherit;
}

#www-dodge-submit,
#www-wit-submit,
.www-game-again {
  appearance: none;
  border: 1px solid var(--copper, #d0b07a);
  background: rgba(208, 176, 122, 0.15);
  color: var(--cream, #f3ead8);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

#www-dodge-submit:hover,
#www-wit-submit:hover,
.www-game-again:hover {
  background: rgba(208, 176, 122, 0.28);
}

.www-nick-err,
.www-dodge-nick-err {
  color: #e8a090;
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
}

.www-wit-end {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line, rgba(208, 176, 122, 0.28));
}

.www-wit-final {
  margin: 0 0 0.5rem;
  font-family: var(--font-display, "Fraunces", serif);
  font-size: 1.05rem;
}

.www-game-again {
  margin-top: 0.65rem;
}

/* —— Leaderboard —— */
.www-lb {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line, rgba(208, 176, 122, 0.2));
}

.www-lb-title {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--copper, #d0b07a);
}

.www-lb-empty,
.www-lb-note {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--cream-dim, #d4c6ae);
}

.www-lb-list {
  margin: 0;
  padding: 0 0 0 1.1rem;
}

.www-lb-list li {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.www-lb-rank {
  color: var(--cream-dim, #d4c6ae);
  margin-right: 0.25rem;
}

.www-lb-nick {
  color: var(--cream, #f3ead8);
}

.www-lb-score {
  float: right;
  color: var(--copper, #d0b07a);
  font-variant-numeric: tabular-nums;
}

/* —— Word Dodge fairness UI (2026-10-01) —— */
.www-dodge-hud {
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}

.www-dodge-board-badge {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cream, #f3ead8);
  background: rgba(208, 176, 122, 0.18);
  border: 1px solid var(--line, rgba(208, 176, 122, 0.28));
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.www-lb-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
  flex-wrap: wrap;
}

.www-lb-tab {
  appearance: none;
  border: 1px solid var(--line, rgba(208, 176, 122, 0.28));
  background: rgba(0, 0, 0, 0.2);
  color: var(--cream-dim, #d4c6ae);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.www-lb-tab.is-active,
.www-lb-tab[aria-selected="true"] {
  background: rgba(208, 176, 122, 0.28);
  color: var(--cream, #f3ead8);
  border-color: var(--copper, #d0b07a);
}

.www-lb-dual .www-lb-panel {
  min-height: 3.5rem;
}

/* —— Word Dodge health bar (2026-10-02) —— */
.www-dodge-hud {
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.www-dodge-hp-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 9.5rem;
  flex: 1 1 9.5rem;
}

.www-dodge-hp-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream-dim, #d4c6ae);
  flex-shrink: 0;
}

.www-dodge-hp-track {
  position: relative;
  flex: 1 1 auto;
  height: 0.72rem;
  min-width: 4.5rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(208, 176, 122, 0.4);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.www-dodge-hp-fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6fbf73 0%, #c6e28a 100%);
  box-shadow: 0 0 10px rgba(111, 191, 115, 0.45);
  transition: width 0.18s ease-out, background 0.18s ease-out, opacity 0.12s;
}

.www-dodge-hp-fill.is-half {
  background: linear-gradient(90deg, #c47a2c 0%, #e8c98a 100%);
  box-shadow: 0 0 10px rgba(232, 201, 138, 0.5);
}

.www-dodge-hp-fill.is-empty {
  width: 0 !important;
  opacity: 0.35;
  box-shadow: none;
}

.www-dodge-hp-fill.is-flash {
  filter: brightness(1.35);
}

.www-dodge-hp-wrap.is-hurt .www-dodge-hp-track {
  border-color: rgba(232, 160, 96, 0.85);
  box-shadow: 0 0 0 1px rgba(232, 160, 96, 0.35);
}

.www-dodge-hp-wrap.is-dead .www-dodge-hp-label,
.www-dodge-hp-wrap.is-dead .www-dodge-hp-text {
  color: #e08a6a;
}

.www-dodge-hp-text {
  font-variant-numeric: tabular-nums;
  font-size: 0.75rem;
  color: var(--copper, #d0b07a);
  min-width: 2.4rem;
  text-align: right;
}


/* Word Dodge UX 2026-10-02c: larger pad always-on + X-only close + cache-bust */
#www-dodge-nick-wrap:not([hidden]) {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 201, 138, 0.35);
  background: rgba(208, 176, 122, 0.08);
}
#www-dodge-nick {
  font-size: 1.05rem;
  min-height: 2.5rem;
}

/* —— Sentence Flight —— */
/* sf-chrome-20261002e: while open, only the starfield, the game, and its X stay visible */
body.www-sf-open > *:not(.starfield):not(#www-sentence-flight) {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.www-sf-open > *:not(.starfield):not(#www-sentence-flight) * {
  visibility: hidden !important;
  pointer-events: none !important;
}

body.www-sf-open .starfield,
body.www-sf-open .starfield * {
  visibility: visible !important;
  pointer-events: none !important;
}

body.www-sf-open .starfield {
  z-index: 1;
  opacity: 1 !important;
}

body.www-sf-open #www-sentence-flight,
body.www-sf-open #www-sentence-flight * {
  visibility: visible !important;
  pointer-events: auto;
}

body.www-sf-open #www-sentence-flight [hidden],
body.www-sf-open #www-sentence-flight [hidden] * {
  visibility: hidden !important;
  pointer-events: none !important;
}

.www-sf-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  max-width: 100%;
  background: transparent;
  color: var(--cream, #f3ead8);
  font-family: var(--font-ui, "Outfit", sans-serif);
  pointer-events: auto;
}

.www-sf-overlay[hidden] {
  display: none !important;
}

.www-sf-hud {
  position: relative;
  z-index: 2;
  padding: 0.75rem 0.9rem 0.35rem;
  background: linear-gradient(to bottom, rgba(10, 8, 6, 0.78), rgba(10, 8, 6, 0));
  pointer-events: auto;
}

.www-sf-hud-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.www-sf-hud h2 {
  margin: 0;
  font-family: var(--font-display, "Fraunces", serif);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-weight: 600;
}

.www-sf-stats {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--copper, #d0b07a);
  font-size: 0.9rem;
}

.www-sf-hull {
  display: inline-flex;
  gap: 0.28rem;
}

.www-sf-hull i {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 8px rgba(232, 201, 138, 0.35);
}

.www-sf-hull i.is-on {
  background: #e8c98a;
}

.www-sf-hull i.is-off {
  background: rgba(243, 234, 216, 0.18);
  box-shadow: none;
}

.www-sf-close {
  appearance: none;
  border: 0;
  background: rgba(10, 8, 6, 0.55);
  color: var(--cream, #f3ead8);
  width: 3rem;
  height: 3rem;
  border-radius: 10px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.www-sf-close:hover,
.www-sf-close:focus-visible {
  color: var(--focus, #e8c98a);
  outline: 2px solid var(--focus, #e8c98a);
  outline-offset: 2px;
}

.www-sf-sentence {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-height: 2.4rem;
  margin: 0.55rem 0 0.25rem;
  align-items: center;
}

.www-sf-word {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: 0.15rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(208, 176, 122, 0.35);
  font-size: 1rem;
}

.www-sf-word.is-locked {
  background: rgba(208, 176, 122, 0.22);
  color: #f3ead8;
}

.www-sf-word.is-bad {
  background: rgba(176, 64, 48, 0.55);
  border-color: #e08a6a;
  color: #fff;
}

.www-sf-word.is-win {
  background: rgba(90, 140, 96, 0.55);
  border-color: #b7d7a8;
  color: #fff;
}


.www-sf-word.is-slot {
  width: 2.4rem;
  background: rgba(255, 255, 255, 0.04);
  border-style: dashed;
}

.www-sf-rule {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  color: var(--cream-dim, #d4c6ae);
  max-width: 42rem;
}

#www-sf-canvas {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  display: block;
  box-sizing: border-box;
  background: transparent;
  touch-action: none;
}

.www-sf-touch {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  touch-action: none;
}

.www-sf-touch button {
  appearance: none;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 14px;
  border: 1px solid rgba(232, 201, 138, 0.55);
  background: rgba(10, 8, 6, 0.62);
  color: #f3ead8;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}

.www-sf-touch-mid {
  display: flex;
  gap: 0.35rem;
}

.www-sf-end {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: min(28rem, calc(100% - 2rem));
  padding: 1.1rem 1.15rem 1.2rem;
  border-radius: 14px;
  background: rgba(20, 16, 13, 0.92);
  border: 1px solid rgba(208, 176, 122, 0.4);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.www-sf-end[hidden] {
  display: none !important;
}

.www-sf-end-title {
  margin: 0 0 0.4rem;
  font-family: var(--font-display, "Fraunces", serif);
  font-size: 1.45rem;
}

.www-sf-end-detail {
  margin: 0 0 0.9rem;
  color: var(--cream-dim, #d4c6ae);
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  .www-sf-touch button {
    width: 4.6rem;
    height: 4.6rem;
  }
  .www-sf-hud {
    padding-top: max(0.6rem, env(safe-area-inset-top));
  }
}

/* sf-slant-20261002i: Sentence Flight top-3 + distinct hull crush (CSS only adds the score card) */
#www-sf-submit {
  appearance: none;
  border: 1px solid var(--copper, #d0b07a);
  background: rgba(208, 176, 122, 0.15);
  color: var(--cream, #f3ead8);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 0;
  flex-shrink: 0;
}
#www-sf-submit:hover,
#www-sf-submit:focus-visible {
  background: rgba(208, 176, 122, 0.28);
}
#www-sf-submit:disabled {
  opacity: 0.55;
  cursor: default;
}
#www-sf-nick {
  font-size: 16px;
  min-height: 2.6rem;
}
#www-sf-nick-wrap:not([hidden]) {
  margin: 0.65rem 0 0.35rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(232, 201, 138, 0.35);
  background: rgba(208, 176, 122, 0.08);
  text-align: left;
}
.www-sf-end {
  max-height: calc(100dvh - 1.25rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
#www-sf-lb {
  text-align: left;
}
@media (max-width: 640px) {
  .www-sf-end {
    width: min(28rem, calc(100% - 1rem));
    padding: 0.9rem 0.85rem 1rem;
  }
}
