.spell-change{position:absolute;left:calc(var(--safe-l,0px) + 8px);bottom:calc(var(--safe-b,0px) + var(--dock048,140px) + 4px);min-height:44px;min-width:92px;padding:6px 10px;z-index:30;color:#ffdf91;background:#122b3d;border:1px solid #b99a5e;font-family:inherit}
.spell-picker{position:fixed;left:calc(var(--safe-l,0px) + 8px);bottom:calc(var(--safe-b,0px) + var(--dock048,140px) + 50px);width:min(400px,calc(100vw - 32px));max-height:calc(100vh - var(--safe-t,0px) - var(--safe-b,0px) - var(--dock048,140px) - 66px);overflow:auto;z-index:90;display:flex;flex-direction:column;gap:8px;padding:12px;color:#fff1c7;background:#122637;border:2px solid #c7a460;box-sizing:border-box}.spell-picker[hidden]{display:none}.spell-picker button{font-family:inherit;min-height:44px;padding:8px;text-align:left;white-space:normal;color:#fff1c7;background:#213c50;border:1px solid #8f805a}.spell-picker button:disabled{opacity:.6}
.spell-picker button:has(.spell-art){display:flex;align-items:center;gap:8px}.spell-picker .spell-art{width:40px;height:40px;object-fit:contain;image-rendering:auto;flex-shrink:0}

/* Keep spell selection in one horizontal row below artillery and shield. */
.battle048 #controls .spell-change{left:calc(var(--safe-l,0px) + 7px);bottom:calc(var(--safe-b,0px) + 6px);width:calc(var(--skill-width048) - 14px);min-width:0;height:44px;padding:4px 6px;white-space:nowrap;font-size:12px;box-sizing:border-box}
.battle048 #controls:has(.spell-change:not([hidden])) .skill-controls{bottom:calc(var(--safe-b,0px) + 72px)}
.battle048 #controls:has(.spell-change:not([hidden])) .skill-controls .skill{height:max(44px,calc(var(--dock048) - 98px))}
@media(min-height:451px){.battle048 #controls .spell-change{left:calc(var(--safe-l,0px) + 9px);width:calc(var(--skill-width048) - 18px)}}

/* 20261018: seven race spells fit as a two-column grid; tech badge shows the live unique/legendary bonus. */
.spell-picker{width:min(560px,calc(100vw - 32px));display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;background:var(--c-panel,#1E2933);border:2px solid var(--c-line,#3E4F5C);border-radius:8px;color:var(--c-text,#ECE6D6)}
.spell-picker[hidden]{display:none!important}
.spell-picker>strong{grid-column:1/-1}
.spell-picker>button:last-child{grid-column:1/-1;text-align:center}
.spell-picker button{background:var(--c-panel-2,#26333F);border:1px solid #5B7385;border-radius:6px;color:var(--c-text,#ECE6D6);font-size:12px;line-height:1.3}
.spell-picker button[aria-pressed=true]{border-color:var(--c-accent,#E3B04B);box-shadow:inset 0 0 0 1px var(--c-accent,#E3B04B)}
.spell-picker .spell-tech1018{font-size:11px;color:var(--c-text-2,#A9B3BA)}
.spell-picker .spell-tech1018.on{color:var(--c-g3,#B78BE0)}
.spell-picker button[data-spell-select] .spell-tech1018.on{text-shadow:0 0 6px rgba(183,139,224,.5)}
@media(max-height:450px){.spell-picker{gap:4px;padding:8px}.spell-picker button{min-height:40px;padding:4px 6px}.spell-picker .spell-art{width:32px;height:32px}}
.spell-picker .spell-tech1018.legendary.on{color:var(--c-g4,#EE9A4E);text-shadow:0 0 6px rgba(238,154,78,.5)}
.spell-picker .spell-text1018{display:flex;flex-direction:column;min-width:0;white-space:normal}
.spell-picker .spell-text1018 strong{font-size:13px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.spell-picker .spell-text1018 small{font-size:11px;line-height:1.25;color:var(--c-text-2,#A9B3BA);white-space:normal}
@media(max-height:450px){.spell-picker{grid-template-columns:repeat(3,minmax(0,1fr));width:min(720px,calc(100vw - 32px))}.spell-picker .spell-text1018 strong{font-size:12px}.spell-picker .spell-text1018 small{font-size:10px}}
@media(max-height:450px){.spell-picker>button:last-child{grid-column:span 2}}
