#wordify-game {
  width: 100%;
  touch-action: manipulation;
}

.wordify-box {
  text-align: center;
  padding: 0 !important;
  overflow: hidden;
}

.game-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 10px;
  text-align: left;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.game-bar-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.game-bar-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 5px 12px;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-s);
  text-transform: lowercase;
  white-space: nowrap;
}

.stat-label {
  font-weight: bold;
  opacity: 0.8;
}

.game-bar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.game-bar-actions .icon-button-bar {
  width: auto;
  height: 38px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-family-primary);
  font-size: var(--font-size-s);
  text-transform: lowercase;
  -webkit-mask-image: none !important;
  mask-image: none !important;
  touch-action: manipulation;
}

.icon-button-bar:hover {
  background: rgba(255, 255, 255, 0.25);
}

.wordify-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 25px 30px 10px;
}

#wordify-game #game {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}

#wordify-game .row {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 60px));
  gap: 6px;
}

#wordify-game .tile {
  width: 100%;
  height: 60px;
  border: 2px solid var(--border-form-fields);
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-l);
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  line-height: 60px;
  background: var(--bg-form-fields);
  color: var(--text-form-fields);
  border-radius: 6px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#wordify-game .tile.correct {
  background: #8de0a4;
  border-color: #6cc487;
  color: #fff;
}

#wordify-game .tile.present {
  background: #f0c477;
  border-color: #d9a95a;
  color: #fff;
}

#wordify-result {
  font-family: var(--font-family-secondary);
  font-size: var(--font-size-m);
  color: var(--text-wrappers);
  margin-bottom: 20px;
  display: none;
}

#wordify-result.visible {
  display: block;
}

.input-section {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 460px;
  margin: 0 auto 25px;
}

.input-section input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  touch-action: manipulation;
}

.icon-button {
  width: 45px;
  height: 35px;
  flex-shrink: 0;
  -webkit-mask-image: url('../../images/shape-box-square.svg');
  mask-image: url('../../images/shape-box-square.svg');
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  z-index: 1;
  touch-action: manipulation;
}

#streak-count.green  { color: #8de0a4; }
#streak-count.orange { color: #f0c477; }

@media (max-width: 600px) {
  .game-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 8px 10px;
    gap: 8px;
  }

  .game-bar-left {
    flex: 1;
    min-width: 0;
  }

  .game-bar-stats {
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, black calc(100% - 24px), transparent 100%);
  }

  .game-bar-stats::-webkit-scrollbar { display: none; }

  .stat-pill {
    padding: 4px 9px;
    font-size: 12px;
    flex-shrink: 0;
  }

  .game-bar-actions {
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: 6px;
  }

  .game-bar-actions .icon-button-bar {
    height: 34px;
    padding: 0;
    width: 34px;
    justify-content: center;
    border-radius: 50%;
  }

  .game-bar-actions .icon-button-bar span { display: none; }
  .game-bar-actions .icon-button-bar i   { font-size: 16px; }

  .wordify-stage {
    padding: 12px 20px 4px;
  }

  #wordify-game .tile {
    height: 48px;
    line-height: 48px;
    font-size: var(--font-size-m);
  }

  #wordify-game .row {
    grid-template-columns: repeat(5, minmax(36px, 52px));
    gap: 4px;
  }

  #wordify-game #game {
    gap: 4px;
  }

  .input-section {
    padding-left: 16px;
    padding-right: 16px;
    gap: 8px;
  }

  .input-section input[type="text"] {
    font-size: 16px;
    padding: 12px 14px;
    transform: scale(0.875);
    transform-origin: left center;
    width: 114.3%;
    margin-right: -14.3%;
  }

  .icon-button {
    width: 40px;
    height: 32px;
  }
}