/* Overlay only: the arena's rows, divider and commander positions are untouched. */
.cb-history-rail{position:absolute;left:6px;top:82px;bottom:130px;width:52px;z-index:40;display:flex;flex-direction:column;align-items:center;gap:7px;pointer-events:none;color:#f5e6bb}
.cb-history-heading{font-size:10px;line-height:1.3;text-align:center;letter-spacing:1px;text-shadow:0 1px 3px #000;background:#26291fed;border:1px solid #97805b;border-radius:8px;padding:5px 8px}
.cb-history-items{display:flex;flex-direction:column;gap:10px;padding:4px 4px 8px;overflow:auto;scrollbar-width:none;pointer-events:auto;overscroll-behavior:contain}
.cb-history-token{position:relative;flex-shrink:0;display:block;width:43px;height:46px;padding:2px;border:2px solid #67bcb5;border-radius:10px;background:#333c34;box-shadow:0 3px 6px #0009;cursor:pointer;color:#fff}
.cb-history-token.is-enemy{border-color:#d2817d;background:#593c3b}
.cb-history-token:hover,.cb-history-token:focus-visible,.cb-history-token[aria-expanded=true]{outline:2px solid #ffe1a0;outline-offset:1px;filter:brightness(1.14)}
.cb-history-thumb{display:block;overflow:hidden;width:100%;height:100%;border-radius:6px}.cb-history-thumb>.cb-illustration{height:100%}.cb-history-thumb svg{width:100%;height:100%}
.cb-history-token>b{position:absolute;right:-6px;bottom:-5px;background:#352c21;border:1px solid #c3a06e;border-radius:50%;width:20px;height:20px;line-height:18px;font-size:13px;text-shadow:0 1px 2px #000}
.cb-history-token>small{position:absolute;left:-5px;top:-5px;min-width:14px;background:#292c25;border-radius:4px;font-size:9px;padding:1px 3px;color:#fce5aa}
.cb-history-empty{font-size:10px;text-align:center;padding:8px;background:#252b23a6;border-radius:8px}.cb-history-previous{pointer-events:auto;border:1px solid #9d865a;border-radius:7px;color:#f7ddb0;background:#292b21;cursor:pointer;width:38px}
.cb-history-popover{position:fixed;z-index:1500;width:410px;max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px);overflow:auto;padding:14px;border:2px solid #b69a63;border-radius:13px;background:linear-gradient(130deg,#343d32,#20281f);color:#fff3d4;box-shadow:0 12px 38px #0009;font-size:12px}
.cb-history-popover header{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#d4c29c}.cb-history-popover header button{border:0;background:transparent;color:#eee0be;font-size:24px;line-height:1;cursor:pointer;padding:0 3px}.cb-history-popover h3{font-size:16px;margin:6px 0 12px;color:#ffe0a0}
.cb-history-explanation{display:grid;grid-template-columns:128px 22px minmax(0,1fr);align-items:center;gap:8px}.cb-history-source{border:2px solid #c0a569;background:#eadcba;color:#342e22;border-radius:10px;padding:6px;text-align:center;overflow:hidden}.cb-history-source-art{position:relative;width:100%;height:112px;border-radius:6px;overflow:hidden}.cb-history-source-art>.cb-illustration{height:100%}.cb-history-source-art svg{width:100%;height:100%}.cb-history-source>strong{display:block;font-size:12px;margin-top:6px}.cb-history-source>p{font-size:10px;line-height:1.5;margin:6px 0}.cb-history-source>small{font-size:12px;font-weight:700}.cb-history-cost{position:absolute;left:2px;top:2px;border-radius:50%;border:1px solid #b8ebe7;background:#276d75;color:#fff;padding:2px 7px;font-size:16px}.cb-history-arrow{font-size:24px;color:#e4c185}.cb-history-results{display:flex;flex-direction:column;gap:12px}.cb-history-effect{display:flex;align-items:center;gap:9px}.cb-history-target-art{position:relative;display:block;flex:0 0 42px;width:42px;height:48px;border:1px solid #bea370;border-radius:7px}.cb-history-target-art>.cb-illustration{height:100%;border-radius:6px}.cb-history-target-art svg{width:100%;height:100%}.cb-history-target-art>b{position:absolute;bottom:-7px;right:-5px;background:#a53233;border:1px solid #f2b793;border-radius:6px;padding:1px 4px;min-width:23px;text-align:center;font-size:14px;color:#fff}.is-heal .cb-history-target-art>b{background:#39885c}.cb-history-effect>div{min-width:0}.cb-history-effect strong{display:block;font-size:11px;margin:3px 0}.cb-history-effect small{display:block;font-size:10px;line-height:1.5;color:#d2c8ad}.cb-history-effect small b{color:#fff2c2}.cb-history-extra{font-size:11px;line-height:1.6;color:#efdfb7}.cb-history-legacy{border-top:1px solid #6d705e;padding-top:8px;font-size:11px}.cb-history-legacy-note{color:#ccb994;font-size:11px}
.cb-battle-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
@media(min-width:1000px) and (min-height:580px){.cb-tutorial-mode.cb-in-match .cb-tutorial-guide{left:68px;width:clamp(235px,calc(28vw - 50px),330px)}}
@media(max-width:700px){.cb-history-rail{left:2px;top:65px;bottom:120px;width:36px;gap:4px}.cb-history-heading{font-size:8px;padding:3px 5px}.cb-history-items{gap:9px;padding-inline:3px}.cb-history-token{width:30px;height:34px;border-radius:7px}.cb-history-token>b{width:16px;height:16px;line-height:14px;font-size:10px;right:-4px}.cb-history-token>small{font-size:8px;left:-3px}.cb-history-popover{padding:10px;width:350px}.cb-history-explanation{grid-template-columns:108px 17px minmax(0,1fr);gap:6px}.cb-history-source-art{height:92px}.cb-history-target-art{flex-basis:35px;width:35px;height:42px}.cb-history-effect{gap:7px}.cb-history-previous{width:28px}.cb-tutorial-mode .cb-history-rail{top:230px}}

.cb-history-heading{pointer-events:auto;cursor:pointer;flex-shrink:0;color:inherit;font-family:inherit}
.cb-history-heading:focus-visible{outline:2px solid #ffe1a0;outline-offset:2px}
.cb-history-chevron{display:block;font-size:10px;line-height:1;margin-top:3px}
.cb-history-content{display:flex;flex-direction:column;align-items:center;gap:7px;min-height:0;width:100%}
.cb-history-content[hidden]{display:none}
.cb-history-rail.is-collapsed{bottom:auto}
.cb-history-previous{flex-shrink:0;font-size:9px;line-height:1.3;padding:3px 0}
@media(max-width:700px){.cb-history-content{gap:4px}.cb-history-previous{font-size:8px}}

/* Override generic battle button padding so the mobile label stays two lines. */
.cb-root .cb-history-heading{box-sizing:border-box;width:48px;min-width:44px;min-height:44px;padding:5px 3px;font-size:10px;line-height:1.25;letter-spacing:0;white-space:nowrap;touch-action:manipulation}
.cb-root .cb-history-chevron{font-size:9px;line-height:1.2;margin-top:3px}
@media(max-width:700px){.cb-history-rail{width:44px}.cb-root .cb-history-heading{width:44px}}
