/* Runebound Mage of Aetheria: base styles. Fonts are system fonts so the game works offline. */
:root {
  --color-fire: #FF2A42;
  --color-earth: #06D6A0;
  --color-water: #118AB2;
  --color-air: #56CFE1;
  --color-light: #FFD166;
  --color-dark: #8338EC;
  --bg: #0d0f18;
  --panel: rgba(20, 24, 42, 0.88);
  --panel-line: #3f466e;
  --text: #e9ecf8;
  --muted: #9aa3c7;
  --gold: #FFD166;
  --danger: #e0475b;
  --font-display: "Cinzel", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --emoji-size: 32px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-body); }
[hidden] { display: none !important; }

#app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
/* Painted backgrounds (backgrounds.css): the picture stays put while a long screen scrolls, and a soft dark veil keeps
   text readable. The veil is on #app only, so the Gallery thumbnails and the full-window preview show the picture as painted. */
#app.bg { background-attachment: fixed; }
#app { --veil-top: 0.30; --veil-bottom: 0.46; }
#app::before { z-index: 0; background: linear-gradient(180deg, rgba(6,8,18,var(--veil-top)) 0%, rgba(6,8,18,var(--veil-bottom)) 100%); }
/* The bright paintings get a stronger veil: the library (small hint text on the page itself), the pillars, the garden and the moor. */
#app.bg-akashic { --veil-top: 0.58; --veil-bottom: 0.70; }
#app.bg-secret { --veil-top: 0.46; --veil-bottom: 0.58; }
#app.bg-training { --veil-top: 0.42; --veil-bottom: 0.56; }
#app.bg-act0 { --veil-top: 0.50; --veil-bottom: 0.62; }
/* Hints that sit straight on the picture (no panel behind them): lighter text with a soft shadow. */
#screen-incarnations > .hint, #screen-modes > .hint, #screen-tutorial > .hint, #map-subtitle, #screen-akashic > .hint,
#screen-akashic .tab-head .hint, .bg-preview-bar .hint { color: #d4daf3; text-shadow: 0 1px 2px rgba(0,0,0,0.9), 0 0 8px rgba(0,0,0,0.65); }
.screen { position: relative; z-index: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 16px 40px; flex: 1; }
.screen:focus-within { outline: none; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: 0.04em; }
h1:focus, h2:focus { outline: none; }
.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 0 16px; }
.error { color: var(--danger); font-size: 0.9rem; margin: 0; }

/* Title */
#screen-title { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 36px; }
.game-title { font-size: clamp(2.2rem, 8vw, 4rem); line-height: 1.05; text-shadow: 0 0 24px rgba(255, 209, 102, 0.35); }
.game-title span { display: block; font-size: 0.4em; letter-spacing: 0.3em; color: var(--gold); margin-top: 10px; }
.menu { display: flex; flex-direction: column; gap: 12px; width: min(280px, 100%); }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; color: var(--text); background: rgba(40, 46, 78, 0.9);
  border: 1px solid var(--panel-line); border-radius: 10px; padding: 12px 18px; cursor: pointer;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.btn:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.btn:focus-visible, .choice:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #8a5a14, #5a3a0a); border-color: var(--gold); }
.btn-danger { border-color: var(--danger); }
.btn-small { padding: 7px 12px; font-size: 0.85rem; }

.screen-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }

/* Incarnation slots */
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.slot { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.slot-empty { border-style: dashed; justify-content: center; }
.slot-label { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em; }
.slot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-top: 6px; }
.slot-actions .btn { width: 100%; min-height: 40px; padding: 8px 6px; font-size: 0.9rem; text-align: center; white-space: nowrap; }
.slot .hint { margin: 0; }

/* Emoji and sprite */
/* One emoji is a square; a pair (Pyeolip's fox + sparkles) is two squares side by side. Width follows the content, so a pair never spills out of its box. */
.emoji { display: inline-flex; height: var(--emoji-size); min-width: var(--emoji-size); flex: none; gap: 2px; align-items: center; justify-content: center; font-size: calc(var(--emoji-size) * 0.8); line-height: 1; }
.emoji img { width: var(--emoji-size); height: var(--emoji-size); flex: none; display: block; }
.sprite { display: inline-flex; align-items: center; gap: 2px; }
.sprite-large { padding: 12px 20px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; }

/* Character Creation */
.creation { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 24px; margin-top: 16px; }
.creation-preview { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.creation-preview .sprite { align-self: center; }
.creation-options { display: flex; flex-direction: column; gap: 14px; }
fieldset { border: 1px solid var(--panel-line); border-radius: 12px; padding: 10px 14px 14px; margin: 0; background: var(--panel); }
legend { padding: 0 8px; color: var(--gold); font-size: 0.85rem; letter-spacing: 0.1em; text-transform: uppercase; }
.choices, .choices-row { display: flex; flex-wrap: wrap; gap: 8px; }
.group-label { width: 100%; color: var(--muted); font-size: 0.75rem; margin: 6px 0 2px; }
.choice { background: rgba(10, 12, 24, 0.7); border: 2px solid transparent; border-radius: 10px; padding: 6px; cursor: pointer; }
.choice:hover { border-color: var(--panel-line); }
.choice.selected { border-color: var(--gold); background: rgba(255, 209, 102, 0.12); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.field input[type="text"] { font: inherit; color: var(--text); background: rgba(10, 12, 24, 0.8); border: 1px solid var(--panel-line); border-radius: 8px; padding: 10px 12px; }
.field input[type="range"] { width: 100%; accent-color: var(--gold); }

/* Mode selection stub */
.modes-profile { display: flex; align-items: center; gap: 12px; margin: 12px 0 20px; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.mode { display: flex; flex-direction: column; gap: 4px; padding: 20px; }
.mode small { color: var(--muted); font-weight: 400; }

/* Modals */
.backdrop { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 5, 12, 0.72); }
.modal { width: min(420px, 100%); background: #151a30; border: 1px solid var(--panel-line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
.modal p { margin: 0; line-height: 1.5; }
.credits { font-size: 0.8rem; color: var(--muted); }
.credits a { color: var(--air, #56CFE1); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
#modal-share { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; }
#modal-share .modal-actions { flex-wrap: wrap; }
.share-text { width: 100%; box-sizing: border-box; resize: none; font: 0.85rem/1.5 ui-monospace, Menlo, Consolas, monospace; color: var(--text); background: rgba(10, 12, 24, 0.8); border: 1px solid var(--panel-line); border-radius: 8px; padding: 10px 12px; }
@media (max-width: 420px) { .share-text { font-size: 0.72rem; } }
.share-styles { display: flex; gap: 18px; align-items: center; }
.share-styles label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; cursor: pointer; }
.share-styles input { accent-color: var(--gold); }

@media (max-width: 640px) {
  .creation { grid-template-columns: 1fr; }
  .screen { padding: 16px 16px 32px; }
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* Board Lab */
.mode-dev { border-style: dashed; }
.lab-controls { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.field select { font: inherit; color: var(--text); background: rgba(10, 12, 24, 0.8); border: 1px solid var(--panel-line); border-radius: 8px; padding: 9px 12px; }
.lab { display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 20px; align-items: start; }
.board-wrap { width: 100%; }
.grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; width: 100%; aspect-ratio: 1; padding: 6px; background: rgba(5, 6, 14, 0.75); border: 1px solid var(--panel-line); border-radius: 14px; touch-action: none; user-select: none; }
.cell { position: relative; padding: 0; margin: 0; border: 0; background: url("assets/tiles/slot-empty.svg") center / 100% 100% no-repeat; border-radius: 6px; cursor: pointer; aspect-ratio: 1; }
.cell img { position: absolute; inset: 7%; width: 86%; height: 86%; pointer-events: none; transition: transform 0.18s, opacity 0.22s; }
.cell .lock-img { inset: 4%; width: 92%; height: 92%; }
.cell.selected { background-image: url("assets/tiles/slot-selected.svg"); }
.cell.selected .tile-img { transform: scale(1.08); }
.cell.clearing .tile-img { transform: scale(0.2); opacity: 0; }
.cell.hit { background-image: url("assets/tiles/slot-selected.svg"); }
.cell.shake { animation: shake 0.3s; }
.cell.gale::after { content: "\203A"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); color: var(--air); font-size: 0.8rem; opacity: 0.7; pointer-events: none; }
.cell.locked { cursor: not-allowed; }
.board-wrap[data-busy="true"] .cell { cursor: progress; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.lab-panel { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 14px 16px; }
.lab-panel dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 12px; }
.lab-panel dt { color: var(--muted); font-size: 0.85rem; }
.lab-panel dd { margin: 0; font-weight: 600; }
#lab-turn.extra { color: var(--gold); }
.log { list-style: none; margin: 0; padding: 0; max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; }
.log li { padding: 6px 8px; border-radius: 8px; background: rgba(10, 12, 24, 0.6); }
.log .ok { border-left: 3px solid var(--earth, #06D6A0); }
.log .warn { border-left: 3px solid var(--danger); }
.log .gale { border-left: 3px solid var(--air); }
.log .extra { border-left: 3px solid var(--gold); color: var(--gold); font-weight: 600; }
@media (max-width: 720px) { .lab { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .cell img { transition: none; } .cell.shake { animation: none; } }

/* Arena (Sprint 2) */
.screen-wide { max-width: 1200px; }
.arena { display: grid; grid-template-columns: 260px minmax(0, 1fr) 260px; gap: 16px; align-items: stretch; margin-top: 12px; }
.panel { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
/* Battle side panels never set the row height: they match the middle column and scroll inside when they are taller. */
.arena > .ar-col { height: 0; min-height: 100%; min-width: 0; overflow-y: auto; }
.ar-centre { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ar-centre h3 { text-align: center; }
.ar-centre .hint { text-align: center; margin: 0; }
.ar-centre .feed { margin-top: auto; } /* when the arena is taller than its content (min-height), the announcer stays at the bottom edge shared with the side panels */
.objective { font-size: 1.17em; font-weight: 700; margin: 0; text-wrap: balance; }
.bar-label { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--muted); }
.bar { height: 12px; background: rgba(5, 6, 14, 0.8); border: 1px solid var(--panel-line); border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; width: 100%; transition: width 0.3s; }
.bar-fill.hp { background: linear-gradient(90deg, #1f9d6a, #5be3a0); }
.bar-fill.shield { background: linear-gradient(90deg, #3d86c6, #8fd0ff); width: 0; }
.bar-fill.ehp { background: linear-gradient(90deg, #b8303f, #ff6b7c); }
.pip { font-size: 0.8rem; color: var(--muted); background: rgba(10, 12, 24, 0.6); border-radius: 8px; padding: 8px; margin: 0; line-height: 1.4; }
/* Battle HUD (1.1.19): turn chip with a sliding highlight, countdown bars (red = time, shrinks right to left; blue = progress, grows left to right). */
.turn-chip { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 360px); margin: 0 auto; border-radius: 999px; background: rgba(5, 6, 14, 0.85); border: 1px solid var(--panel-line); padding: 3px; font-family: var(--font-display); letter-spacing: 0.1em; font-size: 0.85rem; }
.turn-chip span { position: relative; z-index: 1; text-align: center; padding: 6px 8px; color: var(--muted); transition: color 0.25s; white-space: nowrap; }
.turn-chip .hl { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: rgba(255, 209, 102, 0.18); border: 1px solid var(--gold); transition: transform 0.3s cubic-bezier(0.3, 0.8, 0.3, 1), background 0.25s, border-color 0.25s; }
.turn-chip[data-turn="enemy"] .hl { transform: translateX(100%); background: rgba(224, 71, 91, 0.2); border-color: var(--danger); }
.turn-chip[data-turn="you"] .you, .turn-chip[data-turn="extra"] .you { color: var(--gold); }
.turn-chip[data-turn="enemy"] .foe { color: var(--danger); }
.turn-chip[data-turn="extra"] .hl { background: var(--gold); }
.turn-chip[data-turn="extra"] .you { color: #1a1205; font-weight: 700; }
.hbar { position: relative; flex: none; height: 24px; border-radius: 8px; background: rgba(5, 6, 14, 0.85); border: 1px solid var(--panel-line); overflow: hidden; }
.hbar .fill { position: absolute; inset: 0 auto 0 0; width: 100%; transition: width 0.25s linear; }
.hbar.time .fill { background: linear-gradient(90deg, #b8303f, #ff6b7c); }
.hbar.prog .fill { background: linear-gradient(90deg, #2a6fc0, #6fb8ff); }
.hbar .txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85); white-space: nowrap; }
.hbar.low { animation: hbar-pulse 0.7s ease-in-out infinite alternate; border-color: var(--danger); }
@keyframes hbar-pulse { from { filter: brightness(1); } to { filter: brightness(1.35); } }
.hbar.casting { animation: none; border-color: var(--panel-line); }
.hbar.casting .fill { filter: saturate(0.25) brightness(0.7); background: #b8303f repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0 6px, transparent 6px 12px); }
.score { margin: 0; text-align: center; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .hbar.low { animation: none; } .turn-chip .hl, .hbar .fill { transition: none; } }
/* Panel headings and the compact name rows */
.ph { font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold); margin: 6px 0 0; padding-bottom: 4px; border-bottom: 1px solid var(--panel-line); font-weight: 700; flex: none; }
.ar-col > .ph:first-child, .ar-block > .ph:first-child { margin-top: 0; }
.ar-block { display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.who .nm2 { flex: 1; min-width: 0; line-height: 1.2; text-wrap: balance; }
.stage-info { display: flex; flex-direction: column; gap: 6px; }
.stage-info .hint { margin: 0; font-size: 0.8rem; line-height: 1.4; }
.stage-lock { width: 28px; height: 28px; flex: none; }
.sprite-em { display: inline-flex; flex: none; }
.practice { display: flex; flex-direction: column; gap: 8px; flex: none; }
.feed { height: calc(2.75rem + 4px); flex: none; overflow: hidden; text-align: center; display: flex; flex-direction: column; gap: 4px; } /* fixed: the middle column keeps one height whether or not the announcer has text */
.chain { line-height: 1.2; font-family: var(--font-display); font-size: 1.3rem; color: var(--chain-color, var(--gold)); text-shadow: 0 0 12px var(--chain-color, var(--gold)); }
.chain.pop { animation: pop 0.4s; }
.mult { font-size: 0.85rem; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mult.crit { color: var(--gold); font-weight: 700; }
.mult.resist { color: var(--danger); }
@keyframes pop { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.enemy-sprite, #ar-player-sprite { position: relative; display: flex; justify-content: center; flex: none; }
.float { position: absolute; top: 0; left: 50%; transform: translateX(-50%); font-weight: 800; font-size: 1.3rem; color: #fff; text-shadow: 0 0 6px #000; animation: rise 1s forwards; pointer-events: none; }
.float.crit { color: var(--gold); font-size: 1.6rem; }
.float.hurt { color: #ff7d8c; }
@keyframes rise { to { transform: translate(-50%, -40px); opacity: 0; } }
.el-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid var(--panel-line); }
.intent { background: rgba(10, 12, 24, 0.7); border: 1px solid var(--panel-line); border-radius: 10px; padding: 8px 10px; }
.intent-line { font-weight: 700; }
.intent-ultimate { color: var(--danger); }
.intent-then { font-size: 0.8rem; color: var(--muted); }
.status-row { min-height: 1.4em; display: flex; gap: 6px; }
.arena .log { flex: 1; min-height: 0; max-height: none; overflow-y: auto; font-size: 0.78rem; gap: 4px; }
.arena .pip { flex: 1; min-height: 3.2em; overflow-y: auto; }
.overlay { position: fixed; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(circle at 50% 40%, rgba(30, 20, 70, 0.85), rgba(4, 5, 14, 0.94)); backdrop-filter: blur(6px); }
.overlay-card { width: min(380px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.overlay-card .menu { width: 100%; }
.overlay.victory { background: radial-gradient(circle at 50% 35%, rgba(255, 209, 102, 0.35), rgba(8, 8, 18, 0.94) 70%); }
.overlay.defeat { background: radial-gradient(circle at 50% 35%, rgba(100, 40, 140, 0.55), rgba(8, 4, 16, 0.96) 70%); }
.overlay.victory h2 { color: var(--gold); text-shadow: 0 0 30px rgba(255, 209, 102, 0.6); font-size: 2.4rem; }
.overlay.defeat h2 { color: #c79bff; font-size: 2.4rem; }
.result-sub { letter-spacing: 0.25em; margin: 0; color: var(--muted); }
.stars { font-size: 2.2rem; display: flex; justify-content: center; gap: 6px; }
.star { color: #3a3f5c; }
.star.on { color: var(--gold); text-shadow: 0 0 12px var(--gold); }
.result-stats { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; text-align: left; margin: 0; }
.result-stats dt { color: var(--muted); }
.result-stats dd { margin: 0; font-weight: 600; text-align: right; }
.result-tip { margin: 0; color: var(--gold); font-size: 0.9rem; line-height: 1.4; }
/* Panels never get shorter than their spells: keeps Practice (Training) and Pip's Tips in view on short windows. */
@media (min-width: 901px) { .arena { min-height: 520px; } }
@media (max-width: 900px) { .arena { grid-template-columns: 1fr; } .ar-centre { order: -1; } .arena > .ar-col { height: auto; min-height: 0; overflow: visible; } .arena .log { max-height: 180px; } .feed { height: auto; min-height: 3.6em; overflow: visible; } .mult { white-space: normal; } }

/* Mana rings (1.1.19): 2 columns x 3 rows, ring with the element emoji and mana count inside, spell name below */
.mana { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; flex: none; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--text); cursor: pointer; border-radius: 10px; min-width: 0; }
.ring:disabled { cursor: default; }
.ring .face { position: relative; width: 68px; height: 68px; transition: transform 0.12s; }
.ring .face svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ring .inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; gap: 2px; }
.ring .inner .n { font-size: 0.68rem; font-weight: 700; font-variant-numeric: tabular-nums; opacity: 0.9; }
.ring .nm { font-size: 0.7rem; font-weight: 600; text-align: center; line-height: 1.2; color: var(--muted); text-wrap: balance; }
.ring.ready .nm { color: var(--text); }
.ring.ready:hover:not(:disabled) .face { transform: translateY(-1px); }
.ring.ready .face svg { filter: drop-shadow(0 0 5px var(--glow)); }
.ring.warn .face svg { animation: ring-glow 1s ease-in-out infinite alternate; }
.ring.aiming .face::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--gold); }
.ring:not(.ready) .em { opacity: 0.6; }
.ring:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@keyframes ring-glow { from { filter: drop-shadow(0 0 3px var(--glow)); } to { filter: drop-shadow(0 0 10px var(--glow)); } }
@media (prefers-reduced-motion: reduce) { .ring.warn .face svg { animation: none; } }
@media (max-height: 800px) { .ring .face { width: 56px; height: 56px; } .ring .inner .n { font-size: 0.62rem; } .ring .nm { font-size: 0.66rem; } }
.board-wrap.aiming .cell { cursor: crosshair; }
.board-wrap.aiming .grid { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 209, 102, 0.4); }
.chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--panel-line); background: rgba(10, 12, 24, 0.7); }
.chip.burn { border-color: var(--color-fire); }
.chip.expose { border-color: var(--gold); }
.chip.delay { border-color: var(--color-air); }

/* Mode Selection grid (Sprint 4) */
.modes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 20px; }
.mode-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 18px; }
.mode-card-icon { font-size: 1.8rem; }
.mode-card-names { display: flex; flex-direction: column; }
.mode-card-world { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.mode-card-name { font-family: var(--font-display); font-size: 1.2rem; }
.mode-card-progress { color: var(--gold); font-size: 0.85rem; }
.mode-card-desc { color: var(--muted); font-size: 0.82rem; }
@media (max-width: 560px) { .modes-grid { grid-template-columns: 1fr; } }

/* Tutorial stage picker */
.tutorial-stages { display: flex; flex-direction: column; gap: 10px; }
.tutorial-stage { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 18px; }
.tutorial-stage-num { font-size: 1.3rem; font-family: var(--font-display); width: 28px; text-align: center; flex: none; }
.tutorial-stage-text { display: flex; flex-direction: column; gap: 2px; }
.tutorial-stage-text .hint { margin: 0; }
.tutorial-stage.done .tutorial-stage-num { color: var(--gold); }
.tutorial-stage.locked { opacity: 0.55; }

/* Campaign Map */
.map-selector { display: flex; align-items: center; gap: 12px; }
.map-path { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.map-node { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; min-width: 140px; }
.map-node-icon { font-size: 1.6rem; }
.map-node-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.map-node-name { font-weight: 600; }
.map-node-stars { font-size: 0.9rem; }
.map-node-score { color: var(--gold); font-size: 0.85rem; }
.map-node.locked { opacity: 0.5; }
.map-node.cleared { border-color: var(--gold); }
.map-link { width: 28px; height: 2px; background: var(--panel-line); }
.map-link.lit { background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* Training: Reset Board / Hint, and the Hint highlight on the board */
.practice-controls { display: flex; gap: 8px; }
.cell.hint { box-shadow: 0 0 0 3px var(--gold) inset; }

/* Akashic Records */
.akashic-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.akashic-tab { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 999px; padding: 8px 16px; color: var(--text); font: inherit; cursor: pointer; }
.akashic-tab.active { border-color: var(--gold); color: var(--gold); }
.codex-card { display: flex; gap: 14px; align-items: flex-start; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; padding: 14px 16px; }
.codex-card.locked { opacity: 0.6; border-style: dashed; }
.codex-icon { font-size: 1.6rem; flex: none; }
.codex-body { display: flex; flex-direction: column; gap: 4px; }
.codex-body .hint { margin: 0; }

/* Story scene overlay */
.scene-overlay { z-index: 9; cursor: pointer; align-items: flex-end; padding: 0; background: rgba(4, 5, 12, 0.72); }
.scene-skip { position: absolute; top: 16px; right: 16px; }
.scene-box { width: 100%; max-width: 720px; margin: 0 auto 24px; display: flex; gap: 16px; align-items: flex-start; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 14px; padding: 18px 20px; cursor: default; }
.scene-sprite { flex: none; font-size: 2.4rem; }
.scene-text-wrap strong { color: var(--gold); display: block; margin-bottom: 6px; }
.scene-text-wrap p { margin: 0; line-height: 1.5; min-height: 3.2em; }
/* Trust Pip / Question Pip choice (endings) */
.scene-text-wrap { flex: 1 1 auto; min-width: 0; }
.scene-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.scene-choice-btn { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; row-gap: 2px; align-items: center; text-align: left; min-height: 44px; padding: 10px 12px; }
.scene-choice-key { grid-row: 1; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--panel-line); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--gold); }
.scene-choice-label { font-weight: 700; }
.scene-choice-hint { grid-column: 1 / -1; font-size: .82rem; opacity: .8; line-height: 1.35; }
.scene-choice-btn.is-disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 560px) { .scene-choice { grid-template-columns: 1fr; } }

/* ---------- The Bard (audio player tab) ---------- */
.bard-mix { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 8px 0 12px; }
.bard-vol { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.bard-vol input { width: 120px; }
.bard-vol output { font-variant-numeric: tabular-nums; color: var(--fg, #e7e4f2); min-width: 2.6em; }
.bard-tracks { display: grid; gap: 8px; }
.bard-meta { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.74rem; color: var(--gold, #e8c46a); }
.codex-card.playing { border-color: #7fe0b0; }
.bard-group { margin-top: 16px; display: grid; gap: 8px; }
.bard-group h4, .bard-sub h5 { margin: 0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.bard-sub { display: grid; gap: 6px; }
.bard-btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bard-btns .btn { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.75rem; }
.bard-btns button[aria-pressed="true"] { border-color: #7fe0b0; color: #7fe0b0; }

/* ---------- Gallery: fullscreen background preview ---------- */
#bg-preview { position: fixed; inset: 0; z-index: 70; cursor: zoom-out; }
#bg-preview[hidden] { display: none; }
.bg-preview-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(0,0,0,0.72), transparent); z-index: 1; cursor: default; }
.bg-preview-bar strong { font-size: 1.05rem; letter-spacing: 0.04em; }
.codex-body > .btn-small { width: fit-content; margin-top: 4px; }

/* Arena bar labels: Twemoji icon before "HP" / "Shield" */
.bar-name { display: inline-flex; align-items: center; gap: 4px; }
.bar-icon { display: inline-flex; }

/* ---------- Themed menu cards: Mode Selection, Tutorial stages, Campaign Map nodes ----------
   (these are <button>s without .btn, which is why they used to show as bare browser-grey boxes) */
.mode-card, .tutorial-stage, .map-node {
  --accent: var(--gold);
  font: inherit; color: var(--text); cursor: pointer; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
    linear-gradient(160deg, rgba(30, 34, 66, 0.92), rgba(12, 14, 30, 0.94));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--panel-line));
  border-radius: 14px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(3px);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.mode-card::after, .map-node::after {            /* faint rune ring in the corner */
  content: ""; position: absolute; right: -26px; top: -26px; width: 96px; height: 96px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: inset 0 0 0 8px transparent, 0 0 0 10px color-mix(in srgb, var(--accent) 9%, transparent);
  pointer-events: none;
}
.mode-card:hover:not(:disabled), .tutorial-stage:hover:not(:disabled), .map-node:hover:not(:disabled) {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 22px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.mode-card:focus-visible, .tutorial-stage:focus-visible, .map-node:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.mode-card:disabled, .tutorial-stage:disabled, .map-node:disabled { cursor: not-allowed; }

/* Mode Selection */
.mode-tutorial { --accent: var(--color-earth); }
.mode-story    { --accent: var(--color-light); }
.mode-endless  { --accent: var(--color-dark); }
.mode-training { --accent: var(--color-water); }
.mode-card { min-height: 170px; padding: 20px 22px; }
.mode-card-icon { font-size: 2.1rem; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 70%, transparent)); }
.mode-card-world { color: var(--accent); }
.mode-card-name { color: #fff; font-size: 1.45rem; letter-spacing: 0.05em; text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 45%, transparent); }
.mode-card-progress { font-weight: 600; }
.mode-card-desc { line-height: 1.45; }

/* Tutorial stages */
.tutorial-stage { --accent: var(--color-earth); padding: 16px 20px; width: 100%; gap: 18px; }
.tutorial-stage-num {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; font-size: 1.25rem;
  color: var(--accent); background: rgba(5, 6, 14, 0.6); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 30%, transparent);
}
.tutorial-stage-text strong { color: #fff; font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.04em; }
.tutorial-stage-text .hint { color: var(--muted); }
.tutorial-stage.done { --accent: var(--gold); }
.tutorial-stage.done .tutorial-stage-num { color: var(--gold); }
.tutorial-stage.locked { opacity: 0.55; filter: saturate(0.55); box-shadow: none; }
.tutorial-stage.locked .tutorial-stage-num { color: var(--muted); border-color: var(--panel-line); box-shadow: none; }

/* Campaign Map */
.map-selector { margin-top: 36px; }
.map-path { gap: 0; flex-wrap: nowrap; }
.map-node { --accent: var(--color-air); width: 210px; flex: none; min-height: 190px; padding: 22px 18px; gap: 8px; justify-content: center; text-align: center; }
.node-hazard { --accent: var(--color-air); }
.node-minion { --accent: var(--color-fire); }
.node-boss   { --accent: var(--gold); }
.node-secret { --accent: var(--color-dark); }
.map-node-icon { font-size: 2.4rem; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 70%, transparent)); }
.map-node-label { color: var(--accent); font-weight: 600; }
.map-node-name { color: #fff; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.04em; }
.node-stars { display: inline-flex; gap: 4px; font-size: 1.25rem; }
.star-s { color: rgba(154, 163, 199, 0.28); }
.star-s.on { color: var(--gold); text-shadow: 0 0 10px rgba(255, 209, 102, 0.8); }
.map-node.locked { opacity: 0.55; filter: saturate(0.5); box-shadow: none; }
.map-node.cleared { border-color: var(--gold); }
.map-link { width: 44px; height: 3px; border-radius: 2px; background: repeating-linear-gradient(90deg, var(--panel-line) 0 6px, transparent 6px 11px); flex: none; }
.map-link.lit { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.map-selector > .btn { align-self: center; }
@media (max-width: 760px) {
  .map-path { flex-direction: column; }
  .map-link { width: 3px; height: 28px; background: repeating-linear-gradient(180deg, var(--panel-line) 0 6px, transparent 6px 11px); }
  .map-link.lit { background: var(--gold); }
  .map-node { min-width: 0; width: 100%; min-height: 150px; }
}
@media (prefers-reduced-motion: reduce) { .mode-card, .tutorial-stage, .map-node { transition: none; } }

/* ---------- Fit to the window: no scrolling on common laptop/desktop browser sizes ----------
   Typical browser viewports: ~1366x650 (1366x768 laptop minus browser bars), 1280x720, 1920x940 (1080p minus bars). */
.ar-centre .grid { width: min(100%, max(280px, calc(100vh - 280px))); margin: 0 auto; }
@media (max-height: 800px) {
  .screen { padding: 12px 16px 16px; }
  .screen-head { margin-bottom: 4px; }
  .arena { gap: 10px; }
  .mode-card { min-height: 0; padding: 12px 16px; gap: 3px; }
  .mode-card-icon { font-size: 1.6rem; }
  .mode-card-name { font-size: 1.2rem; }
  .mode-card-desc { font-size: 0.78rem; }
  .modes-grid { gap: 10px; margin-bottom: 12px; }
  .map-selector { margin-top: 12px; }
  .map-node { min-height: 150px; padding: 14px; }
  .map-node-icon { font-size: 2rem; }
  .tutorial-stages { gap: 8px; }
  .tutorial-stage { padding: 10px 14px; }
  .tutorial-stage-num { width: 36px; height: 36px; }
  .panel { padding: 10px; gap: 6px; }
  .ar-centre .grid { width: min(100%, max(280px, calc(100vh - 288px))); }
}
/* ---------- Akashic Records (1.1.0) ----------
   The page never scrolls: the screen is exactly one window tall, the tab row stays put, and only the panel under it scrolls.
   Cards sit in two columns (one on narrow windows). `:not([hidden])` keeps the global [hidden] rule working. */
#screen-akashic:not([hidden]) { display: flex; flex-direction: column; flex: 0 0 auto; height: 100vh; height: 100dvh; overflow: hidden; padding-bottom: 16px; }
#screen-akashic .akashic-tabs { flex: none; }
.akashic-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; }
.akashic-panel > .hint:first-child { margin-top: 0; }
.codex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.codex-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-top: 12px; }
.codex-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.codex-title { grid-column: 1 / -1; margin: 10px 0 0; font-size: 0.95rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); border-bottom: 1px solid var(--panel-line); padding-bottom: 6px; }
.codex-grid > .codex-title:first-child { margin-top: 0; }
.codex-card { min-width: 0; }
.codex-wide { grid-column: 1 / -1; }
.codex-body { min-width: 0; }
.codex-icon { display: flex; align-items: center; justify-content: center; min-width: 32px; }
.codex-lock { width: 32px; height: 32px; display: block; }
.matchups { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.matchup { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; }
.matchup-label { color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; margin-right: 2px; }
.matchup-mult { font-variant-numeric: tabular-nums; }
.matchup.strong .matchup-mult { color: #7fe0b0; }
.matchup.weak .matchup-mult { color: #ff8a98; }
.cycle { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.cycle-arrow { color: var(--muted); font-size: 1.1rem; }
.bard-tracks, .bard-sfx { display: grid; gap: 10px; }
.bard-group { margin-top: 8px; }
@media (max-width: 720px) {
  .codex-grid, .codex-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 800px) {
  #screen-akashic:not([hidden]) { padding-bottom: 10px; }
}

/* NPC emoji pairs (1.0.33): a [main, accent] pair sits side by side like the player's trio; the Pip -> Pyeolip speaker swap */
.sprite[role="img"] { display: inline-flex; align-items: center; gap: 2px; }
.scene-sprite { transition: transform .35s ease, opacity .35s ease; }
.scene-sprite.swap-out { transform: scale(.4); opacity: 0; }
.scene-sprite.swap-in { animation: speakerIn .35s ease; }
@keyframes speakerIn { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scene-sprite, .scene-sprite.swap-in { transition: none; animation: none; } }
.codex-pair { min-width: 64px; }
.codex-affinity { margin: 2px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .85rem; }
.affinity-chip { display: inline-flex; align-items: center; gap: 2px; }

/* Akashic Records (1.0.33): tab row justified, tab heads, big icons, tile stacks, gallery thumbnails, lock strips */
.akashic-tabs { gap: 8px; }
.akashic-tab { flex: 1 1 auto; text-align: center; white-space: nowrap; }
@media (max-width: 720px) {
  .akashic-tabs { gap: 6px; }
  .akashic-tab { padding: 6px 10px; font-size: .85rem; }
}
.tab-head { margin: 0 0 12px; }
.tab-title { margin: 0 0 2px; font-size: 1.15rem; letter-spacing: .04em; color: var(--gold); }
.tab-head .hint { margin: 0; }
.codex-icon.big { min-width: 56px; font-size: 2.4rem; line-height: 1; }
.codex-lock { width: 56px; height: 56px; }
.tile-stack { position: relative; display: inline-block; flex: none; }
.tile-stack img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tile-stack .tile-gem { inset: 7%; width: 86%; height: 86%; }
.bg-thumb { display: block; width: 96px; height: 56px; border-radius: 8px; border: 1px solid var(--panel-line); }
.lock-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.lock-stage { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); }
.lock-stage .codex-lock { width: 56px; height: 56px; }
.codex-affinity { border-top: 1px dashed var(--panel-line); padding-top: 4px; margin-top: 6px; }
.codex-pair { padding-right: 10px; margin-right: 2px; border-right: 1px solid var(--panel-line); }
@media (max-width: 720px) {
  .codex-icon.big { min-width: 42px; font-size: 1.8rem; }
  .codex-lock, .lock-stage .codex-lock { width: 42px; height: 42px; }
  .bg-thumb { width: 72px; height: 42px; }
}

/* Deeds (achievements): the "Deed earned" toast and the worn title on a profile card */
.deed-toast { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 10px;
  max-width: min(92vw, 420px); padding: 10px 16px; border-radius: 12px; border: 1px solid rgba(255, 220, 140, 0.6);
  background: rgba(20, 16, 40, 0.94); color: #fff4d6; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); pointer-events: none; }
.deed-toast[hidden] { display: none; }
.deed-toast-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deed-toast-title { font-size: 0.95rem; }
.deed-toast-line { font-size: 0.82rem; opacity: 0.85; }
.deed-toast.deed-in { animation: deed-drop 0.35s ease-out; }
@keyframes deed-drop { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) { .deed-toast.deed-in { animation: none; } }
.deed-title { margin: 2px 0 0; font-size: 0.85rem; color: #ffd98a; }

/* Deeds tab (1.1.0) */
.deed-summary { margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.deed-summary .hint { margin: 0; }
.deed-count { font-size: 1.05rem; }
.deed-date { margin: 4px 0 6px; font-size: 0.8rem; }
.deed-wear[aria-pressed="true"] { outline: 2px solid #ffd98a; }
.codex-card.worn { border-color: #ffd98a; }
/* In the Akashic Records the toast sits at the bottom so it never covers the title or the tab row. */
body:has(#screen-akashic:not([hidden])) .deed-toast { top: auto; bottom: max(12px, env(safe-area-inset-bottom)); }

/* NPC pair: the accent sits on the baseline, smaller than the main emoji (1.1.0) */
.sprite .npc-accent { align-self: flex-end; }

/* ---- 1.1.11 fixes ---- */
/* Bestiary cards: [emoji][name] on row 1; affinity and lore start at the emoji's left edge. */
.codex-card.npc { flex-direction: column; align-items: stretch; gap: 4px; }
.npc-head { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.npc-head strong { min-width: 0; overflow-wrap: anywhere; }
.codex-card.npc > .hint { margin: 0; }
.codex-card.npc > .codex-affinity { margin: 4px 0 2px; }
.bard-sfx-card .codex-body { width: 100%; gap: 14px; }
.slot .slot-story, .slot .slot-shards { margin: 2px 0; }
/* Hidden development-tools star (Mode Selection only). */
.dev-star { position: fixed; right: max(6px, env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom)); width: 32px; height: 32px; padding: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 5; }
.dev-star-dot { width: 4.2px; height: 4.2px; border-radius: 50%; background: rgba(199, 215, 247, .55); animation: devTwinkle 3.4s ease-in-out infinite; }
.dev-star:focus-visible { outline: 2px solid var(--gold, #ffd98a); outline-offset: 0; border-radius: 50%; }
.dev-star:focus-visible .dev-star-dot { opacity: 1; animation: none; }
@keyframes devTwinkle { 0%, 100% { opacity: .25; } 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .dev-star-dot { animation: none; opacity: .4; } }
#screen-modes[hidden] .dev-star { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Deeds: the goal line shown on earned cards (1.1.11) */
.deed-meta { margin: 6px 0 0; font-size: 0.8rem; opacity: 0.75; }

/* Gallery tiles (1.1.14): larger tile and slot icons */
.codex-icon.gallery-tile { min-width: 80px; }
@media (max-width: 720px) { .codex-icon.gallery-tile { min-width: 64px; } .codex-icon.gallery-tile .tile-stack { width: 64px !important; height: 64px !important; } }
