/* Middle Word Unlimited — paper dictionary / alphabet-index theme */

:root{
  --cream: #faf3e6;
  --cream-deep: #f2e6cf;
  --paper: #fffdf8;
  --ink: #2c2420;
  --ink-soft: #5c5147;
  --clay: #d9682f;
  --clay-deep: #b84f1f;
  --clay-pale: #f6d9c4;
  --olive: #6f7d4f;
  --line: #e3d3b8;
  --shadow: 0 10px 24px rgba(90, 60, 20, 0.12);
  --radius: 16px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
}

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

h1, h2{
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  margin: 0 0 0.5em;
}

/* ===== Header ===== */

.site-header{
  background: var(--paper);
  border-bottom: 3px solid var(--clay);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--ink);
}
.brand:hover{ text-decoration: none; }

.brand-tab{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--clay);
  color: var(--paper);
  font-family: Georgia, serif;
  font-weight: bold;
  border-radius: 8px 8px 8px 0;
  box-shadow: var(--shadow);
}

.brand-text em{
  font-style: normal;
  color: var(--clay-deep);
}

.main-nav{
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.main-nav a{
  color: var(--ink-soft);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.main-nav a:hover{
  text-decoration: none;
  background: var(--clay-pale);
  border-color: var(--clay);
  color: var(--clay-deep);
}

/* ===== Hero / Game ===== */

.hero{
  background:
    repeating-linear-gradient(0deg, transparent, transparent 38px, rgba(90,60,20,0.05) 39px),
    var(--cream-deep);
  padding: 44px 24px 56px;
  border-bottom: 1px solid var(--line);
}

.hero-inner{
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.eyebrow{
  display: inline-block;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--clay-deep);
  background: var(--clay-pale);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 14px;
}

.hero h1{
  font-size: clamp(2rem, 5vw, 2.8rem);
  margin-bottom: 0.3em;
}

.hero-lede{
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto 10px;
}

.version-line{
  font-size: 0.82rem;
  color: var(--ink-soft);
  opacity: 0.8;
  margin: 0 0 28px;
}

.game-shell{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px clamp(16px, 4vw, 36px) 32px;
  text-align: left;
}

.mode-row{
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.mode-btn{
  font: inherit;
  font-weight: 700;
  padding: 10px 26px;
  border-radius: 999px;
  border: 2px solid var(--clay);
  background: transparent;
  color: var(--clay-deep);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-btn.is-active,
.mode-btn:hover{
  background: var(--clay);
  color: var(--paper);
}

.game-desc{
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 560px;
  margin: 0 auto 24px;
}

.board{
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

.boundary{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--olive);
  color: var(--paper);
}

.boundary-top{
  border-bottom: 2px dashed rgba(255,255,255,0.4);
}

.boundary-bottom{
  background: var(--clay-deep);
  border-top: 2px dashed rgba(255,255,255,0.4);
}

.boundary-label{
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

.boundary-word{
  font-family: Georgia, serif;
  font-weight: bold;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

#game-root{
  min-height: 220px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(217,104,47,0.03), transparent 20%, transparent 80%, rgba(111,125,79,0.04)),
    var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.guess-form{
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.guess-input{
  flex: 1;
  font: inherit;
  font-size: 1.05rem;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--cream);
  color: var(--ink);
}

.guess-input:focus{
  outline: none;
  border-color: var(--clay);
}

.guess-submit{
  font: inherit;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  background: var(--clay);
  color: var(--paper);
  cursor: pointer;
}

.guess-submit:hover{ background: var(--clay-deep); }

.aux-row{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.aux-btn{
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  cursor: pointer;
}

.aux-btn:hover{
  border-color: var(--clay);
  color: var(--clay-deep);
}

/* ===== Content sections ===== */

.content-section{
  padding: 48px 24px;
}

.content-section.alt{
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.content-inner{
  max-width: 760px;
  margin: 0 auto;
}

.content-section h2{
  font-size: 1.5rem;
  border-left: 5px solid var(--clay);
  padding-left: 12px;
}

.content-section p{
  color: var(--ink-soft);
  margin: 0 0 1em;
}

/* link cards */

.links-section{
  background: var(--cream-deep);
}

.link-cards{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.link-card{
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.link-card:hover{
  text-decoration: none;
  transform: translateY(-3px);
  border-color: var(--clay);
}

.link-card-title{
  font-weight: 700;
  color: var(--clay-deep);
}

.link-card-desc{
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* FAQ */

.faq-section{
  background: var(--paper);
}

.faq-list{
  margin: 20px 0 0;
}

.faq-item{
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.faq-item:last-child{
  border-bottom: 1px solid var(--line);
}

.faq-item dt{
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.faq-item dd{
  margin: 0;
  color: var(--ink-soft);
}

/* disclaimer */

.disclaimer-section{
  padding-top: 0;
  padding-bottom: 36px;
}

.disclaimer{
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0.85;
}

/* ===== Footer ===== */

.site-footer{
  background: var(--ink);
  color: var(--cream);
  padding: 32px 24px;
}

.footer-inner{
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.footer-links{
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.footer-links a{
  color: var(--cream);
  font-weight: 600;
}

.footer-links a:hover{
  color: var(--clay-pale);
}

.footer-disclaimer,
.footer-original{
  font-size: 0.82rem;
  color: rgba(250, 243, 230, 0.75);
  margin: 4px 0;
}

.footer-original a{
  color: var(--clay-pale);
}

@media (max-width: 560px){
  .guess-form{ flex-direction: column; }
  .boundary-word{ font-size: 1rem; }
}

/* ===== Dynamic game board ===== */

#game-root{
  display: block;
  text-align: left;
}

.mw-statusline{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 4px 14px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.mw-statusline strong{
  color: var(--clay-deep);
  white-space: nowrap;
}

.mw-columns{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mw-list{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,253,248,0.72);
  min-height: 150px;
  padding: 12px;
}

.mw-list h3{
  margin: 0 0 10px;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.mw-list ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mw-guess{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--cream);
  border: 1px solid rgba(227,211,184,0.8);
}

.mw-guess strong{
  font-family: Georgia, serif;
  font-size: 1.02rem;
  color: var(--ink);
}

.mw-guess span{
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}

.mw-guess span b{
  color: var(--clay-deep);
  font-size: 0.95rem;
}

.mw-guess span small{
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.mw-before .mw-guess{
  border-left: 4px solid var(--olive);
}

.mw-after .mw-guess{
  border-left: 4px solid var(--clay-deep);
}

.mw-guess.is-correct{
  background: #edf5df;
  border-color: var(--olive);
}

.mw-empty{
  margin: 8px 0;
  color: rgba(92,81,71,0.72);
  font-size: 0.88rem;
}

.mw-feedback{
  margin: 12px 2px 0;
  min-height: 1.4em;
  color: var(--ink-soft);
  font-size: 0.9rem;
  text-align: center;
}

.mw-result{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.mw-result b{
  font-family: Georgia, serif;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--clay-deep);
}

.mw-result span{
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.mw-result.is-win{ border-color: var(--olive); }
.mw-result.is-loss{ border-color: var(--clay-deep); }

.guess-input:disabled,
.guess-submit:disabled{
  opacity: 0.58;
  cursor: not-allowed;
}

@media (max-width: 620px){
  .mw-columns{ grid-template-columns: 1fr; }
  .mw-list{ min-height: 0; }
  .mw-result{ align-items: flex-start; flex-direction: column; gap: 6px; }
}

/* ===== Inner pages ===== */

.inner-hero{
  padding-bottom: 44px;
}

.hero-inner.narrow{
  max-width: 680px;
}

.trust-page h1,
.inner-hero h1{
  font-size: clamp(2rem, 5vw, 2.6rem);
}

.answer-card{
  margin-top: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px clamp(18px, 4vw, 36px);
}

.answer-meta{
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.answer-bounds{
  text-align: center;
  color: var(--ink-soft);
  margin: 18px 0;
}

.answer-reveal-box{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  background: var(--cream);
  border: 1px dashed var(--clay);
}

.answer-word{
  font-family: Georgia, serif;
  font-size: clamp(2rem, 7vw, 3.3rem);
  font-weight: bold;
  color: var(--ink);
  filter: blur(10px);
  user-select: none;
  transition: filter 0.25s ease;
}

.answer-card.is-revealed .answer-word{
  filter: blur(0);
  user-select: text;
}

.answer-reveal-btn{
  font: inherit;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  background: var(--clay);
  color: var(--paper);
  cursor: pointer;
}

.answer-reveal-btn:disabled{
  opacity: 0.7;
  cursor: default;
}

.answer-note{
  text-align: center;
  font-size: 0.84rem;
  color: var(--ink-soft);
  margin-bottom: 0;
}

.rule-steps{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.rule-steps > div{
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.rule-steps b{
  color: var(--clay-deep);
}

.faq-section details{
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.faq-section details:last-child{
  border-bottom: 1px solid var(--line);
}

.faq-section summary{
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}

.faq-section details p{
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.trust-page{
  min-height: 46vh;
}

.contact-email{
  font-weight: 700;
  font-size: 1.1em;
}

/* ===== Static data tables ===== */

.data-table{
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(44, 36, 32, 0.05);
}

.data-table th,
.data-table td{
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table thead th{
  background: rgba(111, 125, 79, 0.13);
  color: var(--clay-deep);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td{
  border-bottom: none;
}

.answer-static-details{
  margin-top: 14px;
}

.answer-static-details summary{
  cursor: pointer;
  font-weight: 700;
  color: var(--clay-deep);
  margin-bottom: 12px;
}

@media (max-width: 640px){
  .data-table{
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
