/* ═══════════════════════════════════════════════════════
   Unscramble AU — Main Stylesheet
   Colours: #1a6b2a (green), #f4b800 (gold), #fff (white)
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:       #1a6b2a;
  --green-dark:  #144f20;
  --green-light: #e8f5ec;
  --gold:        #f4b800;
  --gold-dark:   #c99600;
  --gold-light:  #fff9e0;
  --white:       #ffffff;
  --grey-50:     #f8f9fa;
  --grey-100:    #f0f2f0;
  --grey-200:    #dde3de;
  --grey-400:    #9aab9b;
  --grey-700:    #4a5a4b;
  --grey-900:    #1c241d;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 2px 12px rgba(0,0,0,.08);
  --shadow-md:   0 4px 24px rgba(0,0,0,.12);
  --font:        'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition:  .18s ease;
}

html { scroll-behavior: smooth; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--grey-900);
  background: var(--white);
  min-height: 100vh;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.hidden { display: none !important; }

/* ── Layout ────────────────────────────────────────────────── */
.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.content-area { flex: 1; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 860px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ── Header ────────────────────────────────────────────────── */
.site-header {
  background: var(--green);
  color: var(--white);
  padding: 0 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.site-logo {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
}

.logo-wordmark {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -.5px;
}

.logo-flag {
  font-size: 1.4rem;
}

.logo-tagline {
  font-size: .75rem;
  color: rgba(255,255,255,.8);
  white-space: nowrap;
}

.header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-nav a {
  color: rgba(255,255,255,.88);
  font-size: .9rem;
  font-weight: 500;
  transition: color var(--transition);
}
.header-nav a:hover { color: var(--gold); text-decoration: none; }

/* ── Mode Toggle ────────────────────────────────────────────── */
.mode-toggle-bar {
  background: var(--green-light);
  border-bottom: 2px solid var(--green);
  padding: 12px 20px;
}

.mode-toggle-bar .container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.toggle-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--green-dark);
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 2px solid var(--green);
  border-radius: 50px;
  padding: 4px 8px;
  cursor: pointer;
}

.toggle-option {
  padding: 6px 18px;
  border-radius: 50px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--grey-700);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}

.toggle-option.active {
  background: var(--green);
  color: var(--white);
}

input[type="checkbox"]#mode-toggle { display: none; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: var(--white);
  padding: 56px 20px 48px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero h1 .gold { color: var(--gold); }

.hero p {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  max-width: 560px;
  margin: 0 auto 32px;
}

/* ── Search Box ─────────────────────────────────────────────── */
.search-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  max-width: 680px;
  margin: -28px auto 0;
  position: relative;
  z-index: 10;
}

.search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.letter-input {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-align: center;
  padding: 14px 20px;
  border: 3px solid var(--grey-200);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  color: var(--green-dark);
}
.letter-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(26,107,42,.15);
}
.letter-input::placeholder {
  color: var(--grey-400);
  letter-spacing: 0;
  font-size: 1rem;
  font-weight: 400;
}

.btn-primary {
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform .1s;
  white-space: nowrap;
}
.btn-primary:hover  { background: var(--green-dark); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--grey-700);
  border: 2px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }

.btn-gold {
  background: var(--gold);
  color: var(--grey-900);
  border: none;
  border-radius: var(--radius);
  padding: 12px 24px;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-gold:hover { background: var(--gold-dark); }

/* ── Filters ────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--grey-100);
  margin-top: 8px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-group label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--grey-700);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.filter-group input[type="number"],
.filter-group input[type="text"] {
  width: 90px;
  padding: 7px 10px;
  border: 2px solid var(--grey-200);
  border-radius: 6px;
  font-size: .9rem;
  outline: none;
  transition: border-color var(--transition);
}

.filter-group input:focus { border-color: var(--green); }

/* ── Word Status ────────────────────────────────────────────── */
.word-status {
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 860px) {
  #word-list-status { display: none; }
}
.word-status.full    { background: var(--green-light); color: var(--green-dark); }
.word-status.partial { background: var(--gold-light);  color: #7a5e00; }

/* ── Main Content Area ──────────────────────────────────────── */
.main-section {
  padding: 40px 0;
}

/* ── Results ────────────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.results-header h2 {
  font-size: 1.2rem;
  color: var(--green-dark);
}

#result-count {
  font-size: .9rem;
  color: var(--grey-700);
  font-weight: 600;
}

.word-group { margin-bottom: 24px; }

.group-heading {
  font-size: .95rem;
  font-weight: 700;
  color: var(--grey-700);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 6px;
  display: inline-block;
}

.group-count {
  font-weight: 400;
  color: var(--grey-400);
}

.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-chip {
  background: var(--white);
  border: 2px solid var(--grey-200);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--grey-900);
}
.word-chip:hover  { border-color: var(--green); color: var(--green); background: var(--green-light); }
.word-chip.copied { border-color: var(--gold); background: var(--gold-light); color: var(--gold-dark); }
.word-chip.aussie { border-color: var(--gold); background: var(--gold-light); }
.word-chip.aussie::after { content: '🦘'; margin-left: 4px; font-size: .8em; }

.no-results {
  color: var(--grey-700);
  padding: 24px;
  text-align: center;
  background: var(--grey-50);
  border-radius: var(--radius);
  font-style: italic;
}

/* ── Daily Challenge ────────────────────────────────────────── */
.daily-card {
  background: linear-gradient(135deg, var(--green-light) 0%, var(--gold-light) 100%);
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.daily-card h3 {
  font-size: 1rem;
  color: var(--green-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.daily-date {
  font-size: .8rem;
  color: var(--grey-700);
  margin-bottom: 16px;
}

.daily-scrambled {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--green-dark);
  margin-bottom: 12px;
  text-align: center;
}

.daily-category {
  font-size: .85rem;
  color: var(--grey-700);
  text-align: center;
  margin-bottom: 16px;
  font-style: italic;
}

.daily-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.daily-input-row input {
  flex: 1;
  padding: 10px 14px;
  font-size: 1rem;
  border: 2px solid var(--green);
  border-radius: var(--radius);
  outline: none;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
}

.daily-feedback {
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: .95rem;
}
.daily-feedback.correct  { background: var(--green-light); color: var(--green-dark); }
.daily-feedback.wrong    { background: #ffe0e0; color: #a00; }
.daily-feedback.revealed { background: var(--gold-light); color: var(--grey-900); }

.daily-hint {
  font-size: .9rem;
  color: var(--grey-700);
  font-style: italic;
  padding: 8px 12px;
  background: rgba(255,255,255,.6);
  border-radius: 6px;
  margin-top: 8px;
}

.daily-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* ── AdSense Slots ──────────────────────────────────────────── */
.ad-slot {
  background: var(--grey-50);
  border: 2px dashed var(--grey-200);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-400);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.ad-slot-header   { height: 90px; margin-bottom: 24px; }
.ad-slot-sidebar  { height: 250px; margin-bottom: 16px; }
.ad-slot-below    { height: 100px; margin-top: 24px; }

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 80px; }

.sidebar-section {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.sidebar-section h3 {
  font-size: .95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--green-dark);
}

/* ── Teacher Mode ────────────────────────────────────────────── */
#teacher-mode {
  background: var(--grey-50);
  border-top: 3px solid var(--gold);
  min-height: 60vh;
  padding: 32px 0;
}

.teacher-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.teacher-badge {
  background: var(--gold);
  color: var(--grey-900);
  font-weight: 800;
  font-size: .8rem;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.no-ads-badge {
  background: var(--green-light);
  color: var(--green-dark);
  font-weight: 700;
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid var(--green);
}

.teacher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 700px) {
  .teacher-grid { grid-template-columns: 1fr; }
}

.teacher-card {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.teacher-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
}

.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.form-row input[type="text"],
.form-row select,
select.full-width,
input.full-width {
  width: 100%;
  padding: 10px 14px;
  font-size: .95rem;
  border: 2px solid var(--grey-200);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
  background: var(--white);
}
.form-row input:focus,
.form-row select:focus { border-color: var(--green); }

select.full-width { margin-bottom: 12px; }

.preset-desc {
  font-size: .85rem;
  color: var(--grey-700);
  font-style: italic;
  margin-bottom: 12px;
  min-height: 1.2em;
}

.t-word-list {
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  border: 2px dashed var(--grey-200);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.t-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green-light);
  border: 1px solid var(--green);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--green-dark);
}

.t-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--grey-700);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.t-remove:hover { color: #c00; }

.empty-list { color: var(--grey-400); font-style: italic; font-size: .9rem; }

.toggle-option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.toggle-option-row label {
  font-size: .9rem;
  font-weight: 600;
  color: var(--grey-700);
  cursor: pointer;
}

/* iOS-style toggle */
.ios-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 44px;
  height: 24px;
  background: var(--grey-200);
  border-radius: 50px;
  cursor: pointer;
  position: relative;
  transition: background .2s;
}
.ios-toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.ios-toggle:checked { background: var(--green); }
.ios-toggle:checked::after { left: 22px; }

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.t-word-count {
  font-size: .85rem;
  color: var(--grey-700);
  margin-bottom: 8px;
  font-weight: 600;
}

.save-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.save-row input {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  border: 2px solid var(--grey-200);
  border-radius: var(--radius);
  font-size: .9rem;
  outline: none;
}
.save-row input:focus { border-color: var(--green); }

/* ── Whiteboard Modal ───────────────────────────────────────── */
#wb-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: #0a1f0d;
  z-index: 9999;
}
#wb-modal.active { display: flex; align-items: center; justify-content: center; }

.wb-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.wb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(255,255,255,.06);
}

#wb-progress {
  font-size: 1.1rem;
  color: rgba(255,255,255,.7);
  font-weight: 600;
}

.wb-controls {
  display: flex;
  gap: 12px;
}

.wb-controls button {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--white);
  border-radius: var(--radius);
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}
.wb-controls button:hover { background: rgba(255,255,255,.22); }
#wb-reveal-btn { background: var(--gold); color: var(--grey-900); border-color: var(--gold); }
#wb-reveal-btn:hover { background: var(--gold-dark); }
#wb-close { background: rgba(200,0,0,.4); border-color: transparent; }

.wb-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 40px;
}

#wb-scrambled {
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 900;
  letter-spacing: 16px;
  color: var(--gold);
  text-align: center;
  text-shadow: 0 4px 24px rgba(0,0,0,.4);
}

#wb-answer {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 900;
  color: var(--white);
  letter-spacing: 8px;
  text-align: center;
  transition: opacity .3s;
}

#wb-def {
  font-size: clamp(1rem, 3vw, 1.8rem);
  color: rgba(255,255,255,.8);
  font-style: italic;
  text-align: center;
  max-width: 800px;
}

.wb-hidden { opacity: 0; pointer-events: none; }

/* ── Premium Teaser ─────────────────────────────────────────── */
.premium-teaser {
  background: linear-gradient(135deg, #fff9e0 0%, #e8f5ec 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 32px 0;
  text-align: center;
}
.premium-teaser h3 { color: var(--green-dark); margin-bottom: 8px; }
.premium-teaser p  { color: var(--grey-700); font-size: .9rem; margin-bottom: 16px; }

.email-capture {
  display: flex;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
}
.email-capture input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  font-size: .95rem;
  outline: none;
}
.email-capture input:focus { border-color: var(--green); }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.8);
  padding: 40px 20px 24px;
  margin-top: 48px;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

@media (max-width: 700px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-brand h2 { font-size: 1.3rem; color: var(--white); margin-bottom: 8px; }
.footer-brand p  { font-size: .85rem; line-height: 1.6; }

.footer-col h3 {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 12px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a  { color: rgba(255,255,255,.75); font-size: .9rem; transition: color var(--transition); }
.footer-col a:hover { color: var(--white); text-decoration: none; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--green-dark);
  color: var(--white);
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600;
  font-size: .95rem;
  opacity: 0;
  transition: all .3s ease;
  z-index: 10000;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.shake { animation: shake .4s ease; }

/* ── SEO Page specifics ─────────────────────────────────────── */
.seo-hero {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--grey-200);
  margin-bottom: 24px;
}
.seo-hero h1 { font-size: 1.8rem; color: var(--green-dark); margin-bottom: 6px; }
.seo-hero p  { color: var(--grey-700); }
.letter-display {
  display: inline-block;
  background: var(--gold-light);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 6px 20px;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--green-dark);
  margin-bottom: 12px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .search-row { flex-direction: column; }
  .header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .logo-tagline { display: none; }
  .action-row { flex-direction: column; }
  .daily-input-row { flex-direction: column; }
  .email-capture { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
}
