/* =========================================================
   DUO GAME ZONE — 멀티 오목 (om- prefix)
   - lifegame.css의 lg-*/lgm-* 컴포넌트 위에 얹는 오목 전용 스타일
   - styles.css 절대 수정 X
   ========================================================= */

.om-app {
  max-width: 760px;
}

/* ===== 호스트 옵션 (모드/보드/승리조건/타이머) ===== */
.om-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.om-opt {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  padding: 8px 10px;
}
.om-opt-label {
  font-size: 11px;
  color: #9aa7bd;
  margin-bottom: 4px;
}
.om-opt select {
  width: 100%;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  background: rgba(0,0,0,0.30);
  color: #fff;
}
.om-opt select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== 초대 링크 표시 (lobby) ===== */
.om-invite-link-wrap {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--lg-border);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.om-invite-link-label {
  font-size: 11px;
  color: #9aa7bd;
  margin-bottom: 4px;
}
.om-invite-link {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 6px;
  background: rgba(0,0,0,0.30);
  color: #c5cee0;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  cursor: pointer;
  user-select: all;
}
.om-invite-link:focus {
  outline: none;
  border-color: var(--lg-accent);
}

/* ===== 내 슬롯 컨트롤 (lobby) ===== */
.om-myslot {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.om-myslot-label {
  font-size: 11px;
  color: #9aa7bd;
  margin-bottom: 6px;
}
.om-myslot-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.om-myslot-current {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
}
.om-myslot-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.om-myslot-team-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  letter-spacing: 0.5px;
}
.om-myslot-team-tag.team-A { background: rgba(239, 68, 68, 0.85); }
.om-myslot-team-tag.team-B { background: rgba(59, 130, 246, 0.85); }
.om-myslot-team-tag.team-C { background: rgba(34, 197, 94, 0.85); }
.om-myslot-team-tag.team-D { background: rgba(250, 204, 21, 0.9); color: #14080a; }
.om-myslot-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--lg-border-strong);
  border-radius: 8px;
  background: rgba(156,108,255,0.12);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.om-myslot-btn:hover {
  background: rgba(156,108,255,0.25);
  border-color: var(--lg-accent);
}

/* ffa 색 팔레트 */
.om-color-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.om-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.30);
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.om-color-swatch:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.80);
}
.om-color-swatch.taken {
  opacity: 0.30;
  cursor: not-allowed;
}
.om-color-swatch.taken:hover {
  transform: none;
}
.om-color-swatch.mine {
  border: 3px solid #facc15;
  box-shadow: 0 0 14px rgba(250,204,21,0.55), 0 1px 3px rgba(0,0,0,0.5);
  transform: scale(1.08);
}

/* 호스트 자동 재배정 버튼 */
.om-reshuffle-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--lg-border-strong);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  color: #c5cee0;
  cursor: pointer;
  transition: all 0.15s ease;
}
.om-reshuffle-btn:hover {
  background: rgba(250,204,21,0.18);
  border-color: rgba(250,204,21,0.5);
  color: #facc15;
}

/* ===== 플레이어 스트립 (색 인디케이터) ===== */
.om-players-strip { gap: 6px; }
.om-players-strip .lgm-pcard {
  position: relative;
  padding-top: 14px;
}
.om-pcard-color {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.om-pcard-team {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  letter-spacing: 0.5px;
}
.om-pcard-team.team-A { background: rgba(239, 68, 68, 0.85); }
.om-pcard-team.team-B { background: rgba(59, 130, 246, 0.85); }
.om-pcard-team.team-C { background: rgba(34, 197, 94, 0.85); }
.om-pcard-team.team-D { background: rgba(250, 204, 21, 0.9); color: #14080a; }

/* 팀 선택 버튼 (3/4팀 모드) */
.om-team-picker {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.om-team-pick-btn {
  flex: 1; min-width: 60px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.04);
  color: #fff; font-weight: 800; font-size: 12px;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.om-team-pick-btn.team-A { border-color: rgba(239,68,68,0.55); }
.om-team-pick-btn.team-B { border-color: rgba(59,130,246,0.55); }
.om-team-pick-btn.team-C { border-color: rgba(34,197,94,0.55); }
.om-team-pick-btn.team-D { border-color: rgba(250,204,21,0.6); }
.om-team-pick-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.om-team-pick-btn.active {
  background: rgba(255,255,255,0.18);
  opacity: 0.6;
  cursor: default;
}
.om-team-pick-btn.team-A.active { background: rgba(239,68,68,0.4); }
.om-team-pick-btn.team-B.active { background: rgba(59,130,246,0.4); }
.om-team-pick-btn.team-C.active { background: rgba(34,197,94,0.4); }
.om-team-pick-btn.team-D.active { background: rgba(250,204,21,0.4); color: #14080a; }

/* ===== 턴 바 (보드 위) ===== */
.om-turn-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(180deg, #1a2236 0%, #131a2a 100%);
  border: 1px solid var(--lg-border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.om-turn-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}
#omTurnLabel { font-size: 18px; }
#omTurnName.you {
  color: var(--lg-accent-2);
  text-shadow: 0 0 8px rgba(255,108,182,0.4);
}
#omTurnName {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.om-turn-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  flex: 0 0 auto;
  background-size: cover; background-position: center;
  background-color: rgba(140, 160, 220, 0.18);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #14080a;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
}
.om-turn-name-text { line-height: 1; }
@media (max-width: 540px){
  .om-turn-avatar{ width: 18px; height: 18px; font-size: 9px; }
}
.om-turn-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.om-win-chip {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.18);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.4);
}
.om-timer {
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.25);
  border: 2px solid transparent;
  color: var(--lg-info);
  transition: all 0.2s;
}
.om-timer.urgent {
  color: var(--lg-bad);
  border-color: var(--lg-bad);
  background: rgba(248, 113, 113, 0.15);
  animation: om-timer-pulse 0.5s ease-in-out infinite;
  text-shadow: 0 0 8px rgba(248,113,113,0.6);
}
@keyframes om-timer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ===== 보드 (Canvas) ===== */
.om-board-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background:
    radial-gradient(ellipse at top, rgba(156,108,255,0.08) 0%, transparent 50%),
    linear-gradient(155deg, #3a2818 0%, #1f1409 100%);
  border: 1px solid rgba(184, 138, 71, 0.35);
  border-radius: 16px;
  padding: 14px;
  box-shadow:
    0 12px 36px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,200,140,0.1),
    inset 0 -2px 8px rgba(0,0,0,0.4);
  position: relative;
}
/* 보드 wrap 모서리 골드 빛 */
.om-board-wrap::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 209, 102, 0.15) 50%, transparent 100%);
  pointer-events: none;
  opacity: 0.7;
}
.om-board {
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  display: block;
  touch-action: none;
  user-select: none;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.5),
    inset 0 0 0 2px rgba(184, 138, 71, 0.25),
    inset 0 2px 6px rgba(255,200,140,0.15);
  position: relative;
  z-index: 1;
}
.om-board-hint {
  font-size: 11px;
  color: #9aa7bd;
  text-align: center;
}

/* ===== 결과 화면 ===== */
.om-winner-card {
  background:
    radial-gradient(ellipse at top, rgba(250,204,21,0.25), transparent 60%),
    linear-gradient(135deg, rgba(250,204,21,0.18), rgba(156,108,255,0.18));
  border: 2px solid rgba(250,204,21,0.55);
  border-radius: 18px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(250, 204, 21, 0.2);
  animation: om-winner-in 0.5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes om-winner-in {
  0% { transform: scale(0.7) translateY(20px); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}
.om-winner-card::before {
  content: "";
  position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(250,204,21,0.08) 60deg, transparent 120deg);
  animation: om-winner-rotate 8s linear infinite;
  pointer-events: none;
}
@keyframes om-winner-rotate { to { transform: rotate(360deg); } }
.om-winner-card > * { position: relative; z-index: 1; }
.om-winner-card .om-winner-emoji {
  font-size: 60px;
  margin-bottom: 8px;
  text-shadow: 0 4px 16px rgba(250, 204, 21, 0.6);
  filter: drop-shadow(0 0 16px rgba(250,204,21,0.4));
  animation: om-trophy-bounce 2s ease-in-out infinite;
}
.om-winner-avatar{
  width: 72px; height: 72px;
  border-radius: 50%;
  margin: 4px auto 10px;
  background-size: cover; background-position: center;
  background-color: rgba(140, 160, 220, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 900; color: #14080a;
  border: 3px solid rgba(250, 204, 21, 0.75);
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.55), 0 6px 20px rgba(0,0,0,0.4);
}
.om-winner-card.draw .om-winner-avatar{ display: none; }
@keyframes om-trophy-bounce {
  0%,100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-6px) rotate(-3deg); }
}
.om-winner-card .om-winner-name {
  font-size: 24px;
  font-weight: 900;
  background: linear-gradient(135deg, #facc15, #ff8fc7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.5px;
}
.om-winner-card .om-winner-sub {
  font-size: 13px;
  color: #c5cee0;
  margin-top: 6px;
}
.om-winner-card.draw .om-winner-name {
  background: linear-gradient(135deg, #94a3b8, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.om-winner-card.draw { border-color: rgba(148, 163, 184, 0.45); box-shadow: 0 12px 36px rgba(148, 163, 184, 0.2); }
.om-winner-card.me-won {
  border-color: rgba(250, 204, 21, 0.7);
  box-shadow: 0 12px 40px rgba(250, 204, 21, 0.35), 0 0 24px rgba(250, 204, 21, 0.25);
}
.om-winner-me-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #14080a;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-shadow: none;
  -webkit-background-clip: padding-box;
  background-clip: padding-box;
  vertical-align: middle;
}

/* 승리 모먼트 (전체화면 큰 텍스트) — JS에서 동적 추가 */
.om-moment {
  position: fixed; top: 35%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 64px; font-weight: 900;
  letter-spacing: 4px;
  pointer-events: none; z-index: 2400;
  background: linear-gradient(135deg, #facc15, #ff8fc7, #b794ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 4px 24px rgba(0,0,0,0.6);
  filter: drop-shadow(0 0 24px rgba(250,204,21,0.5));
  animation: om-moment-pop 1.5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes om-moment-pop {
  0% { transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.2) rotate(3deg); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.1) translateY(-20px); opacity: 0; }
}

.om-end-board-wrap {
  display: flex;
  justify-content: center;
  padding: 8px;
  background: var(--lg-card-bg);
  border: 1px solid var(--lg-border);
  border-radius: 14px;
  margin-bottom: 12px;
}

/* ===== 리플레이 컨트롤 ===== */
.om-replay-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.om-replay-row button {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid var(--lg-border-strong);
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.om-replay-row button:hover {
  background: rgba(156,108,255,0.18);
  border-color: var(--lg-accent);
}
.om-replay-row button.primary {
  background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent-2));
  border: none;
  min-width: 90px;
}
.om-replay-step {
  font-size: 13px;
  color: #9aa7bd;
  min-width: 60px;
  text-align: center;
}

/* ===== 모바일 적응 ===== */
@media (max-width: 540px) {
  .om-options { grid-template-columns: repeat(2, 1fr); }
  .om-turn-bar { padding: 8px 10px; }
  .om-turn-info { font-size: 12px; }
  #omTurnLabel { font-size: 16px; }
  .om-timer { font-size: 16px; }
  .om-win-chip { font-size: 10px; padding: 3px 8px; }
}

/* ===== 게임천국 카드 (옵션) ===== */
.gz-card.gz-card-omok {
  background: linear-gradient(135deg, #1f2937 0%, #1a2236 100%);
}
.gz-card.gz-card-omok .gz-card-emoji {
  font-size: 40px;
}

/* ===== 초딩 모드 (특수 카드) ===== */
.om-special-info {
  margin-top: 8px; padding: 10px 12px;
  background: linear-gradient(135deg, rgba(155,89,182,0.18) 0%, rgba(192,132,252,0.10) 100%);
  border: 1px dashed rgba(192,132,252,0.55);
  border-radius: 10px;
}
.om-special-info-title { font-size: 13px; font-weight: 900; color: #c084fc; margin-bottom: 6px; }
.om-special-info-list { font-size: 12px; color: #c8c5d0; margin: 0; padding-left: 18px; line-height: 1.7; }

.om-special-badge {
  background: linear-gradient(135deg, #9b59b6, #c084fc); color: #14080a;
  font-size: 11px; font-weight: 900; padding: 3px 10px; border-radius: 8px;
  box-shadow: 0 0 12px rgba(192,132,252,0.5);
}

.om-card-inventory {
  margin-top: 10px; padding: 10px 12px;
  background: linear-gradient(135deg, rgba(155,89,182,0.12) 0%, rgba(0,0,0,0.4) 100%);
  border: 1px solid rgba(192,132,252,0.4);
  border-radius: 12px;
}
.om-card-inventory-title { font-size: 12px; font-weight: 800; color: #c084fc; margin-bottom: 8px; }
.om-card-slots { display: flex; gap: 8px; }
.om-card {
  flex: 1; min-width: 0; padding: 10px 6px;
  background: linear-gradient(145deg, #2d1b3d 0%, #1a0f24 100%);
  border: 1px solid rgba(192,132,252,0.6);
  border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; transition: all 0.15s;
  color: #fff;
}
.om-card:hover {
  background: linear-gradient(145deg, #c084fc 0%, #9b59b6 100%);
  color: #14080a;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(192,132,252,0.5);
}
.om-card-emoji { font-size: 24px; }
.om-card-name { font-size: 11px; font-weight: 800; }
.om-card-hint { font-size: 9px; color: rgba(255,255,255,0.6); margin-top: 2px; line-height: 1.2; text-align: center; }
.om-card:hover .om-card-hint { color: #14080a; }
.om-card-empty { font-size: 12px; color: #6a6a76; text-align: center; padding: 8px; }
/* 색상 범례 */
.om-card-legend {
  margin-top: 8px; display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 10px; color: #9aa7bd;
  padding-top: 8px; border-top: 1px dashed rgba(192,132,252,0.3);
}
.om-legend-item { display: flex; align-items: center; gap: 4px; }
.om-legend-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid; }
.om-legend-red { border-color: #ff4d6d; background: rgba(255,77,109,0.2); }
.om-legend-blue { border-color: #5fc8ff; background: rgba(95,200,255,0.2); }
.om-legend-gold { border-color: #ffd166; background: rgba(255,209,102,0.2); }
.om-legend-purple { border-color: #c084fc; background: rgba(192,132,252,0.2); }

/* 카드 사용 모드 배너 */
.om-card-mode-banner {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  background: rgba(192,132,252,0.95); color: #14080a;
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 900;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  z-index: 5;
  animation: om-card-mode-pulse 1.2s ease-in-out infinite;
}
.om-card-mode-banner[hidden] { display: none !important; }
@keyframes om-card-mode-pulse { 0%,100% { box-shadow: 0 6px 18px rgba(0,0,0,0.5); } 50% { box-shadow: 0 6px 24px rgba(192,132,252,0.8); } }
.om-card-mode-cancel {
  background: rgba(0,0,0,0.4); border: 1px solid #14080a; color: #14080a;
  border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 800; cursor: pointer;
}
.om-card-mode-cancel:hover { background: #14080a; color: #c084fc; }

/* 짧은 뷰포트 컴팩트 — 보드/HUD 축소 */
@media (max-height: 720px){
  .om-turn-bar{ padding: 6px 10px; }
  .om-turn-info{ font-size: 12px; }
  #omTurnLabel{ font-size: 16px; }
  .om-timer{ font-size: 18px; }
  .om-card-inventory{ padding: 6px 8px; margin-top: 6px; }
  .om-card{ padding: 6px 4px; }
  .om-card-emoji{ font-size: 18px; }
  .om-card-name{ font-size: 10px; }
  .om-card-hint{ font-size: 8px; }
  .om-special-info{ padding: 6px 10px; margin-top: 6px; }
  .om-special-info-list{ font-size: 11px; line-height: 1.5; }
}
@media (max-height: 560px){
  .om-turn-info{ font-size: 11px; }
  .om-card-inventory-title{ font-size: 11px; margin-bottom: 4px; }
  .om-card{ padding: 4px 2px; }
  .om-card-emoji{ font-size: 16px; }
  .om-card-hint{ display: none; }
  .om-card-legend{ display: none; }
}
