/* 냥냥 윷놀이 전용 스타일 (공통은 ../style.css) */

#lobbyButtons { flex-direction: column; }
#lobbyButtons > button { flex: none; width: 100%; }
.mode-row { display: flex; gap: 8px; }
.mode-row button { flex: 1; }
.mode-row select {
  font: inherit;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.center { text-align: center; }

/* 대기실 */
.room-title { margin: 0 0 8px; font-weight: 700; font-size: 1.1rem; text-align: center; }
.room-title small { color: var(--muted); font-weight: 400; }
.seats { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seats li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
  min-height: 52px;
}
.seats li.empty { border-style: dashed; color: var(--muted); justify-content: center; }
.seats li.me { border-color: var(--accent); background: #fff3c4; }
.seats canvas { width: 36px; height: 36px; flex: none; }
.seats .seat-name { font-weight: 700; }
.seats .seat-x { margin-left: auto; padding: 2px 8px; font-size: 0.8rem; }
#hostControls { margin-top: 12px; }
.seats li[data-seat] { cursor: pointer; }
.seats small { color: var(--muted); }

/* 캐릭터 고르기 */
.pick-title { text-align: center; font-weight: 700; margin: 4px 0 8px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.picker button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.picker button canvas { width: 44px; height: 44px; }
.picker button small { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.picker button.on { border-color: var(--accent); background: #fff3c4; box-shadow: 0 0 0 3px rgba(181, 72, 45, 0.15); }
.picker button:disabled { opacity: 0.35; }

/* 게임 */
.yut-players { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 14px; }
.yp {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  transition: all 0.2s;
}
.yp.active { border-color: var(--accent); background: #fff3c4; box-shadow: 0 0 0 3px rgba(181, 72, 45, 0.15); }
.yp canvas { width: 34px; height: 34px; flex: none; }
.yp > div { min-width: 0; }
.yp .yp-name { font-weight: 700; font-size: 0.9rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yp .yp-info { white-space: nowrap; }
.yp .yp-info { font-size: 0.8rem; color: var(--muted); }
.yp .yp-info b { color: var(--text); }

#board { cursor: pointer; touch-action: manipulation; }

.throw-area { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }

/* 윷가락: 둥근 등(round)과 평평한 배(flat). 표시된 가락(첫 번째)은 빽도용 */
.sticks { display: flex; gap: 6px; perspective: 400px; }
.stick {
  display: block;
  width: 16px;
  height: 64px;
  border-radius: 8px;
  background: linear-gradient(90deg, #a86a33, #d9a066, #a86a33);
  border: 2px solid #6b4220;
  transition: transform 0.2s;
}
.stick.flat {
  background: #f3dfb8;
  background-image: repeating-linear-gradient(0deg, transparent 0 10px, rgba(107, 66, 32, 0.35) 10px 12px);
}
/* 뒷도(✕)·뒷뒷도(✕✕) 표시: 규칙을 켠 경우에만 */
.sticks.mark-b .stick:nth-child(1).flat::after,
.sticks.mark-bb .stick:nth-child(2).flat::after {
  content: '✕';
  display: block;
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  line-height: 1.1;
  color: #c0392b;
  font-weight: 900;
}
.sticks.mark-bb .stick:nth-child(2).flat::after { content: '✕\A✕'; white-space: pre; margin-top: 14px; }

/* 대기실 규칙 스위치 */
.rule-box { display: flex; flex-direction: column; gap: 4px; margin: 12px 0 0; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 12px; }
.rule-box b { font-size: 0.9rem; }
.rule-box label { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; }
.rule-box small { color: var(--muted); }
.sticks.tossing .stick { animation: toss 0.7s ease-out; }
.sticks.tossing .stick:nth-child(2) { animation-delay: 0.05s; }
.sticks.tossing .stick:nth-child(3) { animation-delay: 0.1s; }
.sticks.tossing .stick:nth-child(4) { animation-delay: 0.15s; }
@keyframes toss {
  0% { transform: translateY(0) rotateX(0); }
  40% { transform: translateY(-46px) rotateX(540deg); }
  100% { transform: translateY(0) rotateX(1080deg); }
}

.results { display: flex; gap: 6px; flex-wrap: wrap; min-height: 40px; align-items: center; }
.results button {
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
}
.results button.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
.results .more { color: var(--muted); font-size: 0.9rem; }

.yut-buttons { gap: 10px; flex-wrap: wrap; }
.yut-buttons .roll { min-width: 150px; }
button.new-piece { background: #2d6a4f; border-color: #2d6a4f; color: #fff; box-shadow: 0 4px 12px rgba(45, 106, 79, 0.35); }
button.new-piece.sel { outline: 3px solid #ffd23f; }
