/* ------------------------------------------------------------------
   Jotto
   Guess a secret five-letter word from jot counts alone.
   Setup → (two players: secrets + hand-offs) → play → result.
------------------------------------------------------------------ */

.jotto-page {
  --jt-bg: #111315;
  --jt-text: #f1f7ee;
  --jt-accent: #ff2959;
  --jt-accent-hover: #e32751;
  --jt-in: #3a9e62;
  --jt-card-bg: #f1f7ee;
  --jt-card-text: #1b2a31;
  --jt-line: rgba(241, 247, 238, 0.14);
  --jt-chip: rgba(241, 247, 238, 0.08);
}

.jt-stage {
  width: 100%;
  min-height: calc(100vh - 64px);
  padding: 28px 16px 48px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--jt-bg);
  color: var(--jt-text);
}
.jt-screen {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.jt-screen[hidden] { display: none; }

.jt-title {
  font-family: 'Crete Round', serif;
  font-weight: 400;
  font-size: clamp(28px, 6vw, 40px);
  margin: 0;
  text-align: center;
}
.jt-sub { margin: -10px 0 0; font-size: 15px; opacity: 0.75; text-align: center; color: inherit; }
.jt-eyebrow { font: 700 12px 'Inter', sans-serif; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }

/* --- Setup ------------------------------------------------------ */

.jt-modes { width: 100%; display: grid; gap: 12px; }
.jt-mode {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid var(--jt-line);
  background: var(--jt-chip);
  color: var(--jt-text);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.jt-mode:hover { background: rgba(241, 247, 238, 0.14); border-color: var(--jt-accent); }
.jt-mode strong { font: 400 22px 'Crete Round', serif; }
.jt-mode span { font-size: 14px; opacity: 0.75; }
.jt-best { margin: 0; font-size: 14px; opacity: 0.75; color: inherit; }
.jt-best[hidden] { display: none; }

/* --- Cards and forms -------------------------------------------- */

.jt-card {
  width: 100%;
  border-radius: 24px;
  padding: 22px 20px;
  background: var(--jt-card-bg);
  color: var(--jt-card-text);
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45);
}

.jt-form { width: 100%; display: flex; gap: 8px; margin-top: 12px; }
.jt-input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid rgba(27, 42, 49, 0.15);
  background: #fff;
  color: var(--jt-card-text);
  font: 600 22px 'Inter', sans-serif;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.jt-input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 400; }
.jt-input:focus { outline: none; border-color: var(--jt-accent); }
.jt-input:disabled { opacity: 0.5; }
.jt-go {
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: var(--jt-accent);
  color: #fff;
  font: 400 20px 'Crete Round', serif;
  cursor: pointer;
}
.jt-go:hover { background: var(--jt-accent-hover); }
.jt-go:disabled { opacity: 0.35; cursor: default; }

.jt-feedback { min-height: 1.4em; margin: 10px 0 0; font-size: 15px; color: inherit; }
.jt-feedback.is-bad { color: #c41d45; }
#jt-secret .jt-feedback.is-bad { color: #ffb3c4; }

/* --- Guesses ---------------------------------------------------- */

.jt-guesses { margin: 8px 0 0; padding: 0; list-style: none; }
.jt-guesses li {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 6px 0;
}
.jt-guesses li + li { border-top: 1px solid rgba(27, 42, 49, 0.08); }
.jt-tiles { display: flex; gap: 4px; }
.jt-tile {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 2px solid rgba(27, 42, 49, 0.15);
  font: 700 18px 'Inter', sans-serif;
  text-transform: uppercase;
}
.jt-tile.is-out { border-color: transparent; background: rgba(27, 42, 49, 0.08); color: rgba(27, 42, 49, 0.35); text-decoration: line-through; }
.jt-tile.is-in { border-color: var(--jt-in); background: var(--jt-in); color: #fff; }
.jt-jots {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--jt-card-text);
  color: #fff;
  font: 400 22px 'Crete Round', serif;
}
.jt-jots.is-zero { background: rgba(27, 42, 49, 0.25); }

/* --- Notes keyboard --------------------------------------------- */

.jt-notes { width: 100%; }
.jt-notes-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.jt-legend { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 400; opacity: 0.75; }
.jt-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.jt-legend i.is-out { background: rgba(241, 247, 238, 0.2); }
.jt-legend i.is-in { background: var(--jt-in); }
.jt-keys { display: flex; flex-direction: column; gap: 6px; }
.jt-keys div { display: flex; justify-content: center; gap: 5px; }
.jt-key {
  flex: 0 1 40px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  background: rgba(241, 247, 238, 0.16);
  color: var(--jt-text);
  font: 700 16px 'Inter', sans-serif;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
}
.jt-key.is-out { background: rgba(241, 247, 238, 0.04); color: rgba(241, 247, 238, 0.3); text-decoration: line-through; }
.jt-key.is-in { background: var(--jt-in); color: #fff; }
.jt-notes-hint { margin: 8px 0 0; font-size: 13px; opacity: 0.6; text-align: center; color: inherit; }

/* --- Hand-off and result ---------------------------------------- */

.jt-pass, .jt-result { padding: 36px 28px; }
.jt-pass-name, .jt-result-word {
  margin: 8px 0;
  font-family: 'Crete Round', serif;
  font-size: clamp(40px, 11vw, 56px);
  line-height: 1.05;
  color: inherit;
}
.jt-result-word { text-transform: uppercase; letter-spacing: 0.08em; }
.jt-result-word:empty { display: none; }
.jt-pass-note, .jt-result-note { margin: 0; font-size: 15px; opacity: 0.8; color: inherit; }

/* --- Buttons ---------------------------------------------------- */

.jt-btn {
  background: var(--jt-accent);
  color: #fff;
  font-family: 'Crete Round', serif;
  font-size: 22px;
  padding: 16px 40px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 8px 24px -10px rgba(255, 41, 89, 0.6);
  transition: background 0.2s ease, transform 0.1s ease;
}
.jt-btn:hover { background: var(--jt-accent-hover); }
.jt-btn:active { transform: translateY(1px); }
.jt-btn[hidden] { display: none; }
.jt-btn-ghost { background: transparent; border: 1px solid var(--jt-line); box-shadow: none; font-size: 18px; padding: 12px 28px; }
.jt-btn-ghost:hover { background: var(--jt-chip); }
.jt-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
#jt-pass-turn { background: var(--jt-accent); border-color: var(--jt-accent); }

/* --- Rules and content ------------------------------------------ */

.jt-rules {
  background: var(--jt-bg);
  color: var(--jt-text);
  padding: 48px 0 32px;
  border-top: 1px solid var(--jt-line);
  font-family: 'Crete Round', serif;
}
.jt-rules .game-h1 { font-family: 'Crete Round', serif; font-weight: 400; font-size: 46px; text-align: center; margin: 0 0 4px; }
.jt-rules h2 { font-family: 'Crete Round', serif; font-weight: 400; font-size: 30px; text-align: center; opacity: 0.85; margin: 0 0 24px; }
.jt-rules .prose { max-width: 62ch; margin: 0 auto; opacity: 0.92; line-height: 1.6; }
.jt-rules .prose p { color: inherit; }
.jt-credit { margin-top: 32px; font-size: 13px; opacity: 0.7; }
