#number-baseball-wrapper {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: transparent;
  color: #121213;
  padding: 20px 15px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  box-sizing: border-box;
  position: relative;
}

#number-baseball-wrapper .user-greeting {
  background-color: #f8f8f8;
  border: 1px solid #d3d6da;
  color: #555555;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  margin-bottom: 20px;
  display: inline-block;
  text-align: center;
}

#number-baseball-wrapper .game-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

#number-baseball-wrapper .nb-history {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  min-height: 328px;
}

#number-baseball-wrapper .nb-history-empty {
  min-height: 328px;
  border: 2px dashed #d3d6da;
  border-radius: 8px;
  color: #787c7e;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  padding: 20px;
}

#number-baseball-wrapper .nb-row {
  display: grid;
  grid-template-columns: 34px 1fr 96px;
  align-items: center;
  gap: 8px;
}

#number-baseball-wrapper .nb-turn {
  color: #787c7e;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

#number-baseball-wrapper .nb-digits {
  display: grid;
  grid-template-columns: repeat(4, 48px);
  gap: 6px;
}

#number-baseball-wrapper .tile,
#number-baseball-wrapper .letter-input {
  width: 48px;
  height: 48px;
  border: 2px solid #d3d6da;
  background: #ffffff;
  color: #121213;
  border-radius: 4px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
}

#number-baseball-wrapper .nb-result {
  background: #f8f8f8;
  border: 1px solid #d3d6da;
  border-radius: 6px;
  color: #121213;
  font-size: 13px;
  font-weight: 900;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

#number-baseball-wrapper .nb-result-chip {
  min-width: 34px;
  padding: 5px 6px;
  border-radius: 4px;
  color: #ffffff;
  line-height: 1;
  box-sizing: border-box;
}

#number-baseball-wrapper .nb-result-chip.strike {
  background-color: #22c55e;
}

#number-baseball-wrapper .nb-result-chip.ball {
  background-color: #eab308;
}

#number-baseball-wrapper .nb-result-chip.out {
  min-width: 56px;
  background-color: #787c7e;
}

#number-baseball-wrapper .input-section {
  width: 100%;
}

#number-baseball-wrapper #nb-msg {
  text-align: center;
  margin-bottom: 15px;
  color: #555555;
  font-size: 14px;
  font-weight: 800;
  transition: color 0.2s ease;
  min-height: 20px;
  line-height: 1.45;
}

#number-baseball-wrapper #nb-msg[data-state="success"] {
  color: #16a34a;
}

#number-baseball-wrapper #nb-msg[data-state="warning"] {
  color: #dc2626;
}

#number-baseball-wrapper .nb-ranking-status {
  margin: -8px 0 14px;
  min-height: 18px;
  color: #555555;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

#number-baseball-wrapper .nb-ranking-status[data-state="success"] {
  color: #22c55e;
}

#number-baseball-wrapper .nb-ranking-status[data-state="warning"] {
  color: #dc2626;
}

#number-baseball-wrapper .nb-ranking-status[hidden] {
  display: none;
}

#number-baseball-wrapper .input-group {
  display: grid;
  grid-template-columns: repeat(4, 58px);
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}

#number-baseball-wrapper .input-group .letter-input {
  width: 58px;
  height: 58px;
  font-size: 24px;
}

#number-baseball-wrapper .letter-input.active {
  outline: 2px solid #121213;
  border-color: #121213;
}

#number-baseball-wrapper .virtual-keyboard {
  width: 100%;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#number-baseball-wrapper .keyboard-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

#number-baseball-wrapper .v-key,
#number-baseball-wrapper .nb-replay-btn {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: #e3e5e8;
  color: #121213;
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  transition: background-color 0.2s, transform 0.1s;
}

#number-baseball-wrapper .v-key:active,
#number-baseball-wrapper .nb-replay-btn:active {
  background: #d3d6da;
  transform: scale(0.94);
}

#number-baseball-wrapper .v-key.action,
#number-baseball-wrapper .nb-replay-btn {
  background: #d3d6da;
}

#number-baseball-wrapper #nb-submit-btn {
  background: #121213;
  color: #ffffff;
}

#number-baseball-wrapper .nb-replay-btn {
  width: min(160px, 100%);
  margin: 0 auto 18px;
}

#number-baseball-wrapper .nb-replay-btn[hidden] {
  display: none;
}

#number-baseball-wrapper .nb-ranking-input-section {
  display: none;
  margin: 0 0 18px;
  padding: 15px;
  background: #ffffff;
  border: 1px solid #d3d6da;
  border-radius: 8px;
}

#number-baseball-wrapper .ranking-success-msg {
  font-size: 14px;
  color: #555555;
  margin: 0 0 10px;
  text-align: center;
  font-weight: 800;
}

#number-baseball-wrapper .ranking-input-wrap {
  display: flex;
  gap: 6px;
}

#number-baseball-wrapper .nb-guest-ranking-wrap {
  margin-bottom: 20px;
}

#number-baseball-wrapper .nb-guest-ranking-title {
  margin: 0 0 10px;
  color: #121213;
  font-size: 14px;
  font-weight: 800;
}

#number-baseball-wrapper #nb-player-nickname {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 10px;
  background: #ffffff;
  border: 1px solid #d3d6da;
  color: #121213;
  border-radius: 4px;
  box-sizing: border-box;
}

#number-baseball-wrapper .ranking-submit-btn {
  padding: 10px 15px;
  background: #121213;
  border: 0;
  color: #ffffff;
  border-radius: 4px;
  font-weight: 800;
  cursor: pointer;
}

#number-baseball-wrapper .ranking-submit-btn:disabled {
  background: #787c7e;
  cursor: not-allowed;
  opacity: 0.7;
}

#number-baseball-wrapper .rules-section {
  margin: 30px auto 0;
  padding-top: 25px;
  border-top: 1px solid #e5e5e5;
  width: 100%;
}

#number-baseball-wrapper .rules-section h3 {
  margin: 0 0 15px;
  font-size: 18px;
  font-weight: 800;
  color: #121213;
}

#number-baseball-wrapper .rules-section .desc,
#number-baseball-wrapper .rules-section li,
#number-baseball-wrapper .rule-footer {
  word-break: keep-all;
}

#number-baseball-wrapper .rules-section .desc {
  font-size: 15px;
  color: #555555;
  margin-bottom: 15px;
  line-height: 1.4;
}

#number-baseball-wrapper .rules-section ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: left;
}

#number-baseball-wrapper .rules-section li {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
  color: #121213;
}

#number-baseball-wrapper .rules-section .example-tile {
  width: 28px;
  height: 28px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  border-radius: 4px;
  margin-right: 10px;
  color: #ffffff;
  flex-shrink: 0;
}

#number-baseball-wrapper .rules-section .example-tile.correct {
  background-color: #22c55e;
}

#number-baseball-wrapper .rules-section .example-tile.present {
  background-color: #eab308;
}

#number-baseball-wrapper .rules-section .example-tile.absent {
  background-color: #787c7e;
}

#number-baseball-wrapper .rule-footer {
  font-size: 15px;
  color: #121213;
  margin: 20px 0 0;
  padding: 15px;
  background-color: #f8f8f8;
  border-radius: 8px;
  text-align: center;
  line-height: 1.5;
}

@media (min-width: 600px) {
  #number-baseball-wrapper {
    max-width: 100%;
    padding: 40px 20px;
  }

  #number-baseball-wrapper .input-section,
  #number-baseball-wrapper .rules-section {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  #number-baseball-wrapper #nb-msg {
    font-size: 16px;
    margin-bottom: 20px;
  }

  #number-baseball-wrapper .nb-history {
    min-height: 418px;
  }

  #number-baseball-wrapper .nb-history-empty {
    min-height: 418px;
  }

  #number-baseball-wrapper .nb-digits {
    grid-template-columns: repeat(4, 66px);
    gap: 8px;
  }

  #number-baseball-wrapper .tile {
    width: 66px;
    height: 66px;
    font-size: 28px;
  }
}

@media (min-width: 900px) {
  #number-baseball-wrapper .game-layout {
    max-width: 850px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 50px;
  }

  #number-baseball-wrapper .game-left {
    width: 415px;
  }

  #number-baseball-wrapper .game-right {
    width: 380px;
  }

  #number-baseball-wrapper .rules-section {
    max-width: 845px;
  }
}

@media (max-width: 450px) {
  #number-baseball-wrapper {
    padding: 15px 10px;
  }

  #number-baseball-wrapper .nb-history,
  #number-baseball-wrapper .nb-history-empty {
    min-height: 288px;
  }

  #number-baseball-wrapper .nb-row {
    grid-template-columns: 28px 1fr 92px;
    gap: 5px;
  }

  #number-baseball-wrapper .nb-digits {
    grid-template-columns: repeat(4, 42px);
    gap: 4px;
  }

  #number-baseball-wrapper .tile {
    width: 42px;
    height: 42px;
    font-size: 19px;
  }

  #number-baseball-wrapper .input-group {
    grid-template-columns: repeat(4, 48px);
    gap: 5px;
  }

  #number-baseball-wrapper .input-group .letter-input {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  #number-baseball-wrapper .v-key,
  #number-baseball-wrapper .nb-replay-btn {
    min-height: 42px;
    font-size: 14px;
  }
}
