* {
  box-sizing: border-box;
}

:root {
  --bg: #ffffff;
  --card: #CFDEF6;
  --text: #000;
  --muted: #777777;
  --accent: #000000;
  --success: #26734d;
  --error: #a53b3b;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  display: flex;
  justify-content: center;
  padding: 10px 16px;
  
}
a{
  color: #111010;
  text-decoration: none;
}
.game {
  width: min(680px, 100%);
  display: flex;
  flex-direction: column;
}

/* =========================================================
   NAVBAR
========================================================= */

.navbar {

    height: 100px;
    display: flex;
    align-items: center;
    justify-content: space-between;
   
}
.logo {
    display: flex;
    justify-content: center;

}

.logo img {
    display: block;
    width: 230px;
    height: auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}

.eyebrow{
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.round,
.result-kicker {
  margin: 0 0 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1 {
  margin: 0;
  font-size: clamp(25px, 5vw, 30px);
  line-height: 1.05;
}

.timer {
  min-width: 78px;
  text-align: right;
}

.timer-label {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-bottom: 3px;
}

#timer {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

.game-card,
.result-card {
  background: var(--card);
  border-radius: 22px;
  padding: clamp(22px, 5vw, 40px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.round {
  color: var(--muted);
  text-align: center;
}

.scrambled {
  text-align: center;
  font-size: clamp(36px, 10vw, 64px);
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 18px 0 30px;
}

.answer {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
  margin-bottom: 25px;
}

.answer-box {
  width: clamp(44px, 11vw, 62px);
  height: clamp(50px, 12vw, 68px);
  border: 1px solid none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: clamp(22px, 6vw, 30px);
  font-weight: 700;
  text-transform: uppercase;
  background: #fff;
}

.answer-box.filled {
  border-color: var(--text);
}

.letters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
}

.letter-btn {
  width: 48px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.12s ease;
}

.letter-btn:hover {
  transform: translateY(-2px);
}

.letter-btn.used {
  opacity: 0.28;
  cursor: default;
  transform: none;
}

.actions,
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

button {
  font: inherit;
}

.primary-btn,
.secondary-btn {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 20px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  flex: 1;
  border:1px solid  #000;
  background: #000;
  color: #fff;
}

.primary-btn:hover{
  background: #fff;
  color: #000;
  border:1px solid #fff;
}
.secondary-btn:hover{
  background: #000;
  color: #fff;
  border: 1px solid #000;
}

.secondary-btn {
  border: 1px solid #000;
  background: none;
  color: var(--text);
}

.hint,
.share-status {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.hint.error {
  color: var(--error);
}

.hint.success {
  color: var(--success);
}

.result-card {
  margin-top: 18px;
  text-align: center;
}

.result-kicker {
  color: var(--success);
}

.result-card h2 {
  margin: 5px 0 8px;
  font-size: clamp(38px, 10vw, 64px);
}

.result-text {
  color: var(--muted);
  margin: 0;
}

.result-actions {
  justify-content: center;
}

.result-actions .primary-btn {
  flex: 1;
}

.result-actions .secondary-btn {
  flex: 0 0 auto;
}

.hidden {
  display: none;
}

/* ========================================
   HINT BUTTON
======================================== */

.hint-btn {
   min-height: 45px;
  border-radius: 12px;
  padding: 0 35px;

  border: none;

  background: #000;
  color: #fff;

  font: inherit;
  cursor: pointer;
}

.hint-btn:hover {
  color: #000;
  background: #fff;
}

.hint-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ========================================
   HINTED LETTER
======================================== */

.answer-box.hint-letter {
  font-weight: 700;
  border: 2px solid currentColor;
}

/* ========================================
   HOW TO PLAY BUTTON
======================================== */

.how-to-btn {
  padding: 8px 20px;
  background: #AEC2E2;
  border: 1px solid #AEC2E2;
  border-radius: 12px;
  color: #000;
  font: inherit;
  cursor: pointer;
}

.how-to-btn:hover {
  background: #000;
  color: #fff;
  border: 1px solid #fff;
}
/* ========================================
   HOW TO PLAY MODAL
======================================== */

.how-to-modal {
  position: fixed;
  inset: 0;

  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
}

.how-to-modal.hidden {
  display: none;
}


/* Dark background */

.how-to-overlay {
  position: absolute;
  inset: 0;

  background: rgba(0, 0, 0, 0.65);
}


/* Popup */

.how-to-popup {
  position: relative;
  z-index: 1;

  width: min(100%, 480px);

  padding: 32px;

  border-radius: 16px;

  background: #1b1b1b;
  color: #fff;

  box-sizing: border-box;
}


/* Close button */

.how-to-close {
  position: absolute;

  top: 12px;
  right: 16px;

  width: 36px;
  height: 36px;

  border: none;
  border-radius: 50%;
  background: #fff;

  font-size: 28px;
  line-height: 1;

  cursor: pointer;
}


/* Title */

.how-to-popup h2 {
  margin: 6px 0 24px;
}


/* Steps */

.how-to-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.how-to-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.how-to-step > span {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  width: 28px;
  height: 28px;

  border-radius: 50%;

  font-size: 13px;
  font-weight: 700;
}

.how-to-step p {
  margin: 2px 0 0;

  line-height: 1.5;
}


/* Got it button */

.how-to-start {
  width: 100%;
  margin-top: 28px;
}


/* ========================================
   GAME TOP ACTIONS
======================================== */

.game-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 20px;
}


/* ========================================
   GIVE UP BUTTON
======================================== */

.give-up-btn {
  min-height: 45px;
  border-radius: 12px;
  padding: 0 20px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: 0.2s ease;
}

.give-up-btn:hover {
 background: #fff;
  color: #111;
  border: 1px solid #fff;
}

.give-up-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ========================================
   RESULT CARD
======================================== */

.result-card {
  text-align: center;
}


/* ========================================
   RESULT KICKER
======================================== */

.result-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}


/* ========================================
   RESULT TITLE
======================================== */

.result-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 500;
}


/* ========================================
   RESULT WORD
======================================== */

.result-word {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 22px;
}


/* ========================================
   RESULT LETTER BOXES
======================================== */

.result-letters {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 0 auto 24px;
}


/* Individual boxes */

.result-letter-box {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 16px;
}


/* Green boxes */

.result-correct {
  background: #dff5e4;
  color: #218739;
  border: 1px solid #9bd5a8;
}


/* Red boxes */

.result-wrong {
  background: #fbe1e1;
  color: #c73636;
  border: 1px solid #e6a2a2;
}


/* ========================================
   RESULT TIME
======================================== */

.result-time-label {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.55;
}


.result-time {
  margin: 0 0 24px;
  font-size: 24px;
}


/* ========================================
   RESULT ACTIONS
======================================== */

.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}


/* ========================================
   SHARE STATUS
======================================== */

.share-status {
  min-height: 20px;
  margin-top: 14px;
  font-size: 13px;
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 500px) {

  .game-top-actions {
    justify-content: center;
  }

  .result-letter-box {
    width: 36px;
    height: 36px;
  }

  .result-word {
    font-size: 30px;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions button {
    width: 100%;
  }
}


@media (max-width: 480px) {
  body {
    padding: 20px 12px;
  }


  .game-card,
  .result-card {
    border-radius: 18px;
    padding: 22px 16px;
  }

  .letter-btn {
    width: 43px;
    height: 43px;
  }

  .actions,
  .result-actions {
    flex-direction: column;
  }

  .secondary-btn,
  .primary-btn {
    width: 100%;
  }
}
