/* ═══════════════════════════════════════════
   BOLDLE — Main Stylesheet v2
   ═══════════════════════════════════════════ */

@import url('./base/variables.css');
@import url('./base/reset.css');
@import url('./base/body.css');
@import url('./base/toast.css');
@import url('./base/header.css');
@import url('./base/install_pop.css');
@import url('./base/animation.css');
@import url('./base/responsive.css');

/* ===== UI IMPROVEMENT : CATEGORY CARD ===== */

.category-wrapper {
  width: min(650px, 92vw);

  margin: 10px auto 10px;

  background: rgba(18, 18, 34, .75);

  backdrop-filter: blur(16px);

  border: 1px solid rgba(255, 255, 255, .06);

  border-radius: 22px;

  padding: 18px;

  box-shadow:
    0 20px 40px rgba(0, 0, 0, .4);
}



/* CATEGORY */
.category-bar {
  margin: 10px 0 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  z-index: 10;
}

.cat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
}

.cat-badge {
  background: linear-gradient(135deg,
      rgba(255, 153, 51, .15),
      rgba(255, 153, 51, .05));

  border: 1px solid var(--saffron);

  color: var(--saffron);

  font-size: 13px;

  font-weight: 700;

  padding: 6px 16px;

  border-radius: 999px;

  font-family: 'Baloo 2', cursive;

  box-shadow:
    0 0 20px rgba(255, 153, 51, .2);
}

.puzzle-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
  text-align: center;
  margin-bottom: 4px;
  position: relative;
  z-index: 10;
}

#cat-instruction {
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-align: center;
  line-height: 1.5;
}

/* DONE BANNER */
#done-banner {
  display: none;
  width: calc(100% - 24px);
  max-width: 460px;
  margin: 0 12px 10px;
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 14px 16px;
  position: relative;
  z-index: 10;
  animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

#done-banner.show {
  display: block;
}

.done-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.done-icon {
  font-size: 20px;
}

.done-title {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.done-sub {
  font-size: 12px;
  color: var(--text2);
  line-height: 1.4;
  margin-bottom: 10px;
}

.done-countdown-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  margin-bottom: 10px;
}

.done-countdown-label {
  font-size: 10px;
  color: var(--text3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.done-countdown-val {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  color: var(--saffron);
  letter-spacing: 2px;
}

.done-share-btn {
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--saffron-dark), var(--saffron));
  border: none;
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(255, 153, 51, 0.35);
  transition: transform 0.1s;
}

.done-share-btn:active {
  transform: scale(0.97);
}

/* GRID */
#grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 10px;
  position: relative;
  z-index: 10;
  width: 100%;
  align-items: center;
}

.row {
  display: flex;
  gap: 6px;
  justify-content: center;
}

/* ===== UI IMPROVEMENT : TILE HOVER ===== */

@media (hover:hover) {

  .tile:hover {

    transform: translateY(-2px);

    transition: .2s ease;

  }

}

.tile {
  width: var(--tile-size);
  height: var(--tile-size);
  border: 2px solid var(--tile-border);
  border-radius: 10px;
  background:
    linear-gradient(180deg,
      #17172e,
      #111120);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-size: var(--tile-font);
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  transition: border-color 0.1s;
  user-select: none;
  border-radius: 16px;

  box-shadow:
    0 6px 18px rgba(0, 0, 0, .25);
}

.tile.filled {
  border-color: var(--saffron);
  box-shadow: 0 0 8px rgba(255, 153, 51, 0.25);
  animation: pop 0.12s ease;
}

.tile.correct {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 2px 12px var(--green-glow);
}

.tile.present {
  background: linear-gradient(135deg, var(--saffron-dark), var(--saffron));
  border-color: var(--saffron);
  color: #fff;
  box-shadow: 0 2px 12px var(--saffron-glow);
}

.tile.absent {
  background: var(--absent);
  border-color: var(--absent);
  color: var(--text3);
}

.tile.flip {
  animation: flip 0.5s ease forwards;
}

.tile.shake {
  animation: shake 0.4s ease;
}

.tile.bounce {
  animation: bounce 0.4s ease;
}

/* FEEDBACK */
#feedback-modal {
  display: none !important;
}

#feedback-modal.open {
  display: flex !important;
}

.fb-tag {
  font-family: 'Baloo 2', cursive;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  cursor: pointer;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--text2);
  transition: all 0.15s;
}

.fb-tag.selected {
  background: var(--saffron-glow);
  border-color: var(--saffron);
  color: var(--saffron);
}

#share-sheet {
  display: none !important;
}

#share-sheet.open {
  display: flex !important;
}

/* MILESTONE OVERLAY */
#ms-overlay {
  display: none !important;
}

#ms-overlay.open {
  display: flex !important;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 6px;
  position: relative;
  z-index: 10;
}

.diff-badge {
  font-family: 'Baloo 2', cursive;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.diff-easy {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
  border: 1px solid #22C55E;
}

.diff-medium {
  background: rgba(255, 153, 51, 0.15);
  color: #FF9933;
  border: 1px solid #FF9933;
}

.diff-hard {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
  border: 1px solid #EF4444;
}

.solve-pct {
  font-family: 'Baloo 2', cursive;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

.instruction-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 4px 16px 2px;
  position: relative;
  z-index: 10;
}

#cat-instruction {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  line-height: 1.4;
  flex: 1;
}

.hint-btn {
  font-family: 'Baloo 2', cursive;
  font-size: 13px;
  font-weight: 700;
  color: var(--saffron);
  background: var(--saffron-glow);
  border: 1px dashed var(--saffron);
  border-radius: 20px;
  padding: 5px 12px;
  flex-shrink: 0;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.hint-btn:active {
  transform: scale(0.93);
}

.hint-btn.used {
  opacity: 0.35;
  pointer-events: none;
}

/* HINT POPUP */
#hint-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(8, 8, 16, 0.88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#hint-popup.open {
  display: flex;
}

.hint-popup-box {
  background: var(--bg2);
  border: 1px solid var(--saffron);
  border-radius: 20px;
  padding: 24px 20px;
  width: 100%;
  max-width: 320px;
  text-align: center;
  animation: sheetUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hint-popup-title {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  color: var(--saffron);
  margin-bottom: 12px;
}

.hint-popup-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 20px;
  font-family: 'Mukta', sans-serif;
}

.hint-popup-ok {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--saffron-dark), var(--saffron));
  border: none;
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 153, 51, 0.35);
}

/* KEYBOARD */
#keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 10;
  padding: 0 6px 20px;
  width: 100%;
  max-width: 500px;
  flex-shrink: 0;
}

.kb-row {
  display: flex;
  gap: 5px;
  justify-content: center;
  width: 100%;
  padding: 0 2px;
}

.key {
  height: var(--key-h);
  min-width: var(--key-min);
  padding: 0 4px;
  border-radius: 8px;
  background: var(--key-bg);
  border: 1px solid var(--border2);
  color: var(--key-text);
  font-family: 'Baloo 2', cursive;
  font-size: var(--key-font);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  transition: background 0.12s, transform 0.1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  flex: 1;
  background:
    linear-gradient(180deg,
      #252547,
      #1b1b35);

  /* ===== UI IMPROVEMENT : KEYBOARD HOVER ===== */

  @media (hover:hover) {

    .key:hover {

      transform: translateY(-2px);

      border-color: var(--saffron);

    }

  }

  border: 1px solid rgba(255, 255, 255, .06);

  box-shadow: 0 6px 14px rgba(0, 0, 0, .25);
}

.key:active {
  transform: scale(0.91);
}

.key.wide {
  flex: 1.6;
  font-size: calc(var(--key-font) - 1px);
}

.key.correct {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 2px 8px var(--green-glow);
}

.key.present {
  background: linear-gradient(135deg, var(--saffron-dark), var(--saffron));
  border-color: var(--saffron);
  color: #fff;
  box-shadow: 0 2px 8px var(--saffron-glow);
}

.key.absent {
  background: #0E0E1C;
  border-color: #0E0E1C;
  color: var(--text3);
}



/* MODALS */
#modal, #how-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(8, 8, 16, 0.88);
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(8px);
}

#modal.open, #how-modal.open {
  display: flex;
}

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  animation: sheetUp 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  max-height: 92dvh;
  overflow-y: auto;
}

.modal-emoji {
  font-size: 48px;
  margin-bottom: 6px;
}

.modal-title {
  font-family: 'Baloo 2', cursive;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 2px;
  color: var(--text);
}

.modal-word {
  font-family: 'Baloo 2', cursive;
  font-size: 26px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--saffron), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 4px 0 4px;
  letter-spacing: 3px;
}

.modal-meaning {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 16px;
  line-height: 1.5;
}

.stats-row {
  display: flex;
  justify-content: space-around;
  background: var(--bg3);
  border-radius: 14px;
  padding: 12px 8px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-num {
  font-family: 'Baloo 2', cursive;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  display: block;
}

.stat-label {
  font-size: 10px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.win-pct {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 10px;
}

.win-pct strong {
  color: var(--saffron);
  font-size: 14px;
  font-weight: 800;
}

.dist-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text3);
  text-align: center;
  margin-bottom: 8px;
}

.dist-chart {
  margin-bottom: 14px;
}

.dist-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.dist-label {
  font-family: 'Baloo 2', cursive;
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  width: 12px;
  text-align: right;
  flex-shrink: 0;
}

.dist-bar-wrap {
  flex: 1;
}

.dist-bar {
  height: 18px;
  border-radius: 4px;
  background: var(--bg4);
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 6px;
  transition: width 0.6s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.dist-bar.highlight {
  background: linear-gradient(90deg, var(--green-dark), var(--green));
  box-shadow: 0 0 8px var(--green-glow);
}

.dist-bar span {
  font-family: 'Baloo 2', cursive;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

.share-card {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-family: 'Baloo 2', cursive;
  font-size: 14px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
  text-align: left;
}

.btn-share {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--saffron-dark), var(--saffron));
  color: #fff;
  border: none;
  font-family: 'Baloo 2', cursive;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(255, 153, 51, 0.4);
  transition: transform 0.1s;
}

.btn-share:active {
  transform: scale(0.97);
}

.btn-close {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  width: 100%;
  padding: 11px;
  border-radius: 12px;
  font-family: 'Mukta', sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.next-timer {
  font-size: 11px;
  color: var(--text3);
  margin-top: 10px;
}

.timer-val {
  font-family: 'Baloo 2', cursive;
  color: var(--saffron);
  font-weight: 800;
}

/* HOW TO PLAY */
.how-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 24px 24px 0 0;
  padding: 20px 20px 32px;
  width: 100%;
  max-width: 480px;
  animation: sheetUp 0.35s cubic-bezier(0.34, 1.3, 0.64, 1);
  max-height: 92dvh;
  overflow-y: auto;
}

.how-title {
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 14px;
  color: var(--text);
}

.how-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.how-tile {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
  color: #fff;
}

.how-text {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.4;
}

.how-text strong {
  color: var(--text);
}

.how-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 12px 0;
}

.how-close {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--saffron-dark), var(--saffron));
  border: none;
  color: #fff;
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 14px;
  box-shadow: 0 4px 16px rgba(255, 153, 51, 0.35);
}





/* ===== UI IMPROVEMENT ===== */



.timer-bar {
  text-align: center;
  margin: 10px 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--saffron);
}