/* ============================================
   YUT NORI (윷놀이) GAME - SPECIFIC STYLES
   Common styles are in ../css/common.css
   ============================================ */
/* Yut-specific CSS Variables */
:root {
  --board-bg: #f5deb3;
  --board-line: #8b4513;
  --team1-color: #e74c3c;
  --team2-color: #3498db;
  --yut-wood: #deb887;
  --yut-dark: #8b4513;
}
body.theme-light {
  --board-bg: #f5deb3;
  --board-line: #8b4513;
}
/* ============================================
   PLAYER CARD - Yut-specific styles only
   Base styles inherited from common.css
   ============================================ */
/* Team piece indicators */
.player-card .piece-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
}
.player-card .piece-indicator.team1 {
  background: var(--team1-color);
  border: 2px solid #c0392b;
}
.player-card .piece-indicator.team2 {
  background: var(--team2-color);
  border: 2px solid #2980b9;
}
.player-card .pieces-info {
  font-size: 12px;
  color: var(--text-secondary);
}
/* ============================================
   YUT THROW AREA
   ============================================ */
/* 판 위 던지기 버튼 */
.btn-throw-on-board {
  position: absolute;
  top: 73%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 25px;
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: 3px solid #922b21;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  z-index: 100;
}
.btn-throw-on-board:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #c0392b 0%, #922b21 100%);
}
.btn-throw-on-board:disabled {
  background: linear-gradient(135deg, #7f8c8d 0%, #606060 100%);
  border-color: #505050;
  cursor: not-allowed;
  opacity: 0.5;
}
/* 결과 말풍선 */
.yut-result-bubble {
  position: absolute;
  top: 50%;
  left: 75%;
  transform: translate(-50%, -50%);
  z-index: 30;
  animation: bubble-pop 0.3s ease-out;
}
@keyframes bubble-pop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.bubble-content {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  padding: clamp(12px, 3vw, 20px) clamp(20px, 5vw, 35px);
  border-radius: clamp(12px, 3vw, 20px);
  box-shadow: 0 clamp(4px, 1vw, 8px) clamp(15px, 4vw, 30px) rgba(0, 0, 0, 0.3);
  text-align: center;
  border: clamp(2px, 0.5vw, 3px) solid #ddd;
}
.bubble-content .result-text {
  display: block;
  font-size: clamp(24px, 6vw, 36px);
  font-weight: bold;
  color: #2c3e50;
}
.bubble-content .result-value {
  display: block;
  font-size: clamp(12px, 3vw, 18px);
  color: #7f8c8d;
  margin-top: clamp(3px, 0.8vw, 5px);
}
.bubble-tail {
  position: absolute;
  bottom: clamp(-10px, -2vw, -15px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: clamp(10px, 2.5vw, 15px) solid transparent;
  border-right: clamp(10px, 2.5vw, 15px) solid transparent;
  border-top: clamp(10px, 2.5vw, 15px) solid #fff;
  filter: drop-shadow(0 clamp(2px, 0.5vw, 4px) clamp(2px, 0.5vw, 4px) rgba(0, 0, 0, 0.1));
}
/* 남은 이동 표시 (판 위 - 12번과 13번 돌 사이 아랫부분) */
.pending-moves-on-board {
  position: absolute;
  top: 15%;
  left: 48%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 15;
}
.pending-moves-on-board .pending-move {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.yut-area, .yut-controls {
  display: none; /* 더 이상 사용 안함 */
}
.yut-sticks {
  display: flex;
  gap: 8px;
  perspective: 500px;
}
.yut-stick {
  width: 20px;
  height: 70px;
  background: linear-gradient(90deg, var(--yut-wood) 0%, #c4a56a 50%, var(--yut-wood) 100%);
  border-radius: 4px;
  position: relative;
  transition: transform 0.5s ease;
  box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}
.yut-stick.flat {
  background: linear-gradient(90deg, #8b4513 0%, #a0522d 50%, #8b4513 100%);
}
.yut-stick.throwing {
  animation: yut-throw-3d 1s ease-in-out;
}
@keyframes yut-throw-3d {
  0% {
    transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg) translateY(0);
  }
  20% {
    transform: rotateX(180deg) rotateY(45deg) rotateZ(30deg) translateY(-60px) scale(1.1);
  }
  40% {
    transform: rotateX(360deg) rotateY(90deg) rotateZ(-20deg) translateY(-80px) scale(1.15);
  }
  60% {
    transform: rotateX(540deg) rotateY(135deg) rotateZ(15deg) translateY(-50px) scale(1.1);
  }
  80% {
    transform: rotateX(680deg) rotateY(170deg) rotateZ(-5deg) translateY(-20px) scale(1.05);
  }
  100% {
    transform: rotateX(720deg) rotateY(180deg) rotateZ(0deg) translateY(0) scale(1);
  }
}
.yut-result {
  font-size: 20px;
  font-weight: bold;
  color: var(--accent);
  min-height: 28px;
  text-align: center;
}
.btn-throw {
  padding: 10px 25px;
  font-size: 14px;
  font-weight: bold;
}
.btn-throw:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Pending Moves */
.pending-moves {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 5px;
}
.pending-move {
  padding: 6px 14px;
  background: var(--bg-secondary);
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
  border: 2px solid transparent;
}
.pending-move:hover {
  background: var(--accent);
  transform: scale(1.05);
}
.pending-move.selected {
  border-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
}
.pending-move.highlight {
  animation: pulse-highlight 0.8s ease-in-out infinite;
  border-color: #f1c40f;
}
@keyframes pulse-highlight {
  0%, 100% { transform: scale(1); box-shadow: 0 0 5px rgba(241, 196, 15, 0.5); }
  50% { transform: scale(1.05); box-shadow: 0 0 15px rgba(241, 196, 15, 0.8); }
}
.pending-move.do { color: #95a5a6; }
.pending-move.gae { color: #3498db; }
.pending-move.geol { color: #2ecc71; }
.pending-move.yut { color: #f39c12; }
.pending-move.mo { color: #e74c3c; }
.pending-move.backDo { color: #9b59b6; }
/* ============================================
   GAME BOARD - TOP-DOWN VIEW
   ============================================ */
.board-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 500px;
}
.board-3d-wrapper {
  position: relative;
}
#game-board {
  background: linear-gradient(135deg, #e8d4b8 0%, #d4a574 50%, #c4956a 100%);
  border-radius: 8px;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.3),
    0 30px 60px rgba(0, 0, 0, 0.15),
    inset 0 2px 10px rgba(255, 255, 255, 0.1);
  cursor: pointer;
  border: 6px solid #8b5a2b;
}
/* 대기 말 영역 */
.waiting-pieces {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.5vw, 8px);
  padding: clamp(8px, 1vw, 12px);
  background: linear-gradient(145deg, #3a3a4a 0%, #2a2a35 50%, #252530 100%);
  border-radius: 12px;
  z-index: 10;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -2px 5px rgba(0, 0, 0, 0.2);
}
.waiting-pieces.player1 {
  top: 50%;
  transform: translateY(-50%);
  /* 기본 위치: 오른쪽 */
  right: clamp(-80px, calc(-4vw - 20px), -40px);
  left: auto;
}
.waiting-pieces.player2 {
  top: 50%;
  transform: translateY(-50%);
  /* 기본 위치: 왼쪽 */
  left: clamp(-80px, calc(-4vw - 20px), -40px);
  right: auto;
}
/* 위치 클래스 - 게스트(P2)일 때 동적으로 swap */
.waiting-pieces.player1.player2-pos {
  /* P1 컨테이너를 왼쪽으로 이동 */
  left: clamp(-80px, calc(-4vw - 20px), -40px);
  right: auto;
}
.waiting-pieces.player2.player1-pos {
  /* P2 컨테이너를 오른쪽으로 이동 */
  right: clamp(-80px, calc(-4vw - 20px), -40px);
  left: auto;
}
.waiting-piece {
  /* clamp로 대기말 크기도 유동적으로 (넓을때 48px, 좁을때 38px) */
  width: clamp(38px, calc(28px + 1.5vw), 48px);
  height: clamp(38px, calc(28px + 1.5vw), 48px);
  cursor: pointer;
  transition: transform 0.2s, width 0.2s, height 0.2s;
}
.waiting-piece:hover {
  transform: scale(1.15);
}
.waiting-piece.selected {
  filter: drop-shadow(0 0 8px #f1c40f);
  transform: scale(1.2);
}
.waiting-piece.finished {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  opacity: 0.7;
  cursor: default;
  background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}
.waiting-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
/* ============================================
   TUTORIAL
   ============================================ */
.tutorial-content {
  min-height: 350px;
  padding: 20px;
}
.tutorial-step {
  text-align: center;
}
.tutorial-step.hidden {
  display: none;
}
.tutorial-step h3 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--accent);
}
.tutorial-step p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 20px;
}
.tutorial-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 20px auto;
  padding: 15px;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.tutorial-image canvas {
  border-radius: 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
.yut-results-list {
  text-align: left;
  list-style: none;
  padding: 0;
  margin: 15px auto;
  max-width: 400px;
}
.yut-results-list li {
  padding: 10px 15px;
  margin: 6px 0;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
}
.yut-results-list li strong {
  color: var(--accent);
}
.tutorial-tips {
  text-align: left;
  margin-top: 20px;
}
.tutorial-tips .tip {
  padding: 12px 15px;
  margin: 10px 0;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-secondary);
  border-left: 4px solid var(--accent);
}
.tutorial-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid var(--bg-card);
}
.tutorial-progress {
  color: var(--text-secondary);
  font-size: 14px;
}
/* ============================================
   GAME RESULT
   ============================================ */
.game-result {
  text-align: center;
  padding: 20px;
}
.game-result .result-icon {
  font-size: 48px;
  margin-bottom: 15px;
}
.game-result .result-text {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 10px;
}
.game-result .result-text.win {
  color: var(--success);
}
.game-result .result-text.lose {
  color: var(--accent);
}
.rating-change {
  font-size: 18px;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 20px;
  display: inline-block;
  margin-top: 10px;
}
.rating-change.positive {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}
.rating-change.negative {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}
/* ============================================
   RANKING
   ============================================ */
.ranking-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 8px;
}
.ranking-item .rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 12px;
  background: var(--bg-card);
}
.ranking-item .rank.gold {
  background: linear-gradient(135deg, #f1c40f, #f39c12);
  color: #000;
}
.ranking-item .rank.silver {
  background: linear-gradient(135deg, #bdc3c7, #95a5a6);
  color: #000;
}
.ranking-item .rank.bronze {
  background: linear-gradient(135deg, #cd6133, #a0522d);
  color: #fff;
}
.ranking-item .name {
  flex: 1;
  font-weight: 500;
}
.ranking-item .rating {
  color: var(--warning);
  font-weight: bold;
}
/* ============================================
   CHAT
   ============================================ */
.chat-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}
.chat-tab {
  flex: 1;
  padding: 10px 15px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.chat-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.chat-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  font-weight: 500;
}
.participant-count {
  background: var(--accent);
  color: white;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#chat-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}
#chat-content .chat-messages {
  flex: 1;
}
/* Participants List */
.participants-list {
  padding: 10px;
  overflow-y: auto;
  height: 100%;
}
.participant-section {
  margin-bottom: 15px;
}
.participant-section-header {
  font-weight: bold;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 8px;
  color: #ccc;
  font-size: 14px;
}
.participant-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.participant-item {
  display: flex;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  gap: 10px;
}
.participant-item.current-turn {
  background: rgba(108, 92, 231, 0.3);
  border: 1px solid rgba(108, 92, 231, 0.5);
}
.participant-item.waiting {
  opacity: 0.6;
  font-style: italic;
}
.participant-avatar {
  font-size: 24px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.participant-info {
  flex: 1;
}
.participant-name {
  font-weight: bold;
  color: #fff;
  font-size: 14px;
}
.participant-role {
  font-size: 12px;
  color: #aaa;
  margin-top: 2px;
}
.turn-indicator {
  font-size: 18px;
}
.empty-participants {
  text-align: center;
  color: #888;
  padding: 20px;
  font-style: italic;
}
/* ============================================
   RECONNECT OVERLAY
   ============================================ */
#reconnect-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}
#reconnect-overlay.active {
  display: flex;
}
.reconnect-content {
  text-align: center;
  color: white;
  padding: 30px;
  background: rgba(50, 50, 50, 0.9);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}
.reconnect-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #6c5ce7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.reconnect-text {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}
.reconnect-attempt {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 15px;
}
.reconnect-refresh {
  display: none;
  padding: 12px 24px;
  font-size: 16px;
  background: #6c5ce7;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.reconnect-refresh:hover {
  background: #5b4cdb;
}
/* ============================================
   SPECTATOR MODE STYLES
   ============================================ */
.room-item.room-live {
  border: 2px solid #e74c3c;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.05));
}
.room-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-badge {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  animation: live-pulse 1.5s infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
/* ============================================
   PARTICIPANTS LIST
   ============================================ */
.participants-list {
  padding: 10px;
  overflow-y: auto;
  height: 100%;
}
.participant-section {
  margin-bottom: 15px;
}
.participant-section-header {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
}
.participant-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 13px;
}
/* ============================================
   RESPONSIVE
   ============================================ */
/* 1160px, 1024px 대기말 미디어쿼리 제거 - clamp()로 대체됨 */
@media (max-width: 980px) {
  /* 대기말 영역을 보드 위/아래로 이동 */
  .board-container {
    flex-direction: column;
    padding: 5px;
    min-height: auto;
  }
  .board-3d-wrapper {
    order: 2;
  }
  .waiting-pieces {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    flex-direction: row !important;
    justify-content: center;
    width: 100%;
    padding: 5px 12px;
    margin: 3px 0;
  }
  .waiting-pieces.player1 {
    order: 3;  /* 홍팀을 오른쪽으로 */
  }
  .waiting-pieces.player2 {
    order: 1;  /* 청팀을 왼쪽으로 */
  }
  .waiting-label {
    margin-bottom: 0;
    margin-right: 10px;
  }
  .waiting-piece {
    width: 40px;
    height: 40px;
  }
}
@media (max-width: 820px) {
  .yut-area {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px;
  }
  .yut-sticks {
    gap: 6px;
  }
  .yut-stick {
    width: 16px;
    height: 55px;
  }
  .yut-result {
    font-size: 18px;
    min-width: 80px;
  }
  .btn-throw {
    padding: 8px 20px;
    font-size: 13px;
  }
  .pending-moves {
    width: 100%;
  }
  #game-board {
    max-width: calc(100vw - 40px);
  }
  .waiting-piece {
    width: 36px;
    height: 36px;
  }
  /* 결과 말풍선 위치 조정 */
  .yut-result-bubble {
    top: 40%;
  }
  /* 던지기 버튼 - 보드 위에 유지 (중앙돌 아래) */
  .btn-throw-on-board {
    position: absolute;
    top: 65%;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    font-size: 14px;
  }
  /* 남은 이동 표시 - 12번과 13번 돌 사이 아랫부분 */
  .pending-moves-on-board {
    position: absolute;
    top: 15%;
    left: 48%;
    transform: translateX(-50%);
  }
  .pending-moves-on-board .pending-move {
    padding: 4px 8px;
    font-size: 12px;
  }
}
@media (max-width: 600px) {
  .player-card {
    min-width: 110px;
    padding: 6px 8px;
  }
  .player-card .name {
    font-size: 12px;
  }
  .player-card .pieces-info {
    font-size: 11px;
  }
  .yut-stick {
    width: 14px;
    height: 50px;
  }
  .pending-move {
    padding: 5px 10px;
    font-size: 12px;
  }
  .tutorial-step h3 {
    font-size: 20px;
  }
  .tutorial-step p {
    font-size: 14px;
  }
  .yut-results-list li {
    font-size: 13px;
    padding: 8px 12px;
  }
  .waiting-piece {
    /* 모바일에서는 더 작게 */
    width: clamp(28px, calc(20px + 1.5vw), 36px);
    height: clamp(28px, calc(20px + 1.5vw), 36px);
  }
  .btn-throw-on-board {
    padding: 8px 16px;
    font-size: 14px;
    top: 65%;
    bottom: auto;
  }
  .pending-moves-on-board .pending-move {
    padding: 3px 6px;
    font-size: 11px;
  }
}
/* ============================================
   SPEECH BUBBLE (말풍선) - 장기 스타일
   ============================================ */
.speech-bubble-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2000;
  pointer-events: none;
  display: none;
}
.speech-bubble-container.active {
  display: block;
  animation: bubble-appear 0.3s ease-out forwards;
}
.speech-bubble-container .speech-bubble {
  position: relative;
  background: #fff;
  border: 4px solid #333;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  padding: 25px 40px;
  font-size: 32px;
  font-weight: bold;
  color: #333;
  text-align: center;
  box-shadow: 4px 4px 0 #333, 8px 8px 15px rgba(0, 0, 0, 0.3);
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  min-width: 150px;
}
.speech-bubble-container .speech-bubble::before {
  content: '';
  position: absolute;
  top: -15px;
  left: 20%;
  width: 30px;
  height: 30px;
  background: #fff;
  border: 4px solid #333;
  border-radius: 50%;
  border-bottom: none;
  z-index: -1;
}
.speech-bubble-container .speech-bubble::after {
  content: '';
  position: absolute;
  top: -10px;
  right: 25%;
  width: 25px;
  height: 25px;
  background: #fff;
  border: 4px solid #333;
  border-radius: 50%;
  border-bottom: none;
  z-index: -1;
}
.speech-bubble-container .speech-bubble .cloud-bump-1 {
  position: absolute;
  top: -12px;
  left: 45%;
  width: 35px;
  height: 35px;
  background: #fff;
  border: 4px solid #333;
  border-radius: 50%;
  border-bottom: none;
  z-index: -1;
}
.speech-bubble-container .speech-bubble .cloud-bump-2 {
  position: absolute;
  bottom: -8px;
  left: 30%;
  width: 20px;
  height: 20px;
  background: #fff;
  border: 4px solid #333;
  border-radius: 50%;
  border-top: none;
}
.speech-bubble-container .speech-bubble .cloud-bump-3 {
  position: absolute;
  bottom: -10px;
  right: 35%;
  width: 25px;
  height: 25px;
  background: #fff;
  border: 4px solid #333;
  border-radius: 50%;
  border-top: none;
}
/* Capture - Red/Orange */
.speech-bubble-container .speech-bubble.capture {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
  border-color: #e74c3c;
  color: #c0392b;
  box-shadow: 4px 4px 0 #e74c3c, 8px 8px 20px rgba(231, 76, 60, 0.4);
}
.speech-bubble-container .speech-bubble.capture::before,
.speech-bubble-container .speech-bubble.capture::after,
.speech-bubble-container .speech-bubble.capture .cloud-bump-1,
.speech-bubble-container .speech-bubble.capture .cloud-bump-2,
.speech-bubble-container .speech-bubble.capture .cloud-bump-3 {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
  border-color: #e74c3c;
}
/* Finish - Green/Teal */
.speech-bubble-container .speech-bubble.finish {
  background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
  border-color: #27ae60;
  color: #1e8449;
  box-shadow: 4px 4px 0 #27ae60, 8px 8px 20px rgba(39, 174, 96, 0.4);
}
.speech-bubble-container .speech-bubble.finish::before,
.speech-bubble-container .speech-bubble.finish::after,
.speech-bubble-container .speech-bubble.finish .cloud-bump-1,
.speech-bubble-container .speech-bubble.finish .cloud-bump-2,
.speech-bubble-container .speech-bubble.finish .cloud-bump-3 {
  background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
  border-color: #27ae60;
}
/* Win - Gold */
.speech-bubble-container .speech-bubble.win {
  background: linear-gradient(135deg, #fffff0 0%, #fff8dc 100%);
  border-color: #daa520;
  color: #b8860b;
  box-shadow: 4px 4px 0 #daa520, 8px 8px 20px rgba(218, 165, 32, 0.4);
  font-size: 36px;
}
.speech-bubble-container .speech-bubble.win::before,
.speech-bubble-container .speech-bubble.win::after,
.speech-bubble-container .speech-bubble.win .cloud-bump-1,
.speech-bubble-container .speech-bubble.win .cloud-bump-2,
.speech-bubble-container .speech-bubble.win .cloud-bump-3 {
  background: linear-gradient(135deg, #fffff0 0%, #fff8dc 100%);
  border-color: #daa520;
}
@keyframes bubble-appear {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.1); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
/* Emoji style */
.speech-bubble-container .speech-bubble .emoji {
  font-size: 1.2em;
  margin-right: 8px;
}
/* 방식 7: 갈림길 선택은 보드 하이라이트로 처리 (모달 CSS 제거됨) */

/* Responsive Ads */
@media (max-width: 768px) {
  .ad-pc-only { display: none !important; }
}
@media (min-width: 769px) {
  .ad-mobile-only { display: none !important; }
}

/* Ad Lobby Center */
.ad-lobby {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

/* 게임방 모바일 하단 광고 320x50 (스크롤) */
.ad-mobile-fixed {
  position: static;
  margin: 10px auto;
  width: 320px;
  height: 50px;
}

.ad-mobile-fixed.hidden {
  display: none;
}

/* ============================================
   SIDEBAR TAB (탭 기반 통합 사이드바)
   ============================================ */
.sidebar {
  padding: 1px;
  gap: 1px;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1px;
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.sidebar-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-tab.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  margin-bottom: -1px;
}

.sidebar-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  min-height: 0;
}

#sidebar-chat-content .chat-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: var(--bg-card);
  border-radius: 1px;
  overflow: hidden;
  min-height: 0;
}

#sidebar-chat-content .chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

#sidebar-chat-content .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1px;
  min-height: 150px;
}

#sidebar-chat-content .game-controls {
  padding: 10px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

#sidebar-chat-content .game-controls .btn {
  flex: 1;
  min-width: 80px;
}

.sidebar .ad-sidebar {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  justify-content: center;
}

@media (max-width: 820px) {
  .sidebar-tabs {
    display: none;
  }
}

/* ============================================
   GUIDE SLIDE PANEL (SEO 가이드)
   ============================================ */

/* Overlay */
.guide-slide-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.guide-slide-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Slide Panel */
.guide-slide-panel {
  position: fixed;
  top: 0;
  right: -450px;
  width: 450px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-secondary);
  z-index: 9999;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.guide-slide-panel.active {
  right: 0;
}

/* Header */
.guide-slide-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.guide-slide-header h2 {
  margin: 0;
  font-size: 18px;
  color: var(--text-primary);
}

.guide-slide-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.guide-slide-close:hover {
  color: var(--accent);
}

/* Content */
.guide-slide-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.guide-article {
  color: var(--text-primary);
}

/* Sections */
.guide-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.guide-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.guide-section h3 {
  font-size: 16px;
  color: var(--accent);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-section p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

/* Definition Lists */
.guide-definition-list {
  margin: 0;
}

.guide-definition-list dt {
  font-weight: bold;
  color: var(--text-primary);
  font-size: 14px;
  margin-top: 10px;
}

.guide-definition-list dt:first-child {
  margin-top: 0;
}

.guide-definition-list dd {
  margin: 4px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Tips List */
.guide-tips-list {
  margin: 0;
  padding-left: 20px;
}

.guide-tips-list li {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.guide-tips-list li:last-child {
  margin-bottom: 0;
}

/* FAQ List */
.guide-faq-list {
  margin: 0;
}

.guide-faq-list dt {
  font-weight: bold;
  color: var(--text-primary);
  font-size: 14px;
  margin-top: 12px;
}

.guide-faq-list dt:first-child {
  margin-top: 0;
}

.guide-faq-list dd {
  margin: 6px 0 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 12px;
  border-left: 2px solid var(--accent);
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .guide-slide-panel {
    width: 100%;
    max-width: 100%;
    right: -100%;
  }

  .guide-slide-panel.active {
    right: 0;
  }

  .guide-slide-header {
    padding: 14px 16px;
  }

  .guide-slide-header h2 {
    font-size: 16px;
  }

  .guide-slide-content {
    padding: 16px;
  }

  .guide-section h3 {
    font-size: 15px;
  }
}
