:root {
  --bg-dark: #121520;
  --panel-bg: #1e2436;
  --panel-border: #323c59;
  --accent: #ffb703;
  --accent-hover: #fb8500;
  --hp-hero: #06d6a0;
  --hp-monster: #ef476f;
  --text-main: #f8f9fa;
  --text-sub: #adb5bd;
  --btn-bg: #2b344d;
  --btn-border: #435075;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

html, body {
  width: 100%;
  height: 100dvh;
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow: hidden;
}

#app {
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(6px, 1.2vmin, 14px) clamp(8px, 1.6vmin, 18px);
  gap: clamp(6px, 1vmin, 12px);
}

/* ================= 상단 헤더 ================= */
.header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 14px;
  padding: clamp(6px, 1vmin, 10px) clamp(10px, 1.5vmin, 16px);
  flex-shrink: 0;
  gap: 6px 8px;
}

.stat-group {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vmin, 14px);
  font-size: clamp(0.82rem, 1.5vmin, 1.05rem);
  font-weight: 700;
  flex-wrap: wrap;
}

.badge {
  background: #2b344d;
  padding: clamp(4px, 0.7vmin, 7px) clamp(8px, 1.2vmin, 12px);
  border-radius: 10px;
  border: 1px solid #435075;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.gold-text { color: #ffd166; }

.nav-btns {
  display: flex;
  align-items: center;
  gap: clamp(5px, 0.9vmin, 8px);
  flex-shrink: 0;
}

.btn-sm {
  background: var(--btn-bg);
  color: var(--text-main);
  border: 2px solid var(--btn-border);
  border-radius: 10px;
  padding: clamp(5px, 0.8vmin, 8px) clamp(9px, 1.3vmin, 14px);
  font-size: clamp(0.8rem, 1.4vmin, 0.95rem);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.1s;
}
.btn-sm:active { transform: scale(0.95); }

.btn-wanted {
  background: #591c27;
  border-color: #ef476f;
  color: #ffccd5;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* 메인 화면 전환 */
.screen {
  flex: 1;
  display: none;
  flex-direction: column;
  min-height: 0;
}
.screen.active { display: flex; }

/* ================= 로비 화면 (가로/세로 반응형) ================= */
.lobby-body {
  flex: 1;
  display: grid;
  grid-template-columns: clamp(220px, 24vw, 290px) 1fr;
  gap: clamp(8px, 1.4vmin, 14px);
  min-height: 0;
}

.hero-card {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  padding: clamp(10px, 1.5vmin, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}

.hero-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.hero-avatar {
  font-size: clamp(3.2rem, 7vmin, 5rem);
  background: radial-gradient(circle, #2e3856 0%, transparent 70%);
  width: clamp(84px, 13vmin, 126px);
  height: clamp(84px, 13vmin, 126px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  position: relative;
}

.weapon-icon {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: clamp(1.4rem, 2.8vmin, 2.1rem);
  background: #121520;
  border-radius: 50%;
  padding: 4px;
  border: 2px solid var(--accent);
}

.hero-info { text-align: center; }
.hero-title {
  color: var(--accent);
  font-size: clamp(0.78rem, 1.3vmin, 0.92rem);
  font-weight: 700;
}
.hero-name {
  font-size: clamp(1.05rem, 1.8vmin, 1.3rem);
  font-weight: 800;
}

.shop-box {
  width: 100%;
  background: #161b29;
  border-radius: 12px;
  padding: clamp(8px, 1.2vmin, 12px);
  text-align: center;
  border: 1px solid var(--panel-border);
}
.weapon-title {
  font-weight: 800;
  font-size: clamp(0.85rem, 1.4vmin, 1rem);
}
.weapon-desc {
  font-size: clamp(0.74rem, 1.15vmin, 0.84rem);
  color: #adb5bd;
  margin-top: 2px;
}

.btn-upgrade {
  width: 100%;
  margin-top: 8px;
  padding: clamp(8px, 1.2vmin, 12px);
  background: linear-gradient(135deg, #ffb703, #fb8500);
  color: #121520;
  font-weight: 800;
  font-size: clamp(0.85rem, 1.4vmin, 1rem);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.btn-upgrade:disabled {
  background: #3a4259;
  color: #7c859e;
  cursor: not-allowed;
}

.stage-area {
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  padding: clamp(10px, 1.4vmin, 16px);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.1vmin, 12px);
  min-height: 0;
}

.world-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(5px, 0.9vmin, 9px);
  flex-shrink: 0;
}

.world-tab {
  padding: clamp(6px, 0.9vmin, 10px) 4px;
  background: #161b29;
  border: 2px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text-sub);
  font-size: clamp(0.78rem, 1.35vmin, 0.95rem);
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.world-tab.active {
  background: #273252;
  border-color: var(--accent);
  color: var(--text-main);
  box-shadow: 0 0 10px rgba(255, 183, 3, 0.25);
}
.world-tab-sub {
  font-size: clamp(0.68rem, 1.1vmin, 0.78rem);
  font-weight: 600;
  color: #8d99ae;
}
.world-tab.active .world-tab-sub { color: #ffd166; }

.stage-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: clamp(6px, 1vmin, 10px);
  min-height: 0;
}

.stage-btn {
  background: #252d42;
  border: 2px solid #3c486b;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2px, 0.5vmin, 5px);
  cursor: pointer;
  padding: 4px;
  min-height: 0;
  transition: transform 0.1s;
}
.stage-btn:active { transform: scale(0.96); }
.stage-btn.cleared {
  border-color: #06d6a0;
  background: #1b3838;
}
.stage-emoji { font-size: clamp(1.3rem, 2.6vmin, 1.85rem); }
.stage-num { font-size: clamp(0.85rem, 1.45vmin, 1.1rem); font-weight: 800; }
.stage-theme {
  font-size: clamp(0.7rem, 1.15vmin, 0.85rem);
  color: var(--text-sub);
  text-align: center;
  word-break: keep-all;
  line-height: 1.15;
}
.stage-stars { font-size: clamp(0.8rem, 1.3vmin, 1rem); color: #ffd166; }

@media (orientation: portrait) {
  #screen-lobby {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .lobby-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    min-height: auto;
  }
  .hero-card {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
  }
  .hero-profile {
    flex-direction: row;
    gap: 10px;
    flex: 1 1 180px;
    min-width: 0;
  }
  .hero-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
  }
  .weapon-icon {
    font-size: 1.05rem;
    padding: 2px;
  }
  .hero-info {
    text-align: left;
    min-width: 0;
  }
  .hero-title {
    font-size: 0.76rem;
    line-height: 1.25;
    word-break: keep-all;
  }
  .hero-name {
    font-size: 1rem;
    line-height: 1.25;
    word-break: keep-all;
  }
  .shop-box {
    width: auto;
    flex: 1 1 175px;
    min-width: 0;
    padding: 8px 10px;
  }
  .weapon-title {
    font-size: 0.85rem;
    line-height: 1.25;
    word-break: keep-all;
  }
  .weapon-desc {
    font-size: 0.72rem;
    line-height: 1.25;
    word-break: keep-all;
  }
  .stage-area {
    min-height: auto;
    padding: 10px;
  }
  .stage-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: none;
    grid-auto-rows: minmax(76px, auto);
    gap: 8px;
    min-height: auto;
  }
  .stage-btn {
    min-height: 76px;
    padding: 8px 6px;
    gap: 3px;
  }
}

/* ================= 전투 화면 ================= */
.battle-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(5px, 0.8vmin, 8px) clamp(10px, 1.4vmin, 16px);
  background: #161b29;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  flex-shrink: 0;
  gap: 8px;
}

.battle-title {
  font-weight: 800;
  font-size: clamp(0.85rem, 1.45vmin, 1.05rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-dots {
  display: flex;
  gap: clamp(3px, 0.6vmin, 6px);
  font-size: clamp(0.78rem, 1.3vmin, 1rem);
  flex-wrap: wrap;
  justify-content: center;
}

.combo-badge {
  font-size: clamp(0.88rem, 1.5vmin, 1.1rem);
  font-weight: 900;
  color: #ff9f1c;
  min-width: 90px;
  text-align: right;
  white-space: nowrap;
}

.arena {
  flex: 34;
  min-height: 110px;
  background: linear-gradient(180deg, #1b263b 0%, #2b3a55 100%);
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: clamp(6px, 1vmin, 12px) clamp(16px, 3vw, 40px);
  position: relative;
  overflow: hidden;
}

.combatant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.7vmin, 8px);
  width: clamp(140px, 24vw, 250px);
}

.combatant-label {
  font-weight: 800;
  font-size: clamp(0.8rem, 1.35vmin, 0.98rem);
  white-space: nowrap;
}

.hp-bar-wrap {
  width: 100%;
  height: clamp(11px, 1.6vmin, 16px);
  background: #0d111a;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #4a5568;
}

.hp-fill {
  height: 100%;
  transition: width 0.25s ease;
}
.hp-hero-fill { background: var(--hp-hero); }
.hp-monster-fill { background: var(--hp-monster); }

.sprite {
  font-size: clamp(3.4rem, 7.5vmin, 5.4rem);
  line-height: 1;
  transition: transform 0.15s;
}

.anim-attack { transform: translateX(40px) scale(1.15); }
.anim-hit { animation: shake 0.35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-12px); }
  75% { transform: translateX(12px); }
}

.fx-text {
  position: absolute;
  font-size: clamp(1.3rem, 2.8vmin, 2.1rem);
  font-weight: 900;
  color: #ffd166;
  text-shadow: 0 3px 8px rgba(0,0,0,0.85);
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition: all 0.5s ease-out;
  text-align: center;
  z-index: 10;
}
.fx-text.show {
  opacity: 1;
  transform: translateY(-26px);
}

/* 퀴즈 영역 & 중앙 단어 강조 */
.quiz-zone {
  flex: 66;
  min-height: 0;
  background: var(--panel-bg);
  border: 2px solid var(--panel-border);
  border-radius: 16px;
  padding: clamp(10px, 1.5vmin, 18px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(8px, 1.2vmin, 14px);
}

.prompt-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 1.8vw, 22px);
  background: radial-gradient(circle at center, #253257 0%, #141928 85%);
  border-radius: 20px;
  padding: clamp(12px, 1.8vmin, 22px) clamp(14px, 2.2vmin, 26px);
  border: 2.5px solid #ffb703;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(255, 183, 3, 0.14);
  flex-shrink: 0;
}

.btn-tts {
  background: #22304c;
  border: 2px solid #4cc9f0;
  color: #72efdd;
  border-radius: 14px;
  padding: clamp(8px, 1.2vmin, 12px) clamp(11px, 1.5vmin, 16px);
  font-size: clamp(0.9rem, 1.5vmin, 1.12rem);
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.btn-tts:active { transform: scale(0.94); }

.word-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.8vw, 22px);
  flex: 1;
  min-width: 0;
  background: rgba(255, 209, 102, 0.08);
  border: 1.5px solid rgba(255, 209, 102, 0.35);
  border-radius: 16px;
  padding: clamp(6px, 1vmin, 12px) clamp(12px, 2vw, 24px);
}

.word-emoji {
  font-size: clamp(3rem, 6.4vmin, 4.8rem);
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
}

.word-main {
  font-size: clamp(3rem, 7.6vmin, 5.6rem);
  font-weight: 950;
  letter-spacing: 0.8px;
  color: #fff3b0;
  text-shadow:
    0 3px 0 #b56500,
    0 6px 18px rgba(255, 183, 3, 0.45),
    0 0 28px rgba(255, 243, 176, 0.25);
  text-align: center;
  word-break: keep-all;
  line-height: 1.08;
}

.mode-tag {
  font-size: clamp(0.78rem, 1.3vmin, 0.95rem);
  background: #3a0ca3;
  color: #e0aaff;
  padding: clamp(5px, 0.8vmin, 8px) clamp(8px, 1.2vmin, 12px);
  border-radius: 10px;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
}

.retry-banner {
  background: rgba(239, 71, 111, 0.16);
  border: 1px solid #ef476f;
  color: #ffccd5;
  border-radius: 12px;
  padding: clamp(6px, 0.9vmin, 9px) 14px;
  text-align: center;
  font-size: clamp(0.9rem, 1.55vmin, 1.12rem);
  font-weight: 800;
  flex-shrink: 0;
}

.answer-banner {
  background: rgba(255, 183, 3, 0.2);
  border: 2px solid #ffb703;
  color: #ffd166;
  border-radius: 12px;
  padding: clamp(6px, 1vmin, 10px) 14px;
  text-align: center;
  font-size: clamp(0.95rem, 1.65vmin, 1.2rem);
  font-weight: 900;
  flex-shrink: 0;
}

/* 4지선다 그리드 */
.choices-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: clamp(8px, 1.3vmin, 14px);
  min-height: 0;
}

@media (orientation: portrait) {
  .choices-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr);
  }
}

.choice-btn {
  background: var(--btn-bg);
  border: 2px solid var(--btn-border);
  border-radius: 16px;
  color: var(--text-main);
  font-size: clamp(1.25rem, 2.5vmin, 1.85rem);
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  transition: background 0.12s, transform 0.08s;
  word-break: keep-all;
  text-align: center;
}
.choice-btn:active { transform: scale(0.97); }
.choice-btn.correct { background: #06d6a0; border-color: #06d6a0; color: #0b132b; }
.choice-btn.wrong { background: #ef476f; border-color: #ef476f; color: #fff; opacity: 0.45; pointer-events: none; }
@keyframes blinkFourTimes {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 6px rgba(255, 183, 3, 0.35);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 28px rgba(255, 229, 102, 1);
    filter: brightness(1.35);
  }
}

.choice-btn.revealed-answer {
  background: linear-gradient(135deg, #ffd166, #fb8500) !important;
  border-color: #ffffff !important;
  color: #121520 !important;
  animation: blinkFourTimes 0.42s ease-in-out 4 forwards;
}

/* Lv.3 스펠링 블록 영역 */
.spelling-area {
  flex: 1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.5vmin, 16px);
  min-height: 0;
}

.slots-row {
  display: flex;
  gap: clamp(5px, 0.9vmin, 9px);
  flex-wrap: wrap;
  justify-content: center;
}

.letter-slot {
  width: clamp(38px, 6vmin, 54px);
  height: clamp(44px, 6.8vmin, 60px);
  background: #121520;
  border: 2px dashed #5c6b96;
  border-radius: 12px;
  font-size: clamp(1.45rem, 2.8vmin, 2.1rem);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffd166;
}
.letter-slot.filled {
  border-style: solid;
  border-color: #ffd166;
  background: #252e47;
}
.letter-slot.wrong-char {
  border-color: #ef476f !important;
  background: #4a1523 !important;
  color: #ffccd5 !important;
  animation: shake 0.35s;
}
.letter-slot.revealed-slot {
  border-style: solid;
  border-color: #ffffff !important;
  background: #fb8500 !important;
  color: #121520 !important;
  animation: blinkFourTimes 0.42s ease-in-out 4 forwards;
}

.blocks-row {
  display: flex;
  gap: clamp(6px, 1.1vmin, 12px);
  flex-wrap: wrap;
  justify-content: center;
}

.letter-block {
  width: clamp(44px, 6.8vmin, 60px);
  height: clamp(44px, 6.8vmin, 60px);
  background: linear-gradient(180deg, #3b486b, #283149);
  border: 2px solid #697cb3;
  border-radius: 14px;
  color: #fff;
  font-size: clamp(1.45rem, 2.7vmin, 2rem);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 #161b29;
}
.letter-block:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #161b29;
}
.letter-block.used {
  opacity: 0.22;
  pointer-events: none;
}

/* ================= 모달 (도감 / 결과) ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 18, 0.86);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: clamp(12px, 2vmin, 24px);
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: var(--panel-bg);
  border: 3px solid var(--accent);
  border-radius: 20px;
  width: 100%;
  max-width: 820px;
  max-height: 88dvh;
  padding: clamp(16px, 2.2vmin, 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.btn-modal-secondary {
  padding: 12px 22px;
  background: #2b344d;
  border: 2px solid #435075;
  color: #fff;
  border-radius: 12px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.btn-modal-primary {
  padding: 12px 26px;
  background: linear-gradient(135deg, #06d6a0, #00b4d8);
  border: none;
  color: #0b132b;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(6, 214, 160, 0.35);
}
.btn-modal-primary:active { transform: scale(0.96); }

.dex-filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.dex-filter-btn {
  background: #151926;
  border: 1px solid #3c486b;
  color: #adb5bd;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.dex-filter-btn.active {
  background: var(--accent);
  color: #121520;
  border-color: var(--accent);
}

.dex-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
  gap: 8px;
  padding-right: 4px;
}

.dex-item {
  background: #151926;
  border: 1px solid #323c59;
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
}
.dex-item:active { background: #262e47; }

/* ================= 3D 애니메이션 히어로 초상화 & 3D 엠블럼 몬스터 스타일 ================= */
.hero-avatar {
  overflow: visible;
  border: 3px solid var(--accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 183, 3, 0.35);
  background: radial-gradient(circle at 35% 30%, #1d3b72 0%, #091d42 85%);
}

.hero-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.hero-sprite-wrap {
  width: clamp(82px, 14vmin, 126px);
  height: clamp(82px, 14vmin, 126px);
  border-radius: 50%;
  border: 3px solid #ffd166;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(255, 183, 3, 0.4),
    inset 0 2px 6px rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 30% 25%, #234785 0%, #091d42 85%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.battle-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* 몬스터 쪽 3D 메달리온(입체 엠블럼) 스타일 — 꼬마 기사 3D 톤과 통일 */
.monster-sprite-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.monster-medallion {
  width: clamp(82px, 14vmin, 126px);
  height: clamp(82px, 14vmin, 126px);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.08) 28%, transparent 55%),
    radial-gradient(circle at 50% 65%, #3a2359 0%, #17122b 85%);
  border: 3px solid #ff758f;
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.62),
    0 0 18px rgba(239, 71, 111, 0.42),
    inset 0 -6px 12px rgba(0, 0, 0, 0.55),
    inset 0 3px 8px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.monster-medallion.boss-mode {
  border-color: #ffd166;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.48) 0%, rgba(255, 255, 255, 0.1) 28%, transparent 55%),
    radial-gradient(circle at 50% 65%, #5c1a33 0%, #1f0c1d 85%);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.68),
    0 0 22px rgba(255, 183, 3, 0.55),
    inset 0 -6px 12px rgba(0, 0, 0, 0.6),
    inset 0 3px 8px rgba(255, 243, 176, 0.4);
}

#monster-emoji {
  font-size: clamp(2.9rem, 6.2vmin, 4.5rem);
  line-height: 1;
  filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.2));
  transform: translateY(-1px);
}

/* 중앙 단어 옆 그림도 3D 입체 배지로 감싸 통일감 부여 */
.word-emoji-badge {
  width: clamp(56px, 9.6vmin, 82px);
  height: clamp(56px, 9.6vmin, 82px);
  border-radius: 20px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.35) 0%, transparent 55%),
    linear-gradient(145deg, #273763, #131b33);
  border: 2px solid rgba(255, 209, 102, 0.55);
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.5),
    inset 0 2px 5px rgba(255, 255, 255, 0.25),
    inset 0 -4px 8px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.word-emoji {
  font-size: clamp(2.4rem, 5vmin, 3.7rem);
  line-height: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
}
