/* ===== Sidebar ===== */
.sidebar-toggles {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-toggle-btn {
  position: relative;
  background: white;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.2s;
}

.sidebar-toggle-btn:hover {
  border-color: #667eea;
}

.sidebar-toggle-icon {
  font-size: 1rem;
}

.sidebar-toggle-icon-gear {
  font-size: 1.6rem;
  line-height: 1;
  margin-top: -4px;
}

.sidebar-toggle-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #555;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e74c3c;
  color: white;
  font-size: 0.65rem;
  font-weight: 900;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.sidebar {
  position: fixed;
  top: 0;
  right: -340px;
  width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 300;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar.open {
  right: 0;
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  z-index: 250;
  display: none;
}

.sidebar-overlay.open {
  display: block;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.sidebar-tabs {
  display: flex;
  gap: 4px;
}

.sidebar-tab {
  padding: 6px 14px;
  border: none;
  background: #f0f2f5;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #888;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}

.sidebar-tab.active {
  background: #667eea;
  color: white;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Social */
.social-section {
  padding: 10px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.social-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #999;
  margin-bottom: 8px;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}

.social-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s;
}

.social-row:hover {
  background: #f8f9ff;
}

.social-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.social-level {
  font-size: 0.7rem;
  color: #667eea;
  font-weight: 700;
  margin-left: 6px;
}

.social-btn {
  padding: 3px 10px;
  border-radius: 6px;
  border: 1.5px solid #667eea;
  background: white;
  color: #667eea;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}

.social-btn:hover {
  background: #667eea;
  color: white;
}

.social-btn.accept {
  border-color: #4caf50;
  color: #4caf50;
}

.social-btn.accept:hover {
  background: #4caf50;
  color: white;
}

.social-btn.reject {
  border-color: #e74c3c;
  color: #e74c3c;
}

.social-btn.reject:hover {
  background: #e74c3c;
  color: white;
}

.social-btn.chat-btn {
  border-color: #43e97b;
  color: #43e97b;
}

.social-btn.chat-btn:hover {
  background: #43e97b;
  color: white;
}

.social-empty {
  font-size: 0.8rem;
  color: #ccc;
  text-align: center;
  padding: 10px;
}

.social-online-dot {
  width: 8px;
  height: 8px;
  background: #4caf50;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Chat */
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-weight: 700;
  font-size: 0.95rem;
}

.chat-back {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #667eea;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-msg {
  max-width: 80%;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg.mine {
  align-self: flex-end;
  background: #667eea;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg.theirs {
  align-self: flex-start;
  background: #f0f2f5;
  color: #333;
  border-bottom-left-radius: 4px;
}

.chat-unread {
  display: inline-block;
  background: #ffc107;
  color: #5a3e00;
  font-size: 0.55rem;
  font-weight: 900;
  width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

.chat-msg-time {
  font-size: 0.6rem;
  color: #aaa;
  margin-top: 2px;
}

.multi-typing-indicator {
  padding: 2px 14px;
  font-size: 0.78rem;
  color: #aaa;
  min-height: 18px;
  font-style: italic;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-typing-indicator {
  padding: 2px 14px;
  font-size: 0.7rem;
  color: #aaa;
  min-height: 16px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-input-area {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  border-top: 1px solid #eee;
}

.chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
}

.chat-input:focus {
  border-color: #667eea;
}

.notice-write {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-title-input {
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
}

.notice-title-input:focus {
  border-color: #667eea;
}

.notice-textarea {
  padding: 8px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  resize: none;
}

.notice-textarea:focus {
  border-color: #667eea;
}

.notice-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.notice-item {
  border-bottom: 1px solid #f5f5f5;
}

.notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.notice-header:hover {
  background: #f8f9ff;
}

.notice-date {
  font-size: 0.7rem;
  color: #bbb;
}

.notice-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
  flex: 1;
  margin-right: 8px;
}

.notice-delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.notice-delete-btn:hover {
  color: #e74c3c;
}

.notice-arrow {
  font-size: 0.7rem;
  color: #ccc;
  transition: transform 0.2s;
}

.notice-arrow.open {
  transform: rotate(180deg);
}

.notice-body {
  display: none;
  padding: 0 16px 12px;
  font-size: 0.85rem;
  color: #555;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.notice-body.open {
  display: block;
}

.notice-author {
  font-size: 0.72rem;
  color: #999;
  margin-top: 6px;
}

.notice-new {
  display: inline-block;
  background: #e74c3c;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ===== Now Playing ===== */
.now-playing {
  position: fixed;
  bottom: 14px;
  left: 14px;
  z-index: 150;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.72rem;
  color: #555;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 320px;
  animation: nowPlayingIn 0.5s ease;
}

.now-playing-icon {
  font-size: 0.9rem;
  animation: noteFloat 2s ease infinite;
}

@keyframes noteFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.np-btn {
  background: none;
  border: none;
  color: #667eea;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0 4px;
  font-family: sans-serif;
}

.np-vol-text {
  font-size: 0.65rem;
  color: #999;
  min-width: 28px;
}

.np-volume {
  width: 60px;
  height: 4px;
  cursor: pointer;
  accent-color: #667eea;
}

@keyframes nowPlayingIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Maintenance Screen ===== */
.maintenance-screen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.maintenance-container {
  text-align: center;
  padding: 40px 20px;
  max-width: 500px;
  color: white;
}

.maintenance-icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.maintenance-title {
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.maintenance-desc {
  font-size: 1rem;
  opacity: 0.9;
  line-height: 1.7;
  margin-bottom: 24px;
}

.maintenance-info {
  background: rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.maintenance-admin {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.maintenance-footer {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-top: 30px;
}

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== Screen Management ===== */
.screen {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}

.screen.active {
  display: flex;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Home Screen ===== */
.home-container {
  text-align: center;
  padding: 40px;
}

.game-title {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
  margin-bottom: 8px;
  word-break: keep-all;
}

.game-subtitle {
  font-size: 1.2rem;
  color: #888;
  font-weight: 300;
  margin-bottom: 30px;
}

.sound-recommend {
  font-size: 0.7rem;
  color: #bbb;
  font-weight: 400;
  margin-top: -20px;
  margin-bottom: 30px;
}

/* ===== Login Screen ===== */
.login-container {
  text-align: center;
  padding: 40px 20px;
  max-width: 500px;
  width: 100%;
  overflow: visible;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 20px;
}

.login-tabs {
  display: flex;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f2f5;
}

.login-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 700;
  color: #888;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}

.login-tab.active {
  background: #667eea;
  color: white;
  border-radius: 10px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-input {
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.login-input:focus {
  border-color: #667eea;
}

.auth-message {
  margin-top: 12px;
  font-size: 0.85rem;
  min-height: 20px;
}

.auth-message.error { color: #e74c3c; }
.auth-message.success { color: #2e7d32; }

/* Home Profile Card */
.home-profile-card {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.home-profile-card:hover {
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

.home-profile-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.home-profile-avatar {
  font-size: 1.8rem;
}

.home-profile-name {
  font-weight: 700;
  font-size: 0.95rem;
}

/* Role Badge */
.role-badge {
  vertical-align: middle;
  margin-left: 4px;
  object-fit: contain;
}

/* Level Icon Badge */
.level-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.level-icon-large {
  width: 80px;
  height: 80px;
  margin: 8px auto 16px;
}

.level-icon-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.level-icon-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-weight: 900;
  font-size: 0.75rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
  line-height: 1;
}

.level-icon-large .level-icon-num {
  font-size: 1.6rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.level-icon-num.no-shadow {
  text-shadow: none;
}

.level-icon-large .level-icon-num.no-shadow {
  text-shadow: none;
}

.level-icon-num.small-text {
  font-size: 0.45rem;
  transform: translate(-50%, -70%);
}

.level-icon-large .level-icon-num.small-text {
  font-size: 0.94rem;
  transform: translate(-50%, -70%);
}

.home-profile-uid {
  font-size: 0.7rem;
  color: #aaa;
  font-weight: 400;
}

.profile-uid {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 12px;
}

.home-profile-bar-wrap {
  flex: 1;
  min-width: 0;
}

.home-profile-bar-bg {
  background: #e9ecef;
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.home-profile-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.5s ease;
}

.home-profile-exp {
  font-size: 0.7rem;
  color: #aaa;
  text-align: right;
  margin-top: 2px;
}

/* Profile Screen */
.profile-container {
  width: 100%;
  max-width: 500px;
  padding: 40px 20px;
  position: relative;
}

.profile-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.profile-card {
  background: white;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

.profile-avatar-large {
  font-size: 4rem;
  margin-bottom: 12px;
}

.profile-nickname-display {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.85rem;
}


.profile-exp-section {
  max-width: 300px;
  margin: 0 auto;
}

.profile-exp-bar-bg {
  background: #e9ecef;
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
}

.profile-exp-bar-fill {
  height: 100%;
  border-radius: 10px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.5s ease;
}

.profile-exp-text {
  font-size: 0.85rem;
  color: #888;
  margin-top: 6px;
}

.profile-stats {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.profile-stats h3 {
  font-size: 0.9rem;
  color: #aaa;
  margin-bottom: 14px;
  font-weight: 500;
}

.stats-grid {
  display: flex;
  justify-content: space-around;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 900;
  color: #333;
}

.stat-label {
  font-size: 0.8rem;
  color: #999;
  margin-top: 2px;
}

.btn-rank {
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #5a3e00;
}

.btn-multi {
  background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  color: white;
}

.btn-test {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
  margin-top: 10px;
}

/* ===== Multiplayer Screens ===== */
.multi-lobby-container,
.multi-waiting-container {
  width: 100%;
  max-width: 500px;
  padding: 40px 20px;
  position: relative;
}

.multi-lobby-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-align: center;
}

.multi-lobby-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
}

.multi-join-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.room-title-input {
  width: 100%;
  padding: 8px 14px;
  border: 1.5px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  margin-bottom: 8px;
}

.room-title-input:focus {
  border-color: #43e97b;
}

.multi-code-input {
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1.1rem;
  font-family: 'Noto Sans KR', monospace;
  font-weight: 700;
  text-align: center;
  width: 160px;
  outline: none;
  letter-spacing: 3px;
}

.multi-code-input:focus {
  border-color: #43e97b;
}

.room-code-display {
  background: white;
  border-radius: 16px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.room-code-label {
  font-size: 0.85rem;
  color: #888;
}

.room-code-value {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #43e97b;
}

.waiting-players {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.waiting-player {
  text-align: center;
  min-width: 100px;
}

.waiting-avatar {
  font-size: 2.8rem;
  margin-bottom: 4px;
}

.waiting-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.waiting-vs {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ccc;
}

.waiting-status {
  text-align: center;
  font-size: 1rem;
  color: #888;
  margin-bottom: 16px;
}

.waiting-modes {
  text-align: center;
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 16px;
}

.ready-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
}

.ready-badge.ready {
  background: #e8f5e9;
  color: #2e7d32;
}

.ready-badge.not-ready {
  background: #fce8e8;
  color: #d32f2f;
}

/* Room List */
.room-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.room-list-empty {
  text-align: center;
  font-size: 0.85rem;
  color: #bbb;
  padding: 16px 0;
}

.room-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8f9fa;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.room-list-card:hover {
  background: #e8f5e9;
  transform: translateX(2px);
}

.room-list-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.room-list-host {
  font-size: 0.9rem;
  font-weight: 600;
}

.room-list-level {
  font-size: 0.75rem;
  color: #667eea;
  font-weight: 700;
}

.room-list-modes {
  font-size: 0.72rem;
  color: #999;
}

.room-list-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 2px;
}

.room-list-code {
  font-size: 0.85rem;
  font-weight: 700;
  color: #43e97b;
  letter-spacing: 2px;
}

.waiting-room-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.round-select-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.round-select-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  min-width: 50px;
}

.round-btns {
  display: flex;
  gap: 6px;
}

.round-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 2px solid #ddd;
  background: white;
  font-size: 0.9rem;
  font-weight: 700;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}

.round-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.round-btn.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.round-display {
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #667eea;
  margin-bottom: 4px;
}

.server-badge {
  position: fixed;
  top: 16px;
  left: 16px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 12px;
  background: none;
  color: #bbb;
  z-index: 100;
}

.server-badge.test {
  color: #e65100;
}

#test-back-btn {
  position: fixed;
  top: 14px;
  left: 100px;
  z-index: 100;
}

.test-panel {
  background: #fff8e1;
  border: 2px solid #ffcc02;
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.test-panel-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #e65100;
  margin-bottom: 10px;
}

.test-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.test-row:last-child {
  margin-bottom: 0;
}

.test-row label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  min-width: 55px;
}

.test-input {
  padding: 6px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Noto Sans KR', sans-serif;
  width: 140px;
  outline: none;
}

.test-input:focus {
  border-color: #ff9800;
}

/* ===== Boss Battle Screen ===== */
#screen-boss.active {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000;
  z-index: 500;
}

.boss-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.boss-fade-overlay {
  display: none;
}

/* Boss Tutorial Popup */
.boss-tutorial-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boss-tutorial-overlay.hidden {
  display: none;
}

.boss-tutorial-popup {
  background: #1a1a2e;
  border: 2px solid #ff4444;
  border-radius: 16px;
  padding: 28px 24px 20px;
  max-width: 400px;
  width: 90%;
  position: relative;
  color: #eee;
  box-shadow: 0 8px 40px rgba(255,0,0,0.2);
}

.boss-tutorial-close {
  position: absolute;
  top: 10px; right: 14px;
  background: none;
  border: none;
  color: #888;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.boss-tutorial-close:hover {
  color: #fff;
}

.boss-tutorial-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ff4444;
  margin-bottom: 14px;
  text-align: center;
}

.boss-tutorial-body {
  font-size: 0.85rem;
  line-height: 1.7;
}

.boss-tutorial-body p {
  margin-bottom: 8px;
}

.boss-tutorial-body em {
  color: #ff6b6b;
  font-style: normal;
  font-weight: 700;
}

.boss-tutorial-rules {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 10px 0;
}

.boss-rule {
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.boss-rule:last-child {
  margin-bottom: 0;
}

.rule-icon {
  margin-right: 6px;
}

.boss-tutorial-footer {
  margin-top: 14px;
}

.boss-tutorial-check {
  font-size: 0.78rem;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.boss-tutorial-check input {
  cursor: pointer;
}

.boss-game-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.5) 0%,
    transparent 15%,
    transparent 70%,
    rgba(0,0,0,0.7) 100%
  );
}

.boss-game-ui > * {
  pointer-events: auto;
}

/* 보스 체력바 */
.boss-hp-section {
  padding: 12px 20px 0;
}

.boss-name {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 8px rgba(255,0,0,0.6), 0 1px 4px rgba(0,0,0,0.8);
  margin-bottom: 6px;
}

.boss-hp-bar-bg {
  height: 18px;
  background: rgba(255,255,255,0.15);
  border-radius: 9px;
  overflow: hidden;
}

.boss-hp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff0000, #ff4444);
  border-radius: 9px;
  transition: width 0.5s ease;
}

/* 중앙 */
.boss-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.boss-timer-only {
  color: rgba(255,255,255,0.8);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  margin-bottom: 8px;
}

.boss-timer-only.warning { color: #ff6b6b; }
.boss-timer-only.danger { color: #ff0000; font-weight: 900; }

.boss-words-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.boss-word-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.boss-word-display {
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  letter-spacing: 2px;
  display: flex;
  gap: 2px;
}

.boss-word-display .char {
  display: inline-block;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.1s ease;
}

.boss-word-display .char.visible {
  opacity: 1;
  transform: scale(1);
}

.boss-word-display .char.pulse {
  animation: charPulse 0.1s ease;
}

.boss-word-arrow {
  color: rgba(255,255,255,0.4);
  font-size: 1.2rem;
}

.boss-word-answer {
  min-width: 80px;
  padding: 4px 12px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  color: #fff;
  font-size: 0.9rem;
  font-family: 'Noto Sans KR', sans-serif;
  text-align: center;
  outline: none;
}

.boss-word-answer:focus {
  border-color: #ff4444;
}

.boss-word-answer.correct {
  border-color: #4caf50;
  background: rgba(76,175,80,0.2);
}

.boss-word-answer.wrong {
  border-color: #e74c3c;
  background: rgba(231,76,60,0.2);
}

/* 하트 */
.boss-hearts {
  position: absolute;
  bottom: 80px;
  left: 16px;
  display: flex;
  gap: 4px;
}

.boss-heart {
  font-size: 1.4rem;
  color: #ff4444;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  transition: all 0.3s;
}

.boss-heart.lost {
  color: #333;
  opacity: 0.4;
}

/* 하단 입력 */
.boss-input-area {
  padding: 8px 16px 16px;
  display: none;
}

.boss-input {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  display: block;
  padding: 10px 16px;
  font-size: 0.9rem;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  outline: none;
  font-family: 'Noto Sans KR', sans-serif;
  background: rgba(0,0,0,0.5);
  color: #fff;
  text-align: center;
}

.boss-input:focus {
  border-color: rgba(255,255,255,0.7);
}

.boss-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.btn-bug-small {
  background: none;
  border: 1.5px solid #ccc;
  border-radius: 10px;
  color: #aaa;
  font-size: 1.1rem;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  margin-top: 20px;
  padding: 8px 20px;
  transition: all 0.2s;
}

.btn-bug-small:hover {
  color: #667eea;
  border-color: #667eea;
}

/* ===== Bug Report Screen ===== */
.bug-container {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  position: relative;
  margin: 0 auto;
}

.bug-input-area {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  align-items: flex-end;
}

.bug-textarea {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 0.9rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  resize: vertical;
  min-height: 60px;
}

.bug-textarea:focus {
  border-color: #667eea;
}

.bug-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.bug-card {
  background: white;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.bug-card.resolved {
  opacity: 0.6;
  background: #f8fdf8;
}

.bug-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bug-author {
  font-size: 0.8rem;
  font-weight: 700;
  color: #555;
}

.bug-time {
  font-size: 0.7rem;
  color: #bbb;
}

.bug-content {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.5;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.bug-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bug-status {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 700;
}

.bug-status.open {
  background: #fff3e0;
  color: #e65100;
}

.bug-status.done {
  background: #e8f5e9;
  color: #2e7d32;
}

.bug-resolve-area {
  display: flex;
  gap: 6px;
  align-items: center;
}

.bug-resolve-input {
  padding: 4px 10px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.75rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  width: 140px;
}

.bug-resolve-input:focus {
  border-color: #4caf50;
}

.bug-resolve-btn {
  padding: 4px 12px;
  border: 1.5px solid #4caf50;
  border-radius: 8px;
  background: white;
  color: #4caf50;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.2s;
}

.bug-resolve-btn:hover {
  background: #4caf50;
  color: white;
}

.bug-resolver {
  font-size: 0.72rem;
  color: #2e7d32;
  margin-top: 4px;
}

/* ===== Ranking Screen ===== */
.ranking-container {
  width: 100%;
  max-width: 550px;
  padding: 20px;
  position: relative;
  margin: 0 auto;
}

.ranking-list {
  background: white;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}

.ranking-loading {
  text-align: center;
  padding: 30px;
  color: #aaa;
  font-size: 0.9rem;
}

.ranking-header {
  display: grid;
  grid-template-columns: 40px 1fr 70px 70px 70px;
  padding: 12px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #999;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.ranking-row {
  display: grid;
  grid-template-columns: 40px 1fr 70px 70px 70px;
  padding: 10px 16px;
  align-items: center;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
}

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

.ranking-row:hover {
  background: #f8f9ff;
}

.ranking-row.me {
  background: #f0f4ff;
}

.rank-num {
  font-weight: 900;
  font-size: 1rem;
  color: #555;
}

.rank-num.gold { color: #ffc107; }
.rank-num.silver { color: #90a4ae; }
.rank-num.bronze { color: #bf8040; }

.rank-name {
  font-weight: 600;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-level {
  font-weight: 700;
  font-size: 0.9rem;
  color: #667eea;
  text-align: center;
}

.rank-exp {
  font-size: 0.8rem;
  color: #888;
  text-align: right;
}

.rank-lastlogin {
  font-size: 0.7rem;
  color: #aaa;
  text-align: right;
}

/* ===== User Profile Popup ===== */
.user-popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-popup-card {
  background: white;
  border-radius: 20px;
  padding: 30px 24px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.user-popup-avatar {
  font-size: 3rem;
  margin-bottom: 8px;
}

.user-popup-name {
  font-size: 1.2rem;
  font-weight: 900;
  margin-bottom: 2px;
}

.user-popup-uid {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 12px;
}

.user-popup-level {
  margin-bottom: 16px;
}

.user-popup-stats {
  display: flex;
  justify-content: space-around;
  gap: 8px;
}

.user-popup-stat {
  text-align: center;
}

.user-popup-stat .stat-value {
  font-size: 1.2rem;
}

/* ===== Dictionary Screen ===== */
.dict-container {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  position: relative;
  margin: 0 auto;
}

/* ===== Settings ===== */
.settings-container {
  width: 100%;
  max-width: 540px;
  padding: 20px;
  position: relative;
  margin: 0 auto;
}

.settings-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.settings-section {
  background: white;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.settings-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1976d2;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  gap: 12px;
}

.settings-row label {
  font-size: 0.95rem;
  color: #333;
  flex-shrink: 0;
}

.settings-slider-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 280px;
}

.settings-slider-wrap input[type="range"] {
  flex: 1;
  cursor: pointer;
}

.settings-vol-text {
  font-size: 0.9rem;
  color: #666;
  font-weight: 600;
  min-width: 42px;
  text-align: right;
}

.settings-lang-row {
  justify-content: flex-start;
  gap: 24px;
}

.settings-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
}

.settings-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.dict-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.dict-total {
  text-align: center;
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 16px;
}

.dict-filters {
  background: white;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dict-search {
  width: 100%;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.dict-search:focus {
  border-color: #667eea;
}

.dict-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.dict-filter-row:last-child {
  margin-bottom: 0;
}

.dict-filter-row label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  min-width: 60px;
}

.dict-filter-input {
  padding: 6px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: 'Noto Sans KR', sans-serif;
  width: 80px;
  outline: none;
}

.dict-filter-input:focus {
  border-color: #667eea;
}

.dict-filter-select {
  padding: 6px 12px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Noto Sans KR', sans-serif;
  outline: none;
  background: white;
}

.dict-result-count {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 8px;
  padding-left: 4px;
}

.dict-list {
  background: white;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  max-height: 50vh;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dict-word {
  background: #f0f2f5;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #333;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.dict-word:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.dict-word.std {
  background: #e8f0fe;
  color: #1a73e8;
}

.dict-def-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0.96;
  animation: dictModalFadeIn 0.18s ease-out;
}

@keyframes dictModalFadeIn {
  from { opacity: 0; }
  to { opacity: 0.96; }
}

.dict-def-card {
  position: relative;
  background: white;
  border-radius: 18px;
  padding: 32px 28px 28px;
  max-width: 90vw;
  width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.dict-def-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
}
.dict-def-close:hover { color: #333; }

.dict-def-word {
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: 16px;
  color: #1a1a2e;
  letter-spacing: 2px;
}

.dict-def-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #333;
  word-break: keep-all;
}

.dict-def-body .def-pos {
  display: inline-block;
  color: white;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  margin-right: 5px;
  vertical-align: middle;
}
.dict-def-body .def-num {
  display: inline-block;
  font-weight: 700;
  color: #888;
  margin-right: 4px;
}
.dict-def-body .def-word { font-weight: 700; color: #1a1a2e; }
.dict-def-body .def-hanja { color: #888; font-size: 0.85rem; margin-left: 2px; }
.dict-def-body .def-text { color: #444; }

.dict-def-loading,
.dict-def-none {
  text-align: center;
  color: #888;
  padding: 20px 0;
  font-size: 0.9rem;
}

.dict-word.inj {
  background: #fff3e0;
  color: #e65100;
}

.dict-word.killer {
  outline: 2px solid #d32f2f;
  outline-offset: -2px;
  font-weight: 700;
}

.dict-killer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.dict-killer-toggle input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.route-tree {
  padding: 12px 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.route-empty {
  padding: 24px;
  text-align: center;
  color: #888;
  font-size: 0.95rem;
}

.route-node {
  display: inline-block;
  margin: 2px 0;
}

.route-node .route-word {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

.route-node.user .route-word {
  background: #e3f2fd;
  color: #1565c0;
  border: 1.5px solid #1976d2;
}

.route-node.opp .route-word {
  background: #ffebee;
  color: #c62828;
  border: 1.5px solid #e53935;
}

.route-node.killer .route-word {
  background: #fff8e1;
  color: #b71c1c;
  border: 2px solid #b71c1c;
  font-weight: 700;
}

.route-node.deep .route-word {
  opacity: 0.6;
  border-style: dashed;
}

.route-node.error,
.route-node.opp-loss {
  padding: 4px 10px;
  font-size: 0.85rem;
  color: #b71c1c;
  font-style: italic;
}

.route-children {
  margin-left: 24px;
  padding-left: 12px;
  border-left: 2px dashed #bbb;
  margin-top: 4px;
}

.route-branch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 3px 0;
}

.route-branch::before {
  content: "→";
  color: #888;
  font-weight: 700;
}

.route-more {
  margin: 6px 0 6px 0;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: #666;
  font-style: italic;
}

.version-text {
  margin-top: 40px;
  margin-bottom: 4px;
  font-size: 0.8rem;
  color: #ccc;
}

.copyright-text {
  font-size: 0.7rem;
  color: #ddd;
}

/* ===== Buttons ===== */
.btn {
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 40px;
  font-size: 1.1rem;
}

.btn-secondary {
  background: white;
  color: #555;
  padding: 14px 40px;
  font-size: 1.1rem;
  border: 1px solid #ddd;
}

.btn-large {
  padding: 20px 60px;
  font-size: 1.3rem;
  border-radius: 16px;
}

.btn-icon {
  margin-right: 8px;
}

.btn-leave-game {
  position: fixed;
  top: 14px;
  left: 14px;
  background: white;
  border: 1.5px solid #e74c3c;
  color: #e74c3c;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Noto Sans KR', sans-serif;
  z-index: 100;
  transition: all 0.2s;
}

.btn-leave-game:hover {
  background: #e74c3c;
  color: white;
}

.btn-back {
  background: none;
  border: none;
  font-size: 1.1rem;
  color: #888;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s;
  position: absolute;
  top: 20px;
  left: 20px;
  font-family: 'Noto Sans KR', sans-serif;
}

.btn-back:hover {
  background: #eee;
  color: #333;
}

/* ===== Mode Selection ===== */
.mode-section {
  background: white;
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.mode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.mode-row:last-of-type {
  margin-bottom: 8px;
}

.mode-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #555;
  min-width: 70px;
}

.mode-fixed {
  font-size: 0.9rem;
  color: #667eea;
  font-weight: 500;
  background: #f0f2ff;
  padding: 4px 14px;
  border-radius: 8px;
}

.mode-toggles {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.mode-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 2px solid #ddd;
  background: white;
  color: #888;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Noto Sans KR', sans-serif;
}

.mode-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.mode-btn.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.mode-desc {
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 4px;
}

/* ===== Bot Select Screen ===== */
.select-container {
  width: 100%;
  max-width: 700px;
  padding: 40px 20px;
  position: relative;
}

.select-title {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 30px;
  color: #333;
}

.bot-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bot-card {
  background: white;
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.bot-card:hover {
  border-color: #667eea;
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.15);
}

.bot-card-god {
  background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
  border: 2px solid #ffd700;
}

.bot-card-god:hover {
  border-color: #ffaa00;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
}

.bot-avatar {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.bot-lv1 { background: #e8f5e9; }
.bot-lv2 { background: #e3f2fd; }
.bot-lv3 { background: #f3e5f5; }
.bot-lv4 { background: #fce4ec; }
.bot-lv5 { background: #fce4ec; }
.bot-lv6 { background: #fff8e1; }
.bot-lv7 { background: #e8f5e9; }
.bot-boss { background: #2c0000; }

.bot-card-boss {
  background: linear-gradient(135deg, #1a0000 0%, #4a0000 50%, #2c0000 100%);
  border: 2px solid #e74c3c;
  position: relative;
  overflow: hidden;
}

.bot-card-boss h3 {
  color: #ff4444;
}

.bot-card-boss .bot-desc {
  color: #cc8888;
}

.bot-card-boss .bot-info {
  color: #ffcccc;
}

.bot-card-boss:hover {
  border-color: #ff0000;
  box-shadow: 0 4px 20px rgba(255, 0, 0, 0.3);
}

.bot-card-boss.locked {
  opacity: 0.7;
  cursor: not-allowed;
}


.bot-card-boss.locked:hover {
  transform: none;
  box-shadow: none;
  border-color: #e74c3c;
}

.boss-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.5rem;
  z-index: 2;
  opacity: 0.8;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.bot-card-long {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border: 2px solid #4caf50;
}

.bot-card-long:hover {
  border-color: #2e7d32;
  box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

.bot-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.bot-stars {
  margin-bottom: 4px;
}

.star {
  color: #ddd;
  font-size: 0.9rem;
}

.star.filled {
  color: #ffc107;
}

.bot-desc {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.4;
}

/* ===== Game Screen ===== */
.game-container {
  width: 100%;
  max-width: 600px;
  padding: 20px;
  margin: 0 auto;
}

/* Timer */
.timer-section {
  margin-bottom: 16px;
}

.timer-bar-bg {
  background: #e9ecef;
  border-radius: 20px;
  height: 12px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.timer-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.1s linear;
}

.timer-bar-fill.warning {
  background: linear-gradient(90deg, #ff6b6b, #ee5a24);
}

.timer-bar-fill.danger {
  background: linear-gradient(90deg, #ff0000, #cc0000);
  animation: timerPulse 0.5s ease infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.timer-text {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 6px;
  color: #555;
  font-variant-numeric: tabular-nums;
}

.timer-text.warning { color: #ff6b6b; }
.timer-text.danger { color: #ff0000; font-weight: 900; }

/* Turn Indicator */
.turn-indicator {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 20px;
  display: inline-block;
  margin: 0 auto 16px;
  width: fit-content;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.turn-indicator.my-turn {
  background: #e8f5e9;
  color: #2e7d32;
}

.turn-indicator.bot-turn {
  background: #fce4ec;
  color: #c62828;
}

/* Players */
.players-area {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 24px;
}

.player-panel {
  text-align: center;
  min-width: 100px;
}

.player-avatar {
  font-size: 2.8rem;
  margin-bottom: 4px;
}

.player-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 2px;
}

.player-score {
  font-size: 1.4rem;
  font-weight: 900;
  color: #667eea;
}

.vs-text {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ccc;
}

/* Word Display */
.word-display-area {
  text-align: center;
  margin-bottom: 24px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.word-def {
  display: none;
  max-width: 720px;
  margin: 0 auto 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #444;
  background: rgba(255,255,255,0.85);
  border-radius: 10px;
  text-align: center;
  word-break: keep-all;
}
.word-def .def-pos {
  display: inline-block;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  vertical-align: middle;
}
.word-def .def-num {
  display: inline-block;
  font-weight: 700;
  color: #888;
  margin-right: 4px;
}
.word-def .def-word { font-weight: 700; color: #222; }
.word-def .def-hanja { color: #888; font-size: 0.78rem; margin-left: 2px; }
.word-def .def-text { color: #555; }

.current-word {
  font-size: 3rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: #1a1a2e;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.current-word .char {
  display: inline-block;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s ease;
}

.current-word .char.visible {
  opacity: 1;
  transform: scale(1);
}

.current-word .char.pulse {
  animation: charPulse 0.12s ease;
}

@keyframes charPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.current-word.finale-pulse {
  animation: finalePulse 0.35s ease;
}

@keyframes finalePulse {
  0% { transform: scale(1); }
  33% { transform: scale(1.05); }
  66% { transform: scale(1.1); }
  100% { transform: scale(1.02); }
}

.next-char-hint {
  font-size: 1.1rem;
  color: #999;
  margin-top: 8px;
  font-weight: 500;
}

.next-char-hint strong {
  color: #667eea;
  font-size: 1.3rem;
}

/* Input */
.input-area {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.word-input {
  flex: 1;
  padding: 14px 20px;
  font-size: 1.1rem;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  outline: none;
  font-family: 'Noto Sans KR', sans-serif;
  transition: border-color 0.2s;
  background: white;
}

.word-input:focus {
  border-color: #667eea;
}

.word-input:disabled {
  background: #f5f5f5;
  color: #999;
}

#multi-word-input::placeholder {
  color: #aaa;
  font-style: italic;
}

#multi-typing-overlay {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: #aaa;
  font-style: italic;
  font-family: 'Noto Sans KR', sans-serif;
  pointer-events: none;
  display: none;
  max-width: calc(100% - 120px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.btn-submit {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 14px 24px;
  font-size: 1.1rem;
}

.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* Game Message */
.game-message {
  text-align: center;
  min-height: 24px;
  font-size: 0.95rem;
  color: #e74c3c;
  margin-bottom: 12px;
  font-weight: 500;
}

/* Used Words */
.used-words-section {
  background: white;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.used-words-section h4 {
  font-size: 0.85rem;
  color: #aaa;
  margin-bottom: 10px;
  font-weight: 500;
}

.used-words-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.used-word-tag {
  background: #f0f2f5;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  color: #555;
  animation: tagAppear 0.3s ease;
}

.used-word-tag.player-word {
  background: #e8f0fe;
  color: #1a73e8;
}

.used-word-tag.bot-word {
  background: #fce8e8;
  color: #d32f2f;
}

@keyframes tagAppear {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ===== Game Over Screen ===== */
.gameover-container {
  text-align: center;
  padding: 40px;
  max-width: 500px;
}

.gameover-title {
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 30px;
}

.gameover-title.win {
  color: #2e7d32;
}

.gameover-title.lose {
  color: #c62828;
}

.gameover-result {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 20px;
}

.result-panel {
  text-align: center;
  min-width: 120px;
}

.result-label {
  font-size: 1rem;
  color: #888;
  margin-bottom: 8px;
}

.result-score {
  font-size: 2.5rem;
  font-weight: 900;
  color: #667eea;
}

.result-vs {
  font-size: 1.2rem;
  font-weight: 900;
  color: #ccc;
}

.gameover-reason {
  color: #888;
  font-size: 0.95rem;
  margin-bottom: 30px;
  line-height: 1.6;
}

.gameover-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  .game-title { font-size: 2.5rem; }
  .current-word { font-size: 2.2rem; }
  .bot-card { padding: 14px 16px; }
  .players-area { gap: 16px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
