* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-user-select: none; }

body {
  background-color: #000;
  font-family: 'Syne', 'Syne', sans-serif;
  color: #f7f709;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px 12px;
}

main {
  max-width: 560px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ── Canvas ── */
.beta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}
.testing-canvas {
  width: 100%;
  display: flex;
  justify-content: center;
}

#beta-canvas {
  width: 65%;
  height: auto;
  display: block;
  cursor: default;
}

#foto-input { display: none; }

/* ── Controls row ── */
.controls {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 75%;
  gap: 0;
  margin-top: 6px;
}

/* shared */
.controls button,
.ctrl-input-wrap {
  height: 30px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 2px solid #f7f709;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* UPLOAD */
#btn-foto {
  background-color: #f7f709;
  color: #000;
  padding: 0 12px;
  border-color: #f7f709;
  flex: 0 0 auto;
  min-width: 72px;
  white-space: nowrap;
}
#btn-foto:hover { background-color: #e6e600; }

/* Input wrappers */
.ctrl-input-wrap {
  flex: 1;
  position: relative;
  background-color: #000;
  border-color: #f7f709;
  cursor: text;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  margin-left: -2px;
}

.ctrl-input-wrap label {
  display: block;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: #f7f709;
  text-transform: uppercase;
  padding: 3px 8px 0;
  line-height: 1;
  pointer-events: none;
}

.ctrl-input-wrap input,
.ctrl-input-wrap input[type="date"] {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: #f7f709;
  text-transform: uppercase;
  padding: 1px 8px 3px;
  caret-color: #f7f709;
  -webkit-text-fill-color: #f7f709;
  color-scheme: dark;
  user-select: text;
  -webkit-user-select: text;
}

.ctrl-input-wrap input::placeholder {
  color: rgba(247, 247, 9, 0.35);
  -webkit-text-fill-color: rgba(247, 247, 9, 0.35);
}

.ctrl-input-wrap input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0px 1000px #000 inset;
  -webkit-text-fill-color: #f7f709;
}

/* DOWNLOAD */
#btn-download {
  background-color: #f7f709;
  color: #000;
  border-color: #f7f709;
  flex: 0 0 auto;
  width: 38px;
  margin-left: -2px;
}
#btn-download:hover { background-color: #e6e600; }
#btn-download svg { stroke: #000; width: 14px; height: 14px; }

/* ── Tablet (max 600px) ── */
@media (max-width: 600px) {
  body { padding: 12px 10px; }

  .controls {
    flex-wrap: wrap;
    gap: 0;
  }

  #btn-foto {
    flex: 1 1 auto;
    min-width: unset;
    margin-bottom: -2px;
  }

  #btn-download {
    flex: 0 0 48px;
    margin-left: -2px;
    margin-bottom: -2px;
  }

  /* DOB and tweet each take half the row */
  .ctrl-input-wrap {
    flex: 1 1 45%;
    margin-left: 0;
    margin-top: -2px;
  }

  #dob-wrap  { margin-right: -2px; }
}

/* ── Mobile (max 400px) ── */
@media (max-width: 400px) {
  .ctrl-input-wrap { flex: 1 1 100%; }
  #dob-wrap { margin-right: 0; margin-bottom: -2px; }
}

/* ── Custom date picker popup ── */
#cal-popup {
  position: fixed;
  background: #000;
  border: 2px solid #f7f709;
  padding: 14px;
  width: 260px;
  z-index: 9999;
  font-family: 'Syne', sans-serif;
  color: #f7f709;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 6px;
}

.cal-header button {
  background: transparent;
  border: none;
  color: #f7f709;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 4px 6px;
  text-transform: uppercase;
}
.cal-header button:hover { color: #f7f709; opacity: 0.7; }

#cal-month-year {
  flex: 1;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  border: 1px solid #f7f709 !important;
  padding: 4px 6px !important;
}

.cal-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: rgba(247,247,9,0.5);
  margin-bottom: 4px;
}

#cal-popup.mode-my .cal-dow { display: none; }

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-days button {
  background: transparent;
  border: none;
  color: #f7f709;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 5px 0;
  cursor: pointer;
  text-align: center;
}
.cal-days button:hover:not(:disabled) { background: #f7f709; color: #000; }
.cal-days button:disabled { color: rgba(247,247,9,0.2); cursor: default; }
.cal-days button.cal-today { outline: 1px solid #f7f709; }
.cal-days button.cal-selected { background: #f7f709; color: #000; }
.cal-days button.cal-empty { visibility: hidden; pointer-events: none; }

#cal-clear {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid #f7f709;
  color: #f7f709;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  padding: 5px;
  cursor: pointer;
  text-transform: uppercase;
}
#cal-clear:hover { background: #f7f709; color: #000; }

#dob-display { cursor: pointer; }

/* ── Month/year picker ── */
.cal-year-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  margin-bottom: 8px;
}

.cal-year-grid button {
  background: transparent;
  border: none;
  color: #f7f709;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 5px 2px;
  cursor: pointer;
  text-align: center;
}
.cal-year-grid button:hover { background: #f7f709; color: #000; }
.cal-year-grid button.cal-selected { background: #f7f709; color: #000; }

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.cal-month-grid button {
  background: transparent;
  border: none;
  color: #f7f709;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 7px 2px;
  cursor: pointer;
  text-align: center;
}
.cal-month-grid button:hover:not(:disabled) { background: #f7f709; color: #000; }
.cal-month-grid button:disabled { color: rgba(247,247,9,0.2); cursor: default; }
.cal-month-grid button.cal-selected { background: #f7f709; color: #000; }

/* ── Crossword controls ── */
.crossword-controls {
  width: 75%;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cw-words-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cw-word-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  margin-top: -2px;
}

.cw-word-row .ctrl-input-wrap {
  flex: 3;
  margin-left: -2px;
}

.cw-word-row .cw-num {
  flex: 0 0 60px;
  cursor: default;
}

/* Shared style for ALL cw buttons: dir, arrows, remove */
.cw-word-row .cw-dir,
.cw-word-row .cw-remove,
.cw-arrow-btns button {
  height: 30px;
  width: 30px;
  flex: 0 0 30px;
  background: transparent;
  border: 2px solid #f7f709;
  color: #f7f709;
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  margin-left: -2px;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.cw-word-row .cw-dir:first-child { margin-left: 0; }

.cw-word-row .cw-dir:hover,
.cw-word-row .cw-remove:hover,
.cw-arrow-btns button:hover { background: #f7f709; color: #000; }

.cw-word-row .cw-dir.is-down { background: #f7f709; color: #000; }

.cw-word-row .cw-dir {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
}

.cw-arrow-btns {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
}

/* ── Footer links ── */
.footer-links {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
  width: 60%;
}

.footer-links a {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: #f7f709;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-transform: uppercase;
  padding: 1px 3px;
}
.footer-links a:hover {
  background-color: #f7f709;
  color: #000;
  text-decoration: none;
}

.footer-sep {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.5rem;
  color: #f7f709;
  opacity: 0.5;
}

/* ── Password gate ── */
#gate {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#gate.unlocked { display: none; }

.gate-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 220px;
}

.gate-label {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: #f7f709;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.gate-box input {
  width: 100%;
  height: 36px;
  background: #000;
  border: 2px solid #f7f709;
  color: #f7f709;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-align: center;
  outline: none;
  box-sizing: border-box;
  caret-color: #f7f709;
}

.gate-box input::placeholder { color: rgba(247,247,9,0.3); font-size: 0.6rem; letter-spacing: 0.15em; }

.gate-box button {
  width: 100%;
  height: 36px;
  margin-top: -2px;
  background: #f7f709;
  border: 2px solid #f7f709;
  color: #000;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  text-transform: uppercase;
}
.gate-box button:hover { background: #e6e600; }

.gate-error {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: #f7f709;
  opacity: 0.6;
  margin-top: 8px;
  text-transform: uppercase;
}

/* ── Footer hint & copy caption ── */
.footer-hint {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.48rem;
  color: rgba(247,247,9,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-top: 8px;
}

#btn-copy-caption {
  margin-top: 6px;
  width: auto;
  padding: 0 16px;
  height: 32px;
  background: transparent;
  border: 2px solid #f7f709;
  color: #f7f709;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  cursor: pointer;
  text-transform: uppercase;
}
#btn-copy-caption:hover { background: #f7f709; color: #000; }
#btn-copy-caption.copied { background: #f7f709; color: #000; }
.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.site-logo {
  height: 32px;
  width: auto;
  display: block;
}

@media (max-width: 600px) {
  .site-logo { height: 24px; }
}
