/* 기본 */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #eef2f8;
  color: #1e2a38;
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* 상단 정보줄 */
#topBar {
  position: fixed;
  top: 12px;
  left: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(30, 50, 78, 0.13);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(30, 50, 78, 0.09);
  backdrop-filter: blur(4px);
}

#roundInfo {
  font-weight: 700;
  color: #3d6b9c;
}

#turnOwner {
  font-weight: 700;
}

#turnMsg {
  color: #5f7085;
  font-size: 14px;
}

/* 오른쪽 패널 */
#sidePanel {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 268px;
  max-height: calc(100% - 140px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#scoreBoard,
#logBox {
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(30, 50, 78, 0.13);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(30, 50, 78, 0.09);
  padding: 10px 12px;
}

#logBox {
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
}

.panelTitle {
  font-size: 12px;
  letter-spacing: 1px;
  color: #8494a6;
  margin-bottom: 8px;
}

.scoreRow {
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
}

.scoreRow.isTurn {
  background: rgba(70, 140, 230, 0.14);
}

.scoreRow.isWinner {
  background: rgba(240, 175, 40, 0.22);
}

.scoreName {
  font-weight: 700;
}

/* 자리 주인 표시 — 나 / 봇 */
.seatTag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #6d7d90;
  background: rgba(30, 50, 78, 0.09);
  vertical-align: middle;
}

.seatTag.isMe {
  color: #1f5fbf;
  background: rgba(70, 140, 230, 0.18);
}

.scoreTotal {
  font-weight: 700;
  font-size: 18px;
}

.scoreSub {
  grid-column: 1 / -1;
  font-size: 12px;
  color: #6d7d90;
}

.logLine {
  border-bottom: 1px solid rgba(30, 50, 78, 0.08);
  padding: 3px 0;
}

.logRound {
  color: #93a2b3;
  font-size: 11px;
  margin-right: 4px;
}

/* 왼쪽 버튼 열 (손패를 가리지 않도록 세로로 세움) */
#actionBar {
  position: fixed;
  left: 16px;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 138px;
}

.actionBtn {
  padding: 9px 14px;
  border-radius: 10px;
  background: #ffffff;
  color: #24313f;
  border: 1px solid rgba(30, 50, 78, 0.16);
  box-shadow: 0 2px 6px rgba(30, 50, 78, 0.1);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.12s, transform 0.08s;
}

.actionBtn:hover {
  background: #e5edf7;
}

.actionBtn:active {
  transform: translateY(1px);
}

.actionBtn.isActive {
  background: #3f7fc4;
  border-color: #2c68a8;
  color: #ffffff;
}

.actionBtn.ghost {
  background: rgba(30, 50, 78, 0.05);
  box-shadow: none;
}

.actionBtn.wide {
  min-width: 96px;
  text-align: center;
}

/* 설명창 */
#tooltip {
  position: fixed;
  display: none;
  max-width: 320px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.97);
  color: #1e2a38;
  border: 1px solid rgba(30, 50, 78, 0.18);
  border-radius: 9px;
  box-shadow: 0 4px 14px rgba(30, 50, 78, 0.16);
  font-size: 13px;
  line-height: 1.5;
  pointer-events: none;
  z-index: 20;
}

/* 모달 */
#modalLayer {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(225, 232, 242, 0.78);
  z-index: 30;
}

#modalBox {
  width: min(620px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid rgba(30, 50, 78, 0.14);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(30, 50, 78, 0.22);
  padding: 22px 24px;
}

#modalTitle {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}

#modalBody {
  font-size: 14px;
  line-height: 1.7;
  color: #3b4a5c;
}

#modalFoot {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.modalRow {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ruleList {
  padding-left: 18px;
  margin: 0;
}

.ruleList li {
  margin-bottom: 8px;
}

.chipRow {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.chip {
  padding: 4px 9px;
  border: 1px solid rgba(30, 50, 78, 0.3);
  border-radius: 999px;
  font-size: 12px;
}

.chipChar {
  border-color: #b3902f;
  color: #8a6d16;
}

.dim {
  color: #6d7d90;
  font-size: 13px;
}
