/* ============================================================
   디자인 토큰 (기본: 게임 스타일)
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg-0: #0a0612;
  --bg-1: #14092a;
  --bg-2: #1f0f3a;
  --ink: #f4ecff;
  --ink-dim: #b9a8e0;
  --ink-mute: #7a6b9c;
  --accent: #ff2d75;
  --accent-2: #00f0c8;
  --accent-3: #ffcc00;
  --accent-4: #6b4eff;
  --accent-5: #ff8c00;
  --danger: #ff4040;
  --grid: rgba(107, 78, 255, 0.12);
  --font-display: 'Courier New', 'Consolas', monospace;
  --font-body: -apple-system, BlinkMacSystemFont, 'Malgun Gothic', '맑은 고딕', sans-serif;
  --radius: 6px;
  --bg-gradient-1-pos: 20% 10%;
  --bg-gradient-2-pos: 80% 90%;
}

/* ============================================================
   테마: EXCEL (스프레드시트)
   ============================================================ */
body[data-theme="excel"] {
  --bg-0: #ffffff;
  --bg-1: #f3f2f1;
  --bg-2: #e7e6e5;
  --ink: #252423;
  --ink-dim: #605e5c;
  --ink-mute: #a19f9d;
  --accent: #107c41;     /* Excel 그린 */
  --accent-2: #185abd;   /* 짙은 파랑 */
  --accent-3: #d83b01;   /* 주황 (강조) */
  --accent-4: #107c41;
  --accent-5: #2b7a0b;
  --danger: #d13438;
  --grid: rgba(0, 0, 0, 0.08);
  --font-body: 'Segoe UI', '맑은 고딕', sans-serif;
  --font-display: 'Segoe UI', '맑은 고딕', sans-serif;
  --radius: 2px;
}

/* ============================================================
   테마: POWERPOINT (프레젠테이션)
   ============================================================ */
body[data-theme="powerpoint"] {
  --bg-0: #ffffff;
  --bg-1: #f3f2f1;
  --bg-2: #faf9f8;
  --ink: #252423;
  --ink-dim: #605e5c;
  --ink-mute: #a19f9d;
  --accent: #b7472a;     /* PPT 주황빨 */
  --accent-2: #185abd;
  --accent-3: #c43e1c;
  --accent-4: #b7472a;
  --accent-5: #d83b01;
  --danger: #d13438;
  --grid: rgba(0, 0, 0, 0.06);
  --font-body: 'Segoe UI', '맑은 고딕', sans-serif;
  --font-display: 'Segoe UI', '맑은 고딕', sans-serif;
  --radius: 2px;
}

/* ============================================================
   테마: OUTLOOK (이메일)
   ============================================================ */
body[data-theme="outlook"] {
  --bg-0: #faf9f8;
  --bg-1: #ffffff;
  --bg-2: #f3f2f1;
  --ink: #323130;
  --ink-dim: #605e5c;
  --ink-mute: #a19f9d;
  --accent: #0078d4;     /* Outlook 파랑 */
  --accent-2: #106ebe;
  --accent-3: #d29200;
  --accent-4: #0078d4;
  --accent-5: #005a9e;
  --danger: #a4262c;
  --grid: rgba(0, 120, 212, 0.08);
  --font-body: 'Segoe UI', '맑은 고딕', sans-serif;
  --font-display: 'Segoe UI', '맑은 고딕', sans-serif;
  --radius: 2px;
}

/* ============================================================
   테마: IDE (개발자 에디터, VS Code 다크)
   ============================================================ */
body[data-theme="ide"] {
  --bg-0: #1e1e1e;
  --bg-1: #252526;
  --bg-2: #2d2d30;
  --ink: #d4d4d4;
  --ink-dim: #9cdcfe;
  --ink-mute: #6a6a6a;
  --accent: #569cd6;       /* keyword 파랑 */
  --accent-2: #4ec9b0;     /* type 청록 */
  --accent-3: #dcdcaa;     /* function 노랑 */
  --accent-4: #c586c0;     /* keyword 보라 */
  --accent-5: #ce9178;     /* string 주황 */
  --danger: #f48771;
  --grid: rgba(255, 255, 255, 0.04);
  --font-body: 'Consolas', 'Menlo', 'Courier New', monospace;
  --font-display: 'Consolas', 'Menlo', 'Courier New', monospace;
  --radius: 3px;
}

/* 테마 전환 시 부드럽게 */
body, .panel, .btn, .input, .game-card {
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

/* 라이트 테마 (Excel/PPT/Outlook)에서 패널 살짝 어둡게 */
body[data-theme="excel"] .panel,
body[data-theme="powerpoint"] .panel,
body[data-theme="outlook"] .panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body[data-theme="excel"] .input,
body[data-theme="powerpoint"] .input,
body[data-theme="outlook"] .input {
  background: #ffffff;
  border: 1px solid #c8c6c4;
  color: var(--ink);
}
body[data-theme="excel"] .input:focus,
body[data-theme="powerpoint"] .input:focus,
body[data-theme="outlook"] .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* 라이트 테마 토글 버튼 */
body[data-theme="excel"] .btn,
body[data-theme="powerpoint"] .btn,
body[data-theme="outlook"] .btn {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent-5);
}
body[data-theme="excel"] .btn:hover,
body[data-theme="powerpoint"] .btn:hover,
body[data-theme="outlook"] .btn:hover {
  background: var(--accent-5);
}
body[data-theme="excel"] .btn.secondary,
body[data-theme="powerpoint"] .btn.secondary,
body[data-theme="outlook"] .btn.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid #c8c6c4;
}
body[data-theme="excel"] .btn.secondary:hover,
body[data-theme="powerpoint"] .btn.secondary:hover,
body[data-theme="outlook"] .btn.secondary:hover {
  background: #f3f2f1;
}

/* Excel - 스프레드시트 그리드 무드 */
body[data-theme="excel"] {
  background: #ffffff;
}
body[data-theme="excel"]::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.08) 1px, transparent 1px);
  background-size: 80px 24px;
  opacity: 0.6;
  z-index: 0;
}

/* PPT - 슬라이드 무드 */
body[data-theme="powerpoint"] {
  background: linear-gradient(135deg, #faf9f8 0%, #ffffff 100%);
}

/* Outlook - 메일 무드 */
body[data-theme="outlook"] {
  background: linear-gradient(180deg, #faf9f8 0%, #f3f2f1 100%);
}

/* IDE - 코드 에디터 무드 */
body[data-theme="ide"] {
  background: #1e1e1e;
}
body[data-theme="ide"]::before {
  content: '';
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 50px;
  background: #252526;
  border-right: 1px solid #2d2d30;
  pointer-events: none;
  z-index: 0;
}

/* ============================================================
   부장키 (Boss Key) 위장 화면
   ============================================================ */
.boss-screen {
  position: fixed;
  inset: 0;
  background: #ffffff;
  color: #252423;
  z-index: 99999;
  font-family: 'Segoe UI', '맑은 고딕', sans-serif;
  overflow: hidden;
}
.boss-screen.hidden { display: none; }
.boss-toolbar {
  height: 90px;
  background: linear-gradient(180deg, #f3f2f1, #e7e6e5);
  border-bottom: 1px solid #d2d0ce;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.boss-toolbar-tabs {
  display: flex;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #605e5c;
}
.boss-toolbar-tab {
  padding: 4px 12px;
  cursor: default;
}
.boss-toolbar-tab.active {
  color: #185abd;
  border-bottom: 2px solid #185abd;
}
.boss-cell-row {
  display: flex;
  border-bottom: 1px solid #d2d0ce;
}
.boss-cell-header {
  width: 50px;
  background: #e7e6e5;
  text-align: center;
  font-size: 11px;
  color: #605e5c;
  padding: 4px;
  border-right: 1px solid #d2d0ce;
}
.boss-cell {
  flex: 1;
  min-width: 100px;
  padding: 4px 8px;
  border-right: 1px solid #d2d0ce;
  font-size: 12px;
  color: #252423;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boss-cell.formula { color: #107c41; }
.boss-cell.number { text-align: right; }
.boss-cell.header { font-weight: 700; background: #f3f2f1; }

.boss-statusbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: #107c41;
  color: white;
  font-size: 11px;
  padding: 4px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.boss-hint {
  position: fixed;
  bottom: 32px;
  right: 12px;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 2px;
  font-family: 'Segoe UI', sans-serif;
}
html, body { height: 100%; }
body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 10%, var(--bg-2) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, #2a0a3e 0%, transparent 50%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1));
  background-attachment: fixed;
  position: relative;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  z-index: 0;
}
body::after {
  content: ''; position: fixed; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0, rgba(0,0,0,0.12) 1px, transparent 1px, transparent 3px);
  pointer-events: none;
  z-index: 1000;
  opacity: 0.5;
}

.hidden { display: none !important; }

/* ============================================================
   레이아웃
   ============================================================ */
.app {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 16px;
  max-width: 1300px;
  margin: 0 auto;
  gap: 16px;
}
.app-header { text-align: center; flex-shrink: 0; }
.title {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 900;
  letter-spacing: 0.15em;
  text-shadow: 0 0 40px rgba(255, 45, 117, 0.3);
}
.title-accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleGlow 3s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}
.subtitle {
  color: var(--ink-dim);
  font-family: var(--font-display);
  letter-spacing: 0.3em;
  font-size: 11px;
  margin-top: 4px;
}
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#screen-lobby {
  align-items: center;
  gap: 28px;
  overflow-y: auto;
  padding-top: 20px;
}
#screen-room { gap: 14px; }

/* ============================================================
   공통 컴포넌트
   ============================================================ */
.panel {
  background: rgba(20, 9, 42, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(107, 78, 255, 0.3);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.btn {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 20px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: -1;
}
.btn:hover:not(:disabled)::before { transform: translateX(0); }
.btn:hover:not(:disabled) {
  box-shadow: 0 0 24px rgba(255, 45, 117, 0.6);
  color: white;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.secondary { border-color: var(--accent-2); }
.btn.secondary::before { background: var(--accent-2); }
.btn.secondary:hover:not(:disabled) { box-shadow: 0 0 24px rgba(0, 240, 200, 0.6); color: black; }
.btn.warning { border-color: var(--accent-3); }
.btn.warning::before { background: var(--accent-3); }
.btn.warning:hover:not(:disabled) { box-shadow: 0 0 24px rgba(255, 204, 0, 0.6); color: black; }
.btn.tiny { padding: 6px 12px; font-size: 11px; }
.btn.big { padding: 16px 32px; font-size: 18px; }

.input {
  font-family: var(--font-display);
  font-size: 16px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(107, 78, 255, 0.4);
  color: var(--ink);
  border-radius: var(--radius);
  width: 100%;
  letter-spacing: 0.08em;
}
.input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 12px rgba(0, 240, 200, 0.3);
}
.label {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  min-width: 0; /* flex 자식 overflow 방지 */
}
.row > .input {
  flex: 1 1 auto;
  min-width: 0; /* 입력란이 길어져도 버튼 안 밀어내게 */
  width: auto;
}
.row > .btn {
  flex: 0 0 auto; /* 버튼은 고정 너비 */
}
.divider {
  color: var(--ink-mute);
  font-family: var(--font-display);
  letter-spacing: 0.3em;
  font-size: 11px;
  margin: 12px 0;
  text-align: center;
}

/* ============================================================
   연결 상태
   ============================================================ */
.conn-status {
  position: fixed; top: 12px; right: 12px;
  background: rgba(0,0,0,0.8);
  padding: 6px 12px;
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 11px;
  z-index: 999;
  border: 1px solid var(--accent-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.conn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   로비
   ============================================================ */
.lobby-grid {
  display: grid;
  grid-template-columns: minmax(380px, 440px) 1fr;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  align-items: start;
}
@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }
}
.lobby-box {
  width: 100%;
  min-width: 0; /* flex/grid 자식 overflow 방지 */
}
.room-list-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: 520px;
}
.room-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.room-list-header h3 {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.room-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}
.room-list-empty {
  text-align: center;
  color: var(--ink-mute);
  padding: 40px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.room-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(20, 9, 42, 0.5);
  border: 1px solid rgba(107, 78, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.room-item:hover {
  border-color: var(--accent-2);
  background: rgba(0, 240, 200, 0.08);
  transform: translateX(2px);
}
.room-item.private {
  border-color: rgba(255, 204, 0, 0.4);
}
.room-item.private:hover {
  border-color: var(--accent-3);
  background: rgba(255, 204, 0, 0.08);
}
.room-item.full {
  opacity: 0.5;
  cursor: not-allowed;
}
.room-item.full:hover {
  transform: none;
  border-color: rgba(107, 78, 255, 0.3);
  background: rgba(20, 9, 42, 0.5);
}
.room-item-code {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: var(--accent-3);
  text-shadow: 0 0 8px rgba(255, 204, 0, 0.3);
}
.room-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.room-item-name {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room-item-meta {
  font-size: 11px;
  color: var(--ink-dim);
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.room-item-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-family: var(--font-display);
}
.room-item-players {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-2);
}
.room-item-players.full { color: var(--danger); }
.room-item-game-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--accent-4);
  border-radius: 8px;
  letter-spacing: 0.1em;
}
.room-item-lock {
  font-size: 18px;
}
.game-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 900px;
  padding: 0 16px;
}
.game-preview-card {
  padding: 14px 8px;
  background: rgba(20, 9, 42, 0.5);
  border: 1px solid rgba(107, 78, 255, 0.2);
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.2s ease;
}
.game-preview-card:hover {
  border-color: var(--accent-4);
  transform: translateY(-2px);
}
.game-preview-emoji { font-size: 32px; }
.game-preview-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-top: 4px;
  color: var(--ink-dim);
}

/* ============================================================
   방 헤더
   ============================================================ */
.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(20, 9, 42, 0.7);
  border: 1px solid rgba(107, 78, 255, 0.3);
  border-radius: 8px;
  flex-shrink: 0;
}
/* 라이트 테마용 room-header */
body[data-theme="excel"] .room-header,
body[data-theme="powerpoint"] .room-header,
body[data-theme="outlook"] .room-header {
  background: #ffffff;
  border: 1px solid #d2d0ce;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
body[data-theme="excel"] .room-header .label,
body[data-theme="powerpoint"] .room-header .label,
body[data-theme="outlook"] .room-header .label {
  color: #605e5c;
}
body[data-theme="excel"] .room-code,
body[data-theme="powerpoint"] .room-code,
body[data-theme="outlook"] .room-code {
  color: #185abd;
  text-shadow: none;
}
.room-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.room-header {
  flex-wrap: wrap;
  gap: 8px;
}
.room-code {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--accent-3);
  cursor: pointer;
  text-shadow: 0 0 16px rgba(255, 204, 0, 0.4);
}
.room-code:hover { text-shadow: 0 0 24px var(--accent-3); }
.server-ping {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
}

/* ============================================================
   방 그리드
   ============================================================ */
.room-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 220px 1fr 280px;
  gap: 14px;
  min-height: 0;
}
@media (max-width: 1000px) {
  .room-grid { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .panel-side { max-height: 200px; }
  .panel-chat { max-height: 250px; }
}
.panel-side { overflow-y: auto; padding: 16px; }
.panel-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
  position: relative;
}
/* gameArea가 panel-main 전체 높이 채우면서 자체 스크롤 */
#gameArea {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.panel-chat { display: flex; flex-direction: column; }
.panel-side h3 {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* 플레이어 */
.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(107, 78, 255, 0.1);
  border-left: 3px solid var(--accent-2);
  border-radius: 4px;
  font-size: 13px;
  transition: opacity 0.3s;
}
.player-item.host { border-left-color: var(--accent-3); }
.player-item.me { background: rgba(255, 45, 117, 0.15); border-left-color: var(--accent); }
.player-item.disconnected { opacity: 0.4; border-left-color: var(--ink-mute); }
.player-name { display: flex; align-items: center; gap: 6px; }
.player-avatar { font-size: 16px; }
.player-score {
  font-family: var(--font-display);
  color: var(--accent-3);
  font-weight: 700;
}

/* 채팅 */
.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-msg {
  font-size: 13px;
  word-break: break-word;
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 4px;
}
.chat-msg.me {
  background: rgba(255, 255, 255, 0.04);
}
.chat-msg .from {
  font-weight: 700;
  margin-right: 6px;
  /* 색상은 inline style로 주입 */
}
.chat-msg.system { color: var(--accent-3); font-style: italic; font-size: 12px; padding: 2px 8px; }
/* 라이트 테마(엑셀/PPT/메일)에선 시스템 메시지를 회색톤으로 (빨간색이 어색) */
body[data-theme="excel"] .chat-msg.system,
body[data-theme="powerpoint"] .chat-msg.system,
body[data-theme="outlook"] .chat-msg.system {
  color: #605e5c;
  background: rgba(0, 0, 0, 0.03);
  border-left: 2px solid #c8c6c4;
}
.chat-input-row { display: flex; gap: 6px; margin-top: 8px; }
.chat-input-row .input { font-size: 13px; padding: 8px 12px; }

/* ============================================================
   게임 메뉴
   ============================================================ */
.game-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 20px;
  padding-bottom: 80px; /* 리액션바 + 스크롤 끝 여유 */
}
.game-card {
  padding: 18px 12px;
  background: linear-gradient(135deg, rgba(255,45,117,0.08), rgba(107,78,255,0.08));
  border: 2px solid rgba(107, 78, 255, 0.3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.game-card:hover:not(.disabled) {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(255, 45, 117, 0.4);
  transform: translateY(-2px);
}
.game-card.selected {
  border-color: var(--accent-3);
  background: linear-gradient(135deg, rgba(255,204,0,0.15), rgba(255,45,117,0.15));
}
.game-card.disabled { opacity: 0.4; cursor: not-allowed; }
.game-emoji { font-size: 36px; margin-bottom: 6px; }
.game-name {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.game-desc { font-size: 11px; color: var(--ink-dim); line-height: 1.4; }
.game-min-players {
  font-size: 10px;
  color: var(--accent-2);
  font-family: var(--font-display);
  margin-top: 4px;
}

/* ============================================================
   토스트
   ============================================================ */
.toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 14px;
  z-index: 9999;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(255, 45, 117, 0.5);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ============================================================
   모달
   ============================================================ */
.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1001;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--bg-1);
  border: 2px solid var(--accent-4);
  border-radius: 8px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
}
.modal-content h3 {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  margin-bottom: 16px;
  text-align: center;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.avatar-option {
  font-size: 32px;
  padding: 8px;
  background: rgba(107,78,255,0.1);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.avatar-option:hover { border-color: var(--accent); transform: scale(1.1); }
.avatar-option.selected { border-color: var(--accent-3); background: rgba(255,204,0,0.2); }

/* ============================================================
   GAME: REACTION
   ============================================================ */
.reaction-arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}
.reaction-pad {
  width: 100%;
  max-width: 500px;
  height: 280px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.05s;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.1em;
  user-select: none;
  border: 4px solid;
}
.reaction-pad.waiting { background: #c92742; border-color: #ff5577; color: white; }
.reaction-pad.go { background: #00d4a8; border-color: #5fffd0; color: black; box-shadow: 0 0 60px var(--accent-2); }
.reaction-pad.early { background: #444; border-color: #666; color: var(--danger); }
.reaction-pad.finished { background: #2a1855; border-color: var(--accent-4); color: var(--accent-3); }
.reaction-stats { font-family: var(--font-display); color: var(--ink-dim); }

/* ============================================================
   GAME: BULLS
   ============================================================ */
.bulls-area { padding: 20px; flex: 1; overflow-y: auto; }
.bulls-current {
  text-align: center;
  padding: 16px;
  background: rgba(255,45,117,0.1);
  border-radius: 6px;
  margin-bottom: 16px;
}
.bulls-input-row { display: flex; gap: 8px; margin-top: 16px; }
.bulls-history { margin-top: 20px; display: flex; flex-direction: column; gap: 6px; }
.bulls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border-left: 3px solid var(--accent-4);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 14px;
}
.bulls-result { color: var(--accent-3); font-weight: 700; }

/* ============================================================
   GAME: SKETCH
   ============================================================ */
.sketch-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  min-height: 0;
}
.sketch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
  font-family: var(--font-display);
  flex-wrap: wrap;
  gap: 8px;
}
.sketch-word { font-size: 20px; letter-spacing: 0.3em; color: var(--accent-3); font-weight: 900; }
.sketch-time { color: var(--accent-2); font-weight: 900; font-size: 18px; min-width: 80px; text-align: right; }
#sketchCanvas {
  flex: 1;
  background: white;
  border-radius: 8px;
  border: 2px solid var(--accent-4);
  cursor: crosshair;
  touch-action: none;
  min-height: 200px;
}
.sketch-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.2);
  transition: transform 0.1s;
}
.color-swatch.active { border-color: white; transform: scale(1.2); box-shadow: 0 0 8px rgba(255,255,255,0.5); }
.brush-size { width: 60px; }

/* ============================================================
   GAME: DICE
   ============================================================ */
.dice-area { padding: 16px; flex: 1; overflow-y: auto; }
.dice-board {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin-bottom: 16px;
}
.dice-cell {
  aspect-ratio: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(107, 78, 255, 0.3);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 10px;
  position: relative;
  overflow: hidden;
}
.dice-cell.start { background: rgba(0, 240, 200, 0.2); border-color: var(--accent-2); }
.dice-cell.goal { background: rgba(255, 204, 0, 0.3); border-color: var(--accent-3); }
.dice-cell.event-jump { background: rgba(0, 240, 200, 0.15); }
.dice-cell.event-back { background: rgba(255, 64, 64, 0.15); }
.dice-cell.event-extra { background: rgba(255, 204, 0, 0.15); }
.dice-cell-num { font-size: 9px; color: var(--ink-dim); position: absolute; top: 2px; left: 4px; }
.dice-cell-label { font-size: 14px; }
.dice-pawns { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; max-width: 100%; }
.dice-pawn { width: 12px; height: 12px; border-radius: 50%; border: 1px solid white; }
.dice-pawn.mine {
  width: 14px; height: 14px;
  border: 2px solid white;
  box-shadow: 0 0 8px currentColor;
}
.dice-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
}
.dice-result {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 900;
  color: var(--accent-3);
  min-width: 60px; text-align: center;
}
.dice-log {
  max-height: 100px;
  overflow-y: auto;
  font-family: var(--font-display);
  font-size: 12px;
  background: rgba(0,0,0,0.3);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 12px;
}
.dice-log div { padding: 2px 0; color: var(--ink-dim); }
.dice-log div:first-child { color: var(--ink); }

/* ============================================================
   GAME: MAFIA
   ============================================================ */
.mafia-area { padding: 16px; flex: 1; overflow-y: auto; }
.mafia-phase {
  text-align: center;
  padding: 20px;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  margin-bottom: 16px;
}
.mafia-phase-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}
.mafia-phase.night .mafia-phase-title { color: var(--accent-4); }
.mafia-phase.day_discussion .mafia-phase-title,
.mafia-phase.day_vote .mafia-phase-title { color: var(--accent-3); }
.mafia-role-card {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(255,45,117,0.15), rgba(107,78,255,0.15));
  border: 2px solid var(--accent);
  border-radius: 12px;
  margin: 0 auto 16px;
  max-width: 300px;
}
.mafia-role-emoji { font-size: 64px; margin-bottom: 8px; }
.mafia-role-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}
.mafia-role-desc { color: var(--ink-dim); font-size: 13px; line-height: 1.5; }
.mafia-targets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.mafia-target {
  padding: 12px;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(107,78,255,0.3);
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  font-family: var(--font-display);
}
.mafia-target.dead { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }
.mafia-target.selected { border-color: var(--accent-3); background: rgba(255,204,0,0.2); }
.mafia-target:hover:not(.dead):not(.selected) { border-color: var(--accent); }
.mafia-target-avatar { font-size: 28px; }
.mafia-target-name { font-size: 12px; margin-top: 4px; }
.mafia-target-vote {
  font-size: 10px;
  color: var(--accent-3);
  margin-top: 2px;
}
.mafia-log {
  background: rgba(0,0,0,0.3);
  padding: 10px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 12px;
  max-height: 120px;
  overflow-y: auto;
}
.mafia-log div { padding: 3px 0; color: var(--ink-dim); }
.mafia-log div:first-child { color: var(--ink); }

/* ============================================================
   GAME: TYPING
   ============================================================ */
.typing-area { padding: 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.typing-countdown {
  text-align: center;
  font-family: var(--font-display);
  font-size: 80px;
  font-weight: 900;
  color: var(--accent-3);
}
.typing-target {
  font-size: 20px;
  line-height: 1.6;
  padding: 20px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  letter-spacing: 0.05em;
  font-family: 'Malgun Gothic', sans-serif;
}
.typing-target .typed { color: var(--accent-2); }
.typing-target .current {
  background: var(--accent-3);
  color: black;
  padding: 0 2px;
  animation: blink 1s infinite;
}
@keyframes blink { 50% { opacity: 0.5; } }
.typing-target .untyped { color: var(--ink-dim); }
.typing-target .mistake { color: var(--danger); text-decoration: underline wavy; }
.typing-input {
  font-size: 20px;
  padding: 14px;
  font-family: 'Malgun Gothic', sans-serif;
}
.typing-progress-list { display: flex; flex-direction: column; gap: 6px; }
.typing-progress-row {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
}
.typing-progress-bar {
  flex: 1; height: 8px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
  overflow: hidden;
}
.typing-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 0.1s;
}
.typing-progress-row.me .typing-progress-fill {
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
}
.typing-progress-stat { font-size: 11px; color: var(--ink-dim); min-width: 70px; text-align: right; }

/* ============================================================
   GAME: WORDCHAIN
   ============================================================ */
.wordchain-area { padding: 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.wordchain-current {
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(0,240,200,0.1), rgba(107,78,255,0.1));
  border: 2px solid var(--accent-2);
  border-radius: 12px;
}
.wordchain-word {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin: 8px 0;
  font-family: 'Malgun Gothic', sans-serif;
}
.wordchain-next-char {
  font-size: 14px;
  font-family: var(--font-display);
  color: var(--ink-dim);
}
.wordchain-next-char .char {
  color: var(--accent-3);
  font-size: 24px;
  margin: 0 4px;
}
.wordchain-timer {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--accent-3);
  text-align: center;
}
.wordchain-timer.danger { color: var(--danger); animation: pulse 0.5s infinite; }
.wordchain-input-row { display: flex; gap: 8px; }
.wordchain-history {
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 6px;
}
.wordchain-history-row {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0;
  font-family: var(--font-display);
  font-size: 13px;
}

/* ============================================================
   GAME: RPS
   ============================================================ */
.rps-area { padding: 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.rps-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
}
.rps-pair-vs {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.2em;
}
.rps-player {
  text-align: center;
}
.rps-player-name { font-family: var(--font-display); font-size: 13px; }
.rps-player-choice {
  font-size: 64px;
  margin: 8px 0;
}
.rps-player-result {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.2em;
}
.rps-player-result.win { color: var(--accent-2); }
.rps-player-result.lose { color: var(--danger); }
.rps-player-result.draw { color: var(--ink-dim); }
.rps-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px;
}
.rps-choice {
  aspect-ratio: 1;
  font-size: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  border: 3px solid rgba(107,78,255,0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.rps-choice:hover { border-color: var(--accent); transform: scale(1.05); }
.rps-choice.selected { border-color: var(--accent-3); background: rgba(255,204,0,0.15); }

/* ============================================================
   GAME: MEMORY
   ============================================================ */
.memory-area { padding: 16px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.memory-board {
  display: grid;
  grid-template-columns: repeat(2, 160px);
  grid-template-rows: repeat(2, 160px);
  gap: 12px;
  padding: 16px;
  background: rgba(0,0,0,0.4);
  border-radius: 16px;
}
.memory-cell {
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.1s;
  position: relative;
}
.memory-cell.color-0 { background: #c0392b; }   /* 빨 */
.memory-cell.color-1 { background: #27ae60; }   /* 초 */
.memory-cell.color-2 { background: #2980b9; }   /* 파 */
.memory-cell.color-3 { background: #f39c12; }   /* 노 */
.memory-cell.flash { filter: brightness(2); box-shadow: 0 0 60px white; }
.memory-cell.dim { filter: brightness(0.5); }
.memory-progress {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink-dim);
}

/* ============================================================
   GAME: WORDSEARCH
   ============================================================ */
.wordsearch-area {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.wordsearch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  padding: 10px 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
}
.wordsearch-time { color: var(--accent-3); font-size: 18px; font-weight: 900; }
.wordsearch-content {
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 12px;
  flex: 1;
  min-height: 0;
}
@media (max-width: 800px) {
  .wordsearch-content { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
}
.wordsearch-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 2px;
  background: rgba(0,0,0,0.4);
  padding: 6px;
  border-radius: 6px;
  user-select: none;
  aspect-ratio: 1;
  max-height: 100%;
}
.ws-cell {
  background: rgba(107,78,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Malgun Gothic', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  font-size: clamp(10px, 1.6vw, 16px);
  transition: all 0.1s;
  aspect-ratio: 1;
  color: var(--ink);
}
.ws-cell.selecting { background: var(--accent-3); color: black; transform: scale(1.1); }
.ws-cell.found { background: var(--accent-2); color: black; }

/* 라이트 테마(엑셀/PPT/메일) 워드서치 가독성 강화 */
body[data-theme="excel"] .wordsearch-grid,
body[data-theme="powerpoint"] .wordsearch-grid,
body[data-theme="outlook"] .wordsearch-grid {
  background: #ffffff;
  border: 1px solid #d0d0d0;
}
body[data-theme="excel"] .ws-cell,
body[data-theme="powerpoint"] .ws-cell,
body[data-theme="outlook"] .ws-cell {
  background: #ffffff;
  color: #000000;
  border: 1px solid #c0c0c0;
  font-weight: 800;
}
body[data-theme="excel"] .ws-cell:hover,
body[data-theme="powerpoint"] .ws-cell:hover,
body[data-theme="outlook"] .ws-cell:hover {
  background: #e5e5ff;
}
body[data-theme="excel"] .ws-cell.selecting,
body[data-theme="powerpoint"] .ws-cell.selecting,
body[data-theme="outlook"] .ws-cell.selecting {
  background: #1976d2;
  color: white;
  border-color: #1976d2;
}
body[data-theme="excel"] .ws-cell.found,
body[data-theme="powerpoint"] .ws-cell.found,
body[data-theme="outlook"] .ws-cell.found {
  background: #4caf50;
  color: white;
  border-color: #4caf50;
}
.wordsearch-words {
  background: rgba(0,0,0,0.3);
  padding: 12px;
  border-radius: 6px;
  overflow-y: auto;
}
.wordsearch-word-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  background: rgba(107,78,255,0.1);
  border-radius: 4px;
  font-family: 'Malgun Gothic', sans-serif;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wordsearch-word-item.found {
  text-decoration: line-through;
  background: rgba(0,240,200,0.15);
  color: var(--ink-dim);
}
/* 라이트 테마 - 위 기본 정의보다 뒤에 와야 적용됨 */
body[data-theme="excel"] .wordsearch-words,
body[data-theme="powerpoint"] .wordsearch-words,
body[data-theme="outlook"] .wordsearch-words {
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
}
body[data-theme="excel"] .wordsearch-word-item,
body[data-theme="powerpoint"] .wordsearch-word-item,
body[data-theme="outlook"] .wordsearch-word-item {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #252423;
}
body[data-theme="excel"] .wordsearch-word-item.found,
body[data-theme="powerpoint"] .wordsearch-word-item.found,
body[data-theme="outlook"] .wordsearch-word-item.found {
  background: #e8f5e9;
  text-decoration: line-through;
  color: #5e5e5e;
}

/* IDE 다크 테마용 워드서치 (코드에디터 색감) */
body[data-theme="ide"] .wordsearch-grid {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
}
body[data-theme="ide"] .ws-cell {
  background: #2d2d30;
  color: #d4d4d4;
  border: 1px solid #3c3c3c;
  font-family: 'Consolas', 'Courier New', monospace;
}
body[data-theme="ide"] .ws-cell:hover {
  background: #3e3e42;
}
body[data-theme="ide"] .ws-cell.selecting {
  background: #007acc;
  color: white;
  border-color: #007acc;
}
body[data-theme="ide"] .ws-cell.found {
  background: #4ec9b0;
  color: #1e1e1e;
  border-color: #4ec9b0;
}
body[data-theme="ide"] .wordsearch-words {
  background: #252526;
  border: 1px solid #3c3c3c;
}
body[data-theme="ide"] .wordsearch-word-item {
  background: #2d2d30;
  border: 1px solid #3c3c3c;
  color: #d4d4d4;
  font-family: 'Consolas', 'Courier New', monospace;
}
body[data-theme="ide"] .wordsearch-word-item.found {
  background: #1e3a2e;
  text-decoration: line-through;
  color: #6a9955;
}
.wordsearch-word-finder {
  font-size: 10px;
  color: var(--accent-3);
  font-family: var(--font-display);
}

/* ============================================================
   GAME: VOTE
   ============================================================ */
.vote-area { padding: 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.vote-question {
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255,45,117,0.1), rgba(255,204,0,0.1));
  border-radius: 12px;
  line-height: 1.5;
}
.vote-options-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.vote-option-person {
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(107,78,255,0.3);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.vote-option-person:hover { border-color: var(--accent); }
.vote-option-person.selected { border-color: var(--accent-3); background: rgba(255,204,0,0.15); }
.vote-option-person-avatar { font-size: 36px; }
.vote-option-person-name { font-family: var(--font-display); font-size: 12px; margin-top: 4px; }
.vote-option-person-count {
  font-size: 18px;
  color: var(--accent-3);
  font-weight: 900;
  margin-top: 4px;
  font-family: var(--font-display);
}
.vote-options-balance {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.vote-option-balance {
  padding: 30px 20px;
  background: rgba(0,0,0,0.3);
  border: 3px solid rgba(107,78,255,0.3);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-size: 18px;
  line-height: 1.5;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.vote-option-balance:hover { border-color: var(--accent); transform: translateY(-2px); }
.vote-option-balance.selected { border-color: var(--accent-3); background: rgba(255,204,0,0.15); }
.vote-option-balance-percent {
  font-family: var(--font-display);
  font-size: 32px;
  color: var(--accent-2);
  margin-top: 12px;
}

/* ============================================================
   GAME: QUIZ
   ============================================================ */
.quiz-area { padding: 20px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-display);
  padding: 8px 12px;
  background: rgba(0,0,0,0.3);
  border-radius: 6px;
}
.quiz-category {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-4);
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
}
.quiz-question {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  padding: 24px;
  background: linear-gradient(135deg, rgba(0,240,200,0.08), rgba(107,78,255,0.08));
  border-radius: 12px;
  line-height: 1.5;
}
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.quiz-option {
  padding: 18px;
  background: rgba(0,0,0,0.3);
  border: 2px solid rgba(107,78,255,0.3);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-option:hover:not(.disabled) { border-color: var(--accent); transform: translateY(-1px); }
.quiz-option.selected { border-color: var(--accent-3); background: rgba(255,204,0,0.15); }
.quiz-option.correct { border-color: var(--accent-2); background: rgba(0,240,200,0.2); }
.quiz-option.wrong { border-color: var(--danger); background: rgba(255,64,64,0.15); }
.quiz-option.disabled { opacity: 0.6; cursor: not-allowed; }
.quiz-option-letter {
  width: 28px; height: 28px;
  background: rgba(107,78,255,0.3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
  flex-shrink: 0;
}
.quiz-timer-bar {
  height: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 3px;
  overflow: hidden;
}
.quiz-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3), var(--accent));
  transition: width 0.1s linear;
}

/* ============================================================
   타이머 (밀리초)
   ============================================================ */
.timer-ms {
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
}

/* ============================================================
   결과 화면 공통
   ============================================================ */
.result-screen {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; padding: 30px; gap: 16px;
  text-align: center;
}
.result-emoji { font-size: 64px; }
.result-title {
  font-family: var(--font-display);
  color: var(--accent-3);
  font-size: 22px;
  letter-spacing: 0.2em;
}
.ranking-list {
  display: flex; flex-direction: column;
  gap: 6px; min-width: 280px; max-width: 480px;
}
.ranking-item {
  display: flex; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,0.3);
  border-left: 3px solid var(--accent-4);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 14px;
}
.ranking-item.rank-0 { border-left-color: #ffcc00; }
.ranking-item.rank-1 { border-left-color: #c0c0c0; }
.ranking-item.rank-2 { border-left-color: #cd7f32; }

/* ============================================================
   스크롤바
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
::-webkit-scrollbar-thumb { background: var(--accent-4); border-radius: 3px; }

/* ============================================================
   화면 이펙트 애니메이션
   ============================================================ */
@keyframes confettiFall {
  to {
    left: var(--end-x);
    top: var(--end-y);
    transform: rotate(var(--rot));
    opacity: 0;
  }
}
@keyframes reactionFloat {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  20%  { transform: translateY(-30px) scale(1.2); opacity: 1; }
  60%  { transform: translateY(-150px) scale(1); opacity: 1; }
  100% { transform: translateY(-300px) scale(0.8); opacity: 0; }
}

/* ============================================================
   리액션 바 (게임 영역 하단 floating)
   ============================================================ */
.reaction-bar {
  /* 게임 영역과 완전히 분리: 화면 우측 하단 모서리에 fixed */
  position: fixed;
  bottom: 16px;
  right: 16px;
  left: auto;
  transform: none;
  display: flex;
  gap: 4px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(107, 78, 255, 0.4);
  border-radius: 24px;
  z-index: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
/* 라이트 테마 reaction-bar */
body[data-theme="excel"] .reaction-bar,
body[data-theme="powerpoint"] .reaction-bar,
body[data-theme="outlook"] .reaction-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.reaction-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s;
}
.reaction-btn:hover {
  transform: scale(1.3);
  background: rgba(255, 255, 255, 0.1);
}
.reaction-btn:active {
  transform: scale(0.9);
}
.panel-main { position: relative; }

/* ============================================================
   사운드 토글 버튼 (방 헤더에)
   ============================================================ */
.sound-toggle {
  background: transparent;
  border: 1px solid rgba(107, 78, 255, 0.4);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.sound-toggle:hover {
  background: rgba(107, 78, 255, 0.2);
  border-color: var(--accent-2);
}
.sound-toggle.muted {
  opacity: 0.5;
}

/* ============================================================
   토너먼트 진행 표시 (방 헤더)
   ============================================================ */
.tournament-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* ============================================================
   토너먼트 시상식
   ============================================================ */
.podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  align-items: end;
  margin: 30px auto;
  max-width: 600px;
}
.podium-spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: rgba(20, 9, 42, 0.8);
  border-radius: 8px;
  border: 2px solid;
  position: relative;
  animation: podiumRise 0.8s ease-out backwards;
}
.podium-spot.first {
  border-color: #ffcc00;
  box-shadow: 0 0 30px rgba(255, 204, 0, 0.4);
  height: 220px;
  animation-delay: 0.6s;
}
.podium-spot.second {
  border-color: #c0c0c0;
  height: 180px;
  animation-delay: 0.3s;
}
.podium-spot.third {
  border-color: #cd7f32;
  height: 150px;
  animation-delay: 0s;
}
@keyframes podiumRise {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.podium-medal { font-size: 48px; margin-bottom: 8px; }
.podium-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 4px;
}
.podium-score {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--accent-3);
}
.podium-rank-num {
  position: absolute;
  top: -16px;
  background: var(--bg-1);
  border: 2px solid currentColor;
  color: inherit;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
}

/* ============================================================
   GAME: BOMB (글자 폭탄)
   ============================================================ */
.bomb-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}
.bomb-syllable {
  font-size: 90px;
  font-weight: 900;
  font-family: 'Malgun Gothic', sans-serif;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--accent), var(--accent-5));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(255, 45, 117, 0.4);
  animation: bombPulse 0.8s ease-in-out infinite;
}
@keyframes bombPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.bomb-icon {
  font-size: 60px;
  animation: bombShake 0.3s ease-in-out infinite;
}
.bomb-icon.danger { animation: bombShakeDanger 0.1s linear infinite; }
@keyframes bombShake {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@keyframes bombShakeDanger {
  0% { transform: translate(-2px, -1px) rotate(-5deg); }
  25% { transform: translate(2px, 1px) rotate(5deg); }
  50% { transform: translate(-1px, 2px) rotate(-3deg); }
  75% { transform: translate(1px, -2px) rotate(3deg); }
  100% { transform: translate(-2px, -1px) rotate(-5deg); }
}
.bomb-timer-ring {
  width: 100px;
  height: 100px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
}
.bomb-current-player {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.1em;
}
.bomb-input {
  font-size: 32px;
  text-align: center;
  font-family: 'Malgun Gothic', sans-serif;
  padding: 12px 20px;
  width: 100%;
  max-width: 400px;
}
.bomb-history {
  width: 100%;
  max-width: 600px;
  max-height: 100px;
  overflow-y: auto;
  background: rgba(0,0,0,0.3);
  padding: 10px 14px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 13px;
}
.bomb-players-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.bomb-player-chip {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(0,0,0,0.3);
  border: 2px solid;
  font-family: var(--font-display);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bomb-player-chip.eliminated {
  opacity: 0.4;
  text-decoration: line-through;
}
.bomb-player-chip.current {
  box-shadow: 0 0 16px currentColor;
  transform: scale(1.05);
}
.bomb-lives {
  display: inline-flex;
  gap: 2px;
}

/* ============================================================
   GAME: NUNCHI (눈치게임)
   ============================================================ */
.nunchi-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 20px;
}
.nunchi-target-num {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}
.nunchi-current-num {
  font-size: 160px;
  font-weight: 900;
  font-family: var(--font-display);
  background: linear-gradient(180deg, var(--accent-3), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(255, 204, 0, 0.4);
}
.nunchi-press-btn {
  width: 200px;
  height: 200px;
  font-size: 28px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.1em;
  border-radius: 50%;
  border: 4px solid var(--accent);
  background: radial-gradient(circle at 30% 30%, rgba(255,45,117,0.4), rgba(255,45,117,0.1));
  color: white;
  cursor: pointer;
  transition: all 0.1s;
  box-shadow: 0 8px 32px rgba(255, 45, 117, 0.4);
}
.nunchi-press-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 12px 48px rgba(255, 45, 117, 0.6);
}
.nunchi-press-btn:active:not(:disabled) {
  transform: scale(0.95);
}
.nunchi-press-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.nunchi-pressed-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--font-display);
  font-size: 14px;
  background: rgba(0,0,0,0.3);
  padding: 12px 20px;
  border-radius: 8px;
  min-width: 280px;
  max-height: 200px;
  overflow-y: auto;
}
.nunchi-pressed-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* ============================================================
   테마 셀렉터
   ============================================================ */
.theme-select {
  background: rgba(20, 9, 42, 0.5);
  border: 1px solid rgba(107, 78, 255, 0.4);
  color: var(--ink);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  cursor: pointer;
  outline: none;
}
.theme-select:hover {
  border-color: var(--accent-2);
}
body[data-theme="excel"] .theme-select,
body[data-theme="powerpoint"] .theme-select,
body[data-theme="outlook"] .theme-select {
  background: #ffffff;
  border: 1px solid #c8c6c4;
  color: var(--ink);
}

/* 부장키 안내 */
.boss-key-hint {
  margin-top: 18px;
  padding: 10px 12px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px dashed rgba(255, 204, 0, 0.3);
  border-radius: 4px;
  font-size: 11px;
  color: var(--ink-dim);
  line-height: 1.6;
}
.boss-key-hint kbd {
  display: inline-block;
  padding: 1px 6px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 10px;
  margin: 0 2px;
}
body[data-theme="excel"] .boss-key-hint kbd,
body[data-theme="powerpoint"] .boss-key-hint kbd,
body[data-theme="outlook"] .boss-key-hint kbd {
  background: #f3f2f1;
  border: 1px solid #c8c6c4;
  color: #252423;
}

/* ============================================================
   도움말 버튼 + 모달
   ============================================================ */
.help-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(107, 78, 255, 0.2);
  border: 1px solid rgba(107, 78, 255, 0.4);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.help-btn:hover {
  background: rgba(107, 78, 255, 0.4);
  border-color: var(--accent-2);
  transform: scale(1.05);
}
body[data-theme="excel"] .help-btn,
body[data-theme="powerpoint"] .help-btn,
body[data-theme="outlook"] .help-btn {
  background: #ffffff;
  border: 1px solid #c8c6c4;
  color: var(--ink);
}
.app-header { position: relative; }

.modal-help {
  max-width: 720px;
  max-height: 85vh;
  width: 90vw;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.modal-help-header {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(107, 78, 255, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.modal-help-header h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
}
.modal-help-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.btn-modal-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--ink);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s;
}
.btn-modal-close:hover {
  background: rgba(255, 64, 64, 0.2);
  border-color: var(--danger);
}
.help-section {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(107, 78, 255, 0.15);
}
.help-section:last-child { border-bottom: none; }
.help-section h4 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--accent-3);
}
.help-section p {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 8px;
  color: var(--ink-dim);
}
.help-section p strong { color: var(--ink); }
.help-section ul, .help-section ol {
  font-size: 13px;
  line-height: 1.8;
  padding-left: 24px;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.help-section ul li strong, .help-section ol li strong { color: var(--ink); }
.help-section kbd {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  margin: 0 2px;
  color: var(--accent-3);
}
.help-shortcut-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.help-shortcut-table td {
  padding: 6px 10px;
  border-bottom: 1px dashed rgba(107, 78, 255, 0.15);
}
.help-shortcut-table td:first-child {
  width: 140px;
  text-align: right;
  white-space: nowrap;
}
.help-theme-list { padding-left: 0; list-style: none; }
.help-theme-list li {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  border-left: 3px solid var(--accent-2);
}

/* 라이트 테마용 도움말 모달 */
body[data-theme="excel"] .modal-help,
body[data-theme="powerpoint"] .modal-help,
body[data-theme="outlook"] .modal-help {
  background: #ffffff;
  color: #252423;
  border: 1px solid #c8c6c4;
}
body[data-theme="excel"] .modal-help-header,
body[data-theme="powerpoint"] .modal-help-header,
body[data-theme="outlook"] .modal-help-header {
  border-bottom-color: #d2d0ce;
}
body[data-theme="excel"] .help-section h4,
body[data-theme="powerpoint"] .help-section h4,
body[data-theme="outlook"] .help-section h4 {
  color: var(--accent);
}
body[data-theme="excel"] .help-section p,
body[data-theme="powerpoint"] .help-section p,
body[data-theme="outlook"] .help-section p,
body[data-theme="excel"] .help-section li,
body[data-theme="powerpoint"] .help-section li,
body[data-theme="outlook"] .help-section li {
  color: #605e5c;
}
body[data-theme="excel"] .help-section kbd,
body[data-theme="powerpoint"] .help-section kbd,
body[data-theme="outlook"] .help-section kbd {
  background: #f3f2f1;
  border-color: #c8c6c4;
  color: #252423;
}
body[data-theme="excel"] .help-theme-list li,
body[data-theme="powerpoint"] .help-theme-list li,
body[data-theme="outlook"] .help-theme-list li {
  background: #f3f2f1;
  border-left-color: var(--accent);
}

/* ============================================================
   테마 미리보기 카드 (로비)
   ============================================================ */
.theme-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.theme-preview-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  border: 2px solid rgba(107, 78, 255, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}
.theme-preview-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-2);
}
.theme-preview-card.active {
  border-color: var(--accent-3);
  box-shadow: 0 0 0 2px var(--accent-3) inset;
}
.theme-preview-card.active::after {
  content: '✓';
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: var(--accent-3);
  font-weight: 900;
}
.theme-preview-thumb {
  width: 100%;
  height: 32px;
  border-radius: 2px;
  margin-bottom: 6px;
  position: relative;
  overflow: hidden;
}
/* 각 테마의 미리보기 thumb */
.theme-preview-thumb.default {
  background: linear-gradient(135deg, #14092a, #1f0f3a);
  border: 1px solid #6b4eff;
}
.theme-preview-thumb.default::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 45, 117, 0.4), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(0, 240, 200, 0.4), transparent 40%);
}
.theme-preview-thumb.excel {
  background: #ffffff;
  border: 1px solid #c8c6c4;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.1) 1px, transparent 1px);
  background-size: 12px 8px;
}
.theme-preview-thumb.excel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: #107c41;
}
.theme-preview-thumb.powerpoint {
  background: linear-gradient(135deg, #faf9f8, #ffffff);
  border: 1px solid #c8c6c4;
}
.theme-preview-thumb.powerpoint::before {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 50%;
  height: 4px;
  background: #b7472a;
  border-radius: 2px;
}
.theme-preview-thumb.powerpoint::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 4px; right: 4px;
  height: 2px;
  background: #c8c6c4;
}
.theme-preview-thumb.outlook {
  background: linear-gradient(180deg, #faf9f8, #f3f2f1);
  border: 1px solid #c8c6c4;
}
.theme-preview-thumb.outlook::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: #0078d4;
}
.theme-preview-thumb.outlook::after {
  content: '✉';
  position: absolute;
  top: 8px; left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: #0078d4;
}
.theme-preview-thumb.ide {
  background: #1e1e1e;
  border: 1px solid #2d2d30;
}
.theme-preview-thumb.ide::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 25%;
  background: #252526;
}
.theme-preview-thumb.ide::after {
  content: 'fn()';
  position: absolute;
  top: 50%;
  left: 35%;
  transform: translateY(-50%);
  font-family: monospace;
  font-size: 10px;
  color: #dcdcaa;
}

.theme-preview-name {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  text-align: center;
}
.theme-preview-card.active .theme-preview-name {
  color: var(--accent-3);
}

/* 라이트 테마용 미리보기 카드 */
body[data-theme="excel"] .theme-preview-card,
body[data-theme="powerpoint"] .theme-preview-card,
body[data-theme="outlook"] .theme-preview-card {
  background: #ffffff;
  border-color: #c8c6c4;
}
body[data-theme="excel"] .theme-preview-card.active,
body[data-theme="powerpoint"] .theme-preview-card.active,
body[data-theme="outlook"] .theme-preview-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent) inset;
}
body[data-theme="excel"] .theme-preview-name,
body[data-theme="powerpoint"] .theme-preview-name,
body[data-theme="outlook"] .theme-preview-name {
  color: #605e5c;
}

/* ============================================================
   사운드 컨트롤 (버튼 + 볼륨 슬라이더)
   ============================================================ */
.sound-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 16px;
  border: 1px solid rgba(107, 78, 255, 0.3);
}
.sound-volume {
  width: 70px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(107, 78, 255, 0.3);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.sound-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-3);
  cursor: pointer;
  transition: transform 0.15s;
}
.sound-volume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.sound-volume::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-3);
  cursor: pointer;
  border: none;
}
body[data-theme="excel"] .sound-control,
body[data-theme="powerpoint"] .sound-control,
body[data-theme="outlook"] .sound-control {
  background: #ffffff;
  border-color: #c8c6c4;
}
body[data-theme="excel"] .sound-volume,
body[data-theme="powerpoint"] .sound-volume,
body[data-theme="outlook"] .sound-volume {
  background: #d2d0ce;
}
body[data-theme="excel"] .sound-volume::-webkit-slider-thumb,
body[data-theme="powerpoint"] .sound-volume::-webkit-slider-thumb,
body[data-theme="outlook"] .sound-volume::-webkit-slider-thumb {
  background: var(--accent);
}

/* sound-control hidden when sound off */
.sound-control.muted .sound-volume { opacity: 0.3; }

/* "처음 입장 환영" 토스트 (큰 버전) */
.welcome-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-3));
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 24px rgba(255, 45, 117, 0.4);
  z-index: 9000;
  animation: welcomeSlide 4s ease-in-out forwards;
  pointer-events: none;
}
@keyframes welcomeSlide {
  0%   { opacity: 0; transform: translate(-50%, -20px); }
  10%  { opacity: 1; transform: translate(-50%, 0); }
  85%  { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -10px); }
}

/* ============================================================
   위장 CHROME - 공통 베이스
   ============================================================ */
.chrome { display: none; }
body[data-theme="excel"] .chrome-excel,
body[data-theme="powerpoint"] .chrome-powerpoint,
body[data-theme="outlook"] .chrome-outlook,
body[data-theme="ide"] .chrome-ide {
  display: block;
}

/* 테마 적용 시 .app은 chrome의 본문 영역 안에 위치 */
body[data-theme="excel"] .app,
body[data-theme="powerpoint"] .app,
body[data-theme="outlook"] .app,
body[data-theme="ide"] .app {
  max-width: none;
  margin: 0;
}

/* 테마 적용 시 헤더(PARTY ARCADE 타이틀) 숨김 */
body[data-theme="excel"] .app-header,
body[data-theme="powerpoint"] .app-header,
body[data-theme="outlook"] .app-header,
body[data-theme="ide"] .app-header {
  display: none;
}

/* 테마 적용 시 page background 그리드/그라데이션 제거 (chrome이 깔끔) */
body[data-theme="excel"]::before,
body[data-theme="powerpoint"]::before,
body[data-theme="outlook"]::before,
body[data-theme="ide"]::before {
  display: none;
}

/* 도움말 버튼은 화면 모서리에 작게 */
body[data-theme="excel"] .help-btn,
body[data-theme="powerpoint"] .help-btn,
body[data-theme="outlook"] .help-btn,
body[data-theme="ide"] .help-btn {
  display: none;
}

/* ============================================================
   EXCEL Chrome
   ============================================================ */
body[data-theme="excel"] {
  background: #ffffff;
  overflow: hidden;
}
body[data-theme="excel"] .app {
  position: fixed;
  top: 156px;       /* titlebar(28) + ribbon(76) + formulabar(28) + colheader(24) */
  left: 0;
  right: 0;
  bottom: 28px;     /* sheettab + status */
  padding: 0;
  height: auto;
  background: #ffffff;
  overflow: hidden;
}
.excel-titlebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(180deg, #217346, #1d6541);
  color: #fff;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-family: 'Segoe UI', sans-serif;
  z-index: 100;
}
.excel-titlebar-icon { margin-right: 6px; }
.excel-titlebar-text { flex: 1; text-align: center; }
.excel-titlebar-buttons {
  display: flex;
  gap: 0;
  font-family: monospace;
}
.excel-titlebar-buttons span {
  width: 36px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.excel-titlebar-buttons span:hover { background: rgba(255,255,255,0.15); }
.excel-titlebar-buttons span.close:hover { background: #e81123; }

.excel-ribbon {
  position: fixed;
  top: 28px; left: 0; right: 0;
  background: #f3f2f1;
  border-bottom: 1px solid #d2d0ce;
  font-family: 'Segoe UI', sans-serif;
  z-index: 99;
}
.excel-tabs {
  display: flex;
  background: #f3f2f1;
  font-size: 12px;
  border-bottom: 1px solid #d2d0ce;
  height: 28px;
  align-items: stretch;
}
.excel-tab {
  padding: 6px 14px;
  cursor: default;
  color: #444;
  display: flex;
  align-items: center;
}
.excel-tab.active {
  background: #ffffff;
  color: #217346;
  border-bottom: 2px solid #217346;
  font-weight: 600;
}
.excel-tab:hover:not(.active) { background: #e7e6e5; }
.excel-ribbon-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  height: 48px;
  font-size: 11px;
  color: #444;
  background: #fafafa;
}
.excel-rb-btn {
  padding: 4px 8px;
  cursor: default;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.excel-rb-btn:hover { background: #e7e6e5; }
.excel-rb-divider {
  width: 1px;
  height: 20px;
  background: #d2d0ce;
  margin: 0 4px;
}
.excel-formulabar {
  position: fixed;
  top: 104px; left: 0; right: 0;
  height: 28px;
  background: #ffffff;
  border-bottom: 1px solid #d2d0ce;
  display: flex;
  align-items: center;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  z-index: 99;
}
.excel-cellref {
  width: 80px;
  padding: 4px 8px;
  border-right: 1px solid #d2d0ce;
  font-weight: 500;
  text-align: center;
  background: #fafafa;
}
.excel-fx {
  padding: 0 12px;
  color: #888;
  font-style: italic;
}
.excel-formula {
  flex: 1;
  padding: 0 8px;
  color: #444;
  font-family: 'Consolas', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.excel-colheader {
  position: fixed;
  top: 132px; left: 0; right: 0;
  height: 24px;
  background: #f3f2f1;
  border-bottom: 1px solid #d2d0ce;
  display: flex;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #444;
  z-index: 99;
}
.excel-corner {
  width: 36px;
  border-right: 1px solid #d2d0ce;
  background: #e7e6e5;
}
.excel-col {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid #d2d0ce;
  font-weight: 600;
}
.excel-bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: #f3f2f1;
  border-top: 1px solid #d2d0ce;
  display: flex;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  z-index: 100;
}
.excel-sheettabs {
  display: flex;
  flex: 1;
  align-items: center;
  background: #fafafa;
  border-right: 1px solid #d2d0ce;
}
.excel-sheettab {
  padding: 4px 12px;
  border-right: 1px solid #d2d0ce;
  cursor: default;
  font-size: 11px;
  color: #444;
}
.excel-sheettab.active {
  background: #ffffff;
  font-weight: 600;
  color: #217346;
}
.excel-sheettab:hover:not(.active) { background: #e7e6e5; }
.excel-status {
  padding: 4px 12px;
  background: #217346;
  color: #fff;
  display: flex;
  align-items: center;
}

/* 엑셀 모드에서는 게임 영역에 행번호 추가 (왼쪽 36px) */
body[data-theme="excel"] #screen-room,
body[data-theme="excel"] #screen-lobby {
  padding-left: 36px;
  position: relative;
}
body[data-theme="excel"] #screen-room::before,
body[data-theme="excel"] #screen-lobby::before {
  content: '1\A 2\A 3\A 4\A 5\A 6\A 7\A 8\A 9\A 10\A 11\A 12\A 13\A 14\A 15\A 16\A 17\A 18\A 19\A 20\A 21\A 22\A 23\A 24\A 25\A 26\A 27\A 28\A 29\A 30';
  white-space: pre;
  position: absolute;
  left: 0; top: 0;
  width: 36px;
  background: #f3f2f1;
  border-right: 1px solid #d2d0ce;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #444;
  text-align: center;
  line-height: 22px;
  padding-top: 4px;
  z-index: 50;
  pointer-events: none;
}

/* ============================================================
   POWERPOINT Chrome
   ============================================================ */
body[data-theme="powerpoint"] {
  background: #f3f2f1;
  overflow: hidden;
}
body[data-theme="powerpoint"] .app {
  position: fixed;
  top: 104px;       /* titlebar(28) + ribbon(76) */
  left: 200px;      /* slidepanel */
  right: 0;
  bottom: 24px;
  padding: 0;
  height: auto;
  background: #ffffff;
  border-radius: 4px;
  margin: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  width: auto;
  overflow: hidden;
}
.ppt-titlebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(180deg, #b7472a, #a13e25);
  color: #fff;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-family: 'Segoe UI', sans-serif;
  z-index: 100;
}
.ppt-titlebar-icon { margin-right: 6px; }
.ppt-titlebar-text { flex: 1; text-align: center; }
.ppt-titlebar-buttons { display: flex; }
.ppt-titlebar-buttons span {
  width: 36px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ppt-titlebar-buttons span:hover { background: rgba(255,255,255,0.15); }
.ppt-titlebar-buttons span.close:hover { background: #e81123; }
.ppt-ribbon {
  position: fixed;
  top: 28px; left: 0; right: 0;
  background: #f3f2f1;
  border-bottom: 1px solid #d2d0ce;
  font-family: 'Segoe UI', sans-serif;
  z-index: 99;
}
.ppt-tabs {
  display: flex;
  font-size: 12px;
  border-bottom: 1px solid #d2d0ce;
  height: 28px;
  align-items: stretch;
}
.ppt-tab {
  padding: 6px 14px;
  cursor: default;
  color: #444;
  display: flex;
  align-items: center;
}
.ppt-tab.active {
  background: #ffffff;
  color: #b7472a;
  border-bottom: 2px solid #b7472a;
  font-weight: 600;
}
.ppt-ribbon-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  height: 48px;
  font-size: 11px;
  color: #444;
  background: #fafafa;
}
.ppt-rb-btn {
  padding: 4px 8px;
  cursor: default;
  border-radius: 2px;
}
.ppt-rb-btn:hover { background: #e7e6e5; }
.ppt-rb-divider {
  width: 1px; height: 20px; background: #d2d0ce; margin: 0 4px;
}
.ppt-slidepanel {
  position: fixed;
  top: 104px;
  left: 0;
  bottom: 24px;
  width: 200px;
  background: #fafafa;
  border-right: 1px solid #d2d0ce;
  padding: 12px 8px;
  overflow-y: auto;
  z-index: 99;
}
.ppt-slide-thumb {
  background: #ffffff;
  border: 1px solid #d2d0ce;
  border-radius: 2px;
  padding: 8px;
  margin-bottom: 8px;
  display: flex;
  gap: 8px;
  cursor: default;
  height: 80px;
}
.ppt-slide-thumb.active {
  border: 2px solid #b7472a;
  box-shadow: 0 0 0 1px rgba(183,71,42,0.3);
}
.ppt-slide-num {
  font-family: 'Segoe UI', sans-serif;
  font-size: 10px;
  color: #888;
  width: 14px;
}
.ppt-slide-content {
  flex: 1;
  font-size: 11px;
  font-family: 'Segoe UI', sans-serif;
  color: #444;
  overflow: hidden;
}
.ppt-bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 24px;
  background: #f3f2f1;
  border-top: 1px solid #d2d0ce;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  color: #444;
  z-index: 100;
}

/* ============================================================
   OUTLOOK Chrome
   ============================================================ */
body[data-theme="outlook"] {
  background: #faf9f8;
  overflow: hidden;
}
body[data-theme="outlook"] .app {
  position: fixed;
  top: 76px;        /* titlebar(28) + ribbon(48) */
  left: 200px;      /* folders */
  right: 0;
  bottom: 24px;
  padding: 12px;
  height: auto;
  background: #faf9f8;
  width: auto;
  overflow: hidden;
}
.outlook-titlebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 28px;
  background: linear-gradient(180deg, #0078d4, #005a9e);
  color: #fff;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 12px;
  font-family: 'Segoe UI', sans-serif;
  z-index: 100;
}
.outlook-titlebar-icon { margin-right: 6px; }
.outlook-titlebar-text { flex: 1; text-align: center; }
.outlook-titlebar-buttons { display: flex; }
.outlook-titlebar-buttons span {
  width: 36px; height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.outlook-titlebar-buttons span:hover { background: rgba(255,255,255,0.15); }
.outlook-titlebar-buttons span.close:hover { background: #e81123; }

.outlook-ribbon {
  position: fixed;
  top: 28px; left: 0; right: 0;
  height: 48px;
  background: #f3f2f1;
  border-bottom: 1px solid #d2d0ce;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  color: #444;
  z-index: 99;
}
.outlook-rb-btn {
  padding: 6px 12px;
  cursor: default;
  border-radius: 2px;
}
.outlook-rb-btn:hover { background: #e7e6e5; }
.outlook-rb-divider {
  width: 1px; height: 24px; background: #d2d0ce; margin: 0 4px;
}
.outlook-folders {
  position: fixed;
  top: 76px; left: 0;
  bottom: 24px;
  width: 200px;
  background: #faf9f8;
  border-right: 1px solid #d2d0ce;
  padding: 12px 8px;
  overflow-y: auto;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  z-index: 99;
}
.outlook-folder-section {
  font-size: 11px;
  font-weight: 600;
  color: #605e5c;
  padding: 4px 8px;
  margin-bottom: 4px;
}
.outlook-folder {
  padding: 6px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: default;
  border-radius: 2px;
  color: #323130;
}
.outlook-folder:hover { background: #f3f2f1; }
.outlook-folder.active {
  background: #cee9f9;
  font-weight: 600;
  color: #0078d4;
}
.outlook-folder-count {
  font-size: 11px;
  color: #888;
  font-weight: 600;
}
.outlook-folder.active .outlook-folder-count { color: #0078d4; }
.outlook-bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 24px;
  background: #0078d4;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 12px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11px;
  z-index: 100;
}

/* ============================================================
   IDE (VS Code) Chrome
   ============================================================ */
body[data-theme="ide"] {
  background: #1e1e1e;
  overflow: hidden;
}
body[data-theme="ide"] .app {
  position: fixed;
  top: 88px;        /* titlebar(30) + menubar(24) + tabs(34) */
  left: 270px;      /* activitybar(50) + sidebar(220) */
  right: 0;
  bottom: 24px;
  padding: 12px;
  height: auto;
  background: #1e1e1e;
  width: auto;
  overflow: hidden;
}
.ide-titlebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 30px;
  background: #3c3c3c;
  color: #cccccc;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  z-index: 100;
}
.ide-traffic { display: flex; gap: 8px; }
.ide-traffic .dot {
  width: 12px; height: 12px;
  border-radius: 50%;
}
.ide-traffic .dot.red { background: #ff5f56; }
.ide-traffic .dot.yellow { background: #ffbd2e; }
.ide-traffic .dot.green { background: #27c93f; }
.ide-titlebar-text {
  flex: 1;
  text-align: center;
  color: #999;
  font-size: 11px;
}
.ide-menubar {
  position: fixed;
  top: 30px; left: 0; right: 0;
  height: 24px;
  background: #2d2d30;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 16px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  color: #cccccc;
  z-index: 99;
  border-bottom: 1px solid #1e1e1e;
}
.ide-menu { cursor: default; }
.ide-menu:hover { color: #ffffff; }
.ide-activitybar {
  position: fixed;
  top: 54px; left: 0;
  bottom: 24px;
  width: 50px;
  background: #333333;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12px;
  gap: 16px;
  border-right: 1px solid #1e1e1e;
  z-index: 99;
}
.ide-activity {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  cursor: default;
  border-left: 2px solid transparent;
  color: #858585;
  margin-left: -2px;
}
.ide-activity:hover { color: #ffffff; }
.ide-activity.active {
  color: #ffffff;
  border-left-color: #ffffff;
}
.ide-sidebar {
  position: fixed;
  top: 54px; left: 50px;
  bottom: 24px;
  width: 220px;
  background: #252526;
  padding: 8px 0;
  overflow-y: auto;
  font-family: 'Segoe UI', sans-serif;
  font-size: 13px;
  color: #cccccc;
  z-index: 99;
}
.ide-sidebar-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #858585;
  padding: 4px 16px;
  margin-bottom: 4px;
}
.ide-sidebar-section {
  font-size: 11px;
  font-weight: 600;
  color: #cccccc;
  padding: 4px 16px;
  cursor: default;
}
.ide-tree-item {
  padding: 2px 16px;
  cursor: default;
  color: #cccccc;
  font-size: 13px;
}
.ide-tree-item.child { padding-left: 32px; }
.ide-tree-item:hover { background: #2a2d2e; }
.ide-tree-item.active {
  background: #094771;
  color: #ffffff;
}
.ide-tabs {
  position: fixed;
  top: 54px; left: 270px;
  right: 0;
  height: 34px;
  background: #2d2d30;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #1e1e1e;
  z-index: 99;
}
.ide-tab {
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #969696;
  background: #2d2d30;
  border-right: 1px solid #252526;
  cursor: default;
}
.ide-tab.active {
  background: #1e1e1e;
  color: #ffffff;
}
.ide-tab-close {
  font-size: 16px;
  color: transparent;
  padding-left: 4px;
}
.ide-tab.active .ide-tab-close { color: #cccccc; }
.ide-tab:hover .ide-tab-close { color: #cccccc; }
.ide-bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 24px;
  background: #007acc;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 12px;
  z-index: 100;
}
.ide-spacer { flex: 1; }

/* ============================================================
   라이트 테마 (Excel/PPT/Outlook) 추가 보정
   ============================================================ */
body[data-theme="excel"] .chat-list,
body[data-theme="powerpoint"] .chat-list,
body[data-theme="outlook"] .chat-list {
  background: rgba(0, 0, 0, 0.04);
}
body[data-theme="excel"] .chat-message,
body[data-theme="powerpoint"] .chat-message,
body[data-theme="outlook"] .chat-message {
  color: var(--ink);
}
body[data-theme="excel"] .chat-system,
body[data-theme="powerpoint"] .chat-system,
body[data-theme="outlook"] .chat-system {
  color: var(--ink-dim);
  font-style: italic;
}
body[data-theme="excel"] .label,
body[data-theme="powerpoint"] .label,
body[data-theme="outlook"] .label {
  color: var(--ink-dim);
}
body[data-theme="excel"] .player-item,
body[data-theme="powerpoint"] .player-item,
body[data-theme="outlook"] .player-item {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}
body[data-theme="excel"] .player-item.host,
body[data-theme="powerpoint"] .player-item.host,
body[data-theme="outlook"] .player-item.host {
  background: rgba(255, 204, 0, 0.15);
}
body[data-theme="excel"] .player-item.me,
body[data-theme="powerpoint"] .player-item.me,
body[data-theme="outlook"] .player-item.me {
  background: rgba(0, 120, 212, 0.1);
  border-color: var(--accent);
}
body[data-theme="excel"] .game-card,
body[data-theme="powerpoint"] .game-card,
body[data-theme="outlook"] .game-card {
  background: #ffffff;
  border: 1px solid #d2d0ce;
  color: var(--ink);
}
body[data-theme="excel"] .game-card:hover:not(.disabled),
body[data-theme="powerpoint"] .game-card:hover:not(.disabled),
body[data-theme="outlook"] .game-card:hover:not(.disabled) {
  background: #f3f2f1;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
body[data-theme="excel"] .game-card.disabled,
body[data-theme="powerpoint"] .game-card.disabled,
body[data-theme="outlook"] .game-card.disabled {
  background: #f3f2f1;
  opacity: 0.5;
}
body[data-theme="excel"] .lobby-grid .panel,
body[data-theme="powerpoint"] .lobby-grid .panel,
body[data-theme="outlook"] .lobby-grid .panel {
  background: #ffffff;
  border: 1px solid #d2d0ce;
}

/* 로비 룸 카드 */
body[data-theme="excel"] .room-item,
body[data-theme="powerpoint"] .room-item,
body[data-theme="outlook"] .room-item {
  background: #ffffff;
  border: 1px solid #d2d0ce;
}
body[data-theme="excel"] .room-item:hover,
body[data-theme="powerpoint"] .room-item:hover,
body[data-theme="outlook"] .room-item:hover {
  background: #f3f2f1;
  border-color: var(--accent);
}

/* IDE: 코드 에디터 분위기로 패널 */
body[data-theme="ide"] .panel {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  color: #d4d4d4;
}
body[data-theme="ide"] .input {
  background: #3c3c3c;
  border: 1px solid #5a5a5a;
  color: #d4d4d4;
  font-family: 'Consolas', 'Menlo', monospace;
}
body[data-theme="ide"] .input:focus {
  border-color: #007acc;
  box-shadow: 0 0 0 1px #007acc;
}
body[data-theme="ide"] .btn {
  background: #007acc;
  color: #ffffff;
  border: 1px solid #005a9e;
  font-family: 'Consolas', 'Menlo', monospace;
}
body[data-theme="ide"] .btn:hover {
  background: #1f8ad6;
}
body[data-theme="ide"] .btn.secondary {
  background: #3c3c3c;
  color: #d4d4d4;
  border: 1px solid #5a5a5a;
}
body[data-theme="ide"] .game-card {
  background: #2d2d30;
  border: 1px solid #3c3c3c;
  color: #d4d4d4;
}
body[data-theme="ide"] .game-card:hover:not(.disabled) {
  background: #3c3c3c;
  border-color: #007acc;
}
body[data-theme="ide"] .room-item {
  background: #252526;
  border: 1px solid #3c3c3c;
}
body[data-theme="ide"] .room-item:hover {
  background: #2a2d2e;
}
body[data-theme="ide"] .chat-list { background: #252526; }
body[data-theme="ide"] .player-item {
  background: #2d2d30;
  border-color: #3c3c3c;
}

/* 모든 테마에서 .app 자체의 그리드 갭/패딩 자연스럽게 */
body[data-theme="excel"] .room-grid,
body[data-theme="powerpoint"] .room-grid,
body[data-theme="outlook"] .room-grid,
body[data-theme="ide"] .room-grid {
  padding: 12px;
  height: 100%;
}
body[data-theme="excel"] #screen-lobby,
body[data-theme="powerpoint"] #screen-lobby,
body[data-theme="outlook"] #screen-lobby,
body[data-theme="ide"] #screen-lobby {
  padding: 16px;
}

/* 엑셀 모드에선 행번호 영역 따로 빼니까 padding 다시 보정 */
body[data-theme="excel"] #screen-lobby {
  padding-left: 52px;
  padding-top: 16px;
}
body[data-theme="excel"] #screen-room {
  padding-left: 36px;
}

/* 작은 화면에서도 chrome이 살아있게 */
@media (max-width: 1200px) {
  body[data-theme="powerpoint"] .ppt-slidepanel { width: 160px; }
  body[data-theme="powerpoint"] .app { left: 160px; }
  body[data-theme="outlook"] .outlook-folders { width: 160px; }
  body[data-theme="outlook"] .app { left: 160px; }
  body[data-theme="ide"] .ide-sidebar { width: 180px; }
  body[data-theme="ide"] .app,
  body[data-theme="ide"] .ide-tabs { left: 230px; }
}
@media (max-width: 900px) {
  body[data-theme="powerpoint"] .ppt-slidepanel,
  body[data-theme="outlook"] .outlook-folders,
  body[data-theme="ide"] .ide-sidebar,
  body[data-theme="ide"] .ide-activitybar {
    display: none;
  }
  body[data-theme="powerpoint"] .app,
  body[data-theme="outlook"] .app,
  body[data-theme="ide"] .app,
  body[data-theme="ide"] .ide-tabs {
    left: 0;
  }
}

/* 도움말 버튼은 모든 위장 모드에서 우상단 작게 - 실제론 숨김 처리했으니
   대신 키보드 ? 키 사용 안내는 도움말 모달 안에 있음. 위장 시 도움말 접근은
   다시 기본 모드로 돌리거나 ? 키 사용 */

/* 위장 모드일 때 작은 햄버거 메뉴 (테마 변경 + 도움말) */
.chrome-tools {
  display: none;
  position: fixed;
  top: 4px;
  right: 130px;  /* close 버튼 옆 */
  height: 22px;
  z-index: 101;
  display: none;
  align-items: center;
  gap: 4px;
}
body[data-theme="excel"] .chrome-tools,
body[data-theme="powerpoint"] .chrome-tools,
body[data-theme="outlook"] .chrome-tools,
body[data-theme="ide"] .chrome-tools {
  display: flex;
}
.chrome-tools-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  cursor: pointer;
  font-family: 'Segoe UI', sans-serif;
}
.chrome-tools-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}
body[data-theme="ide"] .chrome-tools-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   난이도 선택 카드 (게임 로비)
   ============================================================ */
.difficulty-selector {
  margin: 20px 0;
}
.difficulty-cards {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.difficulty-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 2px solid;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  background: rgba(0, 0, 0, 0.2);
  min-width: 110px;
  opacity: 0.5;
}
.difficulty-card:hover:not(.disabled) {
  opacity: 1;
  transform: translateY(-2px);
}
.difficulty-card.active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 2px currentColor inset;
}
.difficulty-card.disabled {
  cursor: not-allowed;
  opacity: 0.3;
}
.difficulty-card .diff-emoji {
  font-size: 24px;
  margin-bottom: 4px;
}
.difficulty-card .diff-label {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  margin-bottom: 4px;
}
.difficulty-card .diff-hint {
  font-size: 10px;
  color: var(--ink-dim);
  text-align: center;
  font-family: var(--font-display);
}

/* 라이트 테마 */
body[data-theme="excel"] .difficulty-card,
body[data-theme="powerpoint"] .difficulty-card,
body[data-theme="outlook"] .difficulty-card {
  background: #ffffff;
  color: var(--ink);
}
body[data-theme="excel"] .difficulty-card .diff-hint,
body[data-theme="powerpoint"] .difficulty-card .diff-hint,
body[data-theme="outlook"] .difficulty-card .diff-hint {
  color: #605e5c;
}

/* ============================================================
   로비 푸터 (이용약관 링크)
   ============================================================ */
.lobby-footer {
  margin-top: 32px;
  padding: 16px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--ink-mute);
}
.lobby-footer a {
  color: var(--ink-dim);
  text-decoration: none;
  border-bottom: 1px dashed var(--ink-mute);
}
.lobby-footer a:hover {
  color: var(--accent-3);
  border-bottom-color: var(--accent-3);
}
.lobby-footer .footer-sep {
  margin: 0 8px;
  opacity: 0.5;
}
body[data-theme="excel"] .lobby-footer a,
body[data-theme="powerpoint"] .lobby-footer a,
body[data-theme="outlook"] .lobby-footer a {
  color: #605e5c;
  border-bottom-color: #c8c6c4;
}

/* ============================================================
   이모지 가시성 보강 (전체 점검 결과)
   ============================================================ */
/* 모든 이모지 표시 element에 line-height 1 + emoji 폴백 폰트 */
.game-emoji,
.result-emoji,
.podium-medal,
.bomb-icon,
.theme-preview-card .theme-preview-thumb,
.player-item .player-avatar,
.bomb-player-chip,
.reaction-btn {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Segoe UI Symbol', sans-serif !important;
  line-height: 1;
}

/* 결과 화면 이모지가 그라데이션 텍스트와 같은 컨테이너에 있을 경우
   text-fill-color가 상속되지 않도록 격리 */
.result-emoji {
  -webkit-text-fill-color: initial !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}
.game-emoji {
  -webkit-text-fill-color: initial !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
}
.podium-medal {
  -webkit-text-fill-color: initial !important;
}

/* 폭탄 게임의 폭탄 이모지가 그라데이션에 영향받지 않게 */
.bomb-icon {
  -webkit-text-fill-color: initial !important;
  color: initial;
  background: none !important;
}

/* 플레이어 아바타가 이름 그라데이션에 영향 안 받게 */
.player-item .player-avatar,
.player-item .player-avatar-emoji {
  -webkit-text-fill-color: initial !important;
}

/* 위장 모드에서 reactionBar가 게임 콘텐츠에 가려지지 않도록 */
.panel-main { isolation: isolate; }

/* IDE 테마(다크)에서 이모지가 잘 보이게 */
body[data-theme="ide"] .reaction-bar {
  background: rgba(40, 40, 40, 0.95);
  border-color: rgba(255, 255, 255, 0.15);
}

/* spawnReaction 결과 div는 body 직속이라 별도 클래스로 보호 */
body > div[style*="reactionFloat"] {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif !important;
}

/* ============================================================
   모든 게임 영역 하단에 리액션 바와 겹치지 않게 여백
   .reaction-bar는 panel-main 기준 bottom:12px에 floating, 높이 ~46px
   ============================================================ */
.bulls-area,
.sketch-area,
.dice-area,
.mafia-area,
.typing-area,
.wordchain-area,
.rps-area,
.memory-area,
.vote-area,
.quiz-area,
.bomb-area,
.nunchi-area {
  padding-bottom: 70px;
}

/* result-screen은 시작/끝 화면이라 여백은 작게 (리액션 바 자체가 hidden) */

/* ============================================================
   라이트 테마(엑셀/PPT/메일) 게임 영역 가독성 종합 보강
   기본 게임 element들의 어두운 배경을 라이트 모드에 맞게 자동 변환
   ============================================================ */
body[data-theme="excel"] .game-area,
body[data-theme="excel"] .reaction-arena,
body[data-theme="excel"] .quiz-area,
body[data-theme="excel"] .vote-area,
body[data-theme="excel"] .rps-area,
body[data-theme="excel"] .memory-area,
body[data-theme="excel"] .bomb-area,
body[data-theme="excel"] .nunchi-area,
body[data-theme="powerpoint"] .game-area,
body[data-theme="powerpoint"] .reaction-arena,
body[data-theme="powerpoint"] .quiz-area,
body[data-theme="powerpoint"] .vote-area,
body[data-theme="powerpoint"] .rps-area,
body[data-theme="powerpoint"] .memory-area,
body[data-theme="powerpoint"] .bomb-area,
body[data-theme="powerpoint"] .nunchi-area,
body[data-theme="outlook"] .game-area,
body[data-theme="outlook"] .reaction-arena,
body[data-theme="outlook"] .quiz-area,
body[data-theme="outlook"] .vote-area,
body[data-theme="outlook"] .rps-area,
body[data-theme="outlook"] .memory-area,
body[data-theme="outlook"] .bomb-area,
body[data-theme="outlook"] .nunchi-area {
  color: #252423;
}

/* 어두운 배경 카드들을 라이트로 (rgba(0,0,0,0.3)/(0,0,0,0.4) 패턴 대응) */
body[data-theme="excel"] .quiz-option,
body[data-theme="excel"] .vote-option-balance,
body[data-theme="excel"] .vote-option-person,
body[data-theme="excel"] .rps-choice,
body[data-theme="excel"] .quiz-question,
body[data-theme="excel"] .rps-pair,
body[data-theme="excel"] .bulls-history-item,
body[data-theme="excel"] .dice-track,
body[data-theme="powerpoint"] .quiz-option,
body[data-theme="powerpoint"] .vote-option-balance,
body[data-theme="powerpoint"] .vote-option-person,
body[data-theme="powerpoint"] .rps-choice,
body[data-theme="powerpoint"] .quiz-question,
body[data-theme="powerpoint"] .rps-pair,
body[data-theme="powerpoint"] .bulls-history-item,
body[data-theme="powerpoint"] .dice-track,
body[data-theme="outlook"] .quiz-option,
body[data-theme="outlook"] .vote-option-balance,
body[data-theme="outlook"] .vote-option-person,
body[data-theme="outlook"] .rps-choice,
body[data-theme="outlook"] .quiz-question,
body[data-theme="outlook"] .rps-pair,
body[data-theme="outlook"] .bulls-history-item,
body[data-theme="outlook"] .dice-track {
  background: #ffffff !important;
  color: #252423;
  border-color: #d2d0ce !important;
}

body[data-theme="excel"] .quiz-option:hover,
body[data-theme="excel"] .vote-option-balance:hover,
body[data-theme="excel"] .vote-option-person:hover,
body[data-theme="excel"] .rps-choice:hover,
body[data-theme="powerpoint"] .quiz-option:hover,
body[data-theme="powerpoint"] .vote-option-balance:hover,
body[data-theme="powerpoint"] .vote-option-person:hover,
body[data-theme="powerpoint"] .rps-choice:hover,
body[data-theme="outlook"] .quiz-option:hover,
body[data-theme="outlook"] .vote-option-balance:hover,
body[data-theme="outlook"] .vote-option-person:hover,
body[data-theme="outlook"] .rps-choice:hover {
  background: #f5f5ff !important;
}

/* 결과 화면 라이트 테마 */
body[data-theme="excel"] .result-screen,
body[data-theme="powerpoint"] .result-screen,
body[data-theme="outlook"] .result-screen {
  color: #252423;
}
body[data-theme="excel"] .result-title,
body[data-theme="powerpoint"] .result-title,
body[data-theme="outlook"] .result-title {
  color: #185abd;
  -webkit-text-fill-color: #185abd;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
}
body[data-theme="excel"] .ranking-row,
body[data-theme="powerpoint"] .ranking-row,
body[data-theme="outlook"] .ranking-row {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  color: #252423;
}

/* 채팅 영역 라이트 */
body[data-theme="excel"] .chat-list,
body[data-theme="powerpoint"] .chat-list,
body[data-theme="outlook"] .chat-list {
  background: #fafafa;
  border: 1px solid #e0e0e0;
}
body[data-theme="excel"] .chat-msg,
body[data-theme="powerpoint"] .chat-msg,
body[data-theme="outlook"] .chat-msg {
  color: #252423;
}

/* 플레이어 목록 라이트 */
body[data-theme="excel"] .player-item,
body[data-theme="powerpoint"] .player-item,
body[data-theme="outlook"] .player-item {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  color: #252423;
}

/* 리액션 바 - 라이트 테마 (이전에 추가한 것 재확인) */
body[data-theme="excel"] .reaction-bar,
body[data-theme="powerpoint"] .reaction-bar,
body[data-theme="outlook"] .reaction-bar {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* 게임 메뉴 카드 라이트 */
body[data-theme="excel"] .game-card,
body[data-theme="powerpoint"] .game-card,
body[data-theme="outlook"] .game-card {
  background: #ffffff;
  border: 1px solid #d2d0ce;
  color: #252423;
}
body[data-theme="excel"] .game-card:hover,
body[data-theme="powerpoint"] .game-card:hover,
body[data-theme="outlook"] .game-card:hover {
  background: #f5f5ff;
  border-color: #185abd;
}

/* 그라데이션 텍스트가 PPT 테마에서 안 보이는 문제 해결 */
body[data-theme="excel"] .bomb-syllable,
body[data-theme="powerpoint"] .bomb-syllable,
body[data-theme="outlook"] .bomb-syllable {
  background: none !important;
  -webkit-text-fill-color: #b7472a !important;
  color: #b7472a;
}
body[data-theme="excel"] .nunchi-current-num,
body[data-theme="powerpoint"] .nunchi-current-num,
body[data-theme="outlook"] .nunchi-current-num {
  background: none !important;
  -webkit-text-fill-color: #185abd !important;
  color: #185abd;
}
body[data-theme="excel"] .title,
body[data-theme="powerpoint"] .title,
body[data-theme="outlook"] .title {
  background: none !important;
  -webkit-text-fill-color: #185abd !important;
  color: #185abd;
}

/* ============================================================
   GAME: TETRIS
   ============================================================ */
.tetris-area {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}
.tetris-controls-help {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--ink-dim);
  text-align: center;
  padding: 6px;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
.tetris-controls-help kbd {
  background: rgba(107,78,255,0.3);
  border: 1px solid rgba(107,78,255,0.5);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-family: monospace;
  margin: 0 2px;
}
.tetris-boards {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  flex: 1;
}
.tetris-self {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.tetris-self-info {
  font-family: var(--font-display);
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  min-height: 24px;
}
.tetris-stats {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
  justify-content: center;
}
.tetris-stats .label {
  font-size: 10px;
  margin-bottom: 2px;
}
.tetris-stat-value {
  display: block;
  font-family: var(--font-display);
  color: var(--accent-3);
  font-weight: 900;
  font-size: 16px;
}
.tetris-board-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tetris-canvas-container {
  position: relative;
}
.tetris-effect {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  pointer-events: none;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--accent-3);
  text-shadow:
    0 0 8px var(--accent-3),
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000;
  opacity: 0;
  z-index: 10;
  white-space: nowrap;
  line-height: 1.4;
}
.tetris-effect.show {
  animation: tetrisEffectPop 1.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes tetrisEffectPop {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  60% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(0.9); opacity: 0; }
}
.tetris-side-left {
  /* HOLD 패널 - NEXT와 동일하지만 좌측 */
}
.tetris-canvas {
  border: 2px solid rgba(107,78,255,0.5);
  border-radius: 4px;
  image-rendering: pixelated;
  background: #0a0518;
  transition: filter 0.05s, box-shadow 0.05s;
}
.tetris-canvas.flash {
  animation: tetrisCanvasFlash 0.25s ease-out;
}
@keyframes tetrisCanvasFlash {
  0% { filter: brightness(1.8); box-shadow: 0 0 30px rgba(255, 204, 0, 0.6); }
  100% { filter: brightness(1); box-shadow: none; }
}
.tetris-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.tetris-next-canvas {
  border: 1px solid rgba(107,78,255,0.4);
  border-radius: 4px;
  background: #0a0518;
}
.tetris-others {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tetris-others-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, max-content));
  gap: 8px;
  justify-content: center;
}
.tetris-other-garbage {
  font-size: 10px;
  color: var(--accent-3);
  font-family: var(--font-display);
  font-weight: 700;
  margin-top: 2px;
}
.tetris-other {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 6px;
  background: rgba(0,0,0,0.3);
  border-radius: 4px;
}
.tetris-other.dead { opacity: 0.5; }
.tetris-other-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
}
.tetris-other-canvas {
  border: 1px solid rgba(107,78,255,0.3);
  background: #0a0518;
  image-rendering: pixelated;
}
.tetris-other-stats {
  font-size: 10px;
  color: var(--ink-dim);
  font-family: var(--font-display);
}
.tetris-dead {
  color: var(--accent-5);
  font-weight: 900;
  font-family: var(--font-display);
  font-size: 14px;
  margin-top: 6px;
  animation: tetrisDeadFlash 0.6s ease-in-out infinite;
}
@keyframes tetrisDeadFlash {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.tetris-pending-garbage {
  color: var(--accent-3);
  font-size: 11px;
  font-family: var(--font-display);
  margin-top: 4px;
}

/* 라이트 테마 (위장 모드) */
body[data-theme="excel"] .tetris-canvas,
body[data-theme="excel"] .tetris-next-canvas,
body[data-theme="excel"] .tetris-other-canvas,
body[data-theme="powerpoint"] .tetris-canvas,
body[data-theme="powerpoint"] .tetris-next-canvas,
body[data-theme="powerpoint"] .tetris-other-canvas,
body[data-theme="outlook"] .tetris-canvas,
body[data-theme="outlook"] .tetris-next-canvas,
body[data-theme="outlook"] .tetris-other-canvas {
  border-color: #c8c6c4;
}

/* IDE 다크 테마 테트리스 - VS Code 스타일 */
body[data-theme="ide"] .tetris-canvas,
body[data-theme="ide"] .tetris-next-canvas,
body[data-theme="ide"] .tetris-other-canvas {
  border-color: #3c3c3c;
  background: #1e1e1e;
}
body[data-theme="ide"] .tetris-controls-help {
  background: #252526;
  color: #9cdcfe;
  border: 1px solid #3c3c3c;
}
body[data-theme="ide"] .tetris-other {
  background: #252526;
  border: 1px solid #3c3c3c;
}
body[data-theme="ide"] .tetris-canvas-container,
body[data-theme="ide"] .tetris-area {
  position: relative;
  z-index: 2; /* IDE 사이드바(::before z=0) 위로 */
}
body[data-theme="excel"] .tetris-controls-help,
body[data-theme="powerpoint"] .tetris-controls-help,
body[data-theme="outlook"] .tetris-controls-help {
  background: #fafafa;
  color: #605e5c;
  border: 1px solid #e0e0e0;
}
body[data-theme="excel"] .tetris-other,
body[data-theme="powerpoint"] .tetris-other,
body[data-theme="outlook"] .tetris-other {
  background: #fafafa;
  border: 1px solid #e0e0e0;
}

/* ============================================================
   로비 - 접속자 목록 (Online Users)
   ============================================================ */
.online-users-box {
  background: rgba(0, 240, 200, 0.06);
  border: 1px solid rgba(0, 240, 200, 0.25);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.online-users-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 8px var(--accent-2);
  animation: onlineDotPulse 2s ease-in-out infinite;
}
@keyframes onlineDotPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.online-users-title {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.online-users-count {
  margin-left: auto;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--accent-2);
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.online-users-breakdown {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10px;
  color: var(--ink-dim);
  letter-spacing: 0;
  text-transform: none;
}
.online-user-game-badge {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  filter: drop-shadow(0 0 2px rgba(0, 240, 200, 0.5));
}
.online-toast-toggle {
  background: transparent;
  border: 1px solid rgba(107, 78, 255, 0.3);
  color: var(--ink);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s;
}
.online-toast-toggle:hover {
  background: rgba(107, 78, 255, 0.15);
  border-color: rgba(107, 78, 255, 0.5);
}
.online-toast-toggle.off {
  opacity: 0.5;
}
body[data-theme="excel"] .online-toast-toggle,
body[data-theme="powerpoint"] .online-toast-toggle,
body[data-theme="outlook"] .online-toast-toggle {
  border-color: #d2d0ce;
}
body[data-theme="excel"] .online-toast-toggle:hover,
body[data-theme="powerpoint"] .online-toast-toggle:hover,
body[data-theme="outlook"] .online-toast-toggle:hover {
  background: #f3f2f1;
}
.online-users-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.online-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.15);
  font-size: 13px;
}
.online-user.me {
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.3);
  animation: onlineMePulse 3s ease-in-out infinite;
}
@keyframes onlineMePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0); }
  50% { box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2); }
}
.online-user-avatar {
  font-size: 16px;
  flex-shrink: 0;
}
.online-user-name {
  flex: 1;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.online-user-where {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.online-user-where.lobby {
  color: var(--ink-mute);
  background: transparent;
  border: 1px solid var(--ink-mute);
}
.online-user-where[data-room] {
  color: var(--accent-3);
  background: rgba(255, 204, 0, 0.15);
  border: 1px solid rgba(255, 204, 0, 0.3);
  cursor: pointer;
  transition: all 0.15s;
}
.online-user-where[data-room]:hover {
  background: rgba(255, 204, 0, 0.3);
  transform: scale(1.05);
}
.online-users-empty {
  color: var(--ink-dim);
  font-size: 11px;
  text-align: center;
  padding: 8px;
}
.online-users-public {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  font-size: 12px;
  color: var(--ink-dim);
}
.online-users-sep {
  color: var(--ink-mute);
}

/* 라이트 테마 (위장 모드) */
body[data-theme="excel"] .online-users-box,
body[data-theme="powerpoint"] .online-users-box,
body[data-theme="outlook"] .online-users-box {
  background: #f0f8f4;
  border-color: #b8e6c8;
}
body[data-theme="excel"] .online-user,
body[data-theme="powerpoint"] .online-user,
body[data-theme="outlook"] .online-user {
  background: #ffffff;
  border: 1px solid #e0e0e0;
}
body[data-theme="excel"] .online-user.me,
body[data-theme="powerpoint"] .online-user.me,
body[data-theme="outlook"] .online-user.me {
  background: #fffce8;
  border-color: #f5d97a;
}

/* ============================================================
   이용약관 모달 (#legalModal) - legal.html 본문 스타일
   ============================================================ */
#legalModalBody h1 {
  font-family: var(--font-display, 'Courier New', monospace);
  margin-bottom: 8px;
  color: var(--accent-3, #ffcc00);
  font-size: 24px;
}
#legalModalBody h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  color: var(--accent-3, #ffcc00);
  font-size: 16px;
  font-weight: 700;
}
#legalModalBody h3 {
  margin-top: 18px;
  margin-bottom: 6px;
  color: var(--accent-2, #00f0c8);
  font-size: 14px;
}
#legalModalBody p,
#legalModalBody li {
  line-height: 1.7;
  color: var(--ink-mute, #b9a8e0);
  font-size: 14px;
}
#legalModalBody ul,
#legalModalBody ol {
  padding-left: 24px;
  margin: 8px 0;
}
#legalModalBody .updated {
  font-size: 12px;
  color: var(--ink-dim, #7a6b9c);
  margin-bottom: 16px;
}
#legalModalBody hr {
  border: none;
  border-top: 1px dashed rgba(107, 78, 255, 0.2);
  margin: 32px 0;
}
#legalModalBody strong {
  color: var(--ink, #f4ecff);
}

/* 라이트 테마 (위장 모드) 대응 */
body[data-theme="excel"] #legalModalBody h2,
body[data-theme="powerpoint"] #legalModalBody h2,
body[data-theme="outlook"] #legalModalBody h2 {
  color: #c47c00;
}
body[data-theme="excel"] #legalModalBody h3,
body[data-theme="powerpoint"] #legalModalBody h3,
body[data-theme="outlook"] #legalModalBody h3 {
  color: #008060;
}
body[data-theme="excel"] #legalModalBody p,
body[data-theme="powerpoint"] #legalModalBody p,
body[data-theme="outlook"] #legalModalBody p,
body[data-theme="excel"] #legalModalBody li,
body[data-theme="powerpoint"] #legalModalBody li,
body[data-theme="outlook"] #legalModalBody li {
  color: #444;
}

/* ============================================================
   마피아 - 비밀 채팅 / 영매 패널 (v3.11)
   ============================================================ */
.mafia-secret-chat {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 45, 117, 0.08);
  border: 1px solid rgba(255, 45, 117, 0.3);
  border-radius: 8px;
}
.mafia-secret-chat-header {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-3, #ffcc00);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.mafia-secret-chat-log {
  max-height: 140px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mafia-secret-chat-msg {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.mafia-secret-chat-input {
  display: flex;
  gap: 6px;
}
.mafia-secret-chat-input input {
  flex: 1;
}

/* 라이트 테마 */
body[data-theme="excel"] .mafia-secret-chat,
body[data-theme="powerpoint"] .mafia-secret-chat,
body[data-theme="outlook"] .mafia-secret-chat {
  background: #fef7f9;
  border-color: #f5b8c5;
}
body[data-theme="excel"] .mafia-secret-chat-log,
body[data-theme="powerpoint"] .mafia-secret-chat-log,
body[data-theme="outlook"] .mafia-secret-chat-log {
  background: #ffffff;
  border: 1px solid #e0e0e0;
}

/* ============================================================
   WORDLE - 한글 단어맞추기 (v3.12)
   ============================================================ */
.wordle-area {
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}
.wordle-header {
  text-align: center;
  margin-bottom: 16px;
}
.wordle-info {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-dim);
  font-family: var(--font-display);
  letter-spacing: 0.1em;
}
.wordle-info-sep {
  color: var(--ink-mute);
}
.wordle-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.wordle-self {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.wordle-self-name {
  font-weight: 700;
  font-size: 14px;
}
.wordle-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wordle-row {
  display: flex;
  gap: 6px;
}
.wordle-cell {
  width: 56px;
  height: 56px;
  border: 2px solid rgba(107,78,255,0.25);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, background 0.3s, border-color 0.3s;
}
.wordle-cell.filled {
  border-color: rgba(107,78,255,0.6);
  animation: wordleCellPop 0.3s ease-out;
}
@keyframes wordleCellPop {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.wordle-cell.hit {
  background: #2ed573;
  border-color: #2ed573;
  color: white;
}
.wordle-cell.present {
  background: #ffcc00;
  border-color: #ffcc00;
  color: #14092a;
}
.wordle-cell.miss {
  background: #4a4458;
  border-color: #4a4458;
  color: rgba(255, 255, 255, 0.5);
}
.wordle-input-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 280px;
}
.wordle-input-row.hidden {
  display: none;
}
.wordle-input-text {
  flex: 1;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0.15em;
  font-weight: 700;
}
.wordle-hint {
  text-align: center;
  min-height: 24px;
  width: 100%;
}
.wordle-finished {
  padding: 10px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}
.wordle-finished.win {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
  border: 1px solid rgba(46, 213, 115, 0.4);
}
.wordle-finished.lose {
  background: rgba(255, 45, 117, 0.15);
  color: #ff2d75;
  border: 1px solid rgba(255, 45, 117, 0.4);
}
.wordle-others {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wordle-others-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.wordle-other {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(107, 78, 255, 0.2);
  border-radius: 6px;
  padding: 8px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wordle-other.won {
  border-color: rgba(46, 213, 115, 0.5);
  background: rgba(46, 213, 115, 0.05);
}
.wordle-other.lost {
  border-color: rgba(255, 45, 117, 0.4);
  background: rgba(255, 45, 117, 0.05);
  opacity: 0.7;
}
.wordle-other-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wordle-other-status {
  font-size: 11px;
  color: var(--ink-dim);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.wordle-other-win {
  color: #2ed573;
  font-weight: 700;
}
.wordle-other-lose {
  color: #ff2d75;
}
.wordle-other-thinking {
  color: var(--accent-3);
  font-weight: 700;
}
.wordle-other-board {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wordle-mini-row {
  display: flex;
  gap: 2px;
}
.wordle-mini-cell {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #4a4458;
}
.wordle-mini-cell.hit { background: #2ed573; }
.wordle-mini-cell.present { background: #ffcc00; }
.wordle-mini-cell.miss { background: #4a4458; }

/* 좁은 화면 - 세로 배치 */
@media (max-width: 720px) {
  .wordle-main {
    grid-template-columns: 1fr;
  }
  .wordle-cell {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }
}

/* 라이트 테마 */
body[data-theme="excel"] .wordle-cell,
body[data-theme="powerpoint"] .wordle-cell,
body[data-theme="outlook"] .wordle-cell {
  background: #ffffff;
  border-color: #d0d0d0;
  color: #333;
}
body[data-theme="excel"] .wordle-cell.miss,
body[data-theme="powerpoint"] .wordle-cell.miss,
body[data-theme="outlook"] .wordle-cell.miss {
  background: #c0c0c0;
  border-color: #999;
  color: #fff;
}
body[data-theme="excel"] .wordle-other,
body[data-theme="powerpoint"] .wordle-other,
body[data-theme="outlook"] .wordle-other {
  background: #fafafa;
  border-color: #e0e0e0;
}

/* 마피아 - 처형 안 함 / 스킵 카드 */
.mafia-skip-card {
  background: rgba(122, 107, 156, 0.08) !important;
  opacity: 0.85;
}
.mafia-skip-card:hover {
  opacity: 1;
}
.mafia-skip-card.selected {
  background: rgba(122, 107, 156, 0.25) !important;
  opacity: 1;
}

/* ============================================================
   마피아 v3.13 - 사망자 채팅 + 투표자 표시
   ============================================================ */

/* 사망자 채팅 (저승) - 보라색 톤 */
.mafia-dead-chat {
  margin-top: 14px;
  padding: 12px;
  background: rgba(122, 107, 156, 0.12);
  border: 1px solid rgba(122, 107, 156, 0.4);
  border-radius: 8px;
}
.mafia-dead-chat-header {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #b9a8e0;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.mafia-dead-chat-log {
  max-height: 140px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  padding: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mafia-dead-chat-msg {
  font-size: 13px;
  line-height: 1.4;
  word-break: break-word;
}
.mafia-dead-chat-input {
  display: flex;
  gap: 6px;
}
.mafia-dead-chat-input input {
  flex: 1;
}

/* 라이트 테마 */
body[data-theme="excel"] .mafia-dead-chat,
body[data-theme="powerpoint"] .mafia-dead-chat,
body[data-theme="outlook"] .mafia-dead-chat {
  background: #f5f4fa;
  border-color: #cfc8e0;
}
body[data-theme="excel"] .mafia-dead-chat-log,
body[data-theme="powerpoint"] .mafia-dead-chat-log,
body[data-theme="outlook"] .mafia-dead-chat-log {
  background: #ffffff;
  border: 1px solid #e0e0e0;
}

/* 투표자 표시 (누가 누구한테 투표했는지 아바타 칩) */
.mafia-voters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  margin-top: 4px;
  padding: 0 4px;
}
.mafia-voter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid;
  border-radius: 50%;
  cursor: help;
  line-height: 1;
}
body[data-theme="excel"] .mafia-voter-chip,
body[data-theme="powerpoint"] .mafia-voter-chip,
body[data-theme="outlook"] .mafia-voter-chip {
  background: #ffffff;
}

/* 투표 현황 - 카드 외부 별도 패널 (v3.13) */
.mafia-vote-status {
  margin-top: 14px;
  padding: 12px;
  background: rgba(255, 204, 0, 0.06);
  border: 1px solid rgba(255, 204, 0, 0.3);
  border-radius: 8px;
}
.mafia-vote-status-header {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-3, #ffcc00);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mafia-vote-count {
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0;
  text-transform: none;
  font-weight: 400;
}
.mafia-vote-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mafia-vote-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.mafia-vote-target {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 13px;
  min-width: 100px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.mafia-vote-row-count {
  font-size: 11px;
  color: var(--ink-dim);
  font-weight: 400;
}
.mafia-vote-voters {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.mafia-vote-empty {
  text-align: center;
  font-size: 12px;
  color: var(--ink-dim);
  padding: 12px;
}

/* 라이트 테마 */
body[data-theme="excel"] .mafia-vote-status,
body[data-theme="powerpoint"] .mafia-vote-status,
body[data-theme="outlook"] .mafia-vote-status {
  background: #fffbe6;
  border-color: #ffe58f;
}
body[data-theme="excel"] .mafia-vote-row,
body[data-theme="powerpoint"] .mafia-vote-row,
body[data-theme="outlook"] .mafia-vote-row {
  background: #ffffff;
  border: 1px solid #e0e0e0;
}
body[data-theme="ide"] .mafia-vote-status {
  background: rgba(255, 204, 0, 0.06);
  border-color: rgba(255, 204, 0, 0.4);
}
body[data-theme="ide"] .mafia-vote-row {
  background: #252526;
  border: 1px solid #3c3c3c;
}

/* ============================================================
   WORDLE v3.13.2 - 게임 방법 가이드 + 시인성 개선
   ============================================================ */

/* 게임 방법 패널 (게임 시작 시 표시) */
.wordle-rules {
  max-width: 600px;
  margin: 0 auto 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(0, 240, 200, 0.08), rgba(107, 78, 255, 0.08));
  border: 2px solid rgba(0, 240, 200, 0.4);
  border-radius: 10px;
  transition: all 0.3s ease;
  overflow: hidden;
  max-height: 500px;
}
.wordle-rules.collapsed {
  max-height: 0;
  margin: 0 auto;
  padding: 0 20px;
  border-width: 0;
  opacity: 0;
}
.wordle-rules-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-2);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.wordle-rules-list {
  margin: 0 0 14px;
  padding-left: 20px;
  line-height: 1.8;
  font-size: 13px;
  color: var(--ink);
}
.wordle-rules-list li {
  margin-bottom: 4px;
}
.wordle-rules-list strong {
  color: var(--accent-3);
}
.wordle-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  margin-bottom: 12px;
}
.wordle-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}
.wordle-legend-cell {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  border-radius: 3px;
  color: white;
  flex-shrink: 0;
}
.wordle-legend-cell.hit { background: #2ed573; }
.wordle-legend-cell.present { background: #ffcc00; color: #14092a; }
.wordle-legend-cell.miss { background: #4a4458; }
.wordle-rules-close {
  display: block;
  width: 100%;
  padding: 8px;
  background: rgba(0, 240, 200, 0.2);
  border: 1px solid rgba(0, 240, 200, 0.5);
  color: var(--accent-2);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}
.wordle-rules-close:hover {
  background: rgba(0, 240, 200, 0.3);
}

.wordle-help-btn {
  background: rgba(255, 204, 0, 0.2);
  border: 1px solid rgba(255, 204, 0, 0.5);
  color: var(--accent-3);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wordle-help-btn:hover {
  background: rgba(255, 204, 0, 0.4);
}

/* 시인성 개선 - 셀 텍스트 그림자 + 폰트 가독성 */
.wordle-cell.hit,
.wordle-cell.present,
.wordle-cell.miss {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  font-weight: 900;
}
.wordle-cell.present {
  /* 노랑 배경엔 검정 글씨가 더 잘 보임 (이미 .miss 색상과 다름) */
  color: #14092a !important;
}
.wordle-cell.hit {
  color: #ffffff !important;
}
.wordle-cell.miss {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* 입력란 스타일 보강 */
.wordle-input-text {
  font-size: 22px !important;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-align: center;
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(0, 240, 200, 0.5) !important;
}
.wordle-input-text:focus {
  border-color: var(--accent-3) !important;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.2) !important;
}

/* ============================================================
   라이트 테마 (엑셀/PPT/Outlook) - WORDLE 가독성 보장
   ============================================================ */
body[data-theme="excel"] .wordle-rules,
body[data-theme="powerpoint"] .wordle-rules,
body[data-theme="outlook"] .wordle-rules {
  background: linear-gradient(135deg, #e3f2fd, #fff3e0);
  border-color: #1976d2;
}
body[data-theme="excel"] .wordle-rules-title,
body[data-theme="powerpoint"] .wordle-rules-title,
body[data-theme="outlook"] .wordle-rules-title {
  color: #1976d2;
}
body[data-theme="excel"] .wordle-rules-list,
body[data-theme="powerpoint"] .wordle-rules-list,
body[data-theme="outlook"] .wordle-rules-list {
  color: #333;
}
body[data-theme="excel"] .wordle-rules-list strong,
body[data-theme="powerpoint"] .wordle-rules-list strong,
body[data-theme="outlook"] .wordle-rules-list strong {
  color: #d32f2f;
}
body[data-theme="excel"] .wordle-legend,
body[data-theme="powerpoint"] .wordle-legend,
body[data-theme="outlook"] .wordle-legend {
  background: #ffffff;
  border: 1px solid #e0e0e0;
}
body[data-theme="excel"] .wordle-legend-item,
body[data-theme="powerpoint"] .wordle-legend-item,
body[data-theme="outlook"] .wordle-legend-item {
  color: #333;
}
body[data-theme="excel"] .wordle-rules-close,
body[data-theme="powerpoint"] .wordle-rules-close,
body[data-theme="outlook"] .wordle-rules-close {
  background: #1976d2;
  color: white;
  border-color: #1976d2;
}
body[data-theme="excel"] .wordle-rules-close:hover,
body[data-theme="powerpoint"] .wordle-rules-close:hover,
body[data-theme="outlook"] .wordle-rules-close:hover {
  background: #1565c0;
}

/* 라이트 테마 - 셀 색상 더 진하게 (흰 배경에 묻히지 않도록) */
body[data-theme="excel"] .wordle-cell.hit,
body[data-theme="powerpoint"] .wordle-cell.hit,
body[data-theme="outlook"] .wordle-cell.hit {
  background: #2e7d32;
  border-color: #2e7d32;
  color: white !important;
}
body[data-theme="excel"] .wordle-cell.present,
body[data-theme="powerpoint"] .wordle-cell.present,
body[data-theme="outlook"] .wordle-cell.present {
  background: #f57c00;
  border-color: #f57c00;
  color: white !important;
}
body[data-theme="excel"] .wordle-cell.miss,
body[data-theme="powerpoint"] .wordle-cell.miss,
body[data-theme="outlook"] .wordle-cell.miss {
  background: #757575;
  border-color: #757575;
  color: white !important;
}
body[data-theme="excel"] .wordle-legend-cell.hit,
body[data-theme="powerpoint"] .wordle-legend-cell.hit,
body[data-theme="outlook"] .wordle-legend-cell.hit { background: #2e7d32; }
body[data-theme="excel"] .wordle-legend-cell.present,
body[data-theme="powerpoint"] .wordle-legend-cell.present,
body[data-theme="outlook"] .wordle-legend-cell.present { background: #f57c00; color: white; }
body[data-theme="excel"] .wordle-legend-cell.miss,
body[data-theme="powerpoint"] .wordle-legend-cell.miss,
body[data-theme="outlook"] .wordle-legend-cell.miss { background: #757575; }

body[data-theme="excel"] .wordle-input-text,
body[data-theme="powerpoint"] .wordle-input-text,
body[data-theme="outlook"] .wordle-input-text {
  background: #ffffff !important;
  border-color: #1976d2 !important;
  color: #14092a !important;
}

/* ============================================================
   IDE 테마 - WORDLE
   ============================================================ */
body[data-theme="ide"] .wordle-rules {
  background: linear-gradient(135deg, #252526, #2d2d30);
  border-color: #4ec9b0;
}
body[data-theme="ide"] .wordle-rules-title { color: #4ec9b0; }
body[data-theme="ide"] .wordle-rules-list { color: #d4d4d4; }
body[data-theme="ide"] .wordle-rules-list strong { color: #ce9178; }
body[data-theme="ide"] .wordle-legend { background: #1e1e1e; border: 1px solid #3c3c3c; }
body[data-theme="ide"] .wordle-legend-item { color: #d4d4d4; }
body[data-theme="ide"] .wordle-rules-close {
  background: #0e639c;
  color: white;
  border-color: #1177bb;
}
body[data-theme="ide"] .wordle-rules-close:hover { background: #1177bb; }
body[data-theme="ide"] .wordle-input-text {
  background: #1e1e1e !important;
  border-color: #4ec9b0 !important;
  color: #d4d4d4 !important;
}

/* IDE 셀 - VS Code 색감 */
body[data-theme="ide"] .wordle-cell {
  background: #2d2d30;
  border-color: #3c3c3c;
  color: #d4d4d4;
}
body[data-theme="ide"] .wordle-cell.hit {
  background: #4ec9b0;
  border-color: #4ec9b0;
  color: #1e1e1e !important;
}
body[data-theme="ide"] .wordle-cell.present {
  background: #dcdcaa;
  border-color: #dcdcaa;
  color: #1e1e1e !important;
}
body[data-theme="ide"] .wordle-cell.miss {
  background: #3c3c3c;
  border-color: #3c3c3c;
  color: #6a6a6a !important;
}
body[data-theme="ide"] .wordle-legend-cell.hit { background: #4ec9b0; color: #1e1e1e; }
body[data-theme="ide"] .wordle-legend-cell.present { background: #dcdcaa; color: #1e1e1e; }
body[data-theme="ide"] .wordle-legend-cell.miss { background: #3c3c3c; color: #6a6a6a; }
