/* 허수아비 겨룸 패 · 방(榜) 게시판 (public/js/ranking.js)
   패: 처마 끝에 매단 반닫이 나무패(먹빛 느티 + 놋쇠 못), 가는 향이 타 들어가며 30초를 센다 (붉은 점 = 10초, 방에 오를 수 있는 때).
   방: 기와 얹은 나무 게시판에 풀칠해 붙인 한지 한 장. 장원 셋은 시권(試券)에 치던 붉은 관주(貫珠)로. */

/* ───────── 겨룸 패 ───────── */
#dps-tag { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 6; pointer-events: none !important; width: 252px; transition: opacity 0.6s; }
#dps-tag.dt-fade { opacity: 0; }
#dps-tag .dt-cord { height: 10px; margin: 0 auto; width: 120px;
  background: linear-gradient(60deg, transparent 46%, #8a2a1c 47% 53%, transparent 54%) left / 50% 100% no-repeat,
              linear-gradient(-60deg, transparent 46%, #8a2a1c 47% 53%, transparent 54%) right / 50% 100% no-repeat; }
#dps-tag .dt-body { position: relative; padding: 6px 14px 7px; color: #ecdcb6; text-align: center;
  background: url("../ui/tex_bandaji.png") center / 220px, #2a1a10;
  border: 1px solid #0e0805; border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(201,162,79,0.55), inset 0 0 14px rgba(0,0,0,0.75), 0 6px 16px rgba(0,0,0,0.65); }
#dps-tag .dt-body::before, #dps-tag .dt-body::after { content: ''; position: absolute; top: 5px; width: 6px; height: 6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f3d68a, #9a7428 70%, #4a3410); box-shadow: 0 1px 1px #000; }
#dps-tag .dt-body::before { left: 6px; } #dps-tag .dt-body::after { right: 6px; }
.dt-head { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: #c8b48a; }
.dt-seal { font-family: var(--title); font-size: 11px; line-height: 1; padding: 2px 3px; color: #f3dcc4; background: #8e2a22; border: 1px solid #5a120c; transform: rotate(-4deg); }
.dt-title { font-family: var(--title); letter-spacing: 2px; color: #e8c27a; font-size: 13px; }
.dt-state { color: #b8a27a; font-size: 11px; }
.dt-state::before { content: '· '; }
.dt-big { font-family: var(--title); color: #ffe2a0; line-height: 1.05; text-shadow: 0 1px 0 #000, 0 0 10px rgba(255,190,90,0.25); margin-top: 1px; }
.dt-big small { font-size: 12px; color: #c8b48a; margin-right: 6px; letter-spacing: 1px; }
.dt-big b { font-weight: 400; font-size: 30px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.dt-sub { display: flex; justify-content: space-between; font-size: 11.5px; color: #d0bc90; margin-top: 1px; font-variant-numeric: tabular-nums; }
/* 향: 타 들어간 만큼 재가 되고 끝에 불씨 */
.dt-incense { position: relative; height: 4px; margin: 5px 2px 1px; background: #6a5a3a; border-radius: 2px; box-shadow: inset 0 1px 1px rgba(0,0,0,0.6); }
.dt-burn { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: linear-gradient(90deg, #8f8a80, #bdb6a8); transition: width 0.25s linear; }
.dt-burn::after { content: ''; position: absolute; right: -2px; top: -1px; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle, #ffd890 0 30%, #ff6a2a 60%, rgba(255,80,20,0) 72%); }
.dt-done .dt-burn::after { display: none; }
.dt-min { position: absolute; top: -2px; width: 3px; height: 8px; margin-left: -1px; background: #b8281c; border-radius: 1px; }
#dps-tag.dt-ok .dt-min { background: #d8b45a; }
.dt-res { font-size: 12px; color: #e8d8b0; margin-top: 4px; line-height: 1.35; }
.dt-res:empty { display: none; }
.dt-done .dt-big b { color: #f0e0c0; }
.dt-new .dt-big b { color: #ffd77a; }
.dt-stamp { display: inline-block; font-family: var(--title); font-size: 14px; line-height: 1; padding: 3px 4px; margin-right: 6px; vertical-align: -2px;
  color: #f7e4cc; background: #a3281c; border: 1px solid #5a120c; box-shadow: inset 0 0 0 2px rgba(255,210,180,0.3); transform: rotate(-6deg); animation: dt-stamp 0.45s ease-out; }
@keyframes dt-stamp { 0% { transform: scale(2.4) rotate(-14deg); opacity: 0; } 70% { transform: scale(0.92) rotate(-5deg); opacity: 1; } 100% { transform: scale(1) rotate(-6deg); } }
/* 폰: 위쪽은 단추 줄이라 아래 가운데(말 입력 위)에 매단다 */
body.phone #dps-tag { top: auto; bottom: 44px; width: 232px; }
body.phone #dps-tag .dt-cord { display: none; }
body.phone #dps-tag .dt-body { padding: 4px 10px 5px; }
body.phone #dps-tag .dt-big b { font-size: 22px; }
/* 폰 세로: 아래는 조이스틱·기술 단추 → 말 입력 줄 바로 위 (game.css body.phone.portrait #chatbox bottom 236px) */
body.phone.portrait #dps-tag { bottom: 284px; }
@media (max-width: 520px) { .rk-foot { font-size: 10px; text-align: left; } }

/* ───────── 방(榜) ───────── */
#panel-rank { left: 50%; top: 56px; transform: translateX(-50%); width: 600px; max-width: calc(100vw - 16px); max-height: calc(100vh - 80px);
  padding: 0; overflow: visible; display: flex; flex-direction: column; color: var(--ink); }
#panel-rank.hidden { display: none !important; }
/* 기와 얹은 지붕 뚜껑 */
.rk-roof { flex: none; height: 22px; margin: 0 -14px -2px; position: relative; z-index: 1;
  background: repeating-linear-gradient(90deg, #2c2a2a 0 9px, #46423e 9px 11px, #232120 11px 18px), #2c2a2a;
  clip-path: polygon(0 100%, 4% 18%, 12% 0, 88% 0, 96% 18%, 100% 100%);
  box-shadow: 0 3px 0 #120c08; }
.rk-roof::after { content: ''; position: absolute; left: 3%; right: 3%; bottom: 0; height: 5px; background: repeating-linear-gradient(90deg, #6a645c 0 6px, #3a3632 6px 9px); clip-path: inherit; }
/* 나무 판 + 풀칠한 한지 */
.rk-sheet { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative;
  border: 16px solid transparent; border-image: url("../ui/frame_bandaji.png") 58 stretch;
  background: url("../ui/tex_hanji.png") center / 340px, #e6d8b8; background-clip: padding-box;
  padding: 8px 12px 6px; box-shadow: 0 14px 44px rgba(0,0,0,0.75), inset 0 0 26px rgba(120,84,40,0.35); }
.rk-sheet::before, .rk-sheet::after { content: ''; position: absolute; width: 34px; height: 26px; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(250,240,214,0.55), rgba(196,170,120,0.18) 60%, transparent 72%); }   /* 풀 자국 */
.rk-sheet::before { left: -2px; top: -2px; } .rk-sheet::after { right: -2px; bottom: -2px; }
.rk-head { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; border-bottom: 2px solid rgba(60,36,20,0.6); }
.rk-bang { flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-family: var(--title); font-size: 34px; line-height: 1;
  color: #f6e0c8; background: #9a2a1e; border: 2px solid #5e140d; box-shadow: inset 0 0 0 2px rgba(255,214,186,0.35), 1px 1px 0 rgba(0,0,0,0.25); transform: rotate(-3deg); border-radius: 3px; }
.rk-ttl { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rk-name { font-family: var(--title); font-weight: 400; font-size: 24px; letter-spacing: 6px; color: #2a1a10; line-height: 1.1; }
.rk-sub { font-size: 12px; color: var(--ink2); }
.rk-x { align-self: flex-start; background: none; border: none; color: var(--ink2); font-size: 17px; padding: 2px 4px; }
.rk-x:hover { color: var(--red); }
/* 탭: 나무 패 두 장 */
.rk-tabs { display: flex; gap: 6px; margin: 8px 0 6px; }
.rk-tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 14px 3px 8px; font-family: var(--title); font-size: 15px; letter-spacing: 2px;
  color: #e0c890; background: url("../ui/tex_bandaji.png") center / 200px, #3a2416; border: 1px solid #1a0e08; border-radius: 2px 2px 0 0;
  box-shadow: inset 0 0 0 1px rgba(201,162,79,0.35), 0 2px 3px rgba(0,0,0,0.35); filter: brightness(0.75); touch-action: manipulation; }
.rk-tabs button i { font-style: normal; font-size: 13px; padding: 1px 3px; line-height: 1.1; color: #2a0806; background: #b8944a; border-radius: 2px; }
.rk-tabs button.on { filter: none; color: #ffe2a0; box-shadow: inset 0 0 0 1px #c9a24f, 0 0 0 1px #2a0806, 0 3px 5px rgba(0,0,0,0.45); }
.rk-tabs button.on i { background: #d8b45a; }
/* 누리 거르개 (자유 · 철). 하나뿐이면(.one) 먹 글씨 이름표처럼 조용히 */
.rk-realm { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 12px; color: var(--ink2); }
.rk-realm-l { font-family: var(--title); letter-spacing: 2px; margin-right: 2px; opacity: 0.75; }
.rk-realm button { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 2px; min-height: 22px; font-size: 12px; color: var(--ink2);
  background: none; border: none; border-bottom: 1px solid rgba(90,60,30,0.35); touch-action: manipulation; }
.rk-realm button i { font-style: normal; font-family: var(--title); font-size: 12px; width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center;
  color: #3a2a1a; border: 1px solid rgba(58,42,26,0.5); border-radius: 50%; }
.rk-realm button.on { color: #2a1a10; border-bottom-color: #8e2a22; }
.rk-realm button.on i { color: #f6e0c8; background: #3a2a1a; }
.rk-realm.one button { cursor: default; border-bottom-color: transparent; }
.rk-realm.one { opacity: 0.8; }
/* 직업 거르개: 낙관 줄 */
.rk-cls { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.rk-cls button { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 3px; min-height: 26px; font-size: 12.5px; color: var(--ink2);
  background: rgba(255,250,236,0.35); border: 1px solid rgba(90,60,30,0.35); border-radius: 2px; touch-action: manipulation; }
.rk-cls button i { font-style: normal; font-family: var(--title); font-size: 13px; width: 19px; height: 19px; display: inline-flex; align-items: center; justify-content: center;
  color: #8e2a22; border: 1px solid rgba(142,42,34,0.65); border-radius: 2px; }
.rk-cls button:hover { background: rgba(142,42,34,0.08); }
.rk-cls button.on { color: #2a1a10; background: rgba(201,162,79,0.3); border-color: #8a6a3a; }
.rk-cls button.on i { color: #f6e0c8; background: #9a2a1e; border-color: #5e140d; }
/* 표: 괘선 친 방목(榜目) */
.rk-wrap { flex: 1; min-height: 60px; overflow: auto; border-top: 2px solid #3a2416; border-bottom: 2px solid #3a2416; -webkit-overflow-scrolling: touch; }
#panel-rank.rk-wait .rk-wrap { opacity: 0.55; }
.rk-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.rk-tbl th { position: sticky; top: 0; z-index: 1; font-family: var(--title); font-weight: 400; font-size: 13px; letter-spacing: 2px; color: #8e2a22; text-align: left;
  padding: 4px 6px; background: #e3d3b0 url("../ui/tex_hanji.png") center / 340px; border-bottom: 1px solid rgba(60,36,20,0.55); }
.rk-tbl td { padding: 4px 6px; border-bottom: 1px dotted rgba(90,60,30,0.5); white-space: nowrap; }
.rk-tbl tr:last-child td { border-bottom: none; }
.rk-tbl .c-r { width: 52px; text-align: right; padding-right: 10px; font-variant-numeric: tabular-nums; }
.rk-tbl td.c-r { position: relative; font-family: var(--title); font-size: 15px; color: var(--ink2); }
.rk-tbl .c-n { font-size: 15px; color: #1e140c; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.rk-tbl .c-c { color: var(--ink2); }
.rk-hz { font-style: normal; font-family: var(--title); font-size: 12px; color: #8e2a22; margin-right: 4px; }
.rk-tbl .c-l, .rk-tbl .c-v { text-align: right; font-variant-numeric: tabular-nums; }
.rk-tbl td.c-v { font-family: var(--title); font-size: 16px; color: #2a1a10; }
.rk-tbl .c-d { text-align: right; color: var(--ink2); font-size: 12px; }
/* 장원 셋: 붉은 관주 (일등은 겹동그라미) */
.rk-gwan { position: absolute; left: 6px; top: 50%; width: 15px; height: 15px; margin-top: -8px; border-radius: 50%; border: 2px solid rgba(178,38,26,0.85); }
.rk-gwan.g1 { box-shadow: 0 0 0 2px rgba(240,226,196,0.9), 0 0 0 4px rgba(178,38,26,0.8); }
.rk-gwan.g3 { border-style: dotted; }
.rk-tbl tr.top td.c-n { font-weight: 700; }
.rk-tbl tr.top td.c-r span { color: #8e2a22; }
.rk-tbl tr.me td { background: rgba(201,162,79,0.28); }
.rk-tbl tr.me td.c-n { color: #6a1a10; }
.rk-tbl tr.me td:first-child { box-shadow: inset 3px 0 0 #9a2a1e; }
.rk-tbl tr.empty td { text-align: center; white-space: normal; padding: 18px 10px; color: var(--ink2); }
/* 내 자리 */
.rk-me { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 4px 8px; background: rgba(201,162,79,0.22); border-left: 3px solid #9a2a1e; font-size: 13.5px; }
.rk-me-l { flex: none; font-family: var(--title); color: #8e2a22; letter-spacing: 2px; }
.rk-me-row { flex: 1; display: flex; gap: 12px; align-items: baseline; min-width: 0; }
.rk-me-row .c-r { font-family: var(--title); } .rk-me-row .c-r::after { content: '위'; font-size: 11px; margin-left: 1px; }
html.lang-en .rk-me-row .c-r::after { content: none; } html.lang-en .rk-me-row .c-r::before { content: '#'; font-size: 11px; margin-right: 1px; }   /* 영어: '3위' 대신 '#3' */
.rk-me-row .c-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-me-row .c-v { font-family: var(--title); font-size: 15px; }
.rk-me-row .c-d, .rk-me-row .rk-gwan { display: none; }
.rk-me-t { color: var(--ink2); }
.rk-foot { margin: 4px 0 0; font-size: 11px; color: var(--ink2); text-align: right; }

/* 터치: 창은 위 가운데 (game.css body.touch .panel), 높이를 넘지 않게 */
body.touch #panel-rank { top: 40px !important; max-height: calc(100vh - 48px); }
body.short #panel-rank .rk-roof { height: 12px; }
body.short #panel-rank .rk-sheet { border-width: 10px; padding: 4px 8px 4px; }
body.short #panel-rank .rk-head { padding-bottom: 3px; }
body.short #panel-rank .rk-bang { width: 32px; height: 32px; font-size: 24px; }
body.short #panel-rank .rk-name { font-size: 19px; letter-spacing: 4px; }
body.short #panel-rank .rk-tabs { margin: 4px 0 3px; }
body.short #panel-rank .rk-tabs button { min-height: 28px; font-size: 14px; }
body.short #panel-rank .rk-cls { margin-bottom: 3px; }
body.short #panel-rank .rk-tbl td { padding: 2px 6px; }
body.short #panel-rank .rk-foot { display: none; }
@media (max-width: 520px) {
  #panel-rank .rk-sub { display: none; }
  .rk-cls button { padding: 2px 4px 2px 3px; font-size: 0; gap: 0; }      /* 좁은 화면: 직업은 낙관 한 글자만 */
  .rk-cls button i { font-size: 13px; }
  .rk-cls button[data-c=""] { font-size: 12px; gap: 3px; padding-right: 6px; }
  .rk-tbl { font-size: 13px; }
  .rk-tbl .c-r { width: 40px; padding-right: 6px; }
  .rk-tbl .c-c { font-size: 0; } .rk-tbl .c-c .rk-hz, .rk-tbl th.c-c { font-size: 12px; }
  .rk-tbl .c-n { max-width: 96px; }
  .rk-tbl td.c-d { font-size: 11px; }
  .rk-tbl th, .rk-tbl td { padding-left: 4px; padding-right: 4px; }
}
