
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --pink: #8B5CF6;
  --pink-light: #A78BFA;
  --black: #111111;
  --gray: #777777;
  --light-gray: #eeeeee;
  --background: #ffffff;
  --yellow: #f9df6d;
  --green: #a0c35a;
  --blue: #b0c4ef;
  --purple: #ba81c5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--black);
  font-family: 'DM Sans', sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.topbar {
  width: 100%;
  min-height: 72px;
  padding: 0 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--light-gray);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--black);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
}

.brand strong {
  color: var(--pink);
  font-weight: 600;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  background: var(--pink);
  color: white;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
}

.archive-button {
  background: white;
  border: 1px solid var(--black);
  color: var(--black);
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  transition: 0.2s;
}

.archive-button:hover {
  background: var(--black);
  color: white;
}

.archive-button span {
  margin-left: 7px;
  color: var(--pink);
}

.page-container {
  width: min(1120px, 90%);
  margin: 0 auto;
}

.intro {
  padding: 65px 0 40px;
}

.eyebrow {
  color: var(--pink);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 0 0 10px;
}

.intro h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.1;
  margin: 0;
  letter-spacing: -2px;
}

.intro h1 span {
  color: var(--pink);
}

.intro-description {
  color: var(--gray);
  font-size: 14px;
  margin-top: 14px;
}

.puzzle-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  border-top: 1px solid var(--light-gray);
  padding: 25px 0 17px;
}

.puzzle-heading h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  margin: 0;
}

.mistakes-container {
  text-align: right;
}

.mistakes-label {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 9px;
}

.mistake-dots {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.mistake-dots span {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pink);
}

.mistake-dots span.used {
  background: #dedede;
}

.message {
  min-height: 38px;
  padding: 10px 13px;
  background: #fafafa;
  border: 1px solid var(--light-gray);
  border-radius: 7px;
  color: #555;
  font-size: 12px;
  margin-bottom: 20px;
}

.message.success {
  background: var(--pink-light);
  border-color: #ffc5df;
  color: #b00055;
}

.message.error {
  background: #fff4f4;
  border-color: #ffd4d4;
  color: #b42318;
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 25px;
  align-items: start;
}

.game-main {
  min-width: 0;
}

.solved-groups {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 12px;
}

.solved-group {
  padding: 17px 12px;
  text-align: center;
  border-radius: 8px;
  color: var(--black);
  animation: appear 0.25s ease;
}

.solved-group .category-name {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 7px;
}

.solved-group .category-answers {
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.solved-group.yellow { background: var(--yellow); }
.solved-group.green { background: var(--green); }
.solved-group.blue { background: var(--blue); }
.solved-group.purple { background: var(--purple); }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.tile {
  min-height: 92px;
  padding: 10px 6px;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  background: #f4f4f4;
  color: var(--black);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: 0.15s ease;
}

.tile:hover {
  border-color: var(--pink);
  background: var(--pink-light);
}

.tile.selected {
  background: var(--black);
  border-color: var(--black);
  color: white;
  transform: translateY(-2px);
}

.tile:focus-visible,
button:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 3px;
}

.game-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 20px 0 0;
}

.control-button,
.submit-button {
  min-width: 105px;
  padding: 11px 17px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  transition: 0.2s;
}

.control-button {
  background: white;
  border: 1px solid var(--black);
  color: var(--black);
}

.control-button:hover {
  background: var(--black);
  color: white;
}

.submit-button {
  background: var(--pink);
  border: 1px solid var(--pink);
  color: white;
}

.submit-button:hover:not(:disabled) {
  background: #e60070;
}

.hints-panel {
  border: 1px solid var(--light-gray);
  border-radius: 10px;
  padding: 20px;
  background: white;
}

.hints-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hints-header h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  font-size: 22px;
}

.hint-count {
  padding: 6px 9px;
  background: var(--pink-light);
  color: #c00060;
  font-size: 9px;
  font-weight: 800;
  border-radius: 20px;
  white-space: nowrap;
}

.hints-description {
  color: var(--gray);
  font-size: 12px;
  line-height: 1.6;
  margin: 12px 0 20px;
}

.hint-section-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--gray);
  margin: 18px 0 10px;
}

.hint-card {
  padding: 12px;
  background: var(--pink-light);
  border: 1px solid #ffd2e6;
  border-radius: 7px;
  margin-bottom: 8px;
}

.hint-card strong {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}

.hint-card span {
  font-size: 11px;
  color: #8d2857;
}

.hint-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 11px 12px;
  margin-bottom: 7px;
  background: white;
  border: 1px solid var(--light-gray);
  border-radius: 7px;
  color: var(--black);
  text-align: left;
  font-size: 11px;
  font-weight: 700;
}

.hint-button:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.hint-button span {
  color: var(--pink);
  font-size: 16px;
}

.hint-button:disabled {
  display: none;
}

.game-over {
  margin-top: 20px;
  padding: 22px;
  border: 1px solid var(--light-gray);
  border-radius: 9px;
  text-align: center;
}

.game-over h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin: 0 0 8px;
}

.game-over p:not(.eyebrow) {
  color: var(--gray);
  font-size: 13px;
  line-height: 1.6;
}

.game-over button {
  margin: 8px 4px 0;
}

.hidden {
  display: none !important;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--light-gray);
  margin-top: 65px;
  padding: 22px 0;
  color: var(--gray);
  font-size: 10px;
  letter-spacing: 0.5px;
}

/* ARCHIVE MODAL */

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.archive-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  height: 100%;
  padding: 30px;
  overflow-y: auto;
  background: white;
  box-shadow: -10px 0 40px rgba(0,0,0,0.1);
  animation: slideIn 0.25s ease;
}

.archive-header {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.archive-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 26px;
  letter-spacing: -1px;
  margin: 0;
}

.archive-subtitle {
  font-size: 12px;
  color: var(--gray);
}

.close-button {
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  border: 1px solid var(--light-gray);
  background: white;
  border-radius: 50%;
  font-size: 22px;
}

.close-button:hover {
  background: var(--black);
  color: white;
}

.archive-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 25px 0;
}

.archive-stats div {
  padding: 15px;
  background: #f7f7f7;
  border-radius: 8px;
}

.archive-stats strong {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 24px;
}

.archive-stats span {
  display: block;
  color: var(--gray);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 3px;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.archive-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
}

.archive-item.current {
  border-color: var(--pink);
  background: var(--pink-light);
}

.archive-item-info strong {
  display: block;
  font-size: 12px;
}

.archive-item-info span {
  display: block;
  color: var(--gray);
  font-size: 10px;
  margin-top: 4px;
}

.archive-action {
  flex-shrink: 0;
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  background: var(--black);
  color: white;
  font-size: 9px;
  font-weight: 800;
}

.archive-action.solved {
  background: var(--pink);
}

.archive-empty {
  padding: 25px 10px;
  text-align: center;
  color: var(--gray);
  font-size: 12px;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 760px) {
  .topbar {
    padding: 0 5%;
  }

  .brand {
    font-size: 10px;
  }

  .archive-button {
    font-size: 10px;
    padding: 9px 11px;
  }

  .intro {
    padding: 45px 0 30px;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .hints-panel {
    order: 2;
  }

  .board {
    gap: 6px;
  }

  .tile {
    min-height: 78px;
    font-size: 10px;
    padding: 7px 4px;
  }

  .footer {
    flex-direction: column;
  }

  .archive-panel {
    padding: 23px 18px;
  }
}

@media (max-width: 380px) {
  .tile {
    font-size: 9px;
    min-height: 70px;
  }

  .control-button,
  .submit-button {
    min-width: 90px;
    padding: 10px 12px;
  }
}

/* SHARE BUTTON */

.share-button {
  min-width: 130px;
  padding: 11px 17px;
  border-radius: 7px;
  background: var(--pink-light);
  border: 1px solid var(--pink);
  color: var(--pink);
  font-size: 12px;
  font-weight: 800;
  transition: 0.2s;
}

.share-button:hover {
  background: var(--pink);
  color: white;
}

/* SHARE MODAL */

.share-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  height: fit-content;
  margin: auto;
  padding: 27px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.15);
  animation: appear 0.2s ease;
}

.share-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
}

.share-header h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 25px;
  margin: 0;
}

.share-description {
  color: var(--gray);
  font-size: 12px;
  line-height: 1.6;
  margin: 14px 0 17px;
}

.share-copy-area {
  position: relative;
}

#shareText {
  display: block;
  width: 100%;
  min-height: 220px;
  resize: none;
  padding: 15px 48px 15px 15px;
  border: 1px solid var(--light-gray);
  border-radius: 8px;
  background: #f8f8f8;
  color: var(--black);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  opacity: 1;
  -webkit-text-fill-color: var(--black);
}

.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 7px;
  background: var(--pink);
  color: white;
  font-size: 21px;
  cursor: pointer;
  transition: 0.2s;
}

.copy-button:hover {
  background: #e60070;
  transform: scale(1.05);
}

.copy-feedback {
  margin: 10px 0 0;
  color: var(--gray);
  font-size: 11px;
}

.copy-feedback.success {
  color: #16834a;
  font-weight: 700;
}

@media (max-width: 480px) {
  .share-panel {
    width: calc(100% - 30px);
    padding: 21px;
  }
}


/* TOP NAVIGATION */
.topbar {
  width: 100%;
  min-height: 72px;
  padding: 0 5%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #ededed;
}

/* BRAND */
.brand {
  color: #ff2b85;
  text-decoration: none;
  font-family: inherit;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}

.brand strong {
  color: #6D28D9;
  font-weight: 800;
}

.brand-accent {
  color: #111111;
  font-weight: 800;
}

/* BACK BUTTON - NO BORDER */
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border: none;
  background: transparent;
  color: #111111;
  text-decoration: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: color .2s ease;
}

.back-button:hover {
  color: #ff2b85;
}

/* PREVIOUS PUZZLES BELOW INTRO */
.intro .archive-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 44px;
  margin-top: 22px;
  padding: 0 20px;
  border: 1px solid #111;
  background: #fff;
  color: #111;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.intro .archive-button:hover {
  background: #111;
  color: #fff;
}

.intro .archive-button span {
  color: #ff2b85;
  font-size: 15px;
}

/* MOBILE */
@media (max-width: 600px) {
  .topbar {
    min-height: 60px;
    padding: 0 18px;
  }

  .brand {
    font-size: 15px;
  }

  .back-button {
    min-height: 38px;
    padding: 0 11px;
    font-size: 10px;
  }

  .intro .archive-button {
    margin-top: 18px;
    min-height: 40px;
    font-size: 12px;
  }
}

/* UPCOMING PUZZLE */

.upcoming-puzzle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 30px;
  padding: 18px 20px;
  border: 1px solid #e5ddff;
  border-left: 4px solid var(--pink);
  border-radius: 9px;
  background: #faf8ff;
}

.upcoming-puzzle.hidden {
  display: none !important;
}

.upcoming-label {
  color: var(--pink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
}

.upcoming-title {
  color: var(--black);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 17px;
  font-weight: 800;
}

.upcoming-date {
  color: var(--black);
  font-size: 12px;
  font-weight: 600;
}

.upcoming-unlock {
  color: var(--gray);
  font-size: 11px;
  margin-top: 3px;
}
