:root {
	--bg-1: #f5f0df;
	--bg-2: #e0d2b6;
	--ink: #2e2318;
	--panel: rgba(255, 248, 233, 0.9);
	--border: #8a6b45;
	--accent: #a23524;
	--accent-2: #275e4a;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	min-height: 100vh;
	font-family: Georgia, 'Times New Roman', serif;
	color: var(--ink);
	background:
		radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.35), transparent 30%),
		radial-gradient(circle at 88% 82%, rgba(137, 93, 62, 0.25), transparent 40%),
		linear-gradient(135deg, var(--bg-1), var(--bg-2));
}

.auth-page,
.game-page {
	display: grid;
	place-items: start center;
	padding: 24px;
}

.home-auth-page {
	display: block;
}

.home-auth-page .auth-shell {
	width: min(460px, 100%);
	margin-left: auto;
	margin-right: auto;
}

.game-page.has-chat {
	padding-bottom: 360px;
}

.game-page.has-chat.chat-collapsed {
	padding-bottom: 120px;
}

.auth-shell,
.game-shell {
	width: min(980px, 100%);
}

.creation-shell {
	width: min(1100px, 100%);
	display: grid;
	gap: 16px;
}

.admin-shell {
	width: min(1380px, 100%);
}

.admin-layout {
	display: grid;
	grid-template-columns: 320px minmax(0, 1fr);
	grid-template-areas:
		"sidebar sidebar"
		"list editor";
	gap: 16px;
	align-items: start;
}

.admin-users-panel,
.admin-editor-panel {
	min-height: 220px;
}

.admin-sidebar {
	grid-area: sidebar;
	min-height: auto;
}

.admin-users-panel {
	grid-area: list;
}

.admin-editor-panel {
	grid-area: editor;
}

.admin-layout.admin-layout-monster-mode {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"sidebar"
		"list"
		"editor";
}

.admin-layout.admin-layout-user-mode {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"sidebar"
		"list"
		"editor";
}

.admin-layout.admin-layout-settings-mode {
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"sidebar"
		"editor";
}

.admin-layout.admin-layout-settings-mode .admin-users-panel {
	display: none;
}

.admin-settings-form fieldset {
	border: 1px solid var(--color-border, #444);
	border-radius: 8px;
	padding: 16px;
	margin-bottom: 20px;
}

.admin-settings-form legend {
	font-weight: 600;
	padding: 0 8px;
}

.admin-settings-grid {
	display: grid;
	gap: 12px;
}

.admin-settings-row {
	display: grid;
	grid-template-columns: 1fr 120px;
	align-items: center;
	gap: 12px;
}

.admin-settings-actions {
	display: flex;
	gap: 10px;
	margin-top: 4px;
}

.admin-tool-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}

.admin-tool-card {
	display: grid;
	gap: 0;
	padding: 8px 10px;
	border-radius: 8px;
	border: 1px solid rgba(138, 107, 69, 0.35);
	background: rgba(255, 255, 255, 0.55);
	text-align: left;
	color: var(--ink);
	font-size: 0.9em;
}

.admin-tool-card strong {
	font-weight: 600;
}

.admin-tool-card.is-active {
	border-color: var(--accent);
	box-shadow: inset 0 0 0 1px rgba(162, 53, 36, 0.2);
	background: rgba(255, 255, 255, 0.72);
	color: var(--accent);
}

.admin-tool-card.is-disabled {
	opacity: 0.7;
}

.admin-section-header {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 12px;
	margin-bottom: 12px;
}

.admin-search {
	max-width: 220px;
}

.admin-user-list {
	display: grid;
	gap: 10px;
	max-height: 70vh;
	overflow: auto;
	padding-right: 4px;
}

.admin-user-list.admin-user-list-directory-mode {
	max-height: none;
	overflow: visible;
	padding-right: 0;
}

.admin-user-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 14px;
	background: rgba(255, 255, 255, 0.62);
	color: var(--ink);
	border: 1px solid rgba(138, 107, 69, 0.35);
	text-align: left;
}

.admin-user-row.is-selected {
	border-color: var(--accent);
	box-shadow: inset 0 0 0 1px rgba(162, 53, 36, 0.2);
}

.admin-user-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 6px;
	font-size: 0.85rem;
	color: rgba(46, 35, 24, 0.78);
}

.admin-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
	margin-top: 12px;
}

.admin-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 14px;
	background: rgba(255, 255, 255, 0.62);
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 8px;
	text-align: left;
}

.admin-card-content {
	flex: 1;
}

.admin-card h4 {
	margin: 0 0 8px 0;
	font-size: 1.05em;
	color: var(--ink);
	word-break: break-word;
}

.admin-card-info {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 0.85rem;
	color: rgba(46, 35, 24, 0.76);
}

.admin-card-info span {
	display: block;
}

.admin-user-directory {
	display: grid;
	grid-template-columns: repeat(8, minmax(0, 1fr));
	gap: 6px 12px;
	max-height: min(48vh, 560px);
	overflow: auto;
	padding-right: 4px;
}

.admin-user-directory-entry {
	min-width: 0;
	padding-bottom: 6px;
	border-bottom: 1px solid rgba(138, 107, 69, 0.18);
}

.admin-user-directory-entry.is-selected {
	border-bottom-color: rgba(162, 53, 36, 0.5);
}

.admin-user-link {
	color: var(--accent);
	text-decoration: underline;
	font-weight: 700;
	font-size: 0.85rem;
	line-height: 1.2;
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.admin-user-directory-info {
	margin-top: 2px;
	font-size: 0.75rem;
	line-height: 1.3;
	color: rgba(46, 35, 24, 0.78);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hidden {
	display: none !important;
}

.admin-monster-table-wrapper {
	overflow-x: auto;
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.62);
}

.admin-spell-list-toolbar,
.admin-monster-list-toolbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 8px;
}

.admin-spell-effects {
	display: grid;
	gap: 12px;
}

.admin-spell-formula-help {
	padding: 12px 14px;
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.5);
}

.admin-spell-effect-card {
	display: grid;
	gap: 12px;
	padding: 14px;
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.58);
}

.admin-spell-summon-picker {
	display: grid;
	gap: 10px;
}

.admin-spell-summon-help {
	font-size: 0.88rem;
	color: rgba(46, 35, 24, 0.76);
}

.admin-spell-summon-slots {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}

.admin-spell-summon-slot {
	display: grid;
	gap: 8px;
	padding: 10px;
	border: 1px solid rgba(138, 107, 69, 0.22);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.38);
}

.admin-spell-summon-input-row {
	display: flex;
	gap: 8px;
	align-items: center;
}

.admin-spell-summon-input-row input {
	flex: 1 1 auto;
	min-width: 0;
}

.admin-spell-summon-selected {
	font-size: 0.86rem;
	color: rgba(46, 35, 24, 0.82);
}

.admin-spell-summon-selected.is-empty {
	color: rgba(46, 35, 24, 0.58);
	font-style: italic;
}

.admin-spell-summon-suggestions {
	display: grid;
	gap: 6px;
	max-height: 180px;
	overflow: auto;
	padding: 6px;
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.72);
}

.admin-spell-summon-suggestion {
	display: grid;
	gap: 2px;
	padding: 8px 10px;
	border: 1px solid rgba(138, 107, 69, 0.2);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.86);
	color: var(--ink);
	text-align: left;
}

.admin-spell-summon-suggestion span,
.admin-spell-summon-empty {
	font-size: 0.84rem;
	color: rgba(46, 35, 24, 0.74);
}

.admin-spell-summon-empty {
	padding: 4px 2px;
}

@media (max-width: 900px) {
	.admin-spell-summon-slots {
		grid-template-columns: minmax(0, 1fr);
	}
}

.admin-monster-filter-field {
	display: grid;
	gap: 4px;
	min-width: 140px;
	margin: 0;
}

.admin-monster-filter-field span {
	font-size: 0.74rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: rgba(46, 35, 24, 0.72);
	font-weight: 700;
}

.admin-monster-class-level {
	min-width: 65px;
}

.admin-monster-class-name {
	min-width: 200px;
}

.admin-monster-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92rem;
}

.admin-monster-table th,
.admin-monster-table td {
	padding: 8px 10px;
	border-bottom: 1px solid rgba(138, 107, 69, 0.18);
	text-align: left;
	vertical-align: top;
}

.admin-monster-table th:first-child,
.admin-monster-table td:first-child {
	width: 72px;
	white-space: nowrap;
}

.admin-monster-table th {
	font-size: 0.76rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: rgba(46, 35, 24, 0.7);
	background: rgba(224, 210, 182, 0.28);
	position: sticky;
	top: 0;
	z-index: 1;
}

.admin-monster-table tbody tr:last-child td {
	border-bottom: none;
}

.admin-monster-table-row {
	cursor: pointer;
	transition: background 0.16s ease, box-shadow 0.16s ease;
}

.admin-monster-table-row:hover {
	background: rgba(255, 255, 255, 0.78);
}

.admin-monster-table-row.is-selected {
	background: rgba(255, 244, 228, 0.92);
	box-shadow: inset 3px 0 0 rgba(162, 53, 36, 0.7);
}

.admin-user-chevron {
	font-size: 1rem;
	color: rgba(46, 35, 24, 0.6);
}

.admin-editor-content {
	display: grid;
	gap: 16px;
}

.admin-form {
	display: grid;
	gap: 16px;
}

.admin-editor-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 16px;
}

.admin-editor-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: end;
}

.admin-form-section {
	padding-top: 4px;
	border-top: 1px solid rgba(138, 107, 69, 0.25);
	display: grid;
	gap: 12px;
}

.admin-form-section h5 {
	margin: 0;
	color: var(--accent);
}

.admin-form-grid {
	display: grid;
	gap: 12px;
}

.admin-form-grid label {
	margin: 0;
	display: grid;
	gap: 6px;
}

.admin-form-grid textarea {
	min-height: 88px;
	resize: vertical;
}

.admin-form-grid select[multiple] {
	min-height: 160px;
}

.admin-feats-field {
	grid-column: span 2;
	min-width: 520px;
}

.admin-player-feats-row {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	flex-wrap: wrap;
}

.admin-player-feats-field {
	margin: 0;
	display: grid;
	gap: 6px;
	min-width: 280px;
	max-width: 420px;
	flex: 1 1 300px;
}

.admin-player-feats-field select {
	width: 100%;
	min-height: 126px;
	font-size: 0.86rem;
	line-height: 1.15;
}

.admin-player-item-grant-row {
	display: flex;
	align-items: end;
	gap: 12px;
	flex-wrap: wrap;
}

.admin-player-item-grant-field {
	margin: 0;
	display: grid;
	gap: 6px;
	min-width: 280px;
	flex: 1 1 320px;
}

.admin-player-granted-feats {
	display: grid;
	gap: 4px;
	padding: 8px 10px;
	border: 1px dashed rgba(138, 107, 69, 0.35);
	border-radius: 8px;
	max-width: 460px;
	background: rgba(255, 255, 255, 0.45);
}

.admin-player-granted-feats span {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--accent-2);
	font-weight: 700;
}

.admin-player-granted-feats small {
	font-size: 0.8rem;
	color: rgba(46, 35, 24, 0.78);
}

.forest-cast-circle-grid {
	display: grid;
	gap: 12px;
}

.forest-cast-circle-group {
	display: grid;
	gap: 6px;
}

.forest-cast-target-block {
	display: grid;
	gap: 6px;
}

.forest-cast-spell-description {
	padding: 8px 10px;
	border: 1px solid rgba(138, 107, 69, 0.3);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.5);
	color: rgba(46, 35, 24, 0.85);
	min-height: 44px;
}

.combat-cast-spell-name {
	display: block;
	font-size: 0.96rem;
	font-weight: 700;
	color: var(--accent);
	margin-bottom: 4px;
	line-height: 1.2;
}

.combat-cast-spell-text {
	display: block;
	font-size: 0.85rem;
	line-height: 1.3;
	color: rgba(46, 35, 24, 0.9);
}

.forest-cast-target-hint {
	color: rgba(46, 35, 24, 0.78);
}

.combat-cast-circle-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.combat-cast-circle-btn {
	display: grid;
	gap: 4px;
	aspect-ratio: 1 / 1;
	padding: 10px;
	border-radius: 12px;
	border: 1px solid rgba(138, 107, 69, 0.35);
	background: rgba(255, 255, 255, 0.55);
	color: rgba(46, 35, 24, 0.9);
	align-content: center;
	justify-items: center;
	text-align: center;
	transition: transform 0.12s ease, filter 0.12s ease, border-color 0.12s ease;
}

.combat-cast-circle-btn:hover:not(:disabled) {
	transform: translateY(-1px);
	filter: brightness(1.03);
	border-color: rgba(138, 107, 69, 0.65);
}

.combat-cast-circle-btn.is-selected {
	border-color: rgba(111, 75, 36, 0.9);
	box-shadow: 0 0 0 2px rgba(138, 107, 69, 0.2) inset;
}

.combat-cast-circle-btn:disabled {
	opacity: 0.58;
	cursor: not-allowed;
	filter: grayscale(0.22);
}

.combat-cast-circle-title {
	font-weight: 700;
	font-size: 0.92rem;
	line-height: 1.15;
}

.combat-cast-circle-slots {
	font-size: 0.8rem;
	line-height: 1.2;
	color: rgba(46, 35, 24, 0.8);
}

.combat-cast-spell-list {
	display: grid;
	gap: 8px;
}

.combat-cast-spell-btn {
	min-height: 38px;
	padding: 7px 10px;
}

.dungeon-catalog {
	display: grid;
	gap: 12px;
}

.dungeon-catalog-card {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 12px;
	border: 1px solid rgba(138, 107, 69, 0.3);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.45);
}

.dungeon-catalog-meta {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 8px;
	font-size: 0.82rem;
	color: rgba(46, 35, 24, 0.75);
}

.dungeon-room-card {
	display: grid;
	gap: 10px;
	padding: 12px;
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.42);
}

.dungeon-room-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: start;
}

.dungeon-room-details {
	display: grid;
	gap: 8px;
	font-size: 0.92rem;
}

.dungeon-move-controls {
	display: grid;
	gap: 10px;
}

.dungeon-move-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 10px;
}

.dungeon-move-grid .axiom-button.is-disabled,
.dungeon-move-grid .axiom-button:disabled {
	background: linear-gradient(180deg, #8f8f8f, #707070);
	color: rgba(255, 255, 255, 0.78);
	cursor: not-allowed;
	opacity: 0.75;
	transform: none;
	filter: none;
}

.dungeon-move-grid .axiom-button.is-disabled:hover,
.dungeon-move-grid .axiom-button:disabled:hover {
	transform: none;
	filter: none;
}

.dungeon-grid-board {
	display: grid;
	gap: 4px;
}

button.dungeon-grid-cell {
	aspect-ratio: 1 / 1;
	border-radius: 6px;
	border: 2px solid rgba(138, 107, 69, 0.3);
	background: rgba(255, 255, 255, 0.35);
	color: var(--ink);
	padding: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0.65rem;
	max-width: 75px !important;
}

button.dungeon-grid-cell.is-room {
	background: rgba(255, 255, 255, 0.62);
	border-style: solid;
	border-width: 2px;
	border-color: rgba(100, 75, 40, 0.75);
	font-weight: 700;
}

button.dungeon-grid-cell.is-room.exit-north {
	border-top-style: none;
}

button.dungeon-grid-cell.is-room.exit-east {
	border-right-style: none;
}

button.dungeon-grid-cell.is-room.exit-south {
	border-bottom-style: none;
}

button.dungeon-grid-cell.is-room.exit-west {
	border-left-style: none;
}

button.dungeon-grid-cell.is-empty {
	background: transparent;
	border-color: transparent;
	pointer-events: none;
}

button.dungeon-grid-cell.is-current {
	border-style: solid;
	border-width: 2px;
	border-color: var(--accent);
	box-shadow: inset 0 0 0 2px rgba(162, 53, 36, 0.2);
	background: rgba(255, 244, 228, 0.92);
}

button.dungeon-grid-cell:disabled {
	opacity: 1;
	cursor: default;
}

.dungeon-grid-cell-node {
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: rgba(70, 54, 36, 0.78);
}

.admin-dungeon-builder-toolbar {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: center;
	flex-wrap: wrap;
}

.admin-dungeon-mode-group {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.admin-dungeon-mode-group .admin-tool-card {
	padding: 10px 12px;
}

.admin-dungeon-editor-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
	gap: 16px;
	align-items: start;
}

.admin-dungeon-grid {
	display: grid;
	gap: 8px;
}

button.admin-dungeon-cell {
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	border: 1px dashed rgba(138, 107, 69, 0.35);
	background: rgba(255, 255, 255, 0.35);
	color: var(--ink);
	padding: 6px;
	display: grid;
	align-content: space-between;
	text-align: left;
}

button.admin-dungeon-cell.is-room {
	border-style: solid;
	border-width: 2px;
	border-color: rgba(100, 75, 40, 0.7);
	background: rgba(255, 255, 255, 0.7);
}

button.admin-dungeon-cell.is-room.exit-north {
	border-top-style: none;
}

button.admin-dungeon-cell.is-room.exit-east {
	border-right-style: none;
}

button.admin-dungeon-cell.is-room.exit-south {
	border-bottom-style: none;
}

button.admin-dungeon-cell.is-room.exit-west {
	border-left-style: none;
}

button.admin-dungeon-cell.is-room.exit-secret-north {
	border-top-style: dotted;
}

button.admin-dungeon-cell.is-room.exit-secret-east {
	border-right-style: dotted;
}

button.admin-dungeon-cell.is-room.exit-secret-south {
	border-bottom-style: dotted;
}

button.admin-dungeon-cell.is-room.exit-secret-west {
	border-left-style: dotted;
}

button.admin-dungeon-cell.is-selected {
	border-color: var(--accent);
	box-shadow: inset 0 0 0 2px rgba(162, 53, 36, 0.2);
}

button.admin-dungeon-cell.is-start {
	background: rgba(233, 250, 240, 0.92);
}

button.admin-dungeon-cell.is-connect-from {
	background: rgba(255, 238, 214, 0.92);
	border-color: var(--accent-2);
}

.admin-dungeon-cell-name {
	font-size: 0.76rem;
	font-weight: 700;
	word-break: break-word;
}

.admin-dungeon-cell-meta,
.admin-dungeon-cell-empty {
	font-size: 0.68rem;
	color: rgba(46, 35, 24, 0.68);
}

.admin-dungeon-float-save {
	position: fixed;
	bottom: 72px;
	right: 28px;
	z-index: 200;
	width: 62px;
	height: 62px;
	border-radius: 50% !important;
	padding: 0 !important;
	font-size: 1.5rem;
	box-shadow: 0 4px 16px rgba(46, 35, 24, 0.35);
	transition: transform 0.15s ease, filter 0.2s ease, box-shadow 0.15s ease;
}

.admin-dungeon-float-save:hover {
	box-shadow: 0 6px 22px rgba(46, 35, 24, 0.45);
}


.admin-dungeon-room-panel {
	display: grid;
	gap: 10px;
	padding: 12px;
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.45);
}

.admin-dungeon-room-panel label {
	display: grid;
	gap: 6px;
}

.admin-dungeon-collapsible {
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 8px;
	overflow: hidden;
}

.admin-dungeon-collapsible>summary {
	padding: 8px 12px;
	font-weight: 700;
	font-size: 0.85rem;
	cursor: pointer;
	background: rgba(138, 107, 69, 0.08);
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
	user-select: none;
}

.admin-dungeon-collapsible>summary::before {
	content: '▶';
	font-size: 0.65rem;
	transition: transform 0.15s ease;
	display: inline-block;
}

.admin-dungeon-collapsible[open]>summary::before {
	transform: rotate(90deg);
}

.admin-dungeon-collapsible> :not(summary) {
	padding: 12px;
}

.admin-dungeon-room-head {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	align-items: center;
}

.admin-dungeon-level-tabs {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.admin-dungeon-level-tabs .admin-tool-card {
	padding: 6px 14px;
	font-size: 0.82rem;
}

.admin-dungeon-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.admin-dungeon-modal {
	background: var(--paper, #fff8f0);
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 14px;
	padding: 24px 28px;
	max-width: 380px;
	width: 90%;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.admin-dungeon-modal h5 {
	margin: 0 0 8px;
}

.admin-dungeon-modal-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 16px;
}



.forest-enemy-list {
	display: grid;
	gap: 8px;
	margin-top: 8px;
}

.forest-enemy-row {
	display: grid;
	gap: 4px;
	padding: 6px 8px;
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.45);
}

.forest-enemy-row-head {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	font-size: 0.9rem;
}

.combat-monster-info-link {
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	text-decoration: none;
}

.combat-monster-info-link:hover,
.combat-monster-info-link:focus {
	color: #fff;
	transform: translateY(-1px);
	filter: brightness(1.05);
	text-decoration: none;
}

.combat-status-inline {
	color: rgba(46, 35, 24, 0.6);
	font-weight: 500;
	font-size: 0.86em;
}

.admin-feats-field select {
	width: 100%;
}

.admin-field-help {
	font-size: 0.8rem;
	color: rgba(46, 35, 24, 0.74);
}

.admin-monster-skills-feats-row {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	flex-wrap: nowrap;
}

.admin-monster-skills-feats-row .admin-feats-field {
	min-width: 0;
	flex: 0 1 360px;
}

.admin-monster-skill-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 180px));
	gap: 10px;
	align-items: end;
	flex: 1 1 610px;
	min-width: 590px;
}

.admin-compact-field {
	display: grid;
	gap: 4px;
	max-width: 180px;
}

.admin-compact-field input {
	max-width: 88px;
	padding-right: 8px;
}

.admin-form-grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-form-grid-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-form-grid-6 {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

.admin-attack-grid {
	display: grid;
	gap: 10px;
}

.admin-form-grid.admin-attack-row {
	grid-template-columns: 200px 150px 170px 180px minmax(0, 1fr) 140px;
}

@media (max-width: 1200px) {
	.admin-layout {
		grid-template-columns: 1fr;
		grid-template-areas:
			"sidebar"
			"list"
			"editor";
	}

	.admin-form-grid-6,
	.admin-form-grid-4,
	.admin-form-grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.admin-feats-field {
		grid-column: span 2;
		min-width: 0;
	}

	.admin-monster-skills-feats-row {
		flex-wrap: wrap;
	}

	.admin-monster-skills-feats-row .admin-feats-field {
		flex: 1 1 320px;
	}

	.admin-monster-skill-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		min-width: 0;
	}

	.admin-form-grid.admin-attack-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {

	.admin-form-grid-6,
	.admin-form-grid-4,
	.admin-form-grid-3 {
		grid-template-columns: 1fr;
	}

	.admin-feats-field {
		grid-column: auto;
		min-width: 0;
	}

	.admin-monster-skill-grid {
		grid-template-columns: 1fr;
	}

	.admin-monster-skills-feats-row {
		flex-direction: column;
	}

	.admin-monster-skills-feats-row .admin-feats-field {
		width: 100%;
	}

	.admin-form-grid.admin-attack-row {
		grid-template-columns: 1fr;
	}
}

.admin-toggle-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.admin-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: 700;
}

.admin-checkbox input {
	width: auto;
	margin: 0;
}

.admin-checkbox-inline {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.admin-monster-terrain-field {
	display: grid;
	gap: 8px;
}

.admin-monster-language-field {
	display: grid;
	gap: 8px;
}

.admin-monster-language-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 6px 10px;
}

.admin-monster-terrain-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 8px 12px;
}

.admin-monster-terrain-option.is-disabled {
	opacity: 0.5;
}

.admin-skill-table {
	display: grid;
	gap: 8px;
}

.admin-skill-table-header,
.admin-skill-table-row {
	display: grid;
	grid-template-columns: minmax(180px, 1.8fr) 80px 100px 130px;
	gap: 10px;
	align-items: center;
}

.admin-skill-table-header {
	font-size: 0.85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: rgba(46, 35, 24, 0.75);
	padding: 0 4px;
}

.admin-skill-table-row {
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.5);
	border: 1px solid rgba(138, 107, 69, 0.25);
}

.admin-skill-ranks {
	max-width: 100px;
}

.creation-header {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 12px;
}

.creation-progress {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 10px;
}

.creation-progress-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border: 1px solid rgba(138, 107, 69, 0.45);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.5);
	font-size: 0.92rem;
	font-weight: 700;
	color: rgba(46, 35, 24, 0.72);
}

.creation-progress-item.is-current {
	border-color: var(--accent);
	background: rgba(162, 53, 36, 0.12);
	color: var(--ink);
}

.creation-progress-item.is-complete {
	border-color: var(--accent-2);
	background: rgba(39, 94, 74, 0.12);
	color: var(--ink);
}

.creation-progress-index {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 999px;
	background: rgba(46, 35, 24, 0.12);
	font-weight: 700;
	flex: 0 0 auto;
}

.creation-step {
	display: grid;
	gap: 12px;
}

.creation-step-header {
	display: flex;
	justify-content: space-between;
	align-items: start;
	gap: 12px;
}

.creation-step-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 8px;
}

.creation-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}

.creation-choice-card {
	position: relative;
	display: grid;
	gap: 8px;
	text-align: left;
	padding: 12px 14px;
	min-height: 120px;
	background: rgba(46, 35, 24, 0.82);
	color: #fff;
	border: 2px solid rgba(138, 107, 69, 0.35);
	border-radius: 12px;
	cursor: pointer;
}

/* Class selection grid on the multiclass step */
.class-choice-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 12px;
}

.class-choice-card {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	background: rgba(46, 35, 24, 0.82);
	color: #fff;
	border: 2px solid rgba(138, 107, 69, 0.35);
	border-radius: 12px;
	cursor: pointer;
	text-align: left;
	transition: border-color 0.15s, background 0.15s;
}

.class-choice-card:hover {
	border-color: rgba(162, 53, 36, 0.6);
	background: rgba(60, 45, 30, 0.9);
}

.class-choice-card.is-selected {
	border-color: var(--accent);
	background: rgba(255, 236, 222, 0.95);
	color: #4a4a4a;
	box-shadow: 0 0 0 2px rgba(162, 53, 36, 0.2);
}

.class-choice-level {
	font-size: 0.8rem;
	opacity: 0.75;
}

.creation-choice-meta {
	font-size: 0.8rem;
	font-weight: 700;
	color: inherit;
}

.creation-choice-card.is-selected {
	border-color: var(--accent);
	background: rgba(255, 236, 222, 0.95);
	box-shadow: inset 0 0 0 2px rgba(162, 53, 36, 0.45), 0 0 0 2px rgba(162, 53, 36, 0.2);
	transform: translateY(-1px);
	color: #4a4a4a;
}

.creation-race-card {
	justify-items: center;
	text-align: center;
}

.creation-race-name,
.creation-race-modifiers,
.creation-race-description {
	display: block;
	width: 100%;
}

.creation-choice-card.is-selected::after {
	content: 'Selected';
	position: absolute;
	top: 10px;
	right: 10px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	padding: 2px 8px;
	border-radius: 999px;
	color: #fff;
	background: var(--accent);
}

.creation-alignment-grid {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 600px) {
	.creation-alignment-grid {
		grid-template-columns: 1fr 1fr;
	}
}

.creation-alignment-abbr {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--accent-bright, #e8c77a);
}

.creation-alignment-name {
	font-size: 0.95rem;
}

.ability-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 14px;
}

.ability-card,
.creation-review-card {
	background: rgba(255, 255, 255, 0.62);
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 12px;
	padding: 10px 12px;
}

.ability-card {
	display: grid;
	justify-items: center;
	gap: 8px;
}

.ability-label {
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: rgba(46, 35, 24, 0.72);
}

.ability-score {
	font-size: 2rem;
	line-height: 1;
}

.ability-mod {
	font-weight: 700;
	color: var(--accent-2);
}

.ability-assignment-grid {
	display: grid;
	gap: 10px;
	max-width: 560px;
	width: 100%;
	margin: 0 auto;
}

.ability-assignment-row {
	display: grid;
	grid-template-columns: 138px 176px 118px;
	gap: 10px;
	align-items: center;
	background: rgba(255, 255, 255, 0.62);
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 8px;
	padding: 10px 12px;
}

.ability-assign-label {
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--ink);
	white-space: nowrap;
}

.creation-able-select {
	width: 172px;
	justify-self: center;
	padding: 6px 8px;
	border: 1px solid rgba(138, 107, 69, 0.4);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.8);
	font-size: 0.95rem;
	color: var(--ink);
}

.ability-assign-values {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 6px;
	align-items: center;
	text-align: center;
	font-size: 0.85rem;
}

.ability-base {
	font-weight: 700;
	color: inherited;
}

.ability-bonus {
	font-size: 0.8rem;
	color: var(--accent-2);
	font-weight: 600;
}

.ability-final {
	font-size: 1.1rem;
	color: var(--accent);
}

.ability-assignment-legend {
	font-size: 0.8rem;
	color: rgba(46, 35, 24, 0.65);
	text-align: center;
	padding: 8px 0;
	display: grid;
	grid-template-columns: 138px 176px 118px;
	gap: 10px;
	max-width: 560px;
	width: 100%;
	margin: 0 auto;
}

.ability-assignment-legend span {
	display: contents;
}

.creation-pill {
	padding: 8px 12px;
	border-radius: 999px;
	border: 1px solid rgba(138, 107, 69, 0.4);
	background: rgba(255, 255, 255, 0.7);
	font-weight: 700;
	white-space: nowrap;
}

.creation-pill.is-good {
	border-color: var(--accent-2);
	color: var(--accent-2);
}

.creation-skill-list,
.creation-feat-list {
	display: grid;
	gap: 8px;
}

.creation-skill-list {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: stretch;
}

.creation-feat-list {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: stretch;
}

.creation-skill-row,
.creation-feat-card {
	background: rgba(255, 255, 255, 0.62);
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 12px;
	padding: 10px 12px;
}

.creation-skill-row {
	display: grid;
	grid-template-rows: 1fr auto;
	align-content: stretch;
	gap: 8px;
	min-height: 96px;
	height: 100%;
	padding: 8px 10px;
	border-color: var(--accent);
}

.creation-skill-row>div:first-child {
	min-width: 0;
}

.creation-skill-row strong {
	font-size: 0.92rem;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

.creation-skill-meta,
.creation-feat-meta {
	display: flex;
	gap: 6px;
	flex-wrap: nowrap;
	margin-top: 4px;
	font-size: 0.8rem;
	color: rgba(46, 35, 24, 0.8);
}

.creation-skill-meta span {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.level-up-list {
	display: grid;
	gap: 10px;
}

.level-up-row {
	padding: 12px;
	border-radius: 10px;
	border: 1px solid rgba(138, 107, 69, 0.35);
	background: rgba(255, 255, 255, 0.6);
	display: grid;
	gap: 8px;
}

.level-up-row-top {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.creation-skill-controls {
	display: flex;
	align-items: center;
	gap: 6px;
	justify-self: end;
}

.creation-skill-controls .axiom-button {
	min-width: 24px;
	height: 24px;
	padding: 0;
	font-size: 0.76rem;
	line-height: 1;
	border-radius: 7px;
}

.creation-rank-display {
	min-width: 22px;
	text-align: center;
	font-weight: 700;
	font-size: 0.9rem;
}

.creation-feat-card {
	display: grid;
	grid-template-rows: auto 1fr auto;
	align-content: start;
	gap: 8px;
	padding: 8px 10px;
	min-height: 168px;
	height: 100%;
	cursor: default;
	background: rgba(46, 35, 24, 0.82);
	color: #fff;
	border: 2px solid rgba(138, 107, 69, 0.35);
	border-radius: 10px;
}

.creation-feat-card.is-selected {
	border-color: var(--accent);
	background: rgba(255, 236, 222, 0.95);
	box-shadow: inset 0 0 0 2px rgba(162, 53, 36, 0.55), 0 0 0 3px rgba(162, 53, 36, 0.3), 0 10px 18px rgba(80, 34, 24, 0.18);
	color: #4a4a4a;
}

.creation-feat-card.is-disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.creation-feat-card .creation-feat-meta,
.creation-feat-card .creation-feat-meta-block {
	color: inherit;
}

.creation-feat-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.creation-feat-heading {
	display: grid;
	gap: 5px;
}

.creation-feat-title {
	display: block;
	font-size: 1.06rem;
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-transform: none;
}

.creation-feat-card.is-selected .creation-feat-title {
	color: #2f1c10;
}

.creation-feat-description {
	margin: 0;
	font-size: 0.9rem;
	line-height: 1.35;
}

.creation-feat-meta-block {
	display: grid;
	gap: 2px;
	font-size: 0.84rem;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.82);

	.creation-fighter-bonus-pill {
		justify-self: start;
		font-size: 0.68rem;
		line-height: 1;
		padding: 3px 6px;
		border-color: rgba(162, 53, 36, 0.45);
	}
}

.creation-feat-card.is-selected .creation-feat-meta-block {
	color: rgba(47, 28, 16, 0.82);
}

.creation-feat-meta-label {
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(255, 214, 179, 0.9);
}

.creation-feat-card.is-selected .creation-feat-meta-label {
	color: rgba(162, 53, 36, 0.92);
}

.creation-feat-select {
	flex-shrink: 0;
	padding: 5px 11px;
	border: 1px solid rgba(255, 255, 255, 0.42);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.16);
	color: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.creation-feat-card.is-selected .creation-feat-select {
	border-color: rgba(162, 53, 36, 0.75);
	background: linear-gradient(180deg, rgba(200, 72, 48, 0.92), rgba(162, 53, 36, 0.96));
	color: #fff8f2;
	box-shadow: 0 0 0 2px rgba(162, 53, 36, 0.22), 0 6px 14px rgba(162, 53, 36, 0.3);
}

.creation-feat-select:disabled {
	opacity: 0.6;
}

.creation-feat-blocked {
	color: #8b1f1f;
	font-weight: 700;
	font-size: 0.84rem;
}

.creation-inline-select {
	max-width: 100%;
	font-size: 0.9rem;
}

.creation-granted-feats {
	margin-bottom: 14px;
	display: grid;
	gap: 10px;
}

.creation-feat-granted {
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--accent-2);
}

.creation-review-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.creation-review-card h3 {
	margin-bottom: 6px;
	color: var(--accent);
}

.creation-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 18px;
}

.creation-actions-right {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: end;
}

.modal-body p {
	white-space: pre-line;
}

a {
	color: inherit;
	text-decoration: none;
}

h1,
h2,
h3 {
	margin: 0 0 8px;
	letter-spacing: 0.02em;
}

.subtitle {
	margin: 0 0 20px;
	font-style: italic;
}

.panel {
	background: var(--panel);
	border: 2px solid var(--border);
	border-radius: 14px;
	padding: 16px;
	box-shadow: 0 10px 22px rgba(46, 35, 24, 0.18);
}

label {
	display: block;
	margin: 10px 0 6px;
	font-weight: 700;
}

input,
select,
button:not(.navbar-toggler),
.axiom-button {
	border-radius: 10px;
	border: 1px solid #9f8058;
	font: inherit;
	padding: 10px 12px;
}

input,
select {
	width: 100%;
}

button:not(.navbar-toggler),
.axiom-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	cursor: pointer;
	border: 0;
	color: #fff;
	background: linear-gradient(180deg, #bc4d3a, #8f2f21);
	transition: transform 0.15s ease, filter 0.2s ease;
}

button:not(.navbar-toggler):hover,
.axiom-button:hover {
	transform: translateY(-1px);
	filter: brightness(1.05);
}

button:not(.navbar-toggler):active,
.axiom-button:active {
	transform: translateY(2px) scale(0.96);
	filter: brightness(0.9);
	transition: transform 0.07s ease, filter 0.07s ease;
}

button:not(.navbar-toggler):disabled,
.axiom-button:disabled {
	opacity: 0.45;
	filter: grayscale(0.6);
	cursor: not-allowed;
	transform: none;
	pointer-events: none;
}

button.danger {
	background: linear-gradient(180deg, #77471d, #4f2b0e);
}

.actions {
	display: flex;
	gap: 12px;
	margin-top: 14px;
}

.actions button:not(.navbar-toggler),
.actions .axiom-button {
	flex: 1;
}

.auth-view[hidden],
.auth-validation-actions[hidden] {
	display: none;
}

.auth-view h2 {
	margin-bottom: 14px;
}

.auth-actions {
	margin-bottom: 10px;
}

.auth-links,
.auth-validation-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	margin-top: 10px;
}

button.auth-link {
	border: 0;
	padding: 0;
	background: transparent;
	color: var(--accent);
	text-decoration: underline;
	box-shadow: none;
}

button.auth-link:hover,
button.auth-link:active {
	transform: none;
	filter: none;
	color: #742417;
}

.game-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.game-header-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	flex-wrap: wrap;
}

.character-member-select {
	min-width: 180px;
	max-width: 260px;
}

.icon-editor {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
}

.icon-editor-preview {
	width: 92px;
	aspect-ratio: 1;
	border: 1px solid rgba(86, 64, 38, 0.24);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.82);
	color: var(--accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	font-size: 1.8rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.icon-editor-preview img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.icon-editor-controls {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
	min-width: 0;
}

.icon-editor-controls label,
.icon-editor-crop label {
	display: grid;
	gap: 4px;
	margin: 0;
	font-weight: 700;
	color: var(--accent-2);
}

.icon-editor-crop {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: auto minmax(180px, 1fr);
	gap: 12px;
	align-items: center;
}

.icon-editor-crop[hidden] {
	display: none !important;
}

.icon-editor-crop canvas {
	width: min(180px, 100%);
	aspect-ratio: 1;
	border: 1px solid rgba(86, 64, 38, 0.28);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.92);
	cursor: grab;
	touch-action: none;
}

.icon-editor-crop canvas:active {
	cursor: grabbing;
}

.icon-editor-actions {
	grid-column: 1 / -1;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.icon-editor-status {
	grid-column: 1 / -1;
	min-height: 20px;
}

.admin-monster-icon-field {
	display: grid;
	gap: 6px;
}

.admin-monster-icon-field>span {
	font-weight: 700;
	color: var(--accent-2);
}

.top-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.top-actions button {
	padding: 6px 12px;
	font-size: 0.85em;
	width: auto;
	min-width: unset;
}

.top-actions .nav-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(255, 248, 233, 0.95);
	border: 1px solid #9f8058;
	min-width: 120px;
	font-weight: 700;
}

.axiom-navbar {
	background: #a23524;
	border-bottom: 2px solid #000;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.axiom-navbar .navbar-brand,
.axiom-navbar .nav-link {
	color: #fff;
	font-weight: 700;
}

.axiom-navbar .nav-link.active {
	background: #fff;
	color: #a23524 !important;
	border-radius: 6px;
}

.axiom-navbar .nav-link:hover,
.axiom-navbar .navbar-brand:hover {
	color: #fff;
	opacity: 0.9;
}

.axiom-navbar .dropdown-menu {
	background: #8a2a1a;
	border: 1px solid rgba(255, 255, 255, 0.2);
	padding: 4px 0;
}

.axiom-navbar .dropdown-item {
	color: #fff;
	padding: 6px 16px;
}

.axiom-navbar .dropdown-item:hover,
.axiom-navbar .dropdown-item:focus {
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
}

.axiom-navbar .dropdown-item.disabled,
.axiom-navbar .dropdown-item[aria-disabled="true"] {
	opacity: 0.45;
	pointer-events: none;
	cursor: not-allowed;
}

.screen-content {
	display: none;
}

.screen-content.active {
	display: block;
}

.screen-title {
	margin-bottom: 16px;
	color: var(--accent);
	font-size: 1.4em;
}

.actions-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	margin: 12px 0;
}

.forest-layout {
	grid-template-columns: 1.1fr 0.9fr;
}

.wilderness-layout {
	margin: 12px 0;
	width: 100%;
}

.wilderness-main-panel {
	width: 100%;
}

.wilderness-action-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
	gap: 12px;
	align-items: start;
	margin-top: 16px;
}

.wilderness-action-grid > .axiom-button {
	width: 100%;
	margin: 0;
}

.wilderness-action-grid #sharedPlayerActions {
	display: contents;
}

.wilderness-action-grid .player-actions-shared-block,
.wilderness-action-grid [data-role="player-actions-buttons"] {
	display: contents !important;
}

.wilderness-action-grid .player-actions-shared-block > h3,
.wilderness-action-grid .player-actions-shared-block > p {
	display: none;
}

.wilderness-action-grid [data-player-action] {
	width: 100%;
	margin: 0;
}

.dungeon-layout {
	grid-template-columns: 1.1fr 0.9fr;
}

.link-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
	gap: 12px;
	margin: 12px 0;
}

.link-card {
	display: block;
	transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.link-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 26px rgba(46, 35, 24, 0.2);
}

.intro-copy {
	margin: 0;
	line-height: 1.6;
}

.location-summary-panel {
	padding: 18px 22px;
}

.location-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
}

.location-summary-title {
	margin: 0 0 6px;
	color: var(--accent);
}

.actions-grid button:not(.navbar-toggler),
.actions-grid .axiom-button,
.actions-grid select {
	margin-top: 10px;
	width: 100%;
}

.shop-button-stack {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 10px;
}

.admin-monster-skill-value {
	min-width: 100px;
}

@media (max-width: 900px) {
	.admin-monster-table thead {
		display: none;
	}

	.admin-monster-table,
	.admin-monster-table tbody,
	.admin-monster-table tr,
	.admin-monster-table td {
		display: block;
		width: 100%;
	}

	.admin-monster-table-row {
		border-bottom: 1px solid rgba(138, 107, 69, 0.18);
	}

	.admin-monster-table-row:last-child {
		border-bottom: none;
	}

	.admin-monster-table td {
		display: grid;
		grid-template-columns: 110px minmax(0, 1fr);
		gap: 8px;
		padding: 8px 10px;
		border-bottom: none;
	}

	.admin-monster-table td::before {
		content: attr(data-label);
		font-size: 0.72rem;
		text-transform: uppercase;
		letter-spacing: 0.05em;
		color: rgba(46, 35, 24, 0.66);
		font-weight: 700;
	}

	.admin-user-directory {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.admin-spell-list-toolbar,
	.admin-monster-list-toolbar {
		justify-content: stretch;
	}

	.admin-monster-filter-field {
		width: 100%;
	}

	.admin-layout {
		grid-template-columns: 1fr;
	}

	.admin-form-grid-3,
	.admin-form-grid-4,
	.admin-form-grid-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.admin-skill-table-header,
	.admin-skill-table-row {
		grid-template-columns: minmax(160px, 1.6fr) 70px 90px 120px;
	}

	.creation-progress {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.creation-review-grid {
		grid-template-columns: 1fr;
	}

	.creation-skill-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.creation-feat-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.creation-feat-card {
		min-height: 182px;
	}
}

@media (max-width: 640px) {

	.admin-section-header,
	.admin-editor-toolbar,
	.admin-editor-actions,
	.admin-toggle-row {
		flex-direction: column;
		align-items: stretch;
	}

	.admin-user-directory {
		grid-template-columns: 1fr;
	}

	.admin-form-grid-3,
	.admin-form-grid-4,
	.admin-form-grid-6,
	.admin-skill-table-header,
	.admin-skill-table-row {
		grid-template-columns: 1fr;
	}

	.creation-header,
	.creation-step-header,
	.creation-actions,
	.creation-skill-row,
	.ability-assignment-row {
		flex-direction: column;
		align-items: stretch;
	}

	.ability-assignment-row {
		display: grid;
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.creation-skill-list {
		grid-template-columns: 1fr;
	}

	.creation-feat-list {
		grid-template-columns: 1fr;
	}

	.creation-feat-card {
		min-height: 196px;
	}

	.ability-assign-values {
		grid-template-columns: auto auto auto;
	}

	.creation-actions-right {
		justify-content: stretch;
	}

	.creation-actions-right .axiom-button,
	#startOverBtn {
		width: 100%;
	}

	.creation-progress {
		grid-template-columns: 1fr;
	}
}

.work-progress {
	margin-top: 10px;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(255, 248, 233, 0.55);
	border: 1px solid rgba(138, 107, 69, 0.2);
}

.work-progress-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin: 0 0 6px;
	font-size: 0.82em;
	color: var(--accent-2);
	font-weight: 700;
}

.work-progress progress {
	width: 100%;
	height: 12px;
	accent-color: var(--accent);
}

.axiom-button {
	text-align: center;
	text-decoration: none;
}

.axiom-button:visited {
	color: inherit;
}

.hud {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 16px 24px;
}

.hud .stat-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 8px;
	background: rgba(255, 248, 233, 0.3);
	border-left: 3px solid var(--accent-2);
	border-radius: 3px;
}

.hud .stat-row span {
	font-size: 0.85em;
	color: var(--accent-2);
	font-weight: 600;
}

.hud .stat-row strong {
	font-size: 1.1em;
	color: var(--accent);
}

.hud .stat-row:last-child {
	border-bottom: none;
}

/* Character sheet multi-column layout */
.char-identity {
	border-bottom: 1px solid rgba(144, 108, 60, 0.3);
	margin-bottom: 1rem;
	padding-bottom: 0.75rem;
}

.char-label {
	font-size: 0.72em;
	color: var(--accent-2);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.char-block {
	background: rgba(255, 248, 233, 0.25);
	border: 1px solid rgba(144, 108, 60, 0.2);
	border-radius: 6px;
	padding: 10px 12px;
	height: 100%;
}

.char-block-title {
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: var(--accent-2);
	border-bottom: 1px solid rgba(144, 108, 60, 0.25);
	margin-bottom: 7px;
	padding-bottom: 4px;
}

.char-block .stat-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 3px 0;
	border-left: none;
	border-bottom: 1px dotted rgba(144, 108, 60, 0.15);
	background: none;
	border-radius: 6px;
	gap: 8px;
}

.char-block .stat-row:last-child {
	border-bottom: none;
}

.char-block .stat-row span {
	font-size: 0.8em;
	color: var(--accent-2);
	font-weight: 600;
	white-space: nowrap;
}

.char-block .stat-row strong {
	font-size: 0.88em;
	color: var(--accent);
	text-align: right;
}

.skills-block {
	padding-top: 12px;
}

.skills-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 12px;
}

.skill-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	padding: 6px 8px;
	border: 1px solid rgba(138, 107, 69, 0.22);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.45);
}

.skill-row-main {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	font-size: 0.86em;
}

.skill-row-main strong {
	color: var(--ink);
	font-size: 1em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.skill-ability {
	font-size: 0.72em;
	color: var(--accent-2);
	font-weight: 700;
	letter-spacing: 0.03em;
}

.skill-tag {
	font-size: 0.68em;
	font-weight: 700;
	color: #8f2f21;
	padding: 2px 6px;
	border: 1px solid rgba(143, 47, 33, 0.4);
	border-radius: 999px;
	background: rgba(143, 47, 33, 0.08);
}

.skill-row-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.78em;
	color: var(--accent-2);
	white-space: nowrap;
}

.skill-row-meta strong {
	font-size: 1.1em;
	color: var(--accent);
}

.stat-breakdown-trigger {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	margin: 0;
	font: inherit;
	font-weight: 700;
	color: var(--accent);
	cursor: pointer;
	text-align: right;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 0.14em;
}

.stat-breakdown-trigger:hover,
.stat-breakdown-trigger:focus-visible {
	color: #7f2619;
	outline: none;
}

.stat-breakdown-modal {
	display: grid;
	gap: 14px;
}

.stat-breakdown-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 10px 12px;
	border-radius: 10px;
	background: rgba(255, 248, 233, 0.65);
	border: 1px solid rgba(138, 107, 69, 0.28);
}

.stat-breakdown-total span,
.stat-breakdown-section h4,
.stat-breakdown-row span,
.stat-breakdown-notes {
	color: var(--accent-2);
}

.stat-breakdown-total strong {
	font-size: 1.3rem;
	color: var(--accent);
}

.stat-breakdown-section {
	display: grid;
	gap: 8px;
}

.stat-breakdown-section h4 {
	margin: 0;
	font-size: 0.76rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.stat-breakdown-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 7px 0;
	border-bottom: 1px dotted rgba(138, 107, 69, 0.25);
}

.stat-breakdown-row strong {
	color: var(--accent);
	white-space: nowrap;
}

.stat-breakdown-detail {
	margin-top: -4px;
	font-size: 0.84rem;
	color: rgba(46, 35, 24, 0.72);
}

.stat-breakdown-empty {
	margin: 0;
	font-size: 0.9rem;
	color: rgba(46, 35, 24, 0.72);
}

.stat-breakdown-notes {
	margin: 0;
	padding-left: 18px;
	font-size: 0.92rem;
}

.feat-slot-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
	gap: 10px;
	margin-bottom: 10px;
}

.feat-slot-summary div {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 8px 10px;
	border: 1px solid rgba(138, 107, 69, 0.2);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.45);
	gap: 12px;
}

.feat-slot-summary span {
	font-size: 0.78em;
	color: var(--accent-2);
	font-weight: 700;
}

.feat-known-list,
.feat-catalog-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 6px;
}

.feat-known-row,
.feat-catalog-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	padding: 6px 8px;
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 6px;
	background: rgba(255, 248, 233, 0.42);
	flex-wrap: wrap;
}

.feat-known-main,
.feat-catalog-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
	flex: 1;
}

.feat-known-main strong,
.feat-catalog-title strong {
	color: var(--ink);
	font-size: 0.9em;
}

.feat-catalog-title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.feat-catalog-meta {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 0.82em;
	color: var(--accent-2);
}

.feat-pill,
.feat-pill-selection {
	font-size: 0.65em;
	font-weight: 700;
	padding: 1px 6px;
	border-radius: 999px;
	border: 1px solid rgba(39, 94, 74, 0.32);
	background: rgba(39, 94, 74, 0.08);
	color: var(--accent-2);
	white-space: nowrap;
}

.feat-pill-selection {
	border-color: rgba(143, 47, 33, 0.32);
	background: rgba(143, 47, 33, 0.08);
	color: #8f2f21;
}

.feat-pill.is-on {
	border-color: rgba(39, 94, 74, 0.4);
	background: rgba(39, 94, 74, 0.18);
}

.feat-pill.is-off {
	border-color: rgba(138, 107, 69, 0.35);
	background: rgba(138, 107, 69, 0.12);
	color: #6c5134;
}

.feat-pill.is-class-granted {
	border-color: rgba(45, 77, 122, 0.35);
	background: rgba(45, 77, 122, 0.1);
	color: #2d4d7a;
}

.feat-known-actions,
.feat-catalog-actions {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	min-width: auto;
}

.feat-catalog-actions {
	min-width: 220px;
	justify-content: flex-end;
}

.feat-select {
	min-width: 160px;
	max-width: 220px;
	padding: 7px 9px;
	font-size: 0.86em;
}

.feat-learn-btn,
.feat-toggle-btn {
	padding: 7px 11px;
	font-size: 0.82em;
}

.character-options-list {
	display: grid;
	gap: 10px;
}

.character-option-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid rgba(138, 107, 69, 0.28);
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.46);
}

.character-option-main {
	display: grid;
	gap: 3px;
	min-width: 0;
}

.character-option-main strong {
	font-size: 0.96rem;
	color: var(--ink);
}

.character-option-main span {
	font-size: 0.84rem;
	color: var(--accent-2);
}

.character-option-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: flex-end;
}

/* Equipment grid on character sheet */
.equip-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 4px 20px;
}

.equip-slot {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	padding: 4px 0;
	border-bottom: 1px dotted rgba(144, 108, 60, 0.2);
	gap: 8px;
}

.equip-slot span {
	font-size: 0.8em;
	color: var(--accent-2);
	font-weight: 600;
	white-space: nowrap;
}

.equip-slot strong {
	font-size: 0.85em;
	color: var(--accent);
	text-align: right;
}

.equip-empty {
	color: rgba(144, 108, 60, 0.4);
	font-size: 0.85em;
}

/* Summary stats containers (used on Home, Town, Forest, Equipment pages) */
#summaryStats,
#townStats,
#forestStats,
#dungeonStats,
#statsPanel,
.character-stats-panel {
	grid-column: 1 / -1;
}

.character-stats-panel .forest-mini-sheet {
	display: grid;
	gap: 10px;
}

.character-stats-panel .character-party-tabs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	margin-bottom: 10px;
}

.character-stats-panel .character-party-tab {
	display: grid;
	gap: 2px;
	min-width: 0;
	min-height: 58px;
	padding: 6px 8px;
	border: 1px solid rgba(144, 108, 60, 0.28);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.35);
	color: var(--accent-2);
	text-align: left;
	line-height: 1.15;
}

.character-stats-panel .character-party-tab:hover:not(:disabled),
.character-stats-panel .character-party-tab.is-active {
	border-color: rgba(111, 75, 36, 0.72);
	background: rgba(255, 248, 233, 0.68);
	color: var(--accent);
}

.character-stats-panel .character-party-tab:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

.character-stats-panel .character-party-tab-name,
.character-stats-panel .character-party-tab-hp {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.character-stats-panel .character-party-tab-classes {
	min-width: 0;
	overflow-wrap: anywhere;
}

.character-stats-panel .character-party-tab-name {
	font-size: 0.82rem;
	font-weight: 700;
}

.character-stats-panel .character-party-tab-classes {
	font-size: 0.68rem;
	color: rgba(46, 35, 24, 0.72);
}

.character-stats-panel .character-party-tab-hp {
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--accent-2);
}

.character-stats-panel .character-xp-gauge {
	position: relative;
	display: block;
	width: 100%;
	height: 12px;
	overflow: hidden;
	border: 1px solid rgba(111, 75, 36, 0.28);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.48);
	color: var(--accent);
	font-size: 0.58rem;
	font-weight: 700;
	line-height: 10px;
	text-align: center;
	white-space: nowrap;
}

.character-stats-panel .character-xp-gauge-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	border-radius: inherit;
	background: linear-gradient(90deg, #4f8c6a, #c4a04a);
}

.character-stats-panel .character-xp-gauge span {
	position: relative;
	z-index: 1;
	display: block;
	padding: 0 4px;
	text-shadow: 0 1px 0 rgba(255, 248, 233, 0.72);
}

.character-stats-panel .character-party-tab-xp {
	margin-top: 2px;
}

.character-stats-panel .forest-mini-identity {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	align-items: center;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba(144, 108, 60, 0.25);
	font-size: 0.88rem;
	color: var(--accent-2);
}

.character-stats-panel .forest-mini-identity strong {
	color: var(--accent);
	font-size: 0.98rem;
}

.character-stats-panel .forest-mini-effects-btn {
	margin-left: auto;
	padding: 5px 10px;
	font-size: 0.74rem;
	line-height: 1;
	min-height: auto;
}

.character-stats-panel .forest-mini-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
	gap: 8px;
}

.character-stats-panel .forest-mini-card {
	background: rgba(255, 248, 233, 0.34);
	border: 1px solid rgba(144, 108, 60, 0.22);
	border-radius: 8px;
	padding: 8px 10px;
	min-width: 0;
}

.character-stats-panel .forest-mini-title {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--accent-2);
	margin-bottom: 5px;
	padding-bottom: 3px;
	border-bottom: 1px solid rgba(144, 108, 60, 0.2);
}

.character-stats-panel .forest-mini-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
	padding: 2px 0;
	font-size: 0.84rem;
}

.character-stats-panel .forest-mini-row span,
.character-stats-panel .forest-mini-saves span {
	color: var(--accent-2);
	font-weight: 600;
	white-space: nowrap;
}

.character-stats-panel .forest-mini-row strong,
.character-stats-panel .forest-mini-saves strong {
	color: var(--accent);
	font-size: 0.9rem;
	text-align: right;
}

.character-stats-panel .forest-mini-row strong .stat-breakdown-trigger {
	font-size: inherit;
}

.character-stats-panel .forest-mini-row small {
	font-size: 0.72rem;
	color: var(--accent-2);
}

.character-stats-panel .forest-mini-saves {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}

.character-stats-panel .forest-mini-saves div {
	display: grid;
	gap: 2px;
	padding: 4px 6px;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.34);
	text-align: center;
}

.character-stats-panel .forest-mini-weapon-block {
	display: grid;
	gap: 2px;
}

.character-stats-panel .forest-mini-weapon-block-secondary {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px dotted rgba(144, 108, 60, 0.2);
}

.character-stats-panel .forest-mini-weapon-name {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 2px;
}

.character-effects-modal {
	display: grid;
	gap: 14px;
}

.character-effects-section {
	display: grid;
	gap: 8px;
}

.character-effects-section h4 {
	margin: 0;
	font-size: 0.95rem;
	color: var(--accent);
}

.character-effects-list {
	display: grid;
	gap: 8px;
}

.character-effects-card {
	border: 1px solid rgba(144, 108, 60, 0.22);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.34);
	padding: 10px;
	display: grid;
	gap: 6px;
}

.character-effects-card.buff {
	border-left: 4px solid rgba(64, 125, 75, 0.6);
}

.character-effects-card.debuff {
	border-left: 4px solid rgba(160, 72, 64, 0.65);
}

.character-effects-card.summon {
	border-left: 4px solid rgba(66, 109, 150, 0.65);
}

.character-effects-card-head {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	align-items: baseline;
	font-size: 0.9rem;
}

.character-effects-card-head strong {
	color: var(--ink);
}

.character-effects-card-head span {
	color: var(--accent-2);
	font-size: 0.8rem;
	white-space: nowrap;
}

.character-effects-detail {
	display: grid;
	gap: 2px;
	font-size: 0.84rem;
}

.character-effects-detail strong {
	color: var(--accent);
	font-size: 0.8rem;
}

.character-effects-detail span,
.character-effects-notes,
.character-effects-empty {
	color: var(--accent-2);
}

.character-effects-notes {
	font-size: 0.78rem;
}

.mount-pet-list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
	gap: 8px;
}

.mount-pet-row {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.42);
}

.mount-pet-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
}

.mount-pet-main strong {
	color: var(--ink);
	font-size: 0.95em;
}

.mount-pet-controls {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-end;
	flex-wrap: wrap;
}

.combat-checkbox-wrapper,
.mount-radio-wrapper {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.85em;
	color: var(--accent-2);
	white-space: nowrap;
}

.combat-checkbox-wrapper input,
.mount-radio-wrapper input {
	margin: 0;
	cursor: pointer;
}

.combat-checkbox-wrapper label,
.mount-radio-wrapper label {
	margin: 0;
	cursor: pointer;
}

@media (max-width: 900px) {
	.hud {
		grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
		gap: 12px 16px;
	}
}

@media (max-width: 600px) {
	.skills-grid {
		grid-template-columns: 1fr;
	}

	.mount-pet-list {
		grid-template-columns: 1fr;
	}

	.mount-pet-row {
		flex-direction: column;
	}

	.mount-pet-controls {
		align-items: flex-start;
	}

	.feat-known-row,
	.feat-catalog-row {
		flex-direction: column;
	}

	.feat-catalog-actions {
		width: 100%;
		justify-content: flex-start;
		min-width: 0;
	}

	.hud {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.character-stats-panel .forest-mini-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.character-stats-panel .character-party-tabs {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.character-stats-panel .forest-mini-identity {
		gap: 6px 10px;
		font-size: 0.82rem;
	}

	.character-stats-panel .forest-mini-effects-btn {
		margin-left: 0;
	}

	.character-option-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.character-option-actions {
		justify-content: flex-start;
	}
}

.combat-map-shell {
	display: grid;
	gap: 8px;
	margin: 0 0 14px;
}

.combat-action-bar {
	display: none !important;
}

.combat-map-shell[hidden] {
	display: none !important;
}

.combat-map-toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.combat-map-mode-group {
	display: inline-flex;
	gap: 4px;
}

.combat-map-tool {
	width: 34px;
	min-width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid rgba(86, 64, 38, 0.28);
	border-radius: 6px;
	background: rgba(255, 248, 233, 0.78);
	color: var(--accent);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

.combat-map-tool:hover:not(:disabled),
.combat-map-tool.is-active {
	background: #406d53;
	color: #fff;
	border-color: rgba(26, 67, 46, 0.72);
}

.combat-map-tool:disabled {
	opacity: 0.6;
	cursor: wait;
}

.combat-map-readout {
	min-height: 20px;
	margin-left: auto;
	color: var(--accent-2);
	font-size: 0.84rem;
	font-weight: 700;
}

.combat-map-grid-wrap {
	position: relative;
}

@media (max-width: 600px) {
	.combat-map-grid-wrap {
		width: 100%;
		max-height: 72vh;
		overflow: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
		touch-action: pan-x pan-y;
		border: 1px solid rgba(69, 53, 34, 0.42);
		border-radius: 8px;
		background: rgba(46, 35, 24, 0.12);
		scrollbar-width: thin;
	}

	.combat-map-grid-wrap:focus-visible {
		outline: 3px solid rgba(47, 111, 149, 0.65);
		outline-offset: 2px;
	}
}

.combat-quick-action-bar {
	position: fixed;
	left: 50%;
	bottom: 20px;
	transform: translateX(-50%);
	z-index: 1080;
	display: flex;
	align-items: stretch;
	gap: 4px;
	padding: 6px;
	border: 1px solid rgba(242, 206, 98, 0.72);
	border-radius: 10px;
	background: rgba(35, 29, 20, 0.94);
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
	backdrop-filter: blur(6px);
}

.combat-quick-action-bar[hidden] {
	display: none;
}

.combat-quick-action-bar > button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	padding: 7px 11px;
	border: 1px solid rgba(255, 248, 233, 0.24);
	border-radius: 7px;
	color: #fff8e9;
	background: rgba(111, 83, 48, 0.9);
	font-weight: 700;
}

.combat-quick-action-bar > button[hidden] {
	display: none;
}

.combat-quick-action-bar > button:hover:not(:disabled) {
	background: rgba(143, 103, 56, 0.98);
}

.combat-quick-action-bar > button:disabled {
	opacity: 0.42;
}

.combat-quick-action-bar .combat-quick-action-drag {
	cursor: grab;
	padding-inline: 9px;
	color: #f2ce62;
	touch-action: none;
}

.combat-quick-action-bar.is-dragging .combat-quick-action-drag {
	cursor: grabbing;
}

@media (max-width: 600px) {
	.combat-quick-action-bar > button span {
		display: none;
	}
}

.combat-map-grid {
	--combat-map-width: 18;
	--combat-map-height: 18;
	--combat-map-cell-hover-stroke: 2px;
	--combat-map-cell-highlight-stroke: 2px;
	--combat-map-cell-strong-highlight-stroke: 3px;
	--combat-map-token-size: 80%;
	--combat-map-token-border-width: 2px;
	--combat-map-token-radius: 6px;
	--combat-map-token-img-radius: 4px;
	--combat-map-token-font-size: 0.9rem;
	--combat-map-token-shadow-y: 3px;
	--combat-map-token-shadow-blur: 8px;
	--combat-map-token-ring-width: 3px;
	--combat-map-token-ring-offset: 1px;
	--combat-map-token-ring-shadow-y: 4px;
	--combat-map-token-ring-shadow-blur: 10px;
	--combat-map-token-hp-height: 5px;
	--combat-map-token-hp-top: -8px;
	--combat-map-token-hp-edge: -4px;
	--combat-map-token-hp-border-width: 1px;
	--combat-map-token-letter-size: 18px;
	--combat-map-token-letter-offset: -7px;
	--combat-map-token-letter-pad: 4px;
	--combat-map-token-letter-font-size: 0.68rem;
	display: grid;
	grid-template-columns: repeat(var(--combat-map-width), minmax(0, 1fr));
	grid-template-rows: repeat(var(--combat-map-height), minmax(0, 1fr));
	width: 100%;
	aspect-ratio: var(--combat-map-width) / var(--combat-map-height);
	border: 2px solid rgba(69, 53, 34, 0.68);
	border-radius: 8px;
	overflow: hidden;
	background: #65754f;
	box-shadow: 0 10px 24px rgba(46, 35, 24, 0.16);
	touch-action: manipulation;
}

@media (max-width: 600px) {
	.combat-map-grid {
		grid-template-columns: repeat(var(--combat-map-width), 44px);
		grid-template-rows: repeat(var(--combat-map-height), 44px);
		width: max-content;
		min-width: 100%;
		aspect-ratio: auto;
		touch-action: pan-x pan-y;
		border: 0;
		border-radius: 0;
	}
}

.combat-map-cell {
	appearance: none;
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	border-right: 1px solid rgba(255, 255, 255, 0.16);
	border-bottom: 1px solid rgba(0, 0, 0, 0.16);
	background: #6f7b4e;
	position: relative;
}

.combat-map-grid[data-preset="true"] .combat-map-cell[class*="preset-terrain-"] { background-image: none; }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-terrain-grass { background: #789b58 repeating-linear-gradient(70deg, transparent 0 7px, rgba(39,91,41,.65) 8px 9px, transparent 10px 14px); }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-terrain-dirt { background: #8b6847 radial-gradient(circle, rgba(55,35,20,.45) 0 1px, transparent 2px); background-size: 11px 13px; }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-terrain-stone { background: #92938f linear-gradient(90deg, rgba(45,45,43,.4) 1px, transparent 1px); background-size: 50% 100%; }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-terrain-water { background: #4f8caf radial-gradient(ellipse at 50% 100%, transparent 55%, rgba(200,235,242,.55) 60% 64%, transparent 68%); background-size: 22px 11px; }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-terrain-sand { background: #d8c17d radial-gradient(circle, rgba(116,88,38,.35) 0 1px, transparent 1.5px); background-size: 10px 12px; }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-terrain-lava { background: #70291f linear-gradient(125deg, transparent 30%, #f5a623 34% 41%, transparent 45%); background-size: 25px 23px; }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-object-wall { background: repeating-linear-gradient(0deg, #74513a 0 45%, #3f2c21 46% 53%, #74513a 54% 100%); box-shadow: inset 0 0 0 3px #3f2c21; }
.combat-map-grid[data-preset="true"] .combat-map-cell.preset-object-door { background: linear-gradient(90deg, #3c291d 0 9%, #8d5a30 10% 90%, #3c291d 91%); box-shadow: inset 0 0 0 3px #352319; }
.combat-map-preset-object { position: absolute; inset: 0; display: grid; place-items: center; font-size: min(2vw, 22px); pointer-events: none; }

.combat-map-cell:hover {
	box-shadow: inset 0 0 0 var(--combat-map-cell-hover-stroke) rgba(255, 255, 255, 0.58);
}

.combat-map-cell.is-measured {
	box-shadow: inset 0 0 0 999px rgba(74, 137, 187, 0.34);
}

.combat-map-cell.is-measure-origin {
	box-shadow: inset 0 0 0 999px rgba(244, 196, 78, 0.42);
}

.combat-map-cell.is-move-reachable {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-highlight-stroke) rgba(242, 206, 98, 0.92),
		inset 0 0 0 999px rgba(242, 206, 98, 0.16);
}

.combat-map-cell.is-move-reachable:hover {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-strong-highlight-stroke) rgba(255, 248, 233, 0.94),
		inset 0 0 0 999px rgba(242, 206, 98, 0.26);
}

.combat-map-cell.is-move-origin {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-strong-highlight-stroke) rgba(47, 111, 149, 0.95),
		inset 0 0 0 999px rgba(47, 111, 149, 0.18);
}

.combat-map-cell.is-spell-range {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-highlight-stroke) rgba(94, 161, 188, 0.66),
		inset 0 0 0 999px rgba(94, 161, 188, 0.12);
}

.combat-map-cell.is-attack-range {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-highlight-stroke) rgba(71, 167, 96, 0.78),
		inset 0 0 0 999px rgba(71, 167, 96, 0.16);
}

.combat-map-cell.is-attack-penalty-range {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-highlight-stroke) rgba(224, 158, 55, 0.82),
		inset 0 0 0 999px rgba(224, 158, 55, 0.18);
}

.combat-map-cell.is-spell-area {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-strong-highlight-stroke) rgba(232, 91, 71, 0.88),
		inset 0 0 0 999px rgba(232, 91, 71, 0.26);
}

.combat-map-cell.is-spell-origin {
	box-shadow:
		inset 0 0 0 var(--combat-map-cell-strong-highlight-stroke) rgba(255, 248, 233, 0.92),
		inset 0 0 0 999px rgba(47, 111, 149, 0.22);
}

.combat-map-grid[data-terrain="forest"] .combat-map-cell {
	background-color: #426d42;
	background-image:
		linear-gradient(135deg, rgba(20, 67, 32, 0.28) 25%, transparent 25%),
		linear-gradient(45deg, rgba(121, 152, 78, 0.22) 25%, transparent 25%);
	background-size: 18px 18px;
}

.combat-map-grid[data-terrain="grass"] .combat-map-cell,
.combat-map-grid[data-terrain="field"] .combat-map-cell {
	background-color: #7b874e;
	background-image:
		linear-gradient(90deg, rgba(48, 89, 47, 0.2) 1px, transparent 1px),
		linear-gradient(0deg, rgba(232, 216, 132, 0.18) 1px, transparent 1px);
	background-size: 14px 14px;
}

.combat-map-grid[data-terrain="desert"] .combat-map-cell {
	background-color: #b89457;
	background-image: linear-gradient(135deg, rgba(255, 240, 179, 0.22) 25%, transparent 25%);
	background-size: 16px 16px;
}

.combat-map-grid[data-terrain="swamp"] .combat-map-cell {
	background-color: #536846;
	background-image:
		radial-gradient(circle at 30% 30%, rgba(70, 93, 88, 0.38), transparent 36%),
		linear-gradient(135deg, rgba(40, 64, 43, 0.24), transparent);
}

.combat-map-grid[data-terrain="mountain"] .combat-map-cell {
	background-color: #73716b;
	background-image:
		linear-gradient(135deg, rgba(45, 44, 42, 0.22) 25%, transparent 25%),
		linear-gradient(45deg, rgba(214, 208, 190, 0.18) 25%, transparent 25%);
	background-size: 15px 15px;
}

.combat-map-grid[data-terrain="snow"] .combat-map-cell {
	background-color: #c9d7db;
	background-image:
		linear-gradient(135deg, rgba(255, 255, 255, 0.36) 25%, transparent 25%),
		linear-gradient(45deg, rgba(95, 128, 144, 0.14) 25%, transparent 25%);
	background-size: 18px 18px;
}

.combat-map-grid[data-terrain="stone"] .combat-map-cell {
	background-color: #6f6e69;
	background-image:
		linear-gradient(90deg, rgba(45, 43, 40, 0.32) 1px, transparent 1px),
		linear-gradient(0deg, rgba(45, 43, 40, 0.32) 1px, transparent 1px),
		linear-gradient(135deg, rgba(230, 222, 203, 0.12), transparent);
	background-size: 28px 28px, 28px 28px, 100% 100%;
}

.combat-map-grid[data-terrain="water"] .combat-map-cell {
	background-color: #4a7c8c;
	background-image:
		linear-gradient(135deg, rgba(202, 232, 236, 0.25) 25%, transparent 25%),
		linear-gradient(45deg, rgba(25, 76, 92, 0.22) 25%, transparent 25%);
	background-size: 18px 18px;
}

.combat-map-grid[data-terrain="urban"] .combat-map-cell {
	background-color: #787063;
	background-image:
		linear-gradient(90deg, rgba(42, 37, 31, 0.24) 2px, transparent 2px),
		linear-gradient(0deg, rgba(42, 37, 31, 0.24) 2px, transparent 2px);
	background-size: 24px 24px;
}

.combat-map-token {
	appearance: none;
	width: var(--combat-map-token-size);
	height: var(--combat-map-token-size);
	aspect-ratio: 1 / 1;
	align-self: center;
	justify-self: center;
	padding: 0;
	border: var(--combat-map-token-border-width) solid rgba(255, 248, 233, 0.86);
	border-radius: var(--combat-map-token-radius);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: relative;
	font-size: var(--combat-map-token-font-size);
	line-height: 1;
	z-index: 3;
	box-shadow: 0 var(--combat-map-token-shadow-y) var(--combat-map-token-shadow-blur) rgba(28, 22, 16, 0.34);
	overflow: visible;
}

.combat-map-token[data-footprint="2"],
.combat-map-token[data-footprint="3"],
.combat-map-token[data-footprint="4"],
.combat-map-token[data-footprint="5"] {
	width: 90%;
	height: 90%;
}

.combat-map-token-hp {
	position: absolute;
	top: var(--combat-map-token-hp-top);
	left: var(--combat-map-token-hp-edge);
	right: var(--combat-map-token-hp-edge);
	height: var(--combat-map-token-hp-height);
	border: var(--combat-map-token-hp-border-width) solid rgba(35, 29, 20, 0.72);
	border-radius: 999px;
	background: rgba(53, 37, 28, 0.72);
	overflow: hidden;
	pointer-events: none;
	z-index: 5;
}

.combat-map-token-hp span {
	display: block;
	height: 100%;
	background: #55b86f;
}

.combat-map-token.is-player {
	background: #2f6f95;
}

.combat-map-token.is-enemy {
	background: #96382f;
}

.combat-map-token.is-summon {
	background: #6b5a94;
}

.combat-map-token>i {
	position: relative;
	z-index: 1;
}

.combat-map-token-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: var(--combat-map-token-img-radius);
	object-fit: cover;
	z-index: 0;
}

.combat-map-token-letter {
	position: absolute;
	right: var(--combat-map-token-letter-offset);
	bottom: var(--combat-map-token-letter-offset);
	min-width: var(--combat-map-token-letter-size);
	height: var(--combat-map-token-letter-size);
	padding: 0 var(--combat-map-token-letter-pad);
	border: 1px solid rgba(255, 248, 233, 0.9);
	border-radius: 999px;
	background: rgba(82, 31, 25, 0.96);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: var(--combat-map-token-letter-font-size);
	font-weight: 800;
	line-height: 1;
	z-index: 6;
	box-shadow: 0 2px 5px rgba(28, 22, 16, 0.34);
}

.combat-map-token.is-current {
	outline: calc(var(--combat-map-token-ring-width) + 1px) solid #741f1f;
	outline-offset: var(--combat-map-token-ring-offset);
	filter: saturate(1.18) contrast(1.08);
	box-shadow:
		0 0 0 calc(var(--combat-map-token-ring-width) + 2px) rgba(116, 31, 31, 0.34),
		0 0 18px rgba(116, 31, 31, 0.82),
		0 var(--combat-map-token-shadow-y) var(--combat-map-token-shadow-blur) rgba(28, 22, 16, 0.34);
}

.combat-map-token.is-action-menu-source {
	cursor: pointer;
}

.combat-map-token.is-selected {
	box-shadow:
		0 0 0 var(--combat-map-token-ring-width) rgba(255, 248, 233, 0.88),
		0 var(--combat-map-token-ring-shadow-y) var(--combat-map-token-ring-shadow-blur) rgba(28, 22, 16, 0.36);
}

.combat-map-token.is-targetable {
	box-shadow:
		0 0 0 var(--combat-map-token-ring-width) rgba(242, 206, 98, 0.9),
		0 var(--combat-map-token-ring-shadow-y) var(--combat-map-token-ring-shadow-blur) rgba(28, 22, 16, 0.36);
}

.combat-map-token.is-spell-affected {
	box-shadow:
		0 0 0 var(--combat-map-token-ring-width) rgba(232, 91, 71, 0.95),
		0 var(--combat-map-token-ring-shadow-y) var(--combat-map-token-ring-shadow-blur) rgba(28, 22, 16, 0.36);
}

.combat-map-token.is-current.is-selected,
.combat-map-token.is-current.is-action-menu-source {
	box-shadow:
		0 0 0 calc(var(--combat-map-token-ring-width) + 2px) rgba(116, 31, 31, 0.42),
		0 0 20px rgba(116, 31, 31, 0.9),
		0 var(--combat-map-token-ring-shadow-y) var(--combat-map-token-ring-shadow-blur) rgba(28, 22, 16, 0.4);
}

.combat-map-token.is-moving {
	z-index: 9;
	will-change: transform;
}

.combat-map-token.is-dead {
	opacity: 0.46;
	filter: grayscale(0.72);
}

.combat-map-token.is-dying {
	pointer-events: none;
	z-index: 10;
	animation: combat-token-death 1s ease-in forwards;
}

@keyframes combat-token-death {
	0% {
		opacity: 1;
		filter: grayscale(0);
		transform: scale(1) rotate(0deg);
	}
	55% {
		opacity: 0.72;
		filter: grayscale(0.55);
		transform: scale(1.08) rotate(-5deg);
	}
	100% {
		opacity: 0;
		filter: grayscale(1);
		transform: scale(0.25) rotate(16deg);
	}
}

.combat-action-menu {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 1650;
	width: min(320px, calc(100vw - 18px));
	padding: 8px;
	border: 1px solid rgba(255, 248, 233, 0.72);
	border-radius: 8px;
	background: rgba(42, 31, 22, 0.94);
	box-shadow: 0 14px 34px rgba(28, 22, 16, 0.36);
	transform: translate(-50%, -100%);
	backdrop-filter: blur(4px);
}

.combat-action-menu.is-below {
	transform: translate(-50%, 0);
}

.combat-action-menu::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: -8px;
	width: 14px;
	height: 14px;
	border-right: 1px solid rgba(255, 248, 233, 0.72);
	border-bottom: 1px solid rgba(255, 248, 233, 0.72);
	background: rgba(42, 31, 22, 0.94);
	transform: translateX(-50%) rotate(45deg);
}

.combat-action-menu.is-below::after {
	top: -8px;
	bottom: auto;
	border-right: 0;
	border-bottom: 0;
	border-left: 1px solid rgba(255, 248, 233, 0.72);
	border-top: 1px solid rgba(255, 248, 233, 0.72);
}

.combat-action-menu-grid {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
}

.combat-action-menu-close {
	position: absolute;
	right: -8px;
	top: -8px;
	z-index: 2;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 1px solid rgba(255, 248, 233, 0.72);
	border-radius: 50%;
	background: rgba(42, 31, 22, 0.98);
	color: #fff8e9;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(28, 22, 16, 0.34);
}

.combat-action-menu-close:hover,
.combat-action-menu-close:focus-visible {
	background: rgba(0, 229, 255, 0.22);
	border-color: rgba(0, 229, 255, 0.78);
	outline: 0;
}

.combat-action-menu-btn {
	min-width: 0;
	min-height: 48px;
	padding: 6px 4px;
	border: 1px solid rgba(255, 248, 233, 0.28);
	border-radius: 6px;
	background: rgba(255, 248, 233, 0.1);
	color: #fff8e9;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.05;
}

.combat-action-menu-btn i {
	font-size: 0.95rem;
}

.combat-action-menu-btn:hover:not(:disabled),
.combat-action-menu-btn:focus-visible:not(:disabled) {
	background: rgba(0, 229, 255, 0.18);
	border-color: rgba(0, 229, 255, 0.72);
	outline: 0;
}

.combat-action-menu-btn.is-danger:hover:not(:disabled),
.combat-action-menu-btn.is-danger:focus-visible:not(:disabled) {
	background: rgba(194, 55, 43, 0.34);
	border-color: rgba(255, 169, 137, 0.76);
}

.combat-action-menu-btn:disabled {
	opacity: 0.42;
	cursor: not-allowed;
}

.combat-action-animation {
	position: fixed;
	left: 0;
	top: 0;
	width: 36px;
	height: 36px;
	pointer-events: none;
	z-index: 1600;
	transform: translate(-50%, -50%);
	transform-origin: center;
	will-change: transform, opacity;
	filter: drop-shadow(0 0 6px rgba(255, 248, 233, 0.54));
}

.combat-floating-text {
	position: fixed;
	left: 0;
	top: 0;
	z-index: 1500;
	max-width: 150px;
	padding: 3px 7px;
	border: 1px solid rgba(255, 248, 233, 0.68);
	border-radius: 6px;
	background: rgba(42, 31, 22, 0.82);
	color: #fff8e9;
	font-size: 0.82rem;
	font-weight: 900;
	line-height: 1.05;
	text-align: center;
	text-shadow: 0 1px 2px rgba(28, 22, 16, 0.72);
	pointer-events: none !important;
	white-space: nowrap;
	transform: translate(-50%, -50%);
	will-change: transform, opacity;
}

.combat-floating-text.is-action,
.combat-floating-text.is-move {
	color: #d8f6ff;
	border-color: rgba(0, 229, 255, 0.72);
	box-shadow: 0 0 12px rgba(0, 229, 255, 0.34);
}

.combat-floating-text.is-damage {
	color: #ffd3c4;
	border-color: rgba(255, 119, 91, 0.76);
	box-shadow: 0 0 12px rgba(232, 91, 71, 0.4);
}

.combat-floating-text.is-critical {
	color: #ffe99a;
	border-color: rgba(255, 215, 110, 0.82);
	box-shadow: 0 0 16px rgba(255, 203, 68, 0.46);
	font-size: 0.96rem;
}

.combat-floating-text.is-miss {
	color: #d7e8ee;
	border-color: rgba(215, 232, 238, 0.58);
}

.combat-floating-text.is-heal,
.combat-floating-text.is-buff {
	color: #e6ffd8;
	border-color: rgba(98, 171, 108, 0.76);
	box-shadow: 0 0 12px rgba(98, 171, 108, 0.34);
}

.combat-floating-text.is-debuff {
	color: #e6d8ff;
	border-color: rgba(138, 117, 197, 0.76);
	box-shadow: 0 0 12px rgba(138, 117, 197, 0.34);
}

.combat-melee-hit {
	border-radius: 999px;
	border-top: 6px solid rgba(255, 248, 233, 0.98);
	border-left: 3px solid transparent;
	border-right: 3px solid transparent;
	box-shadow: 0 0 18px rgba(255, 248, 233, 0.86);
}

.combat-melee-hit.is-slashing {
	width: 64px;
	height: 36px;
	border-top-color: #fff4cf;
	box-shadow: 0 0 22px rgba(242, 206, 98, 0.94);
}

.combat-melee-hit.is-piercing {
	width: 66px;
	height: 8px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, transparent 0%, #fff8e9 28%, #d7e8ee 100%);
	box-shadow: 0 0 16px rgba(215, 232, 238, 0.9);
}

.combat-melee-hit.is-bludgeoning {
	width: 46px;
	height: 46px;
	border: 5px solid rgba(255, 248, 233, 0.96);
	border-radius: 50%;
	box-shadow: inset 0 0 0 7px rgba(242, 206, 98, 0.34), 0 0 22px rgba(82, 31, 25, 0.42);
}

.combat-melee-miss {
	width: 56px;
	height: 24px;
	border-top: 4px dashed rgba(255, 248, 233, 0.9);
	border-radius: 999px;
	filter: drop-shadow(0 0 8px rgba(28, 22, 16, 0.34));
}

.combat-projectile {
	width: 58px;
	height: 7px;
	border-radius: 999px;
	background: linear-gradient(90deg, rgba(74, 47, 30, 0.1), #3d2c22 42%, #fff8e9 100%);
	box-shadow: 0 0 14px rgba(255, 248, 233, 0.82);
}

.combat-projectile.is-piercing::after,
.combat-projectile.is-weapon::after {
	content: "";
	position: absolute;
	right: -8px;
	top: 50%;
	width: 0;
	height: 0;
	border-top: 7px solid transparent;
	border-bottom: 7px solid transparent;
	border-left: 11px solid #fff8e9;
	transform: translateY(-50%);
}

.combat-projectile.is-bludgeoning {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #5f4737;
	box-shadow: 0 0 0 3px rgba(255, 248, 233, 0.76), 0 0 14px rgba(95, 71, 55, 0.76);
}

.combat-projectile.is-miss {
	opacity: 0.78;
	background: linear-gradient(90deg, rgba(255, 248, 233, 0), rgba(255, 248, 233, 0.82));
}

.combat-ranged-hit,
.combat-ranged-miss {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 4px solid rgba(255, 248, 233, 0.94);
	box-shadow: 0 0 18px rgba(255, 248, 233, 0.78);
}

.combat-ranged-hit {
	background: rgba(242, 206, 98, 0.24);
}

.combat-ranged-miss {
	border-style: dashed;
	background: rgba(255, 248, 233, 0.08);
}

.combat-spell-bolt {
	width: 62px;
	height: 10px;
	border-radius: 999px;
	background: linear-gradient(90deg, transparent, #d7e8ee 38%, #fff8e9 100%);
	box-shadow: 0 0 18px rgba(215, 232, 238, 0.9);
}

.combat-spell-burst,
.combat-spell-resist,
.combat-spell-heal,
.combat-spell-buff {
	width: 58px;
	height: 58px;
	border-radius: 50%;
	border: 4px solid rgba(255, 248, 233, 0.94);
	box-shadow: 0 0 26px rgba(255, 248, 233, 0.7);
}

.combat-spell-burst {
	background: radial-gradient(circle, rgba(255, 248, 233, 0.78), rgba(255, 248, 233, 0.1) 58%, transparent 70%);
}

.combat-spell-resist {
	border-style: dashed;
	background: radial-gradient(circle, rgba(215, 232, 238, 0.28), rgba(215, 232, 238, 0.08) 55%, transparent 72%);
}

.combat-spell-heal,
.combat-spell-buff {
	width: 66px;
	height: 66px;
	background: radial-gradient(circle, rgba(255, 248, 233, 0.68), rgba(111, 180, 117, 0.18) 58%, transparent 74%);
}

.combat-spell-bolt.is-fire,
.combat-spell-burst.is-fire {
	background: radial-gradient(circle, #fff0a8 0%, #f07b3f 46%, rgba(166, 52, 37, 0) 72%);
	box-shadow: 0 0 18px rgba(240, 123, 63, 0.85);
	border-color: #fff0a8;
}

.combat-spell-bolt.is-cold,
.combat-spell-burst.is-cold {
	background: radial-gradient(circle, #f2fbff 0%, #7cc8dc 48%, rgba(64, 132, 156, 0) 74%);
	box-shadow: 0 0 18px rgba(124, 200, 220, 0.85);
	border-color: #d8f6ff;
}

.combat-spell-bolt.is-lightning,
.combat-spell-burst.is-lightning {
	background: linear-gradient(90deg, transparent, #fff59b 36%, #7ad3ff 68%, transparent);
	box-shadow: 0 0 18px rgba(255, 245, 155, 0.95);
	border-color: #fff59b;
}

.combat-spell-bolt.is-acid,
.combat-spell-burst.is-acid {
	background: radial-gradient(circle, #ecffad 0%, #73b65c 48%, rgba(73, 129, 70, 0) 74%);
	box-shadow: 0 0 18px rgba(115, 182, 92, 0.82);
	border-color: #ecffad;
}

.combat-spell-bolt.is-force,
.combat-spell-burst.is-force,
.combat-spell-resist.is-force {
	background: radial-gradient(circle, #f1e7ff 0%, #8a75c5 50%, rgba(78, 62, 132, 0) 74%);
	box-shadow: 0 0 18px rgba(138, 117, 197, 0.82);
	border-color: #f1e7ff;
}

.combat-spell-bolt.is-negative,
.combat-spell-burst.is-negative,
.combat-spell-burst.is-debuff {
	background: radial-gradient(circle, #c5b4d8 0%, #4c3b64 48%, rgba(37, 26, 47, 0) 76%);
	box-shadow: 0 0 18px rgba(76, 59, 100, 0.82);
	border-color: #c5b4d8;
}

.combat-spell-heal.is-healing,
.combat-spell-buff.is-buff {
	border-color: #fff0a8;
	background: radial-gradient(circle, rgba(255, 240, 168, 0.78), rgba(98, 171, 108, 0.24) 58%, transparent 75%);
	box-shadow: 0 0 18px rgba(98, 171, 108, 0.78);
}

.combat-action-economy {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
	font-size: 0.82rem;
	color: var(--accent-2);
}

.combat-action-economy span {
	display: inline-flex;
	align-items: center;
	min-height: 22px;
	padding: 2px 8px;
	border-radius: 6px;
	background: rgba(255, 248, 233, 0.74);
	border: 1px solid rgba(86, 64, 38, 0.18);
}

.combat-action-economy .is-spent {
	opacity: 0.58;
	text-decoration: line-through;
}

.combat-enemy-letter {
	width: 20px;
	height: 20px;
	margin-right: 6px;
	border-radius: 999px;
	background: #96382f;
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 1;
	vertical-align: middle;
}

@media (max-width: 700px) {

	.icon-editor,
	.icon-editor-crop {
		grid-template-columns: 1fr;
	}

	.combat-map-readout {
		width: 100%;
		margin-left: 0;
	}

	.combat-map-tool {
		width: 32px;
		min-width: 32px;
		height: 32px;
	}
}

#log {
	margin: 0;
	min-height: 220px;
	max-height: 340px;
	overflow: auto;
	padding: 10px;
	border-radius: 10px;
	background: #fff6e8;
	border: 1px solid #d1b58c;
	white-space: pre-wrap;
}

#log .combat-log-entry {
	color: #2e2318;
}

#log .combat-log-entry.is-hit {
	color: #1f6b2c;
}

#log .combat-log-entry.is-miss {
	color: #8f2f21;
}

#log .combat-log-entry.is-critical {
	color: #0066cc;
}

#log .combat-log-entry.is-hit strong,
#log .combat-log-entry.is-miss strong,
#log .combat-log-entry.is-critical strong {
	color: inherit;
}

#log .combat-log-hit {
	color: #1f6b2c;
}

#log .combat-log-miss {
	color: #8f2f21;
}

#log .combat-log-critical {
	color: #0066cc;
	font-weight: 800;
}

.message {
	margin: 10px 0 0;
	min-height: 24px;
	color: var(--accent-2);
	font-weight: 700;
}

.chat-shell {
	position: fixed;
	right: 24px;
	bottom: 0;
	z-index: 1100;
	width: min(420px, calc(100vw - 24px));
	max-width: 100%;
}

.chat-window {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	box-shadow: 0 12px 30px rgba(46, 35, 24, 0.28);
	padding: 12px 14px 14px;
}

.chat-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 10px;
}

.chat-header h3 {
	margin-bottom: 4px;
	font-size: 1rem;
	color: var(--accent);
}

.chat-status-text {
	margin: 0;
	font-size: 0.8rem;
	color: var(--accent-2);
	font-weight: 700;
}

.chat-status-text.is-error,
.chat-form-meta .is-error {
	color: #8f2f21;
}

.chat-toggle {
	background: transparent;
	color: var(--accent);
	border: 1px solid rgba(143, 47, 33, 0.3);
	padding: 6px 10px;
	font-size: 0.85rem;
	width: auto;
	min-width: auto;
	flex: 0 0 auto;
}

.chat-body.is-collapsed {
	display: none;
}

.chat-messages {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-height: 220px;
	max-height: 260px;
	overflow-y: auto;
	padding: 6px 4px 6px 0;
	margin-bottom: 10px;
	border-top: 1px solid rgba(138, 107, 69, 0.3);
	border-bottom: 1px solid rgba(138, 107, 69, 0.3);
}

.chat-message {
	background: rgba(255, 248, 233, 0.7);
	border: 1px solid rgba(138, 107, 69, 0.18);
	border-radius: 10px;
	padding: 8px 10px;
}

.chat-message.is-self {
	border-color: rgba(39, 94, 74, 0.35);
	background: rgba(232, 245, 239, 0.8);
}

.chat-message-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 4px;
	font-size: 0.8rem;
}

.chat-message-header strong {
	color: var(--accent);
}

.chat-message-time {
	color: rgba(46, 35, 24, 0.65);
	font-size: 0.75rem;
	white-space: nowrap;
}

.chat-message-body {
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
	line-height: 1.35;
	font-size: 0.92rem;
}

.chat-empty-state {
	margin: auto 0;
	padding: 14px 10px;
	text-align: center;
	color: rgba(46, 35, 24, 0.7);
	font-style: italic;
}

.chat-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.chat-form textarea {
	width: 100%;
	resize: vertical;
	min-height: 58px;
	max-height: 110px;
	border-radius: 10px;
	border: 1px solid #9f8058;
	padding: 10px 12px;
	font: inherit;
	background: rgba(255, 255, 255, 0.85);
}

.chat-form-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	font-size: 0.78rem;
	color: rgba(46, 35, 24, 0.72);
	font-weight: 700;
}

.chat-form-meta button {
	flex: 0 0 auto;
	min-width: 88px;
}

.chat-shell.is-collapsed {
	width: auto;
	right: 16px;
	bottom: 8px;
}

.chat-shell.is-collapsed .chat-window {
	padding: 8px 10px;
	border-radius: 12px;
}

.chat-shell.is-collapsed .chat-header {
	margin-bottom: 0;
	gap: 8px;
	align-items: center;
}

.chat-shell.is-collapsed .chat-header h3 {
	font-size: 0.85rem;
	margin: 0;
}

.chat-shell.is-collapsed .chat-status-text {
	display: none;
}

.chat-shell.is-collapsed .chat-toggle {
	padding: 3px 8px;
	font-size: 0.76rem;
	line-height: 1.1;
	border-radius: 8px;
}

@media (max-width: 900px) {
	.actions-grid {
		grid-template-columns: 1fr;
	}

	.forest-layout {
		grid-template-columns: 1fr;
	}

	.link-grid {
		grid-template-columns: 1fr;
	}

	.game-header {
		flex-direction: column;
		align-items: stretch;
	}

	.game-header-actions {
		width: 100%;
		justify-content: stretch;
	}

	.character-member-select {
		flex: 1 1 180px;
		max-width: none;
	}

	.top-actions {
		width: 100%;
		flex-wrap: wrap;
	}

	.top-actions button,
	.top-actions .nav-link {
		flex: 1;
	}

	.chat-shell {
		right: 16px;
		width: min(420px, calc(100vw - 16px));
	}
}

/* Equipment page styles */
.stats-panel {
	display: block;
	margin-bottom: 16px;
}

.stats-panel .stat-row {
	flex: 1 1 auto;
	min-width: 120px;
	flex-direction: row;
	align-items: center;
	gap: 40px;
	padding: 6px 12px;
}

.stats-panel .stat-row span {
	font-size: 0.8em;
	min-width: 60px;
	margin-right: 20px;
}

.stats-panel .stat-row strong {
	font-size: 1em;
}

@media (max-width: 900px) {
	.stats-panel {
		flex-direction: column;
	}

	.stats-panel .stat-row {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 600px) {
	.game-page.has-chat {
		padding-bottom: 300px;
	}

	.game-page.has-chat.chat-collapsed {
		padding-bottom: 90px;
	}

	.chat-shell {
		left: 0;
		right: 0;
		width: 100%;
	}

	.chat-window {
		border-radius: 14px 14px 0 0;
		padding: 10px 12px 12px;
	}

	.chat-messages {
		max-height: 220px;
		min-height: 180px;
	}

	.chat-form-meta {
		align-items: stretch;
		flex-direction: column;
	}

	.chat-form-meta button {
		width: 100%;
	}

	.stats-panel {
		gap: 8px;
	}

	.stats-panel .stat-row {
		padding: 4px 8px;
	}

	.stats-panel .stat-row span {
		font-size: 0.75em;
	}

	.stats-panel .stat-row strong {
		font-size: 0.9em;
	}
}

.equipment-tabs {
	display: flex;
	gap: 8px;
	margin: 8px 0 12px 0;
	flex-wrap: nowrap;
}

.tab-btn {
	padding: 6px 10px;
	background: #a23524;
	border: none;
	cursor: pointer;
	font-size: 0.8em;
	color: white;
	transition: all 0.2s;
	flex: 1;
	text-align: center;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tab-btn:hover {
	background: #8a2a1a;
}

.tab-btn.active {
	border: none;
	background: white;
	color: #a23524;
	font-weight: bold;
}

.tab-content {
	display: none;
	padding: 20px 0;
}

.tab-content.active {
	display: block;
}

.item-list {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.inventory-item,
.shop-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
}

.item-info {
	flex: 1;
}

.item-info strong {
	display: block;
	margin-bottom: 4px;
}

.item-details {
	font-size: 0.9em;
	color: #666;
}

.shop-filters {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}

.filter-btn {
	padding: 8px 16px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
	background: var(--accent);
	color: white;
	border-color: var(--accent);
}

.equipment-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 16px;
	padding: 16px;
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 4px;
}

.equipment-slot {
	display: flex;
	flex-direction: column;
	padding: 12px;
	background: white;
	border: 2px solid var(--border);
	border-radius: 4px;
	text-align: center;
}

.slot-label {
	font-weight: bold;
	font-size: 0.9em;
	color: var(--accent);
	margin-bottom: 8px;
}

.slot-available-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--accent);
	color: white;
	border-radius: 10px;
	font-size: 0.72em;
	padding: 1px 6px;
	margin-left: 5px;
	font-weight: bold;
	min-width: 18px;
	vertical-align: middle;
}

.slot-display {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	background: var(--bg-1);
	border: 1px solid var(--border);
	border-radius: 2px;
	min-height: 60px;
	margin-bottom: 8px;
	word-wrap: break-word;
	font-size: 0.95em;
}

.slot-display.has-item {
	align-items: flex-start;
	justify-content: flex-start;
	text-align: left;
	flex-direction: column;
	gap: 6px;
}

.equipped-item-name {
	font-weight: bold;
	color: var(--accent);
	line-height: 1.2;
}

.equipped-item-stats {
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.slot-buttons {
	display: flex;
	gap: 6px;
	justify-content: center;
	flex-wrap: wrap;
	margin-top: 4px;
}

.equip-picker-body {
	max-height: 60vh;
	overflow-y: auto;
	padding: 8px 12px;
}

.equip-picker-row {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: 4px;
	margin-bottom: 8px;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.equip-picker-row:hover,
.equip-picker-row:focus {
	background: var(--bg-1);
	border-color: var(--accent);
	outline: none;
}

.equip-picker-item-name {
	font-weight: bold;
	color: var(--accent);
}

.equip-picker-item-stats,
.equip-picker-item-bonus {
	font-size: 0.85em;
	color: var(--text-muted, #666);
}

.equip-picker-empty {
	text-align: center;
	color: var(--text-muted, #888);
	padding: 24px 0;
	font-style: italic;
}

.slot-display .item-stat {
	font-size: 0.82em;
	padding: 3px 5px;
}



.nav-bottom {
	display: flex;
	justify-content: center;
	gap: 12px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--border);
}

.nav-bottom .nav-link {
	padding: 10px 20px;
	background: #a23524;
	border: 2px solid #000000;
	color: white;
	border-radius: 4px;
	text-align: center;
	min-width: 120px;
	transition: all 0.2s;
}

.nav-bottom .nav-link:hover {
	background: #8a2a1a;
	color: white;
	border-color: #000000;
}

.equipment-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
}

.equipment-line {
	padding: 8px 12px;
	background: var(--bg-1);
	border-left: 3px solid var(--accent-2);
	border-radius: 2px;
	font-size: 0.95em;
}

/* Item Cards */
.shop-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}

#inventoryList {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.inv-type-header {
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: rgba(46, 35, 24, 0.55);
	padding: 12px 4px 4px;
	border-bottom: 1px solid rgba(138, 107, 69, 0.2);
	margin-bottom: 4px;
}

.inv-type-header:first-child {
	padding-top: 0;
}

.inv-row {
	display: grid;
	grid-template-columns: 1fr auto auto;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: rgba(255, 248, 233, 0.55);
	border: 1px solid rgba(138, 107, 69, 0.25);
	border-radius: 8px;
}

.inv-row-name {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	min-width: 0;
}

.inv-row-name strong {
	color: var(--accent);
	font-size: 0.95em;
	word-break: break-word;
}

.inv-row-slot {
	font-size: 0.82em;
	color: rgba(46, 35, 24, 0.65);
	white-space: nowrap;
	min-width: 80px;
	text-align: right;
}

.inv-row-actions {
	display: flex;
	gap: 6px;
	align-items: center;
	flex-shrink: 0;
}

.item-details-modal-body {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.inv-btn-unequip {
	background: rgba(180, 80, 60, 0.15);
	color: var(--accent);
	border: 1px solid rgba(180, 80, 60, 0.4);
}

.inv-target-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 4px 0;
}

.inv-target-label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border-radius: 8px;
	cursor: pointer;
	border: 1px solid rgba(138, 107, 69, 0.25);
	background: rgba(255, 248, 233, 0.5);
	transition: background 0.15s;
}

.inv-target-label:hover {
	background: rgba(224, 210, 182, 0.55);
}

.inv-target-label input[type="radio"] {
	accent-color: var(--accent);
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.item-card {
	display: flex;
	flex-direction: column;
	padding: 16px;
	background: white;
	border: 2px solid var(--border);
	border-radius: 6px;
	transition: all 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.item-card:hover {
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
	border-color: var(--accent);
	transform: translateY(-2px);
}

.item-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 12px;
	gap: 8px;
}

.item-card-header strong {
	flex: 1;
	color: var(--accent);
	font-size: 1.05em;
	word-wrap: break-word;
}

.item-qty,
.item-cost {
	background: var(--bg-1);
	padding: 4px 8px;
	border-radius: 3px;
	font-size: 0.85em;
	font-weight: bold;
	color: var(--accent-2);
	white-space: nowrap;
}

.item-cost {
	color: var(--accent);
}

.item-card-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 12px;
	font-size: 0.9em;
}

.item-stat {
	padding: 4px 6px;
	background: rgba(255, 248, 233, 0.5);
	border-left: 2px solid var(--accent-2);
	color: var(--ink);
}

.item-stat-extra {
	font-size: 0.88em;
	background: rgba(224, 210, 182, 0.35);
}

.btn-equip,
.btn-buy {
	padding: 10px 16px;
	background: var(--accent-2);
	color: white;
	border: none;
	border-radius: 4px;
	font-size: 0.95em;
	cursor: pointer;
	font-weight: bold;
	transition: all 0.2s;
}

.btn-equip:hover,
.btn-buy:hover {
	background: var(--accent);
	transform: scale(1.02);
}

.btn-equip:active,
.btn-buy:active {
	transform: scale(0.98);
}

/* Shop Categories */
.shop-categories {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.shop-category {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.shop-dropdown-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.shop-dropdown {
	background: rgba(255, 248, 233, 0.6);
	border: 1px solid var(--border);
	border-radius: 8px;
	overflow: hidden;
}

.shop-dropdown summary {
	list-style: none;
	cursor: pointer;
	padding: 10px 14px;
	font-weight: bold;
	color: var(--accent);
	background: rgba(224, 210, 182, 0.45);
	border-bottom: 1px solid transparent;
}

.shop-dropdown summary::-webkit-details-marker {
	display: none;
}

.shop-dropdown[open] summary {
	border-bottom-color: var(--border);
}

.shop-dropdown .shop-grid {
	padding: 12px;
}

.category-title {
	font-size: 1.3em;
	color: var(--accent);
	border-bottom: 3px solid var(--accent);
	padding-bottom: 8px;
	margin: 0;
}

.shop-card {
	position: relative;
}

.shop-card .item-cost {
	position: absolute;
	top: 16px;
	right: 16px;
	background: var(--accent);
	color: white;
	font-size: 0.9em;
	padding: 6px 10px;
	border-radius: 3px;
}

.shop-card .item-card-header {
	padding-right: 80px;
}

/* Responsive */
@media (max-width: 768px) {
	.shop-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 12px;
	}

	.inv-row {
		grid-template-columns: 1fr auto;
		grid-template-rows: auto auto;
	}

	.inv-row-slot {
		display: none;
	}

	.inv-row-actions {
		grid-column: 2;
		grid-row: 1 / span 2;
	}

	.item-card {
		padding: 12px;
	}

	.shop-card .item-cost {
		top: 12px;
		right: 12px;
		font-size: 0.8em;
		padding: 4px 8px;
	}

	.shop-card .item-card-header {
		padding-right: 70px;
	}
}

/* ── Class Progression Help Page ─────────────────────────────────────── */
.help-menu-modal[hidden] {
  display: none;
}

.help-menu-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 8, 14, 0.82);
}

.help-menu-modal-dialog {
  width: min(1100px, 96vw);
  height: min(850px, 92vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: var(--panel-bg, #121722);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.help-menu-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.help-menu-modal-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.help-menu-modal-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 2rem;
  line-height: 1;
}

.help-menu-modal-body,
.help-menu-modal-body iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
}

body.help-menu-modal-open {
  overflow: hidden;
}

body.help-modal-embed .game-shell {
  width: 100%;
  max-width: none;
  padding-top: 1rem;
}

body.help-modal-embed #appNav,
body.help-modal-embed .game-header {
  display: none !important;
}

@media (max-width: 600px) {
  .help-menu-modal { padding: 0; }
  .help-menu-modal-dialog { width: 100vw; height: 100vh; border-radius: 0; }
}
.progression-class-tabs {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.progression-class-tabs button {
	padding: 6px 18px;
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 999px;
	background: rgba(255, 248, 233, 0.45);
	color: var(--accent-2);
	font-size: 0.83em;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.progression-class-tabs button:hover {
	background: rgba(138, 107, 69, 0.12);
	border-color: rgba(138, 107, 69, 0.55);
}

.progression-class-tabs button.active {
	background: rgba(39, 94, 74, 0.14);
	border-color: rgba(39, 94, 74, 0.45);
	color: var(--ink);
}

.progression-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.86em;
}

.progression-table th {
	text-align: left;
	padding: 7px 10px;
	border-bottom: 2px solid rgba(138, 107, 69, 0.3);
	color: var(--accent-2);
	font-size: 0.78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.progression-table td {
	padding: 7px 10px;
	border-bottom: 1px solid rgba(138, 107, 69, 0.12);
	vertical-align: top;
}

.progression-table tr:last-child td {
	border-bottom: none;
}

.progression-table tr.prog-hp-row td {
	background: rgba(39, 94, 74, 0.04);
}

.progression-table tr.prog-ability-row td {
	background: rgba(255, 248, 233, 0.25);
}

.prog-level-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	font-size: 0.8em;
	font-weight: 700;
	border: 1px solid rgba(138, 107, 69, 0.3);
	background: rgba(255, 248, 233, 0.6);
}

.prog-ability-list {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.prog-ability-tag {
	display: inline-block;
	font-size: 0.78em;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 999px;
	border: 1px solid rgba(39, 94, 74, 0.32);
	background: rgba(39, 94, 74, 0.08);
	color: var(--accent-2);
}

.prog-ability-tag.is-upgrade {
	border-color: rgba(143, 47, 33, 0.32);
	background: rgba(143, 47, 33, 0.08);
	color: #8f2f21;
}

.prog-ability-tag.is-feat {
	border-color: rgba(45, 77, 122, 0.32);
	background: rgba(45, 77, 122, 0.08);
	color: #2d4d7a;
}

.prog-hp-info {
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.prog-hp-value {
	font-weight: 700;
	color: var(--ink);
}

.prog-hp-formula {
	font-size: 0.82em;
	color: var(--accent-2);
}

.prog-spells-scroll {
	overflow-x: auto;
}

.prog-spells-table th,
.prog-spells-table td {
	white-space: nowrap;
	text-align: center;
}

.prog-spells-table th:first-child,
.prog-spells-table td:first-child,
.prog-spells-table th:nth-child(2),
.prog-spells-table td:nth-child(2) {
	text-align: left;
}

.prog-bab-scroll {
	overflow-x: auto;
	max-height: 400px;
	border: 1px solid var(--border-color);
	border-radius: 4px;
}

.prog-bab-table th,
.prog-bab-table td {
	white-space: nowrap;
	text-align: center;
	padding: 8px 12px;
}

.prog-bab-table th:first-child,
.prog-bab-table td:first-child {
	text-align: center;
}

.prog-domain-plus {
	font-size: 0.72em;
	color: #2d4d7a;
	font-weight: 700;
	margin-left: 2px;
}

.prog-spell-list-wrap {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.prog-spell-circle-block {
	border: 1px solid var(--border);
	border-radius: 6px;
	overflow: hidden;
}

.prog-spell-circle-header {
	background: var(--bg-tertiary, #1a2233);
	color: var(--accent-1, #7aa2cc);
	font-weight: 700;
	font-size: 0.82em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 6px 12px;
	border-bottom: 1px solid var(--border);
}

.prog-spell-list-table {
	width: 100%;
	border-collapse: collapse;
}

.prog-spell-list-table tr:not(:last-child) td {
	border-bottom: 1px solid var(--border);
}

.prog-spell-list-table tr:hover td {
	background: var(--bg-tertiary, #1a2233);
}

.prog-spell-name {
	font-weight: 600;
	font-size: 0.88em;
	padding: 7px 12px;
	white-space: nowrap;
	width: 220px;
	color: #5a6a7a;
}

.prog-spell-desc {
	font-size: 0.82em;
	color: var(--accent-2, #8899aa);
	padding: 7px 12px 7px 6px;
	line-height: 1.4;
	transition: color 0.15s ease;
}

.prog-spell-list-table tr:hover .prog-spell-desc {
	color: #c8d8e8;
}

/* ── Character sheet spell list ─────────────────────────── */
.spell-slot-summary {
	font-size: 0.85em;
	color: var(--accent-2, #8899aa);
}

.spell-circle-block {
	margin-bottom: 1.25rem;
}

.spell-circle-dropdown {
	margin-bottom: 1rem;
}

.spell-circle-dropdown>.spell-sheet-grid {
	margin-top: 8px;
}

.spell-circle-dropdown>summary {
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.spell-circle-dropdown>summary::-webkit-details-marker {
	display: none;
}

.spell-circle-header {
	font-size: 0.76em;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #7a4f2f;
	border-bottom: 1px solid rgba(122, 79, 47, 0.28);
	padding-bottom: 4px;
	margin-bottom: 8px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.spell-circle-dropdown>.spell-circle-header::after {
	content: '+';
	font-size: 1rem;
	line-height: 1;
	color: rgba(122, 79, 47, 0.72);
}

.spell-circle-dropdown[open]>.spell-circle-header::after {
	content: '-';
}

.spell-sheet-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 5px 12px;
}

@media (max-width: 980px) {
	.spell-sheet-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 620px) {
	.spell-sheet-grid {
		grid-template-columns: 1fr;
	}
}

.spell-sheet-cell {
	display: flex;
	flex-direction: column;
	padding: 5px 7px;
	border-radius: 6px;
	border: 1px solid rgba(138, 107, 69, 0.18);
	transition: background 0.12s;
}

.spell-sheet-cell:hover {
	background: rgba(255, 255, 255, 0.62);
}

.spell-sheet-name {
	background: none;
	border: none;
	padding: 0;
	text-align: left;
	cursor: pointer;
	font-weight: 600;
	font-size: 0.82em;
	color: #8a3c2d;
	text-decoration: none;
	line-height: 1.15;
}

.spell-sheet-name:hover {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.spell-sheet-short {
	font-size: 0.74em;
	color: rgba(46, 35, 24, 0.72);
	line-height: 1.3;
	margin-top: 2px;
}

/* Spell detail modal */
.spell-detail-modal-content {
	background: rgba(255, 250, 240, 0.98);
	color: var(--ink);
	border: 1px solid rgba(138, 107, 69, 0.42);
	box-shadow: 0 14px 28px rgba(46, 35, 24, 0.2);
}

.spell-detail-modal-header,
.spell-detail-modal-footer {
	border-color: rgba(138, 107, 69, 0.3);
	background: rgba(250, 241, 224, 0.84);
}

.spell-detail-close-btn {
	padding: 6px 10px;
	font-size: 0.84rem;
}

.spell-modal-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 0.85em;
	color: rgba(46, 35, 24, 0.78);
	margin-bottom: 10px;
}

.spell-modal-meta strong {
	color: var(--ink);
}

.spell-modal-desc {
	font-size: 0.9em;
	line-height: 1.55;
	color: rgba(46, 35, 24, 0.92);
	margin-bottom: 10px;
}

.spell-modal-effects {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 10px;
}

.spell-modal-effect {
	font-size: 0.85em;
	color: rgba(46, 35, 24, 0.82);
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.spell-effect-notes {
	color: rgba(46, 35, 24, 0.7);
	font-style: italic;
}

.spell-effect-badge {
	font-size: 0.72em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: 3px;
	padding: 1px 6px;
	flex-shrink: 0;
	background: rgba(138, 107, 69, 0.22);
	color: rgba(46, 35, 24, 0.86);
}

.spell-effect-badge.damage {
	background: rgba(162, 53, 36, 0.18);
	color: #7d2418;
}

.spell-effect-badge.heal {
	background: rgba(39, 94, 74, 0.18);
	color: #1f644c;
}

.spell-effect-badge.buff {
	background: rgba(46, 85, 142, 0.18);
	color: #2e558e;
}

.spell-effect-badge.summon {
	background: rgba(120, 87, 52, 0.2);
	color: #6d4e2f;
}

.spell-modal-src {
	font-size: 0.8em;
	color: #8a3c2d;
}

/* Wizard spell selection grid */
.spell-select-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.spell-select-card {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid rgba(138, 107, 69, 0.35);
	border-radius: 5px;
	cursor: pointer;
	background: rgba(255, 252, 245, 0.7);
	transition: border-color 0.15s, background 0.15s;
}

.spell-select-card input[type="checkbox"] {
	display: none;
}

.spell-select-card:hover:not(.disabled) {
	border-color: rgba(138, 107, 69, 0.7);
	background: rgba(243, 236, 220, 0.85);
}

.spell-select-card.selected {
	border-color: #7d5a2a;
	background: rgba(200, 170, 110, 0.25);
}

.spell-select-card.disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.spell-desc {
	font-size: 0.78em;
	color: #6b5030;
	line-height: 1.3;
}

/* Ability increase card grid */
.ability-increase-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	max-width: 520px;
}

.ability-increase-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 12px 10px 10px;
	border: 2px solid rgba(138, 107, 69, 0.3);
	border-radius: 10px;
	cursor: pointer;
	background: rgba(255, 252, 245, 0.7);
	transition: border-color 0.15s, background 0.15s;
	user-select: none;
}

.ability-increase-card:hover {
	border-color: rgba(138, 107, 69, 0.65);
	background: rgba(243, 236, 220, 0.85);
}

.ability-increase-card.selected {
	border-color: #7d5a2a;
	background: rgba(200, 170, 110, 0.28);
}

.ability-increase-card .ability-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.07em;
	color: rgba(46, 35, 24, 0.65);
}

.ability-increase-card .ability-score {
	font-size: 1.9rem;
	line-height: 1;
	font-weight: 700;
}

.ability-increase-card .ability-mod {
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--accent-2);
}

.ability-increase-badge {
	font-size: 0.7rem;
	font-weight: 700;
	color: #fff;
	background: #7d5a2a;
	border-radius: 10px;
	padding: 1px 7px;
	margin-top: 2px;
}

.ability-increase-preview {
	font-size: 0.75rem;
	color: rgba(46, 35, 24, 0.45);
	margin-top: 2px;
}

.spell-cast-btn {
	font-size: 0.7rem;
	padding: 1px 8px;
	border-radius: 10px;
	line-height: 1.4;
	flex-shrink: 0;
	opacity: 0.85;
}

.spell-cast-btn:hover:not(:disabled) {
	opacity: 1;
}

.spell-cast-btn:disabled {
	opacity: 0.5;
	cursor: default;
}

.spell-target-btn {
	width: 100%;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 2px;
	padding: 6px 10px;
}

.spell-target-hp {
	font-size: 0.75rem;
	color: #6c757d;
	margin-left: auto;
	white-space: nowrap;
}

.active-summons-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 6px;
}

.active-summon-card {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(125, 90, 42, 0.25);
	border-radius: 6px;
	padding: 8px 10px;
}

.active-summon-hp-bar-wrap {
	flex: 1;
	height: 6px;
	background: rgba(0, 0, 0, 0.2);
	border-radius: 3px;
	overflow: hidden;
	min-width: 60px;
}

.active-summon-hp-bar {
	height: 100%;
	background: #5a9e5a;
	border-radius: 3px;
	transition: width 0.3s;
}

/* ─── Map Editor Styles ─────────────────────────────────────────────────── */

.admin-grid-new {
	width: 100%;
	margin-bottom: 16px;
}

.admin-grid-list-card {
	width: 100%;
	text-align: left;
	cursor: pointer;
}

.admin-grid-list-card.is-selected {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(162, 53, 36, 0.18);
}

.admin-grid-list-card small {
	display: block;
	margin-top: 4px;
	opacity: 0.72;
}

.combat-grid-workspace {
	display: grid;
	gap: 14px;
}

.combat-grid-toolbar,
.combat-grid-layer-tabs,
.combat-grid-palette {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}

.combat-grid-toolbar {
	align-items: stretch;
	flex-direction: column;
}

.combat-grid-layer-tabs .admin-tool-card {
	padding: 9px 12px;
}

.combat-grid-brush {
	border: 1px solid rgba(100, 75, 40, 0.32);
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.6);
	color: var(--ink);
	padding: 7px 10px;
}

.combat-grid-brush span {
	margin-right: 5px;
}

.combat-grid-brush.is-active {
	border-color: var(--accent);
	background: rgba(162, 53, 36, 0.12);
	box-shadow: inset 0 0 0 1px var(--accent);
}

.combat-grid-scroll {
	overflow: auto;
	max-width: 100%;
	padding: 10px;
	background: rgba(48, 37, 26, 0.1);
	border-radius: 10px;
}

.combat-grid-board {
	display: grid;
	gap: 1px;
	width: max-content;
	user-select: none;
	touch-action: none;
}

button.combat-grid-cell {
	position: relative;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid rgba(40, 32, 22, 0.3);
	border-radius: 2px;
	background: #eee3cc;
	font-size: 21px;
	overflow: hidden;
}

button.combat-grid-cell.terrain-grass {
	background-color: #789b58;
	background-image:
		linear-gradient(68deg, transparent 44%, rgba(39, 91, 41, 0.75) 46% 49%, transparent 51%),
		linear-gradient(112deg, transparent 45%, rgba(51, 112, 49, 0.7) 47% 50%, transparent 52%),
		linear-gradient(75deg, transparent 46%, rgba(181, 202, 103, 0.5) 48% 50%, transparent 52%);
	background-size: 13px 15px, 17px 19px, 23px 17px;
	background-position: 1px 4px, 7px 1px, 2px 9px;
}

button.combat-grid-cell.terrain-dirt {
	background-color: #8b6847;
	background-image:
		radial-gradient(circle at 25% 30%, rgba(65, 43, 27, 0.55) 0 1px, transparent 2px),
		radial-gradient(circle at 72% 68%, rgba(210, 170, 113, 0.38) 0 1.5px, transparent 2.5px),
		radial-gradient(ellipse at 45% 80%, rgba(69, 46, 29, 0.28) 0 3px, transparent 4px);
	background-size: 16px 14px, 21px 18px, 27px 23px;
}

button.combat-grid-cell.terrain-stone {
	background-color: #92938f;
	background-image:
		linear-gradient(rgba(62, 64, 62, 0.42) 1px, transparent 1px),
		linear-gradient(90deg, rgba(62, 64, 62, 0.35) 1px, transparent 1px),
		linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 55%);
	background-size: 21px 14px, 21px 14px, 100% 100%;
	background-position: 0 0, 10px 7px, 0 0;
}

button.combat-grid-cell.terrain-water {
	background-color: #4f8caf;
	background-image:
		radial-gradient(ellipse at 50% 100%, transparent 55%, rgba(191, 229, 239, 0.55) 58% 63%, transparent 66%),
		radial-gradient(ellipse at 50% 0%, transparent 56%, rgba(31, 99, 143, 0.48) 59% 64%, transparent 67%),
		linear-gradient(115deg, rgba(255, 255, 255, 0.12), transparent 45%);
	background-size: 25px 12px, 31px 15px, 100% 100%;
	background-position: 0 1px, 9px 8px, 0 0;
}

button.combat-grid-cell.terrain-sand {
	background-color: #d8c17d;
	background-image:
		radial-gradient(circle, rgba(116, 88, 38, 0.35) 0 1px, transparent 1.5px),
		radial-gradient(circle, rgba(255, 241, 180, 0.6) 0 1px, transparent 1.5px),
		repeating-radial-gradient(ellipse at 0 50%, transparent 0 8px, rgba(167, 133, 64, 0.2) 9px 10px, transparent 11px 16px);
	background-size: 13px 15px, 19px 17px, 34px 25px;
	background-position: 2px 3px, 8px 10px, 0 0;
}

button.combat-grid-cell.terrain-lava {
	background-color: #70291f;
	background-image:
		linear-gradient(125deg, transparent 0 31%, #f5a623 33% 38%, #ffdb55 40%, #df5b24 43% 48%, transparent 50%),
		linear-gradient(55deg, transparent 0 55%, rgba(255, 189, 48, 0.92) 57% 61%, transparent 64%),
		radial-gradient(circle at 70% 25%, #d64a22, #70291f 68%);
	background-size: 31px 27px, 37px 33px, 100% 100%;
	background-position: -4px 2px, 7px -5px, 0 0;
}

.combat-grid-object,
.combat-grid-actor {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	pointer-events: none;
}

.combat-grid-object { font-size: 20px; }
.combat-grid-object.object-wall,
.combat-grid-object.object-door {
	inset: 0;
	width: 100%;
	height: 100%;
	font-size: 0;
}

.combat-grid-object.object-wall {
	background:
		linear-gradient(90deg, transparent 48%, rgba(65, 42, 27, 0.4) 49% 52%, transparent 53%),
		repeating-linear-gradient(0deg, #74513a 0 9px, #4d3426 9px 11px);
	box-shadow: inset 0 0 0 3px #3f2c21;
}

.combat-grid-object.object-door {
	background: linear-gradient(90deg, #3c291d 0 8%, #8d5a30 8% 92%, #3c291d 92%);
	box-shadow: inset 0 0 0 3px #352319;
}

.combat-grid-object.object-door::after {
	content: '';
	position: absolute;
	right: 7px;
	top: 50%;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: #d8b357;
	transform: translateY(-50%);
}
.combat-grid-actor {
	font-size: 25px;
	z-index: 2;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.7));
}

.admin-map-editor-container {
	display: grid;
	grid-template-columns: 1fr 300px;
	gap: 16px;
	margin-top: 16px;
}

.admin-map-canvas-wrapper {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	background: #f0f0f0;
	border: 2px solid #ccc;
	border-radius: 8px;
	padding: 16px;
	overflow: auto;
	max-height: 700px;
}

.admin-map-canvas {
	cursor: crosshair;
	border: 1px solid #999;
	background: #e0e0e0;
	display: block;
}

.admin-map-pins-panel {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--border);
	border-radius: 4px;
	background: var(--panel);
}

.admin-map-pins-header {
	padding: 6px 8px;
	border-bottom: 1px solid var(--border);
	background: rgba(162, 53, 36, 0.1);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 4px;
	flex-wrap: nowrap;
}

.admin-map-pins-header h6 {
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}

.admin-map-pins-filter {
	display: flex;
	gap: 2px;
	flex-wrap: nowrap;
}

.filter-pin-link {
	color: var(--ink);
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
	border-bottom: 2px solid transparent;
	padding: 0 2px;
	font-size: 12px;
	white-space: nowrap;
	flex-shrink: 0;
}

.filter-pin-link:hover {
	color: var(--accent);
	border-bottom-color: var(--accent);
}

.filter-pin-link.active {
	color: var(--accent);
	border-bottom-color: var(--accent);
	font-weight: 600;
}

/* WYSIWYG Editor Styling */
.wysiwyg-toolbar {
	display: flex;
	gap: 4px;
	padding: 8px;
	background: #f5f5f5;
	border: 1px solid var(--border);
	border-bottom: none;
	border-radius: 4px 4px 0 0;
	flex-wrap: wrap;
}

.wysiwyg-btn {
	padding: 4px 8px;
	background: white;
	border: 1px solid var(--border);
	border-radius: 3px;
	cursor: pointer;
	font-size: 13px;
	transition: all 0.2s ease;
}

.wysiwyg-btn:hover {
	background: #e8e8e8;
}

.wysiwyg-btn:active {
	background: var(--accent);
	color: white;
	border-color: var(--accent);
}

.wysiwyg-separator {
	width: 1px;
	background: var(--border);
	margin: 0 4px;
}

.wysiwyg-editor {
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: 0 0 4px 4px;
	min-height: 100px;
	background: white;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
	outline: none;
}

.wysiwyg-editor:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px rgba(162, 53, 36, 0.1);
}

.wysiwyg-editor[contenteditable]:empty:before {
	content: attr(placeholder);
	color: #999;
}

.admin-map-pins-list {
	flex: 1;
	overflow-y: auto;
	max-height: 400px;
}

.admin-map-pin-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 12px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
	cursor: pointer;
	transition: background-color 0.2s;
}

.admin-map-pin-item:hover {
	background-color: rgba(162, 53, 36, 0.08);
}

.admin-map-pin-info {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.admin-map-pin-info strong {
	font-size: 13px;
	color: var(--ink);
}

.admin-map-pin-info small {
	font-size: 11px;
	margin-top: 2px;
}

.admin-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 1000;
}

.admin-modal.hidden {
	display: none;
}

.admin-modal-content {
	background: var(--panel);
	border: 2px solid var(--border);
	border-radius: 8px;
	padding: 24px;
	max-width: 500px;
	width: 90%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.admin-modal-content h5 {
	margin: 0 0 16px 0;
	font-size: 18px;
	font-weight: 600;
}

.admin-modal-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-top: 16px;
}

.admin-spell-list-toolbar {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.admin-spell-circle-filter {
	display: grid;
	gap: 4px;
	min-width: 150px;
	font-size: 12px;
	font-weight: 700;
}

.admin-spell-name-link,
.admin-monster-name-link,
.admin-magic-item-name-link,
.admin-quest-name-link,
.admin-special-attack-name-link,
.admin-disease-name-link,
.admin-map-name-link,
.admin-combat-grid-name-link,
.admin-account-name-link {
	color: var(--ink);
	font-weight: 700;
	text-decoration: none;
	text-underline-offset: 2px;
}

.admin-spell-name-link:hover,
.admin-spell-name-link:focus-visible,
.admin-monster-name-link:hover,
.admin-monster-name-link:focus-visible,
.admin-magic-item-name-link:hover,
.admin-magic-item-name-link:focus-visible,
.admin-quest-name-link:hover,
.admin-quest-name-link:focus-visible,
.admin-special-attack-name-link:hover,
.admin-special-attack-name-link:focus-visible,
.admin-disease-name-link:hover,
.admin-disease-name-link:focus-visible,
.admin-map-name-link:hover,
.admin-map-name-link:focus-visible,
.admin-combat-grid-name-link:hover,
.admin-combat-grid-name-link:focus-visible,
.admin-account-name-link:hover,
.admin-account-name-link:focus-visible {
	color: var(--accent);
	text-decoration: underline;
}

.admin-spell-editor-modal {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(20, 14, 10, 0.72);
}

.admin-spell-editor-modal-dialog {
	width: min(1200px, 100%);
	max-height: calc(100vh - 48px);
}

.admin-spell-editor-modal-content {
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	padding: 20px;
	border: 2px solid var(--border);
	border-radius: 10px;
	background: var(--panel);
	box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.admin-spell-editor-modal-header {
	position: sticky;
	top: -20px;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: -20px -20px 18px;
	padding: 16px 20px;
	border-bottom: 1px solid var(--border);
	background: var(--panel);
}

.admin-spell-editor-modal-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.admin-spell-editor-modal-close {
	border: 0;
	background: transparent;
	color: var(--ink);
	font-size: 30px;
	line-height: 1;
}

@media (max-width: 700px) {
	.admin-spell-editor-modal {
		padding: 8px;
	}

	.admin-spell-editor-modal-dialog,
	.admin-spell-editor-modal-content {
		max-height: calc(100vh - 16px);
	}

	.admin-spell-editor-modal-header {
		align-items: flex-start;
	}
}

.admin-map-zoom-controls {
	display: flex;
	gap: 8px;
	align-items: center;
	margin-bottom: 12px;
	padding: 8px 12px;
	background: rgba(162, 53, 36, 0.08);
	border-radius: 4px;
	font-size: 13px;
	font-weight: 500;
}

.admin-map-zoom-controls button {
	min-width: 32px;
}

.admin-map-zoom-controls #adminMapZoomLevel {
	min-width: 50px;
	text-align: center;
	color: var(--text-muted);
}

/* Travel Map Styles */
.travel-map-container {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	overflow: visible;
	aspect-ratio: 1912 / 900;
}

.travel-map-image {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.map-pins-container {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
}

/* Hide map image on mobile screens, but keep the container for layout */
@media (max-width: 768px) {
	.travel-map-image {
		display: none;
	}

	.travel-map-container {
		display: none;
	}
}

/* Town Map Styles (similar to travel map) */
.town-map-container {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto 1.5rem auto;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	overflow: visible;
	aspect-ratio: 1912 / 900;
}

.town-map-image {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: contain;
}

.town-map-header {
	margin-bottom: 1.5rem;
}

.town-map-name {
	margin: 0 0 0.5rem 0;
	font-size: 2rem;
	font-weight: 700;
	color: var(--ink);
	line-height: 1.2;
}

.town-map-description {
	margin: 0;
	font-size: 1.05rem;
	color: rgba(46, 35, 24, 0.85);
	line-height: 1.5;
}

.map-image-title {
	display: block;
	margin: 1.5rem 0 0.75rem 0;
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--ink);
}

/* Hide town map image and pins on mobile screens */
@media (max-width: 768px) {
	.town-map-container {
		display: none;
	}

	.map-image-title {
		display: none;
	}

	.town-map-name {
		font-size: 1.5rem;
	}

	.town-map-description {
		font-size: 1rem;
	}
}

/* Locations Grid for Wilderness and Dungeons */
.locations-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.25rem;
}

.location-card {
	border: 1px solid var(--border);
	border-radius: 8px;
	background: rgba(255, 248, 233, 0.6);
	overflow: hidden;
	transition: all 0.2s ease;
}

.location-card:hover {
	background: rgba(255, 248, 233, 0.9);
	border-color: var(--accent);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.location-card-body {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.location-card-title {
	margin: 0;
	font-size: 1.1rem;
	color: var(--ink);
	font-weight: 600;
}

.location-card-meta {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	font-size: 0.85rem;
	color: rgba(46, 35, 24, 0.75);
}

.meta-item {
	display: flex;
	gap: 0.5rem;
}

.enter-dungeon-btn,
.travel-wilderness-btn {
	width: 100% !important;
}

.location-card-description {
	margin: 0;
	font-size: 0.95rem;
	color: rgba(46, 35, 24, 0.85);
	line-height: 1.4;
	flex-grow: 1;
	min-height: 120px;
}

.location-card button {
	align-self: flex-start;
	margin-top: auto;
}

@media (max-width: 768px) {
	.locations-grid {
		grid-template-columns: 1fr;
	}
}

/* Towns list styling */
.towns-list-section {
	margin-top: 2rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
}

.towns-list-section h4 {
	font-size: 1.25rem;
	margin-bottom: 1rem;
	color: var(--ink);
}

.pin-type-filters {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.filter-btn {
	padding: 0.4rem 0.8rem;
	background: rgba(255, 248, 233, 0.6);
	border: 1px solid var(--border);
	border-radius: 20px;
	color: var(--ink);
	font-size: 0.9rem;
	cursor: pointer;
	transition: all 0.2s ease;
}

.filter-btn:hover {
	background: rgba(255, 248, 233, 0.9);
	border-color: var(--accent);
}

.filter-btn.active {
	background: var(--accent);
	color: white;
	border-color: var(--accent);
}

.towns-list-items {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.town-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	padding: 1rem;
	background: rgba(255, 248, 233, 0.5);
	border: 1px solid var(--border);
	border-radius: 6px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.town-item:hover {
	background: rgba(255, 248, 233, 0.8);
	border-color: var(--accent);
	transform: translateX(4px);
}

.town-info {
	flex: 1;
	min-width: 0;
}

.town-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
}

.town-name {
	font-size: 1.1rem;
	font-weight: 600;
	margin: 0;
	color: var(--ink);
}

.pin-type-badge {
	display: inline-block;
	padding: 0.2rem 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 4px;
	white-space: nowrap;
}

.pin-type-badge.badge-town {
	background: rgba(162, 53, 36, 0.15);
	color: #a23524;
}

.pin-type-badge.badge-dungeon {
	background: rgba(74, 144, 226, 0.15);
	color: #4a90e2;
}

.pin-type-badge.badge-wilderness {
	background: rgba(226, 138, 46, 0.15);
	color: #e28a2e;
}

.pin-type-badge.badge-kingdom {
	background: rgba(39, 94, 74, 0.15);
	color: #275e4a;
}

.town-description {
	margin: 0.5rem 0 0.25rem 0;
	font-size: 0.95rem;
	color: var(--ink);
}

.travel-to-btn {
	white-space: nowrap;
	flex-shrink: 0;
}

@media (max-width: 576px) {
	.town-item {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
	}

	.town-info {
		width: 100%;
	}

	.travel-to-btn {
		width: 100%;
	}

	.town-item:hover {
		transform: none;
	}
}

.map-pin {
	position: absolute;
	transform: translate(-50%, -50%);
	cursor: pointer;
	width: 40px;
	height: 40px;
	overflow: visible;
}

.pin-circle {
	width: 20px;
	height: 20px;
	background: #a23524;
	border: 3px solid #fff;
	border-radius: 50%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(162, 53, 36, 0.4);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pin-circle.pin-town {
	background: #a23524;
	box-shadow: 0 2px 8px rgba(162, 53, 36, 0.4);
}

.pin-circle.pin-dungeon {
	background: #4a90e2;
	box-shadow: 0 2px 8px rgba(74, 144, 226, 0.4);
}

.pin-circle.pin-wilderness {
	background: #e28a2e;
	box-shadow: 0 2px 8px rgba(226, 138, 46, 0.4);
}

.pin-circle.pin-kingdom {
	background: #275e4a;
	box-shadow: 0 2px 8px rgba(39, 94, 74, 0.4);
}

.pin-type-char {
	color: white;
	font-weight: bold;
	font-size: 9px;
	line-height: 1;
}

.map-pin:hover .pin-circle {
	width: 28px;
	height: 28px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.map-pin:hover .pin-circle.pin-town {
	background: #c24530;
	box-shadow: 0 4px 12px rgba(162, 53, 36, 0.6);
}

.map-pin:hover .pin-circle.pin-dungeon {
	background: #5a9fea;
	box-shadow: 0 4px 12px rgba(74, 144, 226, 0.6);
}

.map-pin:hover .pin-circle.pin-wilderness {
	background: #f09a42;
	box-shadow: 0 4px 12px rgba(226, 138, 46, 0.6);
}

.map-pin:hover .pin-circle.pin-kingdom {
	background: #336b5a;
	box-shadow: 0 4px 12px rgba(39, 94, 74, 0.6);
}

.level-range-info {
	margin-top: 12px;
	padding: 12px;
	background: rgba(162, 53, 36, 0.08);
	border-left: 4px solid #a23524;
	border-radius: 4px;
	font-size: 14px;
}

/* NPC Containers */
#innNpcsList,
#templeNpcsList,
#marketNpcsList {
	text-align: center;
}
