/* Energy Wordle — shared base styles. Each hub can override colors with
   its own CSS variables (--ew-correct, --ew-present, --ew-absent, --ew-accent)
   scoped to #energy-wordle-root, to match that hub's branding. */
#energy-wordle-root {
  --ew-correct: #3aa655;
  --ew-present: #c9a227;
  --ew-absent: #787c7e;
  --ew-accent: #1a2b4c;
  max-width: 420px;
  margin: 0 auto;
  font-family: inherit;
}
.ew-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ew-row { display: flex; gap: 6px; justify-content: center; }
.ew-cell {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #d3d6da;
  font-size: 1.75rem; font-weight: 700;
  text-transform: uppercase;
  color: #1a1a1b;
}
.ew-cell.ew-filled { border-color: #878a8c; }
.ew-cell.ew-correct { background: var(--ew-correct); border-color: var(--ew-correct); color: #fff; }
.ew-cell.ew-present { background: var(--ew-present); border-color: var(--ew-present); color: #fff; }
.ew-cell.ew-absent { background: var(--ew-absent); border-color: var(--ew-absent); color: #fff; }

.ew-message { text-align: center; min-height: 1.5em; font-weight: 600; margin-bottom: 8px; }

.ew-keyboard { display: flex; flex-direction: column; gap: 6px; }
.ew-kb-row { display: flex; gap: 4px; justify-content: center; }
.ew-key {
  min-width: 32px; height: 44px; padding: 0 8px;
  border: none; border-radius: 4px; background: #d3d6da;
  font-weight: 600; cursor: pointer;
}
.ew-key.ew-correct { background: var(--ew-correct); color: #fff; }
.ew-key.ew-present { background: var(--ew-present); color: #fff; }
.ew-key.ew-absent { background: var(--ew-absent); color: #fff; }

.ew-done { text-align: center; }

/* Toolbar (how-to / stats / leaderboard icons) */
.ww-toolbar { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.ww-icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid #d3d6da;
  background: #fff; font-size: 1.1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.ww-cta {
  margin-top: 14px; padding: 10px 18px; border: none; border-radius: 6px;
  background: var(--ew-accent); color: #fff; font-weight: 700; cursor: pointer;
}
.ww-share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.ww-share-row .ww-cta { margin-top: 0; }
.ww-cta-secondary { background: #0a66c2; } /* LinkedIn blue */
.ww-cta-ghost { background: transparent; color: var(--ew-accent); border: 1px solid var(--ew-accent); }
.ww-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1a1a1b; color: #fff; padding: 10px 18px; border-radius: 6px;
  font-weight: 600; font-size: 0.9rem; z-index: 1100;
}

/* Modal */
.ww-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  padding: 16px;
}
.ww-modal {
  background: #fff; color: #1a1a1b; border-radius: 10px; padding: 24px;
  max-width: 420px; width: 100%; max-height: 85vh; overflow-y: auto; position: relative;
}
.ww-modal-close {
  position: absolute; top: 10px; right: 14px; border: none; background: none;
  font-size: 1.5rem; line-height: 1; cursor: pointer; color: #787c7e;
}
.ww-modal-title { margin: 0 0 14px; font-size: 1.25rem; text-align: center; }

/* How to play */
.ww-howto p { margin: 0 0 10px; }
.ww-example { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.ww-example .ew-cell { width: 36px; height: 36px; font-size: 1.1rem; }

/* Stats */
.ww-stats-grid { display: flex; justify-content: space-around; text-align: center; margin-bottom: 18px; }
.ww-stat-num { font-size: 1.6rem; font-weight: 700; }
.ww-stat-label { font-size: 0.75rem; color: #787c7e; text-transform: uppercase; }
.ww-dist-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ww-dist-n { width: 12px; font-weight: 700; }
.ww-dist-barwrap { flex: 1; background: #f0f0f0; border-radius: 3px; }
.ww-dist-bar {
  background: var(--ew-correct); color: #fff; text-align: right; padding: 2px 6px;
  border-radius: 3px; font-size: 0.8rem; font-weight: 700; min-width: 20px; box-sizing: border-box;
}
.ww-no-stats { text-align: center; color: #787c7e; }

.ew-email-form, .ww-email-form { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.ew-email-form input, .ww-email-form input {
  padding: 10px 14px; border: 1px solid #d3d6da; border-radius: 6px; min-width: 180px; flex: 1;
}
.ew-email-form button, .ww-email-form button {
  padding: 10px 18px; border: none; border-radius: 6px;
  background: var(--ew-accent); color: #fff; font-weight: 700; cursor: pointer;
}
.ew-saved { font-weight: 600; color: var(--ew-correct); }

/* Leaderboard */
.ww-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.ww-tab {
  padding: 6px 14px; border-radius: 20px; border: 1px solid #d3d6da; background: #fff;
  cursor: pointer; font-weight: 600;
}
.ww-tab-active { background: var(--ew-accent); color: #fff; border-color: var(--ew-accent); }
.ww-lb-row {
  display: grid; grid-template-columns: 36px 1fr 60px 50px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid #f0f0f0; gap: 6px;
}
.ww-lb-rank { font-weight: 700; color: #787c7e; }
.ww-lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ww-lb-streak, .ww-lb-winrate { font-size: 0.85rem; text-align: right; color: #787c7e; }
