.map-history{box-sizing:border-box;max-width:calc(100% - 16px);width:38rem;max-height:calc(100dvh - 24px);margin:auto;padding:0;overflow:hidden;color:var(--text,#e4d6bf);background:var(--ink-2,#29251f);border:3px double var(--metal-hi,#a59170);font-family:inherit}
.map-history[open]{display:flex;flex-direction:column}
.map-history::backdrop{background:#090910b8}
.map-history>header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:10px 14px;border-bottom:1px solid var(--metal-hi,#a59170)}
.map-history h2,.map-history h3,.map-history h4,.map-history p{margin:0}
.map-history h2{font-size:1.1rem}.map-history h3{font-size:1.08rem}.map-history h4{font-size:1rem}
.map-history button{min-height:44px;min-width:44px;max-width:100%;white-space:normal;font:inherit}
.map-history .history-close{flex:none}
.history-body{overflow:auto;overscroll-behavior:contain;min-height:0;display:block;padding:14px;overflow-wrap:anywhere;line-height:1.5}
.history-body>*+*,.history-detail>*+*{margin-top:12px}
.history-body>h3{margin-top:10px}
.history-detail>h4{margin:16px 0 5px;border-bottom:1px solid var(--metal-lo,#685e55);padding-bottom:4px}
.history-detail>section p{margin-top:3px}
.history-note,.history-list span,.history-evidence small,.history-team small{color:var(--muted,#c9c1b0);font-size:.86rem}
.history-list,.history-team,.history-evidence{list-style:none;margin:0;padding:0}
.history-list li+li{margin-top:8px}
.history-list button{display:grid;gap:4px;width:100%;padding:10px 12px;text-align:left}
.history-team li,.history-evidence li{padding:8px 0;border-bottom:1px solid var(--metal-lo,#685e55)}
.history-evidence small,.history-team small{display:block}
.history-board{display:grid;gap:2px;grid-template-columns:auto repeat(var(--history-cells),minmax(0,1fr));text-align:center;font-size:.8rem}
.history-board>span{display:grid;place-items:center;min-height:22px;background:#262835;color:#ddd6dd}
.history-board>span.marked{color:#f1e1bf;background:#41404b;border:1px solid #93867c}
.history-board>span.mine{color:#15151a;background:#cfb980;font-weight:bold}
.map-history[data-game=seta]{background:#292632;border-color:#9d90a9}
.history-share-actions{display:grid;justify-items:start;gap:4px}
.history-share-actions [role=status]:empty{display:none}
.map-chat-log .map-history-link,.map-dm-log .dm-history-link,.social-dm .dm-history-link{display:block;width:100%;min-height:44px;margin-top:5px;padding:8px 10px;text-align:left;white-space:normal;overflow-wrap:anywhere;border-inline-start:3px solid var(--ex-line,var(--accent))}
.history-dm-actions,.history-dm-controls,.history-dm-controls label{display:grid;gap:8px;min-width:0;justify-items:start}
.history-dm-actions [hidden],.history-dm-controls:empty,.history-dm-note:empty{display:none}
.history-dm-controls select{max-width:100%;min-width:0;min-height:44px;font:inherit}
.history-dm-controls label{max-width:100%}
.map-chat-log .map-history-unavailable{font-size:.875rem;color:var(--ex-muted);margin-top:4px}
.map-dm-log .dm-head{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;overflow-wrap:anywhere}
.map-dm-log .dm-head img{width:28px;height:28px;object-fit:cover;image-rendering:pixelated}
.map-dm-log .dm-head time{color:var(--ex-muted);font-size:.875rem}
.map-dm-input,#dm-input{scroll-margin-block:8px}

/* ==== 2026-11-20 second pass: past records read as a bound ledger (list -> one record) ==== */
.map-history{width:min(46rem,calc(100% - 24px));border:1px solid var(--metal-hi,#a59170);box-shadow:0 0 0 4px var(--ink-2,#29251f),0 0 0 5px var(--metal-lo,#685e55),0 18px 50px #000a}
.map-history[data-game=seta]{box-shadow:0 0 0 4px #292632,0 0 0 5px #6d64a3,0 18px 50px #000a}
.map-history>header{padding:14px 18px;border-bottom:3px double var(--metal-lo,#685e55)}
.map-history h2{font-size:20px;line-height:1.3}
.map-history h2::before{content:"지난 기록";display:block;margin-bottom:2px;font-size:13px;line-height:1.4;letter-spacing:.1em;color:var(--muted,#c9c1b0)}
.map-history .history-close{min-width:72px;padding:0 14px}
.history-body{padding:18px;line-height:1.6}
.history-note{font-size:14px!important;line-height:1.6}
.history-note[role=alert]{padding:8px 12px;color:var(--error,#ffb3a3);border-left:3px solid var(--error,#ffb3a3);background:#0003}
.history-body>.history-note:only-child{padding:28px 12px;text-align:center;border:1px dashed var(--metal-lo,#685e55)}
.history-list{display:grid;gap:8px}
.history-list li+li{margin-top:0}
.history-list button{position:relative;grid-template-columns:minmax(0,1fr);gap:2px;padding:12px 40px 12px 14px;border-left:3px solid var(--accent,#e4c98c)}
.history-list button::after{content:"";position:absolute;right:16px;top:50%;width:8px;height:8px;margin-top:-5px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);opacity:.7}
.history-list strong{font-size:16px;line-height:1.45}
.history-list span{font-size:14px!important;line-height:1.5}
.map-history .history-more{display:block;width:100%;margin-top:12px}
.map-history .history-back{padding:0 14px 0 30px;position:relative}
.map-history .history-back::before{content:"";position:absolute;left:14px;top:50%;width:7px;height:7px;margin-top:-4px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
.history-body>h3{margin-top:14px;font-size:20px;line-height:1.35;outline:0}
.history-detail>h4{margin:20px 0 8px;padding-bottom:6px;font-size:15px;letter-spacing:.06em;color:var(--accent,#e4c98c)}
.history-detail>section{padding:10px 12px;background:#0003;border-left:3px solid var(--metal-lo,#685e55)}
.history-detail>section+section{margin-top:8px}
.history-team li,.history-evidence li{padding:10px 0}
.history-team li:last-child,.history-evidence li:last-child{border-bottom:0}
.history-evidence small,.history-team small{font-size:14px!important;line-height:1.5;margin-top:2px}
.history-board{font-size:13px;gap:3px;margin-top:8px}
.history-board>span{min-height:28px}
.history-share-actions,.history-dm-actions{padding:10px 12px;border:1px solid var(--metal-lo,#685e55);background:#0002}
.history-share-actions button,.history-dm-actions button{padding:0 14px}
@media(max-width:560px){.history-body{padding:12px}.map-history>header{padding:10px 12px}.map-history h2{font-size:18px}}
