/* ==========================================================================
   단어 학습 게임 (Wordle 스타일) 메인 스타일시트
   ========================================================================== */

:root {
  /* 배경 이미지 */
  --bg-image: url('../assets/bg-dark.svg');

  /* 색상 팔레트 (다크 테마 기본 - IMG_3367.PNG 기준) */
  --color-bg: #121213;
  --color-surface: rgba(26, 26, 27, 0.85);
  --color-surface-elevated: #242526;
  --color-text: #ffffff;
  --color-text-sub: #d7dadc;
  --color-text-muted: #818384;
  --color-border: #3a3a3c;
  --color-border-active: #565758;

  /* 타일 및 키보드 상태 색상 */
  --color-correct: #538d4e;       /* 초록색: 글자 & 위치 일치 */
  --color-present: #b59f3b;       /* 노란색: 글자 포함 & 위치 상이 */
  --color-absent: #3a3a3c;        /* 회색: 미포함 */
  --color-key-bg: #818384;
  --color-key-text: #ffffff;

  /* UI 인터랙션 */
  --color-btn-primary: #538d4e;
  --color-btn-primary-hover: #467642;
  --color-modal-bg: #121213;
  --color-toast-bg: #f8f9fa;
  --color-toast-text: #121213;
  --color-focus: #9cdb92;
  --surface-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);

  /* 레이아웃 규격 */
  --header-height: 66px;
  --board-max-width: 350px;
  --board-max-height: 420px;
  --tile-size: 60px;
  --tile-gap: 6px;
  --keyboard-max-width: 500px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

/* 라이트 테마 변수 */
body.light-theme {
  --bg-image: none;
  --color-bg: #f7f7f2;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-text: #1d2930;
  --color-text-sub: #425159;
  --color-text-muted: #718087;
  --color-border: #d9dfdc;
  --color-border-active: #8da09d;

  --color-correct: #438873;
  --color-present: #c49a45;
  --color-absent: #839098;
  --color-key-bg: #e1e7e3;
  --color-key-text: #1d2930;

  --color-btn-primary: #193941;
  --color-btn-primary-hover: #28535c;
  --color-modal-bg: #ffffff;
  --color-toast-bg: #193941;
  --color-toast-text: #ffffff;
  --color-focus: #296e76;
  --surface-shadow: 0 14px 34px rgba(25, 57, 65, 0.12);
}

/* 고대비 모드 변수 */
body.high-contrast {
  --color-correct: #f5793a; /* 주황색 */
  --color-present: #85c0f9; /* 하늘색 */
}

/* 기본 리셋 및 전역 스타일 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

[hidden] {
  display: none !important;
}

input,
textarea,
select {
  -webkit-user-select: text;
  user-select: text;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--color-text);
  font-family: var(--font-family);
  transition: background-color 0.25s ease, background-image 0.25s ease, color 0.2s ease;
}

.site-nav {
  position: fixed;
  z-index: 1500;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  border-bottom: 1px solid #e0e4dd;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 8px rgba(25, 57, 65, 0.04);
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1120px);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.site-brand {
  display: grid;
  color: #193941;
  line-height: 1;
  text-decoration: none;
}

.site-brand strong {
  font-size: 1.25rem;
  letter-spacing: 0.03em;
}

.site-brand span {
  margin-top: 4px;
  color: #668076;
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
}

.site-links {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-share-btn,
.site-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(230, 198, 110, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #f7df93;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.site-share-btn {
  padding: 0;
}

.site-fullscreen-btn {
  padding: 0;
}

.site-share-btn:hover,
.site-fullscreen-btn:hover {
  background: rgba(230, 198, 110, 0.2);
  border-color: #f7df93;
  color: #fff8d9;
  transform: translateY(-1px);
}

.site-share-btn:active,
.site-fullscreen-btn:active {
  transform: translateY(0);
}

.site-share-btn:focus-visible,
.site-fullscreen-btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

.site-nav-divider {
  width: 1px;
  height: 20px;
  background: rgba(230, 198, 110, 0.5);
}

.site-links .header-user-status {
  max-width: 132px;
  min-width: 0;
  padding: 3px 9px;
  font-size: 0.78rem;
}

.site-links #header-user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-center .game-timer {
  padding: 0;
  font-size: 0.76rem;
}

.site-share-btn svg,
.site-fullscreen-btn svg {
  display: block;
  flex-shrink: 0;
}

.site-fullscreen-btn .icon-fullscreen-exit {
  display: none;
}

:fullscreen .site-fullscreen-btn .icon-fullscreen-enter,
:-webkit-full-screen .site-fullscreen-btn .icon-fullscreen-enter,
.is-fullscreen .site-fullscreen-btn .icon-fullscreen-enter {
  display: none;
}

:fullscreen .site-fullscreen-btn .icon-fullscreen-exit,
:-webkit-full-screen .site-fullscreen-btn .icon-fullscreen-exit,
.is-fullscreen .site-fullscreen-btn .icon-fullscreen-exit {
  display: block;
}

#app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 600px;
  height: calc(100% - 64px);
  margin: 0 auto;
  margin-top: 64px;
  position: relative;
  background: radial-gradient(circle at center, rgba(18, 18, 19, 0.45) 0%, rgba(18, 18, 19, 0.75) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--surface-shadow);
}

.auth-screen {
  --color-bg: #f7f7f2;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-text: #1d2930;
  --color-text-sub: #425159;
  --color-text-muted: #718087;
  --color-border: #d9dfdc;
  --color-border-active: #8da09d;
  --color-btn-primary: #193941;
  --color-btn-primary-hover: #28535c;
  --color-focus: #296e76;
  --surface-shadow: 0 14px 34px rgba(25, 57, 65, 0.12);
  color: var(--color-text);
  min-height: calc(100% - 64px);
  height: calc(100% - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 0;
  margin-top: 64px;
  background: #f7f7f2;
  box-sizing: border-box;
}

.auth-panel {
  margin: 12px 0 24px;
  width: min(100%, 420px);
  padding: clamp(20px, 5vw, 36px);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--surface-shadow);
  animation: modalContentPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 20px 24px;
  background: #193941;
  color: #dce7e2;
  box-sizing: border-box;
}

.site-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100%, 1120px);
  margin: 0 auto;
}

.site-footer-identity {
  display: grid;
  gap: 5px;
}

.site-footer-brand {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.site-footer-links {
  display: flex;
  gap: 20px;
}

.site-footer-links a {
  color: #dce7e2;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer p {
  color: #aebfba;
  font-size: 0.75rem;
  line-height: 1.45;
}

.auth-eyebrow {
  color: var(--color-present);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.auth-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-toolbar .auth-eyebrow {
  margin-right: auto;
}

.auth-language-label {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.auth-language-select {
  min-height: 32px;
  padding: 4px 7px;
  border: 1px solid var(--color-border-active);
  border-radius: 4px;
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  font-size: 0.8rem;
}

.auth-panel h1 {
  margin: 10px 0 8px;
  font-size: clamp(1.7rem, 6vw, 2.25rem);
  letter-spacing: 0;
}

.auth-description {
  color: var(--color-text-sub);
  font-size: 0.95rem;
  line-height: 1.55;
}

.auth-account-notice {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #bed2c9;
  border-left: 4px solid #296e76;
  border-radius: 4px;
  background: #edf5f2;
  color: #25454a;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 9px;
  margin-top: 20px;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 24px;
  padding: 4px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.auth-mode-btn {
  min-height: 40px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-sub);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-mode-btn.active {
  background: var(--color-surface-elevated);
  color: var(--color-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.auth-mode-btn:focus-visible,
.auth-language-select:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.auth-form label {
  font-size: 0.9rem;
  font-weight: 700;
}

.auth-field-group {
  display: grid;
  gap: 9px;
}

.auth-field-help {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.auth-requirements {
  padding: 10px 12px;
  border-left: 3px solid var(--color-present);
  background: rgba(181, 159, 59, 0.12);
  color: var(--color-text-sub);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-form input,
.setting-select {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--color-border-active);
  border-radius: 6px;
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
}

.auth-form input:focus-visible,
.setting-select:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.auth-error {
  color: #ff9292;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 2px;
}

.auth-notice {
  color: #0d5751;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-top: 2px;
}

.auth-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.auth-actions .btn-primary {
  flex: 1;
}

.btn-link-action {
  align-self: center;
  border: 0;
  background: transparent;
  color: var(--color-focus);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 8px 2px;
  white-space: nowrap;
}

.btn-link-action:hover {
  color: var(--color-btn-primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-guest-actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  text-align: center;
}

.auth-guest-actions .btn-secondary {
  min-height: 44px;
}

.auth-guest-actions p {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

body.light-theme #app-container {
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--surface-shadow);
}

/* ==========================================================================
   상단 헤더
   ========================================================================== */
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: var(--header-height);
  padding: 0 14px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(88px, 1fr) auto minmax(88px, 1fr);
  position: relative;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right {
  justify-content: flex-end;
}

.header-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
  font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
  text-align: center;
}

.header-center {
  display: grid;
  justify-items: center;
}

.game-timer {
  min-height: 14px;
  color: var(--color-text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s, background-color 0.15s;
}

.icon-btn:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.icon-btn:focus-visible,
.key-btn:focus-visible,
.close-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.speak-btn:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.icon-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2.2;
}

/* ==========================================================================
   토스트 메시지 (알림)
   ========================================================================== */
#toast-container {
  position: absolute;
  top: clamp(58px, 9vh, 82px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: 94vw;
}

.toast {
  background-color: var(--color-toast-bg);
  color: var(--color-toast-text);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1.5px solid rgba(230, 198, 110, 0.75);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: clamp(0.82rem, 3.2vw, 0.95rem);
  box-shadow: 0 8px 22px rgba(0, 15, 14, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  animation: toastFadeIn 0.25s ease-out forwards;
  pointer-events: auto;
  text-align: center;
  max-width: min(92vw, 440px);
  white-space: normal;
  word-break: keep-all;
  line-height: 1.4;
}

.toast.fade-out {
  animation: toastFadeOut 0.2s ease-in forwards;
}

/* ==========================================================================
   게임 메인 보드 (6 x 5 그리드)
   ========================================================================== */
.game-board-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
  padding: 8px 16px 12px;
  overflow: hidden;
}

.game-progress {
  min-height: 22px;
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

.board-grid {
  display: grid;
  grid-template-rows: repeat(var(--max-guesses, 6), 1fr);
  grid-gap: var(--tile-gap);
  width: 100%;
  max-width: min(88vw, 390px);
  height: 100%;
  max-height: 400px;
  aspect-ratio: var(--word-length, 5) / var(--max-guesses, 6);
  position: relative;
  isolation: isolate;
}

.board-grid::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -20px;
  border-radius: 24px;
  background: radial-gradient(circle, rgba(18, 18, 19, 0.62) 0%, rgba(18, 18, 19, 0) 72%);
  filter: blur(10px);
}

body.light-theme .board-grid::before {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0) 72%);
}

.board-row {
  display: grid;
  grid-template-columns: repeat(var(--word-length, 5), 1fr);
  grid-gap: var(--tile-gap);
}

.tile {
  width: 100%;
  height: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-size: 1.9rem;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid var(--color-border);
  background-color: transparent;
  color: var(--color-text);
  box-sizing: border-box;
  vertical-align: middle;
  line-height: 1;
  transition: border-color 0.1s ease;
}

.tile[data-state="tbd"] {
  border-color: var(--color-border-active);
  animation: popIn 0.1s ease-in-out;
}

.tile[data-state="correct"] {
  background-color: var(--color-correct);
  border-color: var(--color-correct);
  color: #ffffff;
}

.tile[data-state="present"] {
  background-color: var(--color-present);
  border-color: var(--color-present);
  color: #ffffff;
}

.tile[data-state="absent"] {
  background-color: var(--color-absent);
  border-color: var(--color-absent);
  color: #ffffff;
}

body.high-contrast .tile[data-state="correct"] {
  background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(0, 0, 0, 0.2) 8px 11px);
}

body.high-contrast .tile[data-state="present"] {
  background-image: radial-gradient(rgba(0, 0, 0, 0.26) 1px, transparent 1px);
  background-size: 6px 6px;
}

/* ==========================================================================
   가상 키보드
   ========================================================================== */
.keyboard-container {
  width: 100%;
  max-width: var(--keyboard-max-width);
  margin: 0 auto;
  padding: 0 8px max(12px, env(safe-area-inset-bottom)) 8px;
  flex-shrink: 0;
}

.keyboard-row {
  display: flex;
  width: 100%;
  margin: 0 auto 6px auto;
  touch-action: manipulation;
  gap: 5px;
}

.key-btn {
  font-family: inherit;
  font-weight: bold;
  border: 0;
  padding: 0;
  height: clamp(48px, 7vh, 56px);
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  background-color: var(--color-key-bg);
  color: var(--color-key-text);
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  font-size: 1.15rem;
  transition: background-color 0.15s, transform 0.05s;
}

.key-btn:active {
  transform: scale(0.95);
  opacity: 0.9;
}

.key-btn:hover {
  filter: brightness(1.08);
}

.key-btn.wide-key {
  flex: 1.5;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}

.key-btn[data-state="correct"] {
  background-color: var(--color-correct);
  color: #ffffff;
}

.key-btn[data-state="present"] {
  background-color: var(--color-present);
  color: #ffffff;
}

.key-btn[data-state="absent"] {
  background-color: var(--color-absent);
  color: #ffffff;
  opacity: 0.6;
}

/* ==========================================================================
   모달 레이아웃 및 디자인
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.65);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.modal-backdrop.active {
  display: flex;
  opacity: 1;
  animation: modalBackdropFade 0.2s ease-out;
}

.modal-content {
  background-color: var(--color-modal-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: modalContentPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-settings .modal-content {
  max-height: 80vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  width: 100%;
  letter-spacing: 0.02em;
}

.close-btn {
  position: absolute;
  right: 0;
  top: 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.close-btn:hover {
  color: var(--color-text);
  background-color: rgba(255, 255, 255, 0.1);
}

/* 도움말 모달 스타일 (order.md 규칙 표현) */
.help-section {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--color-text-sub);
}

.help-section p {
  margin-bottom: 12px;
}

.help-examples {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
  margin: 16px 0;
}

.example-row {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.example-tile {
  width: 38px;
  height: 38px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #b89146;
  border-radius: 6px;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fffef7 0%, #f8eed2 100%);
  color: #153d3a;
  box-shadow: 0 2px 0 #9e7930;
}

.example-tile.correct {
  background: linear-gradient(180deg, #329680 0%, #1a6451 100%);
  border-color: #135242;
  color: #fff;
  box-shadow: 0 2px 0 #0e3d31;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.example-tile.present {
  background: linear-gradient(180deg, #f7ba2a 0%, #db8f08 100%);
  border-color: #b06e00;
  color: #fff;
  box-shadow: 0 2px 0 #7a4c00;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.example-tile.absent {
  background: linear-gradient(180deg, #5b6873 0%, #3a444c 100%);
  border-color: #283036;
  color: #fff;
  box-shadow: 0 2px 0 #1c2227;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.example-desc {
  font-size: 13.5px;
  margin-bottom: 14px;
  color: var(--color-text);
}

/* 통계 모달 스타일 */
.stats-container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
  text-align: center;
}

.stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 70px;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  padding: 4px 2px;
}

.stat-value {
  font-size: clamp(1.25rem, 4.5vw, 1.65rem);
  font-weight: bold;
  line-height: 1.2;
}

.stat-label {
  font-size: clamp(10px, 2.8vw, 12px);
  color: var(--color-text-muted);
  line-height: 1.15;
  word-break: keep-all;
}

.stats-secondary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}

.stats-secondary div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 9px 10px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.stats-secondary strong {
  color: var(--color-text);
  font-size: 1rem;
}

.stats-empty {
  margin: 12px 0 18px;
  padding: 18px;
  border: 1px dashed var(--color-border-active);
  border-radius: 6px;
  color: var(--color-text-sub);
  text-align: center;
}

.distribution-chart {
  margin-top: 20px;
}

.chart-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-align: center;
}

.chart-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: bold;
}

.chart-label {
  width: 16px;
  margin-right: 6px;
}

.chart-bar-container {
  flex-grow: 1;
  background-color: var(--color-surface);
  height: 22px;
  display: flex;
}

.chart-bar {
  background-color: var(--color-absent);
  color: #ffffff;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 12px;
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.chart-bar.highlight {
  background-color: var(--color-correct);
}

/* ==========================================================================
   통계 및 랭킹 모달 탭 & 명예의 전당 스타일
   ========================================================================== */
.stats-tab-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: rgba(4, 38, 36, 0.15);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(202, 166, 83, 0.4);
}

.stats-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #554429;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.88rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.stats-tab-btn .tab-icon {
  width: 17px;
  height: 17px;
  stroke: #7b581e;
  flex-shrink: 0;
  transition: stroke 0.15s;
}

.stats-tab-btn:hover {
  background: rgba(255, 255, 255, 0.45);
  color: #153d3a;
}

.stats-tab-btn:hover .tab-icon {
  stroke: #153d3a;
}

.stats-tab-btn.active {
  background: linear-gradient(180deg, #166b63 0%, #0d5751 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 20, 18, 0.25);
  border: 1px solid #e5c673;
}

.stats-tab-btn.active .tab-icon {
  stroke: #fce8a6;
}

.ranking-category-switch {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.ranking-cat-btn {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid #b88d3d;
  background: rgba(255, 255, 255, 0.6);
  color: #4a371c;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ranking-cat-btn .cat-icon {
  width: 15px;
  height: 15px;
  stroke: #7b581e;
  flex-shrink: 0;
  transition: stroke 0.15s;
}

.ranking-cat-btn:hover {
  background: #ffffff;
  border-color: #8c6828;
}

.ranking-cat-btn:hover .cat-icon {
  stroke: #4a371c;
}

.ranking-cat-btn.active {
  background: linear-gradient(180deg, #d4af37 0%, #b38b1d 100%);
  color: #ffffff;
  border-color: #805e0c;
  box-shadow: 0 2px 6px rgba(128, 94, 12, 0.35);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}

.ranking-cat-btn.active .cat-icon {
  stroke: #ffffff;
}

.ranking-desc {
  font-size: 0.76rem;
  color: #6d5b40;
  margin-bottom: 12px;
  text-align: center;
  font-style: italic;
  line-height: 1.35;
}

.ranking-table-header {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(184, 141, 61, 0.2);
  border-radius: 6px 6px 0 0;
  border-bottom: 1px solid #caa653;
  font-size: 0.74rem;
  font-weight: 700;
  color: #554429;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ranking-table-header .col-rank,
.ranking-item-row .col-rank {
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.ranking-table-header .col-sailor,
.ranking-item-row .col-sailor {
  flex: 1;
  text-align: left;
  padding-left: 8px;
}

.ranking-table-header .col-record,
.ranking-item-row .col-record {
  width: 140px;
  text-align: right;
  flex-shrink: 0;
}

.ranking-list-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 270px;
  overflow-y: auto;
  padding: 4px 0;
  border: 1px solid #caa653;
  border-top: none;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 0 0 8px 8px;
}

.ranking-item-row {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(202, 166, 83, 0.25);
  transition: background-color 0.15s ease;
}

.ranking-item-row:last-child {
  border-bottom: none;
}

.ranking-item-row:hover {
  background-color: rgba(255, 255, 255, 0.65);
}

.ranking-item-row.is-me {
  background: linear-gradient(90deg, rgba(22, 107, 99, 0.15) 0%, rgba(202, 166, 83, 0.2) 100%);
  border-left: 3px solid #0d5751;
  font-weight: 700;
}

.medal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.medal-badge.gold {
  background: linear-gradient(135deg, #ffe066 0%, #d4af37 100%);
  border: 1px solid #a6841c;
  color: #4a3400;
}

.medal-badge.silver {
  background: linear-gradient(135deg, #f0f3f5 0%, #cbd5e1 100%);
  border: 1px solid #94a3b8;
  color: #334155;
}

.medal-badge.bronze {
  background: linear-gradient(135deg, #fbd5b5 0%, #cd7f32 100%);
  border: 1px solid #9c581a;
  color: #431f00;
}

.sailor-name {
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.86rem;
  font-weight: 700;
  color: #153d3a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sailor-sub {
  display: block;
  font-size: 0.7rem;
  color: #7b684e;
  margin-top: 1px;
}

.record-main {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.86rem;
  font-weight: 800;
  color: #0d5751;
  white-space: nowrap;
}

.ranking-my-rank {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #154540 0%, #082d2a 100%);
  border: 1.5px solid #d4af37;
  border-radius: 8px;
  color: #fce8a6;
  font-size: 0.8rem;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}

.my-rank-label {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  color: #e5c673;
}

.my-rank-badge {
  background: rgba(202, 166, 83, 0.35);
  border: 1px solid #d4af37;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 800;
  color: #ffffff;
}

.my-rank-name {
  flex: 1;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-rank-score {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  color: #4ade80;
  white-space: nowrap;
}

.my-rank-guest-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
  font-size: 0.78rem;
  color: #e5c673;
}

.ranking-loading,
.ranking-empty,
.ranking-error {
  padding: 30px 10px;
  text-align: center;
  color: #6d5b40;
  font-size: 0.84rem;
}

/* 설정 모달 스타일 */
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.modal-content[data-arrow-scroll]:focus-visible {
  outline: 2px solid #0d5751;
  outline-offset: -5px;
}

.setting-text {
  flex: 1 1 auto;
  min-width: 0;
}

.setting-select {
  flex-shrink: 0;
  width: auto;
  max-width: 140px;
  font-size: 0.8rem;
}

.account-setting {
  gap: 14px;
}

.recovery-profile-setting {
  align-items: stretch;
}

.recovery-profile-setting .setting-text {
  width: 100%;
}

.recovery-profile-setting .setting-text > p {
  margin: 0 0 5px;
}

.recovery-profile-setting .setting-text > p:first-of-type {
  color: var(--color-primary);
  font-weight: 700;
}

.recovery-profile-notice {
  font-size: 11px;
}

.recovery-profile-details {
  margin-top: 10px;
}

.recovery-profile-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  background: var(--color-surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  list-style-position: inside;
}

.recovery-profile-details summary::-webkit-details-marker {
  margin-right: 6px;
}

.recovery-profile-details summary:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.recovery-profile-details summary:hover {
  background: var(--color-surface-elevated);
}

.recovery-profile-collapse-label {
  display: none;
}

.recovery-profile-details[open] .recovery-profile-expand-label {
  display: none;
}

.recovery-profile-details[open] .recovery-profile-collapse-label {
  display: inline;
}

.recovery-profile-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.recovery-profile-form label {
  display: grid;
  gap: 4px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
}

.recovery-profile-form input {
  width: 100%;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.recovery-profile-form input:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.recovery-profile-form .setting-select,
.recovery-form .setting-select,
.auth-form .setting-select {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.recovery-profile-form button {
  justify-self: start;
}

.recovery-profile-error {
  min-height: 1.2em;
  margin: 0;
  color: var(--color-danger);
  font-size: 12px;
  font-weight: 600;
}

.recovery-profile-result {
  min-height: 1.2em;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}

.recovery-profile-result.is-saving {
  color: var(--color-text-muted);
}

.recovery-profile-result.is-success {
  color: var(--color-primary);
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.btn-danger {
  border: 1px solid #a6302d;
  border-radius: 6px;
  padding: 8px 12px;
  background: #a6302d;
  color: #ffffff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger:hover:not(:disabled) {
  background: #812421;
}

.btn-danger:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.withdraw-modal-content {
  max-width: 440px;
}

.password-change-modal-content {
  max-width: 440px;
}

.password-change-notice {
  margin: 0 0 18px;
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.password-change-form {
  display: grid;
}

.recovery-modal-content {
  max-width: 540px;
}

.recovery-notice,
.recovery-reset-section p {
  color: var(--color-text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.recovery-notice {
  margin: -6px 0 18px;
}

.recovery-methods {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.recovery-methods legend {
  padding: 0 5px;
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 800;
}

.recovery-method-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.recovery-method-option:has(input:checked) {
  border-color: var(--color-border-active);
  background: rgba(181, 159, 59, 0.1);
}

.recovery-method-option.is-disabled {
  color: var(--color-text-muted);
}

.recovery-method-option input {
  margin-top: 3px;
}

.recovery-method-option span {
  display: grid;
  gap: 3px;
}

.recovery-method-option small {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.recovery-method-notice,
.recovery-success,
.recovery-error {
  font-size: 0.82rem;
  line-height: 1.45;
}

.recovery-method-notice {
  margin: 0 0 12px;
  padding: 9px 10px;
  border-left: 3px solid var(--color-present);
  background: rgba(181, 159, 59, 0.12);
}

.recovery-form {
  display: grid;
  gap: 8px;
}

.recovery-form label {
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 700;
}

.recovery-form input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid var(--color-border-active);
  border-radius: 6px;
  background: var(--color-surface-elevated);
  color: var(--color-text);
  font: inherit;
  padding: 8px 10px;
}

.recovery-form input:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

.captcha-field {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-icon-action {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--color-border-active);
  border-radius: 5px;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-size: 1.2rem;
}

.btn-icon-action:hover {
  background: rgba(41, 110, 118, 0.12);
}

.captcha-image {
  width: min(100%, 220px);
  height: 62px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: #edf5f2;
}

.recovery-error {
  color: #a6302d;
  margin: 2px 0 0;
}

.recovery-success {
  color: #0d5751;
  margin: 2px 0 0;
}

.recovery-reset-section {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.recovery-reset-section h3 {
  margin: 0;
  color: var(--color-text);
  font-size: 0.96rem;
}

.recovery-reset-section p {
  margin: 0 0 5px;
}

.withdraw-warning {
  margin: 0 0 18px;
  color: #8b2925;
  font-size: 0.9rem;
  line-height: 1.55;
}

.withdraw-field {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 700;
}

.withdraw-field input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.withdraw-error {
  min-height: 1.3em;
  margin: 0 0 14px;
  color: #a6302d;
  font-size: 0.84rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.setting-text h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  word-break: break-word;
}

.setting-text p {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.35;
  word-break: break-word;
}

/* 토글 스위치 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-absent);
  transition: .2s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-correct);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* 단어 학습 상세 카드 모달 */
.learning-card {
  text-align: center;
  padding: 10px 0;
}

.learning-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto 16px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-correct);
  border-radius: 6px;
  background: var(--color-surface);
  text-align: left;
}

.learning-rank > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 4px;
  background: var(--color-correct);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
}

.learning-rank[data-rank="D"] {
  border-left-color: var(--color-present);
}

.learning-rank[data-rank="D"] > span {
  background: var(--color-present);
}

.learning-rank strong,
.learning-rank span:not(:first-child) {
  display: block;
}

.learning-rank strong {
  font-size: 0.78rem;
}

.learning-rank-detail {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

.learning-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.learning-badge.win {
  background-color: rgba(83, 141, 78, 0.2);
  color: #538d4e;
  border: 1px solid #538d4e;
}

.learning-badge.lose {
  background-color: rgba(235, 87, 87, 0.2);
  color: #eb5757;
  border: 1px solid #eb5757;
}

.learning-badge.review {
  background-color: rgba(212, 175, 55, 0.25);
  color: #8c5806;
  border: 1px solid #d4af37;
}

.learning-word {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--color-text);
  margin-bottom: 4px;
}

.learning-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--color-text-muted);
  font-size: 14px;
  margin-bottom: 16px;
}

.speak-btn {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 4px 8px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.speak-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.learning-meaning-box {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  text-align: left;
}

.meaning-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-correct);
  margin-bottom: 10px;
}

.example-en {
  font-size: 14px;
  font-style: italic;
  color: var(--color-text);
  margin-bottom: 4px;
}

.example-kr {
  font-size: 13px;
  color: var(--color-text-muted);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
}

.modal-actions .btn-secondary {
  flex: 0 1 auto;
  white-space: nowrap;
}

.btn-primary {
  flex: 1;
  background-color: var(--color-btn-primary);
  color: #ffffff;
  border: none;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.btn-primary:hover {
  background-color: var(--color-btn-primary-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

/* 단어장 모달 스타일 */
.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.vocab-item {
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.vocab-item:hover {
  background: rgba(255, 255, 255, 0.85);
  border-color: #8c6828;
  transform: translateX(3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.vocab-item:focus-visible {
  outline: 2px solid var(--color-focus, #c18a2f);
  outline-offset: 2px;
}

.vocab-word-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  text-align: left;
}

.vocab-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
  flex-shrink: 0;
}

.vocab-arrow {
  font-size: 1.3rem;
  font-weight: 700;
  color: #b08a3a;
  line-height: 1;
  transition: transform 0.15s ease, color 0.15s ease;
}

.vocab-item:hover .vocab-arrow {
  transform: translateX(3px);
  color: #0d5751;
}

.vocab-word-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vocab-word-text {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.vocab-pos {
  font-size: 11px;
  color: var(--color-text-muted);
}

.vocab-meaning {
  font-size: 13px;
  color: var(--color-text-sub);
}

.vocab-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* 모바일 및 작은 화면 반응형 미디어 쿼리 */
@media (max-height: 720px) {
  :root {
    --header-height: 54px;
    --tile-size: 44px;
    --tile-gap: 3px;
  }
}

@media (max-width: 390px) {
  .site-nav-inner {
    padding: 0 10px;
  }

  .site-brand strong {
    font-size: 1.05rem;
  }

  .site-brand span {
    display: none;
  }

  .site-links {
    gap: 7px;
  }

  .site-share-btn {
    width: 28px;
    height: 28px;
    padding: 0;
  }

  .site-fullscreen-btn {
    width: 28px;
    height: 28px;
    padding: 0;
  }

  .site-nav-divider {
    height: 18px;
  }

  .site-share-btn svg,
  .site-fullscreen-btn svg {
    width: 13px;
    height: 13px;
  }

  .site-footer-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}

/* ==========================================================================
   Word Voyage 기본 항해 테마 (design_01.png 구현)
   ========================================================================== */
:root,
body.light-theme {
  --bg-image: url('../assets/bg_ver2.png');
  --color-bg: #062e2d;
  --color-surface: rgba(246, 232, 190, 0.96);
  --color-surface-elevated: #f5e6bd;
  --color-text: #153d3a;
  --color-text-sub: #486052;
  --color-text-muted: #6d7259;
  --color-border: #b08a3a;
  --color-border-active: #e6c66e;
  --color-correct: #1a6451;
  --color-present: #c27700;
  --color-absent: #434f57;
  --color-key-bg: #ead8a4;
  --color-key-text: #153d3a;
  --color-btn-primary: #0d5751;
  --color-btn-primary-hover: #063f3b;
  --color-modal-bg: #f6e8be;
  --color-toast-bg: #123f3c;
  --color-toast-text: #fff5d8;
  --color-focus: #f4cf68;
  --surface-shadow: 0 18px 42px rgba(0, 21, 20, 0.48);
}

html,
body {
  background-color: #062e2d;
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: #fff5d8;
}

.site-nav {
  border-bottom-color: rgba(230, 198, 110, 0.5);
  background: rgba(5, 47, 45, 0.96);
  box-shadow: 0 2px 14px rgba(0, 16, 15, 0.42);
}

.site-brand {
  color: #f7df93;
}

.site-brand span {
  color: #d8bb66;
}

#app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 640px;
  height: calc(100% - 64px);
  margin: 0 auto;
  margin-top: 64px;
  position: relative;
  background: linear-gradient(180deg, rgba(4, 48, 46, 0.72), rgba(6, 38, 37, 0.8)), url('../assets/inner_bg.png') center center / cover no-repeat;
  border-left: 1px solid rgba(230, 198, 110, 0.4);
  border-right: 1px solid rgba(230, 198, 110, 0.4);
  box-shadow: 0 0 48px rgba(0, 19, 18, 0.55);
}

body.light-theme #app-container {
  background: linear-gradient(180deg, rgba(4, 48, 46, 0.72), rgba(6, 38, 37, 0.8)), url('../assets/inner_bg.png') center center / cover no-repeat;
}

/* ==========================================================================
   좌측 앤틱 항해 메모 태그 (design_01.png 참조)
   ========================================================================== */
.voyage-sidebar {
  position: absolute;
  top: 18px;
  left: -210px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  z-index: 50;
  pointer-events: auto;
}

.sidebar-menu-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: transparent;
  box-shadow: 0 6px 16px rgba(0, 15, 14, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}

.sidebar-menu-btn img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.sidebar-menu-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(0, 15, 14, 0.5);
}

.voyage-log-tag {
  position: relative;
  width: 175px;
  padding: 22px 16px 16px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7dc 0%, #f7e6b8 100%);
  border: 1px solid #caa653;
  box-shadow: 0 12px 28px rgba(0, 16, 15, 0.45), inset 0 0 0 2px rgba(188, 145, 59, 0.15);
  text-align: center;
  transform: rotate(-2.5deg);
  transition: transform 0.2s ease;
}

.voyage-log-tag:hover {
  transform: rotate(0deg) scale(1.02);
}

.thumbtack-pin {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6dd 0%, #e6ca81 50%, #8c6828 100%);
  border: 1px solid #caa653;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.thumbtack-pin::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
}

.voyage-date {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #3b2c15;
  margin: 0 0 4px 0;
  letter-spacing: 0.05em;
}

.voyage-code {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.88rem;
  color: #6d522a;
  margin: 0;
}

/* ==========================================================================
   상단 헤더 (design_01.png 완벽 구현 & 모바일 겹침 방지)
   ========================================================================== */
.game-header {
  height: clamp(50px, 7vh, 62px);
  border-bottom: 1px solid rgba(230, 198, 110, 0.45);
  background: linear-gradient(180deg, rgba(8, 67, 63, 0.98), rgba(5, 48, 46, 0.98));
  padding: 0 clamp(8px, 2vw, 16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(4px, 1.5vw, 12px);
  position: relative;
  z-index: 10;
  box-sizing: border-box;
  width: 100%;
}

.header-left {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 8px);
  flex-shrink: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1vw, 8px);
  flex-shrink: 0;
  justify-content: flex-end;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 2px;
  text-align: center;
}

.header-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.95rem, 3.8vw, 1.65rem);
  font-weight: 800;
  letter-spacing: clamp(0.03em, 1.2vw, 0.1em);
  text-transform: uppercase;
  margin: 0;
  color: #f7df93;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 14px rgba(229, 198, 115, 0.35);
  white-space: nowrap;
  line-height: 1.15;
}

.header-sub-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 3px;
  white-space: nowrap;
}

.header-dot {
  color: #c9b171;
  font-size: 0.85rem;
  opacity: 0.7;
}

.game-timer {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.72rem, 2.1vw, 0.86rem);
  font-weight: 700;
  color: #ebd79e;
  letter-spacing: 0.04em;
  padding: 2px 4px;
}

.icon-btn {
  width: clamp(28px, 6.5vw, 36px);
  height: clamp(28px, 6.5vw, 36px);
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
  padding: 4px;
  border: 1.5px solid rgba(230, 198, 110, 0.75);
  border-radius: 50%;
  color: #f5d77d;
  background: radial-gradient(circle at 35% 30%, rgba(9, 67, 63, 0.8), rgba(4, 38, 36, 0.95));
  box-shadow: 0 3px 8px rgba(0, 15, 14, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: transform 0.15s, background-color 0.15s, border-color 0.15s;
}

.icon-img-btn {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: 0 3px 8px rgba(0, 15, 14, 0.35);
  border-radius: 50%;
  overflow: hidden;
}

.icon-img-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
  pointer-events: none;
}

.icon-btn:hover {
  transform: scale(1.08);
  border-color: #fce8a6;
  background: rgba(188, 132, 42, 0.35);
}

.icon-img-btn:hover {
  transform: scale(1.08);
  filter: brightness(1.1);
  background: transparent;
}

.icon-btn svg {
  width: 60%;
  height: 60%;
  stroke-width: 2.2;
}

/* ==========================================================================
   원형 나침반 다이얼 무대 & 타일 그리드 (design_01.png 완벽 구현)
   ========================================================================== */
.game-board-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex-grow: 1;
  width: 100%;
  padding: clamp(16px, 2.5vh, 28px) 16px;
  overflow: hidden;
  position: relative;
}

.game-progress {
  display: none;
  min-height: 20px;
  margin: 0 0 10px;
  color: #f3d98d;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
}

.board-dedication {
  position: absolute;
  left: 2px;
  top: -27px;
  pointer-events: none;
  user-select: none;
  z-index: 5;
}

.dedication-text {
  font-family: 'Great Vibes', cursive;
  font-size: clamp(1.5rem, 5vw, 2.05rem);
  color: rgba(247, 223, 147, 0.75);
  letter-spacing: 0.04em;
  display: inline-block;
  transform: rotate(-5deg);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65), 0 0 14px rgba(229, 198, 115, 0.35);
  line-height: 1;
  white-space: nowrap;
}

.compass-stage {
  position: relative;
  width: min(88vw, 340px);
  border-radius: clamp(18px, 4.5vw, 28px);
  border: 4px solid #caa653;
  background: radial-gradient(ellipse at center, #fcf5dd 0%, #f4e7be 60%, #cca356 94%, #0d5751 98%);
  box-shadow:
    0 0 0 2px #062f2d,
    0 0 0 4px rgba(229, 198, 115, 0.65),
    0 14px 32px rgba(0, 16, 15, 0.5),
    inset 0 0 20px rgba(0, 20, 18, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: clamp(8px, 2vw, 14px) clamp(10px, 2.5vw, 16px);
  margin: clamp(12px, 2vh, 20px) 0;
  box-sizing: border-box;
}

.compass-marker {
  position: absolute;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.72rem;
  font-weight: 800;
  color: #7b581e;
  pointer-events: none;
  user-select: none;
}

.marker-n { top: 2px; left: 50%; transform: translateX(-50%); }
.marker-s { bottom: 2px; left: 50%; transform: translateX(-50%); }
.marker-w { left: 4px; top: 50%; transform: translateY(-50%); }
.marker-e { right: 4px; top: 50%; transform: translateY(-50%); }

.compass-rivet {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7dc, #caa653 70%, #7b581e 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.rivet-tl { top: 6px; left: 6px; }
.rivet-tr { top: 6px; right: 6px; }
.rivet-bl { bottom: 6px; left: 6px; }
.rivet-br { bottom: 6px; right: 6px; }

.board-grid {
  display: grid;
  grid-template-rows: repeat(var(--max-guesses, 6), 1fr);
  grid-gap: clamp(3px, 1vw, 5px);
  width: 100%;
  aspect-ratio: var(--word-length, 5) / var(--max-guesses, 6);
  max-height: clamp(190px, 38vh, 320px);
  position: relative;
  z-index: 2;
  box-sizing: border-box;
}

.board-grid::before {
  display: none;
}

.guess-meaning-feedback-slot {
  display: flex;
  flex: 0 0 clamp(60px, 9vh, 76px);
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: min(92vw, 360px);
  min-height: clamp(60px, 9vh, 76px);
  position: relative;
  z-index: 3;
}

.guess-meaning-bubble {
  position: relative;
  width: 100%;
  min-height: 54px;
  max-height: 68px;
  padding: 8px 14px;
  overflow: hidden;
  border: 1px solid #e5c673;
  border-radius: 10px;
  background: rgba(53, 37, 10, 0.94);
  color: #fff8e7;
  box-shadow: 0 5px 14px rgba(0, 16, 15, 0.34);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.guess-meaning-bubble::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  border-top: 1px solid #e5c673;
  border-left: 1px solid #e5c673;
  background: #4b350e;
  transform: translateX(-50%) rotate(45deg);
}

.guess-meaning-bubble.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.guess-meaning-bubble:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 2px;
}

.guess-meaning-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  color: #f5d47b;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.1;
}

.guess-meaning-label {
  flex-shrink: 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.guess-meaning-word {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #ffffff;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.guess-meaning-separator {
  color: #d5ad4c;
  flex-shrink: 0;
}

.guess-meaning-pos {
  min-width: 0;
  overflow: hidden;
  color: #f7e8b5;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guess-meaning-text {
  display: -webkit-box;
  margin-top: 5px;
  overflow: hidden;
  color: #ffffff;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.82rem;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.high-contrast .guess-meaning-bubble {
  border-color: #ffffff;
  background: #000000;
  color: #ffffff;
  box-shadow: 0 0 0 2px #000000, 0 0 0 4px #ffffff;
}

body.high-contrast .guess-meaning-bubble::before {
  border-color: #ffffff;
  background: #000000;
}

body.high-contrast .guess-meaning-heading,
body.high-contrast .guess-meaning-pos,
body.high-contrast .guess-meaning-text {
  color: #ffffff;
}

.board-row {
  display: grid;
  grid-template-columns: repeat(var(--word-length, 5), 1fr);
  grid-gap: clamp(3px, 1vw, 5px);
}

.tile {
  width: 100%;
  height: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.2rem, 4.2vw, 1.85rem);
  font-weight: 800;
  text-transform: uppercase;
  border: 2px solid #b89146;
  border-radius: clamp(6px, 1.8vw, 10px);
  background: linear-gradient(180deg, #fffef7 0%, #f8eed2 100%);
  color: #153d3a;
  box-shadow: 0 3px 0 #9e7930, inset 0 1px 0 rgba(255, 255, 255, 0.95);
  box-sizing: border-box;
  vertical-align: middle;
  line-height: 1;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.tile[data-state="tbd"] {
  border-color: #e5c673;
  box-shadow: 0 3px 0 #9e7930, 0 0 10px rgba(229, 198, 115, 0.5);
}

.tile[data-state="correct"] {
  background: linear-gradient(180deg, #329680 0%, #1a6451 100%);
  border-color: #135242;
  color: #ffffff;
  box-shadow: 0 3px 0 #0e3d31, inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tile[data-state="present"] {
  background: linear-gradient(180deg, #f7ba2a 0%, #db8f08 100%);
  border-color: #b06e00;
  color: #ffffff;
  box-shadow: 0 3px 0 #7a4c00, inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tile[data-state="absent"] {
  background: linear-gradient(180deg, #5b6873 0%, #3a444c 100%);
  border-color: #283036;
  color: #ffffff;
  box-shadow: 0 3px 0 #1c2227, inset 0 1px 0 rgba(255, 255, 255, 0.2);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   하단 가상 키보드 (원형 코인 키캡)
   ========================================================================== */
.keyboard-container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 4px 8px 2px 8px;
  border-top: 1px solid rgba(230, 198, 110, 0.38);
  background: rgba(3, 46, 44, 0.9);
  flex-shrink: 0;
  z-index: 10;
}

/* ==========================================================================
   게임 화면 하단 1줄 저작권 Footer
   ========================================================================== */
.game-footer {
  width: 100%;
  padding: 4px 12px max(6px, env(safe-area-inset-bottom));
  background: rgba(2, 28, 26, 0.95);
  border-top: 1px solid rgba(230, 198, 110, 0.2);
  text-align: center;
  flex-shrink: 0;
  z-index: 10;
}

.game-footer-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.65rem, 1.8vw, 0.74rem);
  color: #9ebdb5;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-footer-text a {
  color: #e5c673;
  text-decoration: none;
  font-weight: 700;
  transition: color 0.15s, text-decoration 0.15s;
}

.game-footer-text a:hover,
.game-footer-text a:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.game-footer-dot {
  color: rgba(230, 198, 110, 0.5);
  margin: 0 4px;
}

.game-footer-admin,
.footer-admin-link {
  color: #caa653 !important;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(202, 166, 83, 0.6);
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}

.game-footer-admin:hover,
.footer-admin-link:hover {
  color: #4ade80 !important;
  border-bottom-color: #4ade80;
}

.keyboard-row {
  display: flex;
  width: 100%;
  margin: 0 auto clamp(3px, 0.6vh, 5px) auto;
  touch-action: manipulation;
  gap: clamp(3px, 0.9vw, 5px);
  justify-content: center;
}

.key-btn {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  border: 1.5px solid #b88d3d;
  padding: 0;
  height: clamp(38px, 5.6vh, 48px);
  flex: 1;
  min-width: 0;
  border-radius: clamp(14px, 3.5vw, 24px);
  cursor: pointer;
  user-select: none;
  background: radial-gradient(circle at 35% 30%, #fffbf0 0%, #faecc9 55%, #d9ba76 100%);
  color: #153d3a;
  box-shadow: 0 2.5px 0 #7b581e, 0 4px 8px rgba(0, 14, 13, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 3.2vw, 1.15rem);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.12s;
}

.key-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #7b581e, 0 2px 4px rgba(0, 14, 13, 0.3);
}

.key-btn:hover {
  filter: brightness(1.08);
}

.key-btn.wide-key {
  flex: 1.45;
  border-radius: clamp(14px, 3.5vw, 22px);
  font-size: clamp(0.68rem, 2.2vw, 0.82rem);
  letter-spacing: 0.03em;
}

.key-btn[data-state="correct"] {
  background: linear-gradient(180deg, #329680 0%, #1a6451 100%);
  border-color: #135242;
  color: #ffffff;
  box-shadow: 0 2.5px 0 #0e3d31;
}

.key-btn[data-state="present"] {
  background: linear-gradient(180deg, #f7ba2a 0%, #db8f08 100%);
  border-color: #b06e00;
  color: #ffffff;
  box-shadow: 0 2.5px 0 #7a4c00;
}

.key-btn[data-state="absent"] {
  background: linear-gradient(180deg, #5b6873 0%, #3a444c 100%);
  border-color: #283036;
  color: #ffffff;
  opacity: 0.65;
  box-shadow: 0 2.5px 0 #1c2227;
}

/* ==========================================================================
   인증 화면 & 모달 디자인
   ========================================================================== */
.auth-screen {
  background: linear-gradient(rgba(4, 43, 41, 0.65), rgba(4, 43, 41, 0.85)), var(--bg-image) center top / cover fixed;
  --color-text: #153d3a;
  --color-text-sub: #486052;
  --color-text-muted: #6d7259;
  --color-surface-elevated: #fff1c7;
  --color-border: #b08a3a;
  --color-border-active: #8c6828;
  --color-btn-primary: #0d5751;
  --color-btn-primary-hover: #063f3b;
  --color-focus: #c18a2f;
}

.password-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-input-wrapper input {
  width: 100%;
  padding-right: 42px !important;
  box-sizing: border-box;
}

.recovery-info-input {
  -webkit-text-security: disc;
}

.recovery-info-input.is-visible {
  -webkit-text-security: none;
}

.btn-toggle-password {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: #7b581e;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background-color 0.15s;
  user-select: none;
}

.btn-toggle-password:hover {
  color: #153d3a;
  background-color: rgba(176, 138, 58, 0.2);
}

.btn-toggle-password .eye-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.header-user-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 16px;
  border: 1.5px solid #d4af37;
  background: linear-gradient(180deg, rgba(8, 52, 48, 0.9) 0%, rgba(3, 33, 30, 0.95) 100%);
  color: #fce8a6;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.78rem, 2.2vw, 0.92rem);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  line-height: 1.25;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  letter-spacing: 0.02em;
}

.header-user-status:hover {
  background: linear-gradient(180deg, rgba(22, 107, 99, 0.95) 0%, rgba(13, 75, 70, 0.98) 100%);
  border-color: #ffe89e;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45), 0 0 10px rgba(212, 175, 55, 0.4);
}

.header-user-status:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.header-user-status .user-status-icon {
  width: 14px;
  height: 14px;
  stroke: #e5c673;
  flex-shrink: 0;
  transition: stroke 0.2s;
}

.header-user-status:hover .user-status-icon {
  stroke: #ffffff;
}

.header-user-status.is-auth {
  background: linear-gradient(180deg, #1b7a70 0%, #0d5751 100%);
  border-color: #fce8a6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 12px rgba(74, 222, 128, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.header-user-status.is-auth .user-status-icon {
  stroke: #a7f3d0;
}

.user-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  border: 1px solid rgba(0, 0, 0, 0.2);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.6);
}

.header-user-status.is-auth .user-status-dot {
  background: #22c55e;
  border-color: #15803d;
  box-shadow: 0 0 8px #22c55e, 0 0 2px #ffffff;
}

.voyage-sailor {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.76rem;
  font-weight: 700;
  color: #4a3416;
  margin: 3px 0 0;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.auth-panel,
.modal-content {
  border: 2px solid #caa653;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 245, 218, 0.98), rgba(238, 220, 172, 0.98));
  box-shadow: 0 18px 48px rgba(0, 22, 21, 0.55), inset 0 0 0 3px rgba(128, 91, 30, 0.12);
  color: #153d3a;
}

.auth-eyebrow {
  color: #80601d;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.auth-panel h1,
.modal-title {
  font-family: Georgia, 'Times New Roman', serif;
  color: #2a1f0c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary {
  border: 1px solid #e5c673;
  background: linear-gradient(180deg, #166b63 0%, #0d5751 100%);
  color: #ffffff;
  box-shadow: 0 3px 0 #063832, 0 6px 14px rgba(0, 20, 18, 0.35);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.btn-primary:hover {
  background: linear-gradient(180deg, #1c7c73 0%, #0f625b 100%);
}

.btn-secondary,
.setting-select,
.auth-language-select {
  border-color: #b08a3a;
  background-color: #fff0c6;
  color: #153d3a;
}

/* ==========================================================================
   반응형 미디어 쿼리
   ========================================================================== */
@media (max-width: 1100px) {
  .voyage-sidebar {
    display: none;
  }
}

@media (max-height: 720px) {
  .site-nav {
    height: 50px;
  }

  #app-container,
  .auth-screen {
    margin-top: 50px;
    height: calc(100% - 50px);
    min-height: calc(100% - 50px);
  }

  .game-header {
    height: 52px;
    padding: 0 8px;
  }

  .game-board-container {
    padding: 12px 6px 16px;
  }

  .compass-stage {
    padding: 6px 10px;
  }

  .guess-meaning-feedback-slot {
    flex-basis: 58px;
    min-height: 58px;
  }
}

@media (max-width: 380px) {
  .game-header {
    height: 54px;
    padding: 0 6px;
    gap: 4px;
  }

  .header-left,
  .header-right {
    gap: 3px;
  }

  .icon-btn {
    width: 28px;
    height: 28px;
  }

  .header-title {
    font-size: clamp(0.9rem, 3.6vw, 1.15rem);
    letter-spacing: 0.03em;
  }

  .header-sub-row {
    gap: 5px;
  }

  .header-user-status {
    padding: 2px 8px;
    font-size: 0.74rem;
  }

  .compass-stage {
    max-width: 96vw;
    padding: 8px 10px;
  }

  .tile {
    font-size: 1.15rem;
  }

  .key-btn {
    height: 38px;
    font-size: 0.82rem;
  }

  .key-btn.wide-key {
    font-size: 0.62rem;
  }

  .guess-meaning-feedback-slot {
    max-width: calc(100% - 20px);
  }

  .guess-meaning-bubble {
    padding-right: 10px;
    padding-left: 10px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 8px;
  }

  .modal-actions .btn-secondary,
  .modal-actions .btn-primary,
  .modal-actions .btn-danger {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .game-header {
    height: 54px;
  }
}

@media (max-width: 380px) {
  .compass-stage {
    width: fit-content;
    max-width: calc(100% - 20px);
    margin: 38px 0 12px;
  }

  .board-grid {
    width: auto;
    height: min(39svh, 316px);
    max-height: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .guess-meaning-bubble,
  .tile,
  .tile.flip,
  .tile.bounce,
  .tile.pop,
  .board-row.shake {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .guess-meaning-bubble {
    transform: none;
  }
}
