: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;
}

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

.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;
}

.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: 0;
	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 .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 .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;
	}
}

#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;
	}

	.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 ─────────────────────────────────────── */
.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-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-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;
}
