/* ============================================================
   SPOT-THE-DIFFERENCE — style.css
   Palette: #1B3659 | #0867CC | #1EBFF5 | #F40C0C
   Tone: editorial / newspaper / elegant
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy:   #1B3659;
  --blue:   #0867CC;
  --cyan:   #1EBFF5;
  --red:    #F40C0C;
  --ink:    #111111;
  --paper:  #F8F6F1;
  --mid:    #888880;
  --rule:   #D0CBC0;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', 'Helvetica Neue', sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- HEADER ---------- */
#site-header {
  border-bottom: 2px solid var(--ink);
  padding: 20px 32px 16px;
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-brand {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.header-rule {
  height: 48px;
  width: 3px;
  background: var(--red);
  flex-shrink: 0;
}

.header-titles {
  display: flex;
  flex-direction: column;
  line-height: 1;
  gap: 3px;
}

.brand-kicker {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.01em;
  line-height: 1;
}

.brand-byline {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.2vw, 0.95rem);
  font-weight: 400;
  font-style: italic;
  color: var(--mid);
}

/* Language switcher */
.header-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.lang-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--mid);
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.15s;
}

.lang-btn:hover,
.lang-btn.active {
  color: var(--navy);
}

.lang-btn.active {
  border-bottom: 2px solid var(--red);
}

.lang-sep {
  color: var(--rule);
  font-size: 0.8rem;
}

/* ---------- GAME AREA ---------- */
.game-area {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 32px 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

/* ---------- PANEL ---------- */
.panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Panel labels — visible on desktop & tablet, hidden on mobile */
.panel-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 6px;
}

/* ---------- IMAGE FRAME ---------- */
.image-frame {
  position: relative;
  width: 100%;
  line-height: 0;
  border: 1px solid var(--rule);
  background: #fff;
  box-shadow: 2px 2px 0 var(--rule);
  overflow: hidden;
}

.image-frame img {
  width: 100%;
  height: auto;
  display: block;
}

/* Solution overlay */
.sol-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 2;
}

.sol-overlay.hidden {
  display: none;
}

/* Drawing canvas */
#draw-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  z-index: 3;
}

/* Close solution button */
.close-sol {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--ink);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.close-sol:hover {
  background: var(--red);
}

.close-sol.hidden {
  display: none;
}

/* ---------- CIRCLES ROW ----------
   Desktop / tablet: circles on left, label flush right, all on one line */
.circles-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.circles-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mid);
  white-space: nowrap;
  text-align: right;
  flex-shrink: 0;
}

.circles {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: nowrap;
}

.circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.circle:hover {
  transform: scale(1.1);
}

.circle.checked {
  background: var(--cyan);
  border-color: var(--cyan);
}

/* ---------- BUTTONS ---------- */
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-clear {
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.btn-clear:hover {
  background: var(--ink);
  color: #fff;
}

/* Undo button — same style as btn-clear, square */
.btn-undo {
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  font-size: 1rem;
  width: 40px;
  height: 40px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-undo:hover:not(:disabled) {
  background: var(--ink);
  color: #fff;
}

.btn-undo:disabled {
  opacity: 0.25;
  cursor: default;
}

.btn-reveal {
  background: var(--ink);
  border: 1.5px solid var(--ink);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  flex: 1;
}

.btn-reveal.all-found {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #fff;
}

.btn-reveal:hover {
  opacity: 0.85;
}

/* ---------- EMAIL SIGNUP ---------- */
.signup-section {
  border-top: 2px solid var(--ink);
  padding: 28px 32px;
  background: var(--paper);
}

/* signup-inner: centres everything */
.signup-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}



.signup-rule {
  display: none;
}

/* signup-group: centered block, label above form */
.signup-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.signup-label {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.6vw, 1.1rem);
  font-weight: 400;
  font-style: italic;
  color: var(--navy);
  line-height: 1.3;
  text-align: center;
}

.signup-form {
  display: flex;
  gap: 0;
  width: auto;
}

/* ── MailerLite embedded form — override to match site style ── */

/* Nuclear reset — kill all MailerLite layout */
.ml-embedded,
.ml-embedded * {
  box-sizing: border-box !important;
  float: none !important;
}

.ml-embedded {
  width: auto !important;
  display: inline-block !important;
}

.ml-embedded .ml-form-embedWrapper,
.ml-embedded .ml-form-embedContainer,
.ml-embedded .ml-form-embedBody,
.ml-embedded .ml-form-formContent,
.ml-embedded .ml-block-form {
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  width: auto !important;
  max-width: none !important;
  display: block !important;
  box-shadow: none !important;
}

/* Force the horizontal row to be a proper flex row */
.ml-embedded .ml-form-horizontalRow,
.ml-embedded .ml-form-formContent.horozintalForm {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
}

.ml-embedded .ml-input-horizontal {
  display: flex !important;
  flex: none !important;
  width: auto !important;
}

.ml-embedded .ml-input-horizontal .horizontal-fields {
  display: flex !important;
  width: auto !important;
  padding: 0 !important;
}

.ml-embedded .ml-button-horizontal {
  display: flex !important;
  flex: none !important;
  width: auto !important;
}

/* Email input */
.ml-embedded input[type="email"] {
  width: 280px !important;
  border: 1.5px solid var(--ink) !important;
  border-right: none !important;
  border-radius: 0 !important;
  padding: 10px 14px !important;
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
  background: #fff !important;
  color: var(--ink) !important;
  outline: none !important;
  box-shadow: none !important;
  height: auto !important;
  line-height: normal !important;
  margin: 0 !important;
  display: block !important;
}

.ml-embedded input[type="email"]::placeholder {
  color: var(--mid) !important;
  font-family: var(--font-body) !important;
}

.ml-embedded input[type="email"]:focus {
  border-color: var(--blue) !important;
}

/* Submit button */
.ml-embedded button[type="submit"] {
  background: var(--navy) !important;
  border: 1.5px solid var(--navy) !important;
  border-radius: 0 !important;
  color: #fff !important;
  font-family: var(--font-body) !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
  padding: 10px 18px !important;
  cursor: pointer !important;
  transition: background 0.15s, border-color 0.15s !important;
  white-space: nowrap !important;
  height: auto !important;
  line-height: normal !important;
  width: auto !important;
  box-shadow: none !important;
  display: block !important;
  margin: 0 !important;
}

.ml-embedded button[type="submit"]:hover {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
}

/* Hide mobile duplicate button and loading state */
.ml-embedded .ml-mobileButton-horizontal,
.ml-embedded button.loading {
  display: none !important;
}

/* Success message */
.ml-embedded .ml-form-successBody {
  padding: 0 !important;
  background: none !important;
}

.ml-embedded .ml-form-successContent h4 {
  font-family: var(--font-display) !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  font-style: italic !important;
  color: var(--navy) !important;
  margin: 0 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.ml-embedded .ml-form-successContent p {
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
  color: var(--mid) !important;
  margin: 4px 0 0 !important;
}

/* Hide MailerLite built-in label text — we use our own */
.ml-embedded .ml-form-embedContent {
  display: none !important;
}

.signup-form input[type="email"] {
  flex: 1;
  border: 1.5px solid var(--ink);
  border-right: none;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.signup-form input[type="email"]::placeholder {
  color: var(--mid);
}

.signup-form input[type="email"]:focus {
  border-color: var(--blue);
}

.btn-subscribe {
  background: var(--navy);
  border: 1.5px solid var(--navy);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-subscribe:hover {
  background: var(--blue);
  border-color: var(--blue);
}

.signup-confirm {
  font-size: 0.85rem;
  color: var(--navy);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.signup-confirm.hidden {
  display: none;
}

/* ---------- FOOTER ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 16px 32px;
  text-align: center;
  font-size: 0.72rem;
  color: var(--mid);
  letter-spacing: 0.06em;
}

/* ---------- TABLET — iPad landscape (769px–1100px) ---------- */
@media (min-width: 769px) and (max-width: 1100px) {

  #site-header {
    padding: 14px 24px 12px;
    position: sticky;
  }

  .brand-title {
    font-size: 1.7rem;
  }

  .brand-byline {
    font-size: 0.8rem;
  }

  .game-area {
    padding: 20px 24px 32px;
    gap: 16px;
    max-width: 100%;
  }

  .panel {
    gap: 8px;
  }

  .circle {
    width: 24px;
    height: 24px;
  }

  .circles {
    gap: 8px;
  }

  .btn-clear,
  .btn-reveal {
    font-size: 0.72rem;
    padding: 8px 14px;
  }

  .btn-undo {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .signup-section {
    padding: 28px 24px;
  }
}

/* ---------- TABLET — iPad portrait (600px–768px) ---------- */
@media (min-width: 600px) and (max-width: 768px) {

  .game-area {
    grid-template-columns: 1fr 1fr;
    padding: 16px 20px 28px;
    gap: 14px;
  }

  .panel-left,
  .panel-right {
    order: unset;
  }

  .btn-row {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .btn-clear,
  .btn-reveal {
    width: auto;
    font-size: 0.7rem;
    padding: 8px 12px;
  }

  .btn-undo {
    width: 34px;
    height: 34px;
  }

  .circle {
    width: 22px;
    height: 22px;
  }

  .circles {
    gap: 7px;
  }

  .signup-form {
    flex-direction: row;
  }

  .signup-form input[type="email"] {
    border-right: none;
    border-bottom: 1.5px solid var(--ink);
  }

  .btn-subscribe {
    width: auto;
    padding: 10px 18px;
  }
}

/* ---------- MOBILE portrait (max 599px) ---------- */
@media (max-width: 599px) {

  /* Header scrolls with page on mobile */
  #site-header {
    padding: 12px 16px 10px;
    position: static;
  }

  .header-rule {
    display: none;
  }

  .game-area {
    grid-template-columns: 1fr;
    padding: 12px 16px 24px;
    gap: 12px;
  }

  .panel-left  { order: 1; }
  .panel-right { order: 2; }

  .panel-label {
    display: none;
  }

  .panel {
    gap: 8px;
  }

  .circles-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .circles-label {
    text-align: left;
    font-size: 0.6rem;
  }

  .circles { gap: 8px; }

  .circle {
    width: 26px;
    height: 26px;
  }

  .btn-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .btn-clear {
    font-size: 0.72rem;
    padding: 9px 14px;
  }

  .btn-reveal {
    font-size: 0.72rem;
    padding: 9px 14px;
    flex: 1;
    text-align: center;
  }

  .btn-undo {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    background: transparent;
    border: 1.5px solid var(--ink);
    color: var(--ink);
  }

  /* Signup: stack label above form on mobile */
  .signup-section {
    padding: 24px 16px;
  }

  .signup-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .signup-label {
    font-size: 0.9rem;
  }

  /* MailerLite mobile overrides */
  .ml-embedded .ml-form-horizontalRow {
    flex-direction: row !important;
    width: 100% !important;
  }

  .ml-embedded input[type="email"] {
    min-width: 0 !important;
  }
}

/* ---------- MOBILE landscape (max 599px height, orientation landscape) ---------- */
@media (max-height: 500px) and (orientation: landscape) {

  /* Header always scrolls in landscape — reclaim precious vertical space */
  #site-header {
    position: static;
    padding: 8px 16px;
  }

  .brand-title {
    font-size: 1.2rem;
  }

  .brand-kicker,
  .brand-byline {
    display: none;
  }

  .header-rule {
    height: 32px;
  }

  .game-area {
    grid-template-columns: 1fr 1fr;
    padding: 10px 16px 20px;
    gap: 12px;
  }

  /* Restore two-column for landscape */
  .panel-left,
  .panel-right {
    order: unset;
  }

  .panel-label {
    display: none;
  }

  .panel {
    gap: 6px;
  }

  .circles-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .circles-label {
    text-align: right;
    font-size: 0.6rem;
  }

  .circle {
    width: 22px;
    height: 22px;
  }

  .circles { gap: 6px; }

  .btn-row {
    flex-direction: row;
    gap: 6px;
  }

  .btn-clear,
  .btn-reveal {
    font-size: 0.68rem;
    padding: 7px 10px;
  }

  .btn-undo {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }
}
