body {
  padding: 20px 2px 2px 2px;
  font-family: 'Roboto', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  background-color: #f0f8ff; /* 밝은 하늘색 배경 */
  min-height: 100vh;
  margin: 0;
  font-size: 1.5rem;
}

header {
  background-color: #02051d; /* Dark blue background color */
  color: white;
  text-align: left;
  padding: 1em 0;
}

#topic-selection {
  margin-top: -10px !important;
  text-align: center;
  font-size: 30px;
  width: 100%;
}

.container {
  padding: 2px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background-color: transparent;
  width: 100%;
  max-width: 1200px;
  min-height: unset;
}

#words-block, #button-block {
  margin-bottom: 4px;
}

#hangman-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#canvas {
  width: 100%;
  max-width: 360px;
  height: 288px;
  margin: 20px auto;
  display: block;
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.block {
  width: 100%;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

#topic-heading {
  color: #333;
  margin-bottom: 15px;
  margin-top: 50px;
  font-size: 26px !important;
}

#topic-dropdown {
  width: 100%;
  max-width: 360px;
  padding: 8px;
  font-size: 26.2px !important;
  border: 2px solid #1e90ff;
  border-radius: 8px;
  margin-bottom: 20px;
}

#hint-container, #result-text {
  font-size: 24px !important;
  color: #1e90ff !important;
  text-align: center !important;
  min-height: 24px !important;
  margin: 6px 0 0 0 !important;
  word-break: break-word !important;
  white-space: pre-line !important;
  display: block !important;
}

#hint-container {
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}

#button-block {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: none;
  box-shadow: none;
  padding: 0 !important;
}

#button-block button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 19px;
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  background: #1e90ff;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  min-width: 0;
  box-shadow: 0 2px 8px rgba(30,144,255,0.10);
}

#button-block button:hover {
  background: #187bcd;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .container {
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  #words-block,
  #hangman-block {
    margin: 0 !important;
    padding: 0 !important;
  }
  #topic-selection {
    margin-top: 1px !important;
  }
  .block {
    margin-bottom: 16px !important;
    margin-top: 3.2px !important;
    padding: 16px !important;
  }
  body {
    padding-top: 56px !important;
  }
  #canvas {
    width: 100% !important;
    max-width: 288px !important;
    height: 230px !important;
    min-height: unset !important;
    margin: 0 auto 4px auto !important;
    display: block;
  }
  #topic-dropdown {
    width: 100% !important;
    max-width: 288px !important;
    font-size: 19px !important;
    padding: 4px !important;
    margin-bottom: 8px !important;
  }
}

#user-input-section {
  margin: 0;
  font-size: 2.5rem;
  min-height: 48px;
  text-align: center;
}

#user-input-section .dash {
  display: inline-block;
  border-bottom: 3px dotted #bbb !important;
  font-size: 28px;
  color: #222;
  text-align: center;
  vertical-align: bottom;
  font-weight: bold;
  margin: 0 18px 0 0;
  min-width: 32px;
}

#canvas-message {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  pointer-events: none;
  font-size: 24px;
  font-weight: bold;
  color: #1e90ff;
  text-shadow: 2px 2px 8px #fff, 0 0 2px #000;
  z-index: 2;
  text-align: center;
  box-sizing: border-box;
  padding-bottom: 8px;
}

.letter-container button.color1 { background: #ffb3ba; color: #222; }
.letter-container button.color2 { background: #bae1ff; color: #222; }
.letter-container button.color3 { background: #baffc9; color: #222; }
.letter-container button.color4 { background: #ffffba; color: #222; }
.letter-container button.color5 { background: #ffdfba; color: #222; }
.letter-container button.color6 { background: #e2f0cb; color: #222; }
.letter-container button.color7 { background: #b5ead7; color: #222; }
.letter-container button.color8 { background: #c7ceea; color: #222; }
.letter-container button.color9 { background: #f7cac9; color: #222; }
.letter-container button.color10 { background: #f6eac2; color: #222; }

.letter-container button.used::after {
  content: '✖️';
  color: #e74c3c;
  font-size: 22px;
  position: absolute;
  top: 2px;
  right: 6px;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  font-weight: bold;
}

.letter-container {
  margin-top: 10px !important;
}

body, #user-input-section, .letter-container button, #canvas-message {
  font-family: 'Nanum Pen Script', cursive;
}

.letter-container button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: bold;
  margin: 3px;
  box-shadow: 0 2px 8px rgba(30,144,255,0.15);
  border: none;
  transition: background 0.2s, color 0.2s, transform 0.1s;
  color: #222;
  position: relative;
}

.navbar-brand {
  font-size: 22px;
}

.letters {
  position: relative;
}
.letters .mark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, calc(-50% + 15px));
  color: red;
  font-size: 54px;
  font-weight: bold;
  display: none;
  pointer-events: none;
  z-index: 2;
  background: none !important;
}
