/* ==========================================================================
   HIMALAYA WORDS — Stylesheet
   Атмосфера Гималаев: Ночной фиолетовый, глубокий синий, золото, бирюза
   ========================================================================== */

:root {
  --hw-bg-dark: #0a0e17;
  --hw-bg-card: rgba(18, 26, 42, 0.88);
  --hw-gold: #f5a425;
  --hw-gold-light: #ffd166;
  --hw-turquoise: #2dd4bf;
  --hw-turquoise-glow: rgba(45, 212, 191, 0.4);
  --hw-crimson: #c92a42;
  --hw-text: #f8fafc;
  --hw-text-muted: #94a3b8;
  --hw-border: rgba(245, 164, 37, 0.3);
  --hw-cell-bg: rgba(255, 255, 255, 0.08);
  --hw-cell-border: rgba(255, 255, 255, 0.2);
  --hw-cell-filled-bg: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%);
  --hw-cell-highlight: rgba(245, 164, 37, 0.5);
  --font-serif: 'Cinzel', serif;
  --font-sans: 'Outfit', 'Nunito', -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body {
  background-color: var(--hw-bg-dark);
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(45, 212, 191, 0.12) 0%, transparent 60%),
    radial-gradient(circle at 10% 80%, rgba(201, 42, 66, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(245, 164, 37, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, #0c1526 0%, #070b12 100%);
  color: var(--hw-text);
  font-family: var(--font-sans);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top Navigation Bar & Prayer Flags ── */
#htxTopNav,
.htx-top-nav {
  flex-shrink: 0;
  z-index: 99999;
}

/* Prayer Flags Ribbon (Inherited from himaltrex-profile.css) */

/* ── App Workspace Container ── */
.hw-app {
  flex: 1;
  display: flex;
  flex-direction: row;
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  height: calc(100vh - 54px - 12px);
  height: calc(100dvh - 54px - 12px);
}

/* ── Left Sidebar HUD & Controls ── */
.hw-sidebar {
  width: 228px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 10px 12px;
  background: transparent;
  border-right: none;
  box-shadow: none;
  z-index: 20;
  overflow-y: auto;
  scrollbar-width: none;
}

.hw-sidebar::-webkit-scrollbar {
  display: none;
}

.hw-sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hw-sidebar-map-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.22) 0%, rgba(13, 148, 136, 0.3) 100%);
  border: 1.5px solid var(--hw-turquoise);
  border-radius: 12px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.2);
}

.hw-sidebar-map-btn:hover {
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.4) 0%, rgba(13, 148, 136, 0.5) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(45, 212, 191, 0.35);
}

.hw-sidebar-level-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

.hw-sidebar-location {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--hw-turquoise);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-sidebar-level-num {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.3px;
}

.hw-sidebar-level-name {
  font-size: 0.76rem;
  color: var(--hw-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hw-sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hw-sidebar-stat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: var(--hw-text);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hw-sidebar-stat-btn:hover {
  background: rgba(245, 164, 37, 0.15);
  border-color: rgba(245, 164, 37, 0.4);
}

.hw-sidebar-stat-btn .stat-icon {
  font-size: 0.95rem;
  margin-right: 6px;
}

.hw-sidebar-stat-btn .stat-label {
  flex: 1;
  text-align: left;
  color: var(--hw-text-muted);
  font-size: 0.74rem;
}

.hw-sidebar-stat-btn .stat-value {
  font-weight: 800;
  color: #fff;
}

.hw-sidebar-coin-card {
  cursor: default;
  background: rgba(245, 164, 37, 0.1);
  border-color: rgba(245, 164, 37, 0.4);
}

.hw-sidebar-coin-card .stat-value {
  color: var(--hw-gold-light);
}

/* ── Right Sidebar Toolbar: Hint, Shuffle, Help (Compact column) ── */
.hw-sidebar-right {
  width: 92px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
  padding: 14px 6px 20px;
  background: transparent;
  border-left: none;
  box-shadow: none;
  z-index: 20;
}

.hw-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 80px;
  padding: 8px 4px 7px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  user-select: none;
  box-sizing: border-box;
}

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

.hw-tool-btn:active {
  transform: scale(0.96);
}

.hw-tool-btn .tool-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.hw-tool-btn .tool-text {
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.hw-tool-btn .tool-cost {
  font-size: 0.65rem;
  font-weight: 900;
  background: var(--hw-gold);
  color: #0c121e;
  padding: 1px 7px;
  border-radius: 8px;
  margin-top: 1px;
  line-height: 1.2;
}

.hw-sidebar-right .hw-btn-hint {
  background: linear-gradient(135deg, rgba(245, 164, 37, 0.22) 0%, rgba(180, 83, 9, 0.35) 100%);
  border-color: var(--hw-gold);
  color: #fff;
}

.hw-sidebar-right .hw-btn-hint:hover {
  background: linear-gradient(135deg, rgba(245, 164, 37, 0.42) 0%, rgba(180, 83, 9, 0.55) 100%);
  box-shadow: 0 0 16px rgba(245, 164, 37, 0.45);
}

.hw-sidebar-right .hw-btn-shuffle {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.hw-sidebar-right .hw-btn-shuffle:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #fff;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.25);
}

.hw-sidebar-right .hw-btn-help {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.45);
  color: var(--hw-turquoise);
}

.hw-sidebar-right .hw-btn-help:hover {
  background: rgba(45, 212, 191, 0.25);
  border-color: var(--hw-turquoise);
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.35);
}

/* ── Main Game Board Area ── */
.hw-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 12px 10px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* ── Dynamic Vector Mountain & Nature Backdrop (Static, no floating particles) ── */
.hw-stage-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.88;
  transition: opacity 0.6s ease;
}

.hw-stage-backdrop svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ── Central Stage: Crossword Board (Raised to very top) ── */
.hw-stage {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 6px;
  position: relative;
  z-index: 1;
  min-height: 0;
  max-height: 48vh;
  width: 100%;
}

.crossword-viewport {
  width: 100%;
  height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.crossword-grid {
  display: grid;
  gap: 4px;
  padding: 8px;
  background: rgba(14, 22, 36, 0.55);
  border: 1px solid rgba(245, 164, 37, 0.25);
  border-radius: 16px;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-width: 96vw;
}

.cw-cell {
  width: var(--cell-size, 46px);
  height: var(--cell-size, 46px);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 3.5vw, 1.45rem);
  font-weight: 800;
  color: #fff;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.cw-cell.empty {
  visibility: hidden;
}

.cw-cell.locked {
  background: var(--hw-cell-bg);
  border: 1.5px solid var(--hw-cell-border);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cw-cell.filled {
  background: var(--hw-cell-filled-bg);
  border: 1.5px solid #2dd4bf;
  box-shadow: 0 0 14px var(--hw-turquoise-glow), 0 3px 8px rgba(0, 0, 0, 0.4);
  animation: cellPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cw-cell.hinted {
  background: linear-gradient(135deg, #f5a425 0%, #b45309 100%);
  border-color: #fcd34d;
  box-shadow: 0 0 16px rgba(245, 164, 37, 0.6);
  animation: cellPop 0.35s ease-out;
}

@keyframes cellPop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* Selected word current preview strip */
.current-word-tray {
  min-height: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 3px 0 3px;
  flex-shrink: 0;
}

.current-word-pill {
  padding: 4px 16px;
  background: rgba(18, 30, 48, 0.9);
  border: 1.5px solid var(--hw-turquoise);
  border-radius: 20px;
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  box-shadow: 0 0 16px var(--hw-turquoise-glow);
  min-width: 100px;
  text-align: center;
  display: none;
}

.current-word-pill.active {
  display: inline-block;
  animation: trayBounce 0.2s ease-out;
}

@keyframes trayBounce {
  0% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

/* ── Bottom Section: Circular Letter Wheel Raised Directly Under Crossword ── */
.hw-wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  margin-top: 0;
  position: relative;
  flex-shrink: 0;
}

/* Circular Letter Wheel */
.wheel-container {
  position: relative;
  width: clamp(190px, 32vh, 260px);
  height: clamp(190px, 32vh, 260px);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(28, 44, 68, 0.85) 0%, rgba(14, 20, 32, 0.95) 100%);
  border: 2px solid rgba(245, 164, 37, 0.45);
  box-shadow: 
    inset 0 0 30px rgba(0, 0, 0, 0.7),
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 25px rgba(245, 164, 37, 0.15);
  touch-action: none;
  transition: transform 0.3s ease;
}

.wheel-container.shuffling {
  animation: wheelShuffleAnim 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wheelShuffleAnim {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(0.92) rotate(180deg); opacity: 0.6; }
  100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

.wheel-container::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

/* SVG Line connecting letters in gesture */
.wheel-svg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* Letter Nodes on Wheel */
.wheel-letter {
  position: absolute;
  width: clamp(42px, 7vh, 52px);
  height: clamp(42px, 7vh, 52px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #334d74 0%, #17263b 100%);
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: clamp(1.25rem, 3.8vh, 1.65rem);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  z-index: 10;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.wheel-letter.selected {
  background: radial-gradient(circle at 35% 35%, #2dd4bf 0%, #0d9488 100%);
  border-color: #ffd166;
  box-shadow: 0 0 20px var(--hw-turquoise-glow), 0 4px 12px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%) scale(1.18);
}

.wheel-letter.wheel-letter-dense {
  width: clamp(38px, 6.2vh, 46px);
  height: clamp(38px, 6.2vh, 46px);
  font-size: clamp(1.1rem, 3.2vh, 1.45rem);
}

/* ── Modals & Overlays ── */
.hw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 100001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.hw-modal-overlay.active {
  display: flex;
}

.hw-modal-box {
  position: relative;
  background: linear-gradient(165deg, #18283d 0%, #0d1624 100%);
  border: 1.5px solid var(--hw-gold);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  padding: 24px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 164, 37, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hw-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #94a3b8;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 10;
  padding: 0;
  user-select: none;
}

.hw-modal-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  transform: scale(1.1);
}

.hw-modal-close:active {
  transform: scale(0.95);
}

@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.hw-modal-icon {
  font-size: 3.2rem;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(245, 164, 37, 0.4));
}

.hw-modal-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #ffd166;
  margin-bottom: 6px;
}

.hw-modal-sub {
  color: var(--hw-text-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
  line-height: 1.4;
}

.hw-modal-reward-card {
  background: rgba(245, 164, 37, 0.12);
  border: 1px solid var(--hw-gold);
  border-radius: 12px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.hw-btn-primary {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #df6a27 0%, #f5a425 100%);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 164, 37, 0.4);
  transition: all 0.2s;
}

.hw-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(245, 164, 37, 0.6);
}

/* ── Hunt-style Victory Modal Upgrades ── */
.hw-win-box {
  max-width: 470px;
  padding: 26px 24px 22px;
  background: radial-gradient(circle at top center, rgba(30, 41, 59, 0.96), rgba(11, 16, 22, 0.98) 78%);
  border: 1.5px solid rgba(250, 204, 21, 0.55);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 38px rgba(250, 204, 21, 0.22);
}

.hw-victory-stars-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.hw-result-stars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.hw-star {
  display: inline-block;
  filter: drop-shadow(0 4px 12px rgba(250, 204, 21, 0.55));
}

.hw-star-side {
  font-size: 2rem;
  transform: translateY(-2px);
}

.hw-star-center {
  font-size: 3.1rem;
  transform: translateY(-10px);
  filter: drop-shadow(0 6px 18px rgba(250, 204, 21, 0.75));
}

.hw-victory-stars-subtext {
  font-size: 0.78rem;
  font-weight: 800;
  color: #fde047;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hw-win-stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.hw-win-stat-box {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.hw-stat-lbl {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--hw-text-muted);
  text-transform: uppercase;
}

.hw-stat-val {
  font-size: 1.25rem;
  font-weight: 900;
}

.hw-stat-val.gold { color: #facc15; }
.hw-stat-val.cyan { color: #38bdf8; }

.hw-btn-hunt {
  background: linear-gradient(135deg, #c1121f 0%, #e63946 100%);
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.45);
}

.hw-btn-hunt:hover {
  box-shadow: 0 8px 26px rgba(230, 57, 70, 0.65);
}

/* ── Two-Column Help Modal Cards ── */
.hw-help-modal-box {
  max-width: 740px;
  max-height: 88vh;
  overflow-y: auto;
}

.hw-help-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 10px;
  text-align: left;
}

.hw-help-card {
  background: rgba(11, 16, 22, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hw-help-card-wide {
  grid-column: 1 / -1;
}

.hw-help-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffd166;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hw-help-card-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.wc-gold   { color: #facc15; font-weight: 700; }
.wc-cyan   { color: #38bdf8; font-weight: 700; }
.wc-green  { color: #4ade80; font-weight: 700; }
.wc-orange { color: #fb923c; font-weight: 700; }

@media (max-width: 640px) {
  .hw-help-grid {
    grid-template-columns: 1fr;
  }
}

/* Chapters Map View */
.hw-chapters-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-height: 65vh;
  overflow-y: auto;
  padding: 6px;
}

.hw-chapter-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(18, 28, 44, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
}

.hw-chapter-card:hover {
  border-color: var(--hw-gold);
  background: rgba(28, 44, 68, 0.95);
  transform: translateY(-2px);
}

.hw-chapter-card.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.hw-chapter-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.hw-chapter-info h4 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: 2px;
}

.hw-chapter-info p {
  font-size: 0.78rem;
  color: var(--hw-text-muted);
}

/* Floating Word Explanations on Complete */
.hw-fact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-bottom: 16px;
  text-align: left;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 164, 37, 0.4) rgba(0, 0, 0, 0.2);
}

.hw-fact-list::-webkit-scrollbar {
  width: 5px;
}

.hw-fact-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.hw-fact-list::-webkit-scrollbar-thumb {
  background: rgba(245, 164, 37, 0.45);
  border-radius: 4px;
}

.hw-fact-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  border-left: 3px solid var(--hw-turquoise);
}

.hw-fact-item strong {
  color: var(--hw-gold-light);
}

/* ── Enlarged Achievements Modal (No scrollbar, perfectly fitted) ── */
.hw-ach-modal-box {
  max-width: 540px !important;
  width: 94% !important;
  padding: 22px 22px 20px !important;
}

.hw-ach-modal-box .hw-modal-icon {
  font-size: 2.8rem;
  margin-bottom: 4px;
}

.hw-ach-modal-box .hw-modal-title {
  font-size: 1.5rem;
  margin-bottom: 3px;
}

.hw-ach-modal-box .hw-modal-sub {
  margin-bottom: 14px;
  font-size: 0.86rem;
}

.hw-ach-list {
  max-height: none !important;
  overflow: visible !important;
  gap: 8px !important;
  margin-bottom: 18px !important;
}

.hw-ach-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 8px 14px !important;
  background: rgba(0, 0, 0, 0.35) !important;
  border-left: 3.5px solid var(--hw-gold) !important;
  border-radius: 10px !important;
  transition: transform 0.15s ease, background 0.15s ease;
}

.hw-ach-item:hover {
  background: rgba(245, 164, 37, 0.08) !important;
  transform: translateX(2px);
}

.hw-ach-icon {
  font-size: 1.45rem;
  line-height: 1;
  flex-shrink: 0;
}

.hw-ach-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hw-ach-title {
  font-weight: 800;
  color: #ffd166;
  font-size: 0.86rem;
}

.hw-ach-desc {
  font-size: 0.78rem;
  color: var(--hw-text-muted);
  line-height: 1.25;
}

/* ── Educational Fact Card in Win Modal ── */
.hw-fact-highlight-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.18) 0%, rgba(13, 148, 136, 0.1) 100%);
  border: 1.5px solid rgba(45, 212, 191, 0.45);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  animation: factFadeIn 0.4s ease-out;
}

@keyframes factFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.fact-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.fact-icon {
  font-size: 1.25rem;
}

.fact-heading {
  font-family: var(--font-serif);
  font-weight: 800;
  color: #5eead4;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.fact-card-body {
  font-size: 0.85rem;
  line-height: 1.45;
  color: #e2e8f0;
  margin: 0;
}

/* ── Expedition Journey Route Tracker (Map Modal) ── */
.hw-route-tracker {
  width: 100%;
  background: rgba(10, 18, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 10px;
  margin-bottom: 14px;
}

.hw-route-title {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--hw-gold);
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hw-route-stops {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  padding: 0 8px;
}

.hw-route-line-bg {
  position: absolute;
  top: 14px;
  left: 20px;
  right: 20px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 1;
}

.hw-route-line-fill {
  position: absolute;
  top: 14px;
  left: 20px;
  height: 3px;
  background: linear-gradient(90deg, #f5a425, #2dd4bf);
  z-index: 2;
  transition: width 0.4s ease;
}

.hw-route-stop {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.hw-route-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  transition: all 0.25s;
}

.hw-route-stop.reached .hw-route-dot {
  background: #0f766e;
  border-color: #2dd4bf;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
}

.hw-route-stop.current .hw-route-dot {
  background: #b45309;
  border-color: #ffd166;
  box-shadow: 0 0 14px rgba(245, 164, 37, 0.8);
  transform: scale(1.15);
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 10px rgba(245, 164, 37, 0.7); }
  50% { box-shadow: 0 0 20px rgba(245, 164, 37, 1); }
}

.hw-route-stop-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--hw-text-muted);
  max-width: 60px;
  text-align: center;
  line-height: 1.1;
  white-space: nowrap;
}

.hw-route-stop.reached .hw-route-stop-name {
  color: #cbd5e1;
}

.hw-route-stop.current .hw-route-stop-name {
  color: #ffd166;
  font-weight: 800;
}

/* ── Badges Collection Grid ── */
.hw-badges-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-height: 55vh;
  overflow-y: auto;
  padding: 4px;
}

.hw-badge-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  text-align: left;
}

.hw-badge-card.unlocked {
  background: linear-gradient(135deg, rgba(245, 164, 37, 0.15) 0%, rgba(223, 106, 39, 0.1) 100%);
  border-color: rgba(245, 164, 37, 0.55);
  box-shadow: 0 4px 14px rgba(245, 164, 37, 0.18);
}

.hw-badge-card.locked {
  opacity: 0.55;
  filter: grayscale(0.85);
}

.hw-badge-icon {
  font-size: 1.85rem;
  min-width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.hw-badge-card.unlocked .hw-badge-icon {
  background: radial-gradient(circle, rgba(245, 164, 37, 0.35) 0%, rgba(0, 0, 0, 0.5) 100%);
  border: 1.5px solid rgba(245, 164, 37, 0.6);
}

.hw-badge-info {
  flex: 1;
}

.hw-badge-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.hw-badge-title {
  font-family: var(--font-serif);
  font-weight: 800;
  color: #fff;
  font-size: 0.95rem;
}

.hw-badge-card.unlocked .hw-badge-title {
  color: #ffd166;
}

.hw-badge-status-tag {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.hw-badge-status-tag.unlocked {
  background: rgba(45, 212, 191, 0.2);
  color: #5eead4;
  border: 1px solid rgba(45, 212, 191, 0.4);
}

.hw-badge-status-tag.locked {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.hw-badge-region {
  font-size: 0.78rem;
  color: var(--hw-turquoise);
  font-weight: 700;
  margin-bottom: 3px;
}

.hw-badge-desc {
  font-size: 0.76rem;
  color: var(--hw-text-muted);
  line-height: 1.35;
}

/* ── Custom Packs UI & Create Pack Modal ── */
.hw-pack-actions-row {
  width: 100%;
  display: flex;
  margin-bottom: 12px;
}

.hw-btn-create-pack {
  width: 100%;
  padding: 11px 14px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.18) 0%, rgba(13, 148, 136, 0.1) 100%);
  border: 1.5px dashed var(--hw-turquoise);
  border-radius: 12px;
  color: #5eead4;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.hw-btn-create-pack:hover {
  background: rgba(45, 212, 191, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--hw-turquoise-glow);
}

.hw-form-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.hw-form-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--hw-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hw-form-input, .hw-form-textarea {
  width: 100%;
  background: rgba(10, 16, 26, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 10px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.hw-form-input:focus, .hw-form-textarea:focus {
  border-color: var(--hw-gold);
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.3);
}

.hw-icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-opt {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid transparent;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-opt:hover {
  background: rgba(255, 255, 255, 0.15);
}

.icon-opt.selected {
  border-color: var(--hw-gold);
  background: rgba(245, 164, 37, 0.25);
  box-shadow: 0 0 10px rgba(245, 164, 37, 0.4);
}

/* ── Toast Notifications: Positioned directly below Letter Wheel ── */
.hw-toast-tray {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  pointer-events: none;
  z-index: 50;
  position: relative;
}

#hwToast {
  display: none;
  opacity: 0;
  pointer-events: none !important;
  user-select: none !important;
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(14, 23, 38, 0.96);
  border: 1.5px solid #ffd166;
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65);
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  transition: opacity 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateY(6px);
}

#hwToast.visible {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0);
}

#hwToast.bonus {
  border: 2px solid #2dd4bf;
  background: linear-gradient(135deg, rgba(14, 28, 48, 0.98) 0%, rgba(13, 148, 136, 0.95) 100%);
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.6), 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #fff;
}

#hwToast.warning {
  border: 1.5px solid #f59e0b;
  background: rgba(28, 20, 14, 0.96);
  color: #fde68a;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

#hwToast.error {
  border: 1.5px solid #ef4444;
  background: rgba(30, 14, 18, 0.96);
  color: #fca5a5;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

#hwToast.combo {
  border: 2px solid #f59e0b;
  background: linear-gradient(135deg, rgba(35, 18, 10, 0.98) 0%, rgba(217, 119, 6, 0.92) 100%);
  box-shadow: 0 0 22px rgba(245, 158, 11, 0.6), 0 8px 24px rgba(0, 0, 0, 0.6);
  color: #fff;
}

#hwToast.success {
  border: 1.5px solid #22c55e;
  background: rgba(14, 30, 22, 0.96);
  color: #86efac;
}

/* ── Help & Rules Modal Box ── */
.hw-help-modal-box {
  max-width: 540px;
  max-height: 85vh;
  overflow-y: auto;
  text-align: left;
}

.hw-help-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  line-height: 1.5;
  color: var(--hw-text);
  font-size: 0.88rem;
}

.hw-help-section h4 {
  font-size: 0.95rem;
  color: var(--hw-gold-light);
  margin-bottom: 6px;
  font-weight: 800;
}

.hw-help-rule {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hw-help-rule .rule-icon {
  font-size: 1.25rem;
  line-height: 1;
}

/* ── Responsive Adaptations ── */
@media (max-width: 680px) {
  .hw-sidebar {
    width: 64px;
    padding: 8px 4px;
    align-items: center;
  }
  .hw-sidebar-map-btn span:last-child,
  .hw-sidebar-level-card .hw-sidebar-location,
  .hw-sidebar-level-card .hw-sidebar-level-name,
  .hw-sidebar-stat-btn .stat-label,
  .hw-sidebar-stat-btn .stat-arrow,
  .hw-sidebar-action-btn,
  .hw-sidebar-action-btn .action-text,
  .hw-sidebar-action-btn .action-cost {
    display: none;
  }
  .hw-sidebar-map-btn {
    padding: 8px;
    font-size: 1.1rem;
  }
  .hw-sidebar-level-card {
    padding: 6px 4px;
    text-align: center;
  }
  .hw-sidebar-level-num {
    font-size: 0.82rem;
  }
  .hw-sidebar-stat-btn {
    padding: 6px 4px;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
  }
  .hw-sidebar-stat-btn .stat-icon {
    margin-right: 0;
  }
  .hw-sidebar-stat-btn .stat-value {
    font-size: 0.72rem;
  }
  .hw-sidebar-right {
    width: 58px;
    padding: 8px 3px 14px;
    gap: 8px;
  }
  .hw-tool-btn {
    width: 50px;
    padding: 6px 2px 5px;
  }
  .hw-tool-btn .tool-text {
    font-size: 0.58rem;
  }
  .hw-tool-btn .tool-icon {
    font-size: 1.15rem;
  }
  .hw-tool-btn .tool-cost {
    font-size: 0.58rem;
    padding: 1px 4px;
  }
}




