/* ========================================
   DICE TECH DOMINION - Enter the Shadow Circuit
   AAA Quality Stylesheet
   ======================================== */

:root {
	--void: #070411;
	--void-2: #0c0720;
	--abyss: #1a0b2e;
	--abyss-2: #241138;
	--violet: #7c3aed;
	--violet-soft: #a78bfa;
	--cyan: #22d3ee;
	--cyan-soft: #67e8f9;
	--amber: #fbbf24;
	--rose: #ef4444;
	--ink: #e8e6f0;
	--ink-dim: #a89fc4;
	--ink-mute: #6b6188;
	--rule: rgba(167, 139, 250, 0.14);
	--rule-strong: rgba(167, 139, 250, 0.28);
	--grid-line: rgba(124, 58, 237, 0.1);
	--primary: var(--cyan);
	--primary-dark: #0d7490;
	--secondary: var(--violet);
	--accent: var(--amber);
	--enemy: var(--rose);
	--player: var(--cyan);
	--bg-dark: var(--void);
	--bg-panel: rgba(12, 7, 32, 0.88);
	--glass-border: rgba(167, 139, 250, 0.16);
	--glass-turn-border: rgba(34, 211, 238, 0.36);
	--glass-turn-glow: rgba(34, 211, 238, 0.16);
	--glass-bg: rgba(15, 9, 34, 0.78);
	--text: var(--ink);
	--text-dim: var(--ink-dim);
	--success: #44ff88;
	--danger: #ff4466;
	--dragon: #ff7a7a;
	--undead: #f6de72;
	--beast: #6be89a;
	--warrior: #7ec8ff;
	--spellcaster: #d7c9ff;
	--font-title: 'Space Grotesk', system-ui, sans-serif;
	--font-body: 'Space Grotesk', system-ui, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, monospace;
	--font-crt: 'VT323', monospace;
	--ui-scale: 0.94;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html,
body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background:
		radial-gradient(circle at top, rgba(124, 58, 237, 0.18), transparent 32%),
		radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.14), transparent 24%),
		linear-gradient(180deg, var(--void-2) 0%, var(--void) 35%, #05030d 100%);
	color: var(--text);
	font-family: var(--font-body);
	font-size: calc(16px * var(--ui-scale));
}

#game-container {
	position: relative;
	width: 100%;
	height: 100%;
	background-image:
		linear-gradient(rgba(124, 58, 237, 0.08) 1px, transparent 1px),
		linear-gradient(90deg, rgba(124, 58, 237, 0.08) 1px, transparent 1px);
	background-size: 32px 32px;
}

#game-canvas {
	display: block;
	width: 100%;
	height: 100%;
	position: relative;
	z-index: 0;
}

.crt-overlay {
	position: fixed;
	inset: 0;
	z-index: 60;
	pointer-events: none;
	background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
	mix-blend-mode: multiply;
}

.scanlines {
	position: fixed;
	inset: 0;
	z-index: 61;
	pointer-events: none;
	background: repeating-linear-gradient(
		to bottom,
		rgba(255, 255, 255, 0.025) 0px,
		rgba(255, 255, 255, 0.025) 1px,
		transparent 1px,
		transparent 3px
	);
	mix-blend-mode: overlay;
	opacity: 0.5;
}

/* ========================================
   OVERLAYS
   ======================================== */
.overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: none;
	justify-content: center;
	align-items: center;
	z-index: 100;
	overflow: hidden;
	background: rgba(4, 2, 12, 0.82);
	backdrop-filter: blur(16px);
}

.overlay::before {
	content: '';
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	filter: grayscale(1) blur(8px) brightness(0.24) saturate(0.8);
	transform: scale(1.06);
	opacity: 0.72;
}

.overlay::after {
	content: '';
	position: absolute;
	inset: 0;
	background:
		linear-gradient(180deg, rgba(124, 58, 237, 0.18), rgba(34, 211, 238, 0.08)),
		radial-gradient(circle at top, rgba(124, 58, 237, 0.2), transparent 35%);
}

.overlay > * {
	position: relative;
	z-index: 1;
}

.overlay.active {
	display: flex;
}

.hidden {
	display: none !important;
}

/* ========================================
   DECK EDITOR
   ======================================== */
.deck-editor-content {
	width: 100vw;
	height: 100vh;
	max-width: 100vw;
	max-height: 100vh;
	border-radius: 0;
	overflow: auto;
	padding: 24px;
	scroll-padding: 16px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 40%),
		radial-gradient(circle at top left, rgba(124, 58, 237, 0.14), transparent 32%),
		linear-gradient(180deg, rgba(12, 7, 32, 0.98), rgba(7, 4, 17, 0.98));
}

.deck-select-content {
	width: min(1200px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	overflow: hidden;
	padding: 24px;
	scroll-padding: 16px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 40%),
		radial-gradient(circle at top left, rgba(124, 58, 237, 0.14), transparent 32%),
		linear-gradient(180deg, rgba(12, 7, 32, 0.96), rgba(7, 4, 17, 0.96));
}

.deck-editor-header,
.deck-editor-actions,
.deck-select-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 16px;
}

.deck-editor-header {
	align-items: flex-start;
}

.deck-editor-status {
	color: var(--text-dim);
	margin-top: 6px;
}

.deck-editor-meta,
.deck-editor-buttons {
	display: flex;
	align-items: center;
	gap: 10px;
}

.deck-editor-currency-box {
	padding: 10px 14px;
	border-radius: 0;
	border: 1px solid rgba(251, 191, 36, 0.35);
	background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(124, 58, 237, 0.14));
	font-family: var(--font-mono);
	letter-spacing: 0.08em;
	color: var(--accent);
}

.deck-editor-actions label,
.deck-panel-header h3 {
	font-family: var(--font-title);
	letter-spacing: 1px;
}

#deck-select,
#player-deck-select,
#ai-deck-select {
	min-width: 220px;
	padding: 10px 12px;
	border-radius: 0;
	background: rgba(6, 10, 24, 0.85);
	border: 1px solid rgba(167, 139, 250, 0.18);
	color: var(--text);
	font-family: var(--font-mono);
}

.deck-editor-layout {
	display: grid;
	grid-template-columns: minmax(0, 3.3fr) minmax(320px, 2.9fr);
	gap: 18px;
}

.deck-editor-filters {
	display: grid;
	grid-template-columns: minmax(220px, 1.4fr) repeat(8, minmax(130px, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}

.deck-editor-filters input,
.deck-editor-filters select,
.deck-editor-filters button {
	padding: 10px 12px;
	border-radius: 0;
	background: rgba(6, 10, 24, 0.85);
	border: 1px solid rgba(167, 139, 250, 0.18);
	color: var(--text);
}

.deck-editor-column {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.deck-editor-preview,
.deck-editor-current-sticky {
	position: sticky;
	top: 12px;
	align-self: start;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

.deck-editor-preview-column {
	grid-column: 1;
}

.deck-editor-database-column {
	grid-column: 2;
	min-width: 0;
}

.deck-editor-current-column {
	grid-column: 3;
	min-width: 0;
}

.deck-editor-preview {
	flex: 0 0 auto;
	min-height: 520px;
	max-height: calc(100vh - 120px);
}

.deck-editor-preview-content {
	position: relative;
	z-index: 1;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 14px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 212, 255, 0.3) transparent;
	min-height: 490px;
}

.deck-editor-current-sticky {
	display: flex;
	flex-direction: column;
	gap: 12px;
	max-height: calc(100vh - 120px);
	overflow: hidden;
	position: sticky !important;
}

.deck-editor-list-header {
	margin-bottom: 0;
	flex-shrink: 0;
}

.deck-current-list {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 15px;
	background: rgb(0 0 0 / 27%);
	padding: 25px;
	border-radius: 15px;
	min-height: 407px;
	grid-auto-rows: min-content;
	align-items: start;
	align-content: start;
	min-width: 0;
	overflow-y: auto;
	overflow-x: hidden;
	scrollbar-gutter: stable;
}

.deck-select-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
	margin-bottom: 18px;
}

.deck-panel {
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 14px;
	background: rgba(5, 10, 24, 0.4);
	padding: 16px;
}

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

.deck-dice-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 15px;
	background: rgb(0 0 0 / 27%);
	padding: 25px;
	border-radius: 15px;
	min-height: 407px;
	grid-auto-rows: min-content;
	margin-bottom: 14px;
}

#deck-editor .deck-dice-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 15px;
	background: rgb(0 0 0 / 27%);
	padding: 25px;
	border-radius: 15px;
	min-height: 407px;
	grid-auto-rows: min-content;
	align-items: start;
	align-content: start;
	margin-bottom: 14px;
}

.deck-die-card,
.deck-current-row {
	width: 100%;
	text-align: left;
	cursor: pointer;
}

.deck-db-item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	/* max-width: 33%; */
}

.deck-db-item-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.deck-db-item-actions .btn {
	width: 100%;
	min-width: 100%;
}

.deck-die-card {
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
}

.deck-dice-grid .deck-die-card {
	flex: 0 0 min(360px, 78vw);
}

.deck-die-card.locked {
	opacity: 0.22;
}

.deck-die-card:disabled {
	cursor: not-allowed;
	transform: none;
}

.deck-die-meta {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	font-size: 0.66rem;
	font-family: var(--font-title);
	letter-spacing: 0.8px;
	color: rgba(240, 244, 255, 0.88);
	font-size: 1.1rem;
}

.deck-preview-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 0;
}

.deck-preview-rarity {
	height: 3px;
	border-radius: 12px 12px 0 0;
}

.deck-preview-image {
	height: 220px;
	margin: 14px 14px 0;
	border-radius: 14px;
	background-size: cover;
	background-position: center top;
	border: 1px solid rgba(170, 223, 255, 0.22);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.04),
		0 18px 40px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: flex-end;
}

.deck-preview-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(6, 10, 18, 0.04) 0%,
		rgba(6, 10, 18, 0.14) 38%,
		rgba(6, 10, 18, 0.82) 100%
	);
}

.deck-preview-image-overlay {
	position: relative;
	z-index: 1;
	width: 100%;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.deck-preview-name {
	font-family: var(--font-title);
	font-size: 1.06rem;
	letter-spacing: 1.4px;
	color: #fff;
	line-height: 1.2;
	padding: 5px 10px;
	background-color: rgb(0 0 0 / 66%);
	border-radius: 6px;
}

.deck-preview-badges {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.deck-preview-type-badge {
	font-size: 0.74rem;
	padding: 4px 7px;
	letter-spacing: 0.8px;
}

.deck-preview-level-badge,
.deck-preview-context-badge {
	font-size: 0.82rem;
	padding: 4px 6px;
	border-radius: 4px;
	background: rgb(0 0 0 / 73%);
	color: rgba(255, 255, 255, 1);
	border: 1px solid rgba(255, 255, 255, 0.16);
	letter-spacing: 0.8px;
}

.deck-preview-context-badge {
	background: rgba(255, 215, 0, 0.15);
	color: var(--accent);
	border-color: rgba(255, 215, 0, 0.35);
}

.deck-preview-data-card {
	margin: 0 14px;
	padding: 10px 12px;
	border-radius: 12px;
	background: linear-gradient(180deg, rgba(8, 12, 20, 0.92), rgba(8, 12, 20, 0.84));
	border: 1px solid rgba(168, 226, 255, 0.14);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.deck-preview-data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9rem;
}

.deck-preview-data-table th,
.deck-preview-data-table td {
	padding: 8px 6px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	vertical-align: top;
}

.deck-preview-data-table tr:last-child th,
.deck-preview-data-table tr:last-child td {
	border-bottom: none;
}

.deck-preview-data-table th {
	width: 74px;
	text-align: left;
	font-family: var(--font-title);
	font-size: 0.68rem;
	letter-spacing: 1.8px;
	color: #8fd5ff;
	font-weight: 700;
}

.deck-preview-data-table td {
	color: #eef7ff;
	font-weight: 600;
	line-height: 1.35;
}

.deck-preview-data-subline {
	display: block;
	margin-top: 3px;
	font-weight: 500;
	font-size: 0.8rem;
	line-height: 1.35;
	color: rgba(220, 234, 245, 0.82);
}

.deck-preview-paired-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
}

.deck-preview-paired-stat {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 5px 7px;
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.deck-preview-paired-stat strong {
	font-size: 0.72rem;
	letter-spacing: 1px;
	color: #8fd5ff;
}

.deck-preview-paired-stat span {
	font-size: 0.92rem;
	font-weight: 700;
	color: #eef7ff;
}

.deck-preview-faces {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}

.deck-preview-face {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	background-color: rgba(255, 255, 255, 0.04);
	background-size: 65%;
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid rgba(255, 255, 255, 0.07);
	box-shadow: inset 0 0 8px var(--face-color, rgba(255, 255, 255, 0.08));
	border-radius: 7px;
	width: 100%;
	min-width: 0;
	height: 64px;
}

.deck-preview-face-count {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--face-color, #fff);
	line-height: 1;
}

.deck-preview-face-name {
	font-size: 0.72rem;
	color: rgba(255, 255, 255, 1);
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.deck-preview-meta {
	padding: 0 14px 14px;
	font-size: 0.92rem;
}

.deck-info-tag {
	display: inline-flex;
	align-items: center;
	padding: 5px 16px;
	border-radius: 999px;
	background: rgba(5, 10, 24, 0.58);
	border: 1px solid rgba(143, 213, 255, 0.18);
	color: #eef6ff;
}

.deck-die-crest-block {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(5, 10, 24, 0.52);
	border: 1px solid rgba(255, 215, 0, 0.14);
}

.dice-pool-item-background .deck-die-crest-block {
	position: absolute;
	bottom: 10px;
	background: rgba(5, 10, 24, 0.72);
	border-color: rgba(255, 215, 0, 0.22);
	z-index: 2;
}

.deck-die-crest-title {
	font-family: var(--font-title);
	font-size: 0.64rem;
	letter-spacing: 1px;
	color: #ffd966;
}

.deck-die-crest-block .dice-crests {
	gap: 8px;
}

.deck-die-crest-block .dice-crest-chip {
	background: rgba(0, 0, 0, 0.52);
	border-color: rgba(255, 255, 255, 0.14);
}

.deck-die-effect {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(5, 10, 24, 0.46);
	border: 1px solid rgba(143, 213, 255, 0.14);
}

.deck-die-effect-name {
	font-family: var(--font-title);
	font-size: 0.68rem;
	letter-spacing: 1px;
	color: #8fd5ff;
}

.deck-die-effect-desc {
	font-size: 1.2rem;
	line-height: 1.25;
	color: rgba(238, 244, 255, 0.9);
}

.deck-die-effect-empty {
	display: none;
	font-size: 0.64rem;
	font-family: var(--font-title);
	letter-spacing: 1px;
	color: rgba(255, 255, 255, 0.56);
	justify-content: center;
}

.dice-select-effect-block {
	margin-top: 2px;
}

.deck-die-card .dice-pool-item-main,
.deck-current-row .dice-pool-item-main {
	min-height: 124px;
}

.deck-current-row {
	position: relative;
	overflow: hidden;
	background-size: cover;
	background-position: center top;
	background-repeat: no-repeat;
}

.deck-current-info-wrap {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.deck-current-actions,
.deck-die-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 10px;
	flex-wrap: nowrap;
}

.deck-inline-action {
	padding: 8px 12px;
	font-size: 0.72rem;
	letter-spacing: 1px;
	min-width: 96px;
	justify-content: center;
}

.deck-buy-action {
	background: linear-gradient(135deg, #187a34, #29b85b);
	color: #f5fff7;
	box-shadow: 0 4px 18px rgba(41, 184, 91, 0.24);
}

.deck-buy-action:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 22px rgba(41, 184, 91, 0.32);
}

.deck-sell-action {
	background: linear-gradient(135deg, #8b1f1f, #d44444);
	color: #fff4f4;
	box-shadow: 0 4px 18px rgba(212, 68, 68, 0.24);
}

.deck-sell-action:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 22px rgba(212, 68, 68, 0.32);
}

/* ========================================
   MAIN MENU
   ======================================== */
.menu-content {
	text-align: center;
	animation: fadeInUp 1s ease;
	position: relative;
	z-index: 1;
}

.subtitle {
	font-family: var(--font-title);
	font-size: 1.1rem;
	color: var(--text-dim);
	letter-spacing: 12px;
	margin-bottom: 48px;
}

/* .title-accent {
	background: linear-gradient(135deg, var(--primary), var(--accent), var(--secondary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	font-size: 7rem;
	text-shadow: none;
	animation: accentPulse 2s ease-in-out infinite;
} */

.game-title {
	font-family: var(--font-title);
	font-size: 6rem;
	font-weight: 900;
	color: #fff;
	text-shadow:
		0 0 20px rgba(0, 212, 255, 0.8),
		0 0 40px rgba(0, 212, 255, 0.6),
		0 0 80px rgba(0, 212, 255, 0.4),
		0 0 120px rgba(255, 215, 0, 0.3);
	letter-spacing: 8px;
	line-height: 1.1;
	margin-bottom: 8px;
	animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
	0% {
		text-shadow:
			0 0 20px rgba(0, 212, 255, 0.8),
			0 0 40px rgba(0, 212, 255, 0.6),
			0 0 80px rgba(0, 212, 255, 0.4),
			0 0 120px rgba(255, 215, 0, 0.3);
	}
	100% {
		text-shadow:
			0 0 30px rgba(0, 212, 255, 1),
			0 0 60px rgba(0, 212, 255, 0.8),
			0 0 100px rgba(0, 212, 255, 0.6),
			0 0 150px rgba(255, 215, 0, 0.5);
	}
}

@keyframes accentPulse {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
}

.menu-buttons {
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: center;
}

.version-text {
	margin-top: 48px;
	font-size: 0.8rem;
	color: var(--text-dim);
	letter-spacing: 2px;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
	font-family: var(--font-mono);
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	padding: 14px 22px;
	border: 1px solid var(--violet);
	border-radius: 0;
	cursor: pointer;
	transition: all 0.2s ease;
	text-transform: none;
	position: relative;
	overflow: hidden;
	background: transparent;
	color: var(--ink);
}

.btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(34, 211, 238, 0.28), transparent 60%);
	opacity: 0;
	transition: opacity 0.2s ease;
	pointer-events: none;
}

.btn:hover::before {
	opacity: 1;
}

.btn:hover {
	transform: translateY(-1px);
}

.btn-primary {
	background: linear-gradient(180deg, rgba(124, 58, 237, 0.26), rgba(124, 58, 237, 0.08));
	color: var(--ink);
	box-shadow:
		0 0 0 1px rgba(124, 58, 237, 0.4),
		0 0 24px rgba(124, 58, 237, 0.24);
}

.btn-primary:hover {
	box-shadow:
		0 0 0 1px var(--cyan),
		0 0 30px rgba(34, 211, 238, 0.4);
	border-color: var(--cyan);
}

.btn-primary:disabled {
	background: rgba(255, 255, 255, 0.04);
	color: var(--ink-mute);
	box-shadow: none;
	border-color: var(--rule);
	cursor: not-allowed;
	transform: none;
}

.btn-secondary {
	background: rgba(255, 255, 255, 0.02);
	color: var(--ink-dim);
	border: 1px solid var(--rule-strong);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
	background: rgba(34, 211, 238, 0.08);
	border-color: var(--cyan);
	color: var(--cyan);
}

.btn-small {
	font-size: 0.72rem;
	padding: 8px 14px;
	letter-spacing: 0.08em;
	color: var(--ink);
	border: 1px solid var(--rule-strong);
	font-family: var(--font-mono);
	font-weight: 600;
	border-radius: 0;
	cursor: pointer;
	transition: all 0.2s;
	background: rgba(255, 255, 255, 0.02);
}

.btn-small:hover {
	background: rgba(34, 211, 238, 0.08);
	border-color: var(--cyan);
	color: var(--cyan);
}

/* ========================================
   GLASS PANEL (style_patched_v3 inspired)
   ======================================== */
.glass-panel {
	position: relative;
	border: 1px solid var(--glass-turn-border);
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0) 46%),
		radial-gradient(circle at 18% 0%, rgba(124, 58, 237, 0.14), transparent 52%),
		repeating-linear-gradient(
			0deg,
			rgba(255, 255, 255, 0.015) 0px,
			rgba(255, 255, 255, 0.015) 1px,
			transparent 1px,
			transparent 8px
		),
		repeating-linear-gradient(
			90deg,
			rgba(124, 58, 237, 0.025) 0px,
			rgba(124, 58, 237, 0.025) 1px,
			transparent 1px,
			transparent 8px
		),
		var(--glass-bg);
	backdrop-filter: blur(10px);
	padding: 16px;
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.34),
		0 0 0 1px rgba(255, 255, 255, 0.03) inset,
		0 0 0 1px var(--glass-turn-glow),
		0 0 24px var(--glass-turn-glow);
}

.glass-panel::before {
	content: '';
	position: absolute;
	inset: -1px;
	border: 1px solid rgba(167, 139, 250, 0.06);
	pointer-events: none;
}

body.turn-player {
	--glass-turn-border: rgba(34, 211, 238, 0.46);
	--glass-turn-glow: rgba(34, 211, 238, 0.18);
}

body.turn-enemy {
	--glass-turn-border: rgba(239, 68, 68, 0.46);
	--glass-turn-glow: rgba(239, 68, 68, 0.18);
}

/* ========================================
   HOW TO PLAY
   ======================================== */
.how-to-content {
	max-width: 700px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 32px;
	animation: fadeInUp 0.5s ease;
}

.how-to-content h2 {
	font-family: var(--font-title);
	font-size: 2rem;
	color: var(--primary);
	margin-bottom: 24px;
	text-align: center;
	letter-spacing: 4px;
}

.rules-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 24px;
}

.rule-item {
	background: rgba(255, 255, 255, 0.03);
	border-radius: 8px;
	padding: 16px;
	text-align: center;
}

.rule-icon {
	font-size: 2rem;
	margin-bottom: 8px;
}

.rule-item h3 {
	font-family: var(--font-title);
	font-size: 0.9rem;
	color: var(--primary);
	margin-bottom: 8px;
	letter-spacing: 2px;
}

.rule-item p {
	font-size: 1rem;
	color: #ffffff;
	line-height: 1.4;
}

.rules-details h3 {
	font-family: var(--font-title);
	font-size: 0.9rem;
	color: var(--accent);
	margin: 16px 0 8px;
	letter-spacing: 2px;
}

.crest-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 12px;
}

.crest-info {
	font-size: 1rem;
	display: flex;
	align-items: center;
	gap: 8px;
}

.type-chain {
	font-size: 1.2rem;
	color: #ffffff;
	text-align: center;
	padding: 8px;
	background: rgba(255, 255, 255, 0.03);
	border-radius: 4px;
	margin-bottom: 20px;
}

.controls-list {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-bottom: 12px;
}

.control-row {
	font-size: 1rem;
	color: #ffffff;
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.key-badge {
	display: inline-block;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 4px;
	padding: 2px 8px;
	font-family: var(--font-title);
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--primary);
	letter-spacing: 1px;
	white-space: nowrap;
}

.combat-rules {
	font-size: 1rem;
	color: #ffffff;
	line-height: 1.5;
	margin-bottom: 12px;
}

.combat-rules strong {
	color: var(--text);
}

/* ========================================
   SUPPORT PROJECT
   ======================================== */
.support-content {
	max-width: 800px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 32px;
	animation: fadeInUp 0.5s ease;
}

.support-content h2 {
	font-family: var(--font-title);
	font-size: 2rem;
	color: var(--primary);
	margin-bottom: 24px;
	text-align: center;
	letter-spacing: 4px;
}

.support-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 20px;
	margin-bottom: 32px;
}

.support-item {
	background: rgba(255, 255, 255, 0.03);
	border-radius: 12px;
	padding: 24px;
	text-align: center;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.support-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(0, 212, 255, 0.1);
}

.support-icon {
	font-size: 3rem;
	margin-bottom: 16px;
}

.support-item h3 {
	font-family: var(--font-title);
	font-size: 1.1rem;
	color: var(--primary);
	margin-bottom: 12px;
	letter-spacing: 2px;
}

.support-item p {
	font-size: 1rem;
	color: #ffffff;
	line-height: 1.5;
}

.support-links {
	list-style: none;
	padding: 0;
	margin: 0;
	text-align: left;
}

.support-links li {
	margin-bottom: 8px;
}

.support-link {
	color: var(--accent);
	text-decoration: none;
	font-size: 0.85rem;
	transition: color 0.2s ease;
}

.support-link:hover {
	color: var(--primary);
	text-decoration: underline;
}

.support-footer {
	text-align: center;
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.support-version {
	font-size: 0.8rem;
	color: var(--text-dim);
	margin-bottom: 16px;
	letter-spacing: 1px;
}

/* ========================================
   SETTINGS PANEL
   ======================================== */
#settings-panel {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1000;
}

.settings-content {
	max-width: 400px;
	padding: 32px;
	text-align: center;
	animation: fadeInUp 0.5s ease;
}

.settings-content h2 {
	font-family: var(--font-title);
	font-size: 2rem;
	color: var(--primary);
	margin-bottom: 24px;
	letter-spacing: 4px;
}

.setting-group {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.03);
	border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-group label {
	font-family: var(--font-body);
	font-size: 1rem;
	color: var(--text);
	font-weight: 600;
}

.setting-group input[type='range'] {
	width: 120px;
}

.setting-group input[type='checkbox'] {
	width: 20px;
	height: 20px;
}

/* ========================================
   HUD
   ======================================== */
#hud {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto;
	gap: 14px;
	padding: 16px;
	pointer-events: none;
	z-index: 10;
}

#hud > * {
	pointer-events: auto;
}

#hud > .hud-columns {
	grid-row: 1;
	pointer-events: none;
}

.hud-columns {
	min-height: 0;
	display: grid;
	grid-template-columns: minmax(300px, 420px) minmax(520px, 1fr) minmax(300px, 420px);
	gap: 14px;
	align-items: stretch;
	pointer-events: none;
}

.hud-column {
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}

.hud-column > * {
	pointer-events: auto;
}

.hud-column-center {
	align-items: anchor-center;
	justify-content: center;
}

.hud-column-right {
	min-height: 0;
}

/* Top Bar + Phase Indicator */
#top-bar {
	grid-row: 2;
	position: relative;
	left: auto;
	right: auto;
	bottom: auto;
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	align-items: center;
	gap: 16px;
	padding: 10px 16px;
	z-index: 28;
	border-color: var(--rule-strong);
}

#top-bar-left {
	display: flex;
	justify-content: flex-start;
	gap: 10px;
}

#top-bar-center {
	display: flex;
	justify-content: center;
	align-items: center;
	min-width: 0;
}

#top-bar-right {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.dimension-skip-button {
	min-width: 84px;
}

.hud-icon-button {
	min-width: 58px;
	padding: 8px 10px;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
}

.hud-icon {
	font-size: 1.1rem;
	line-height: 1;
}

.hud-icon-label {
	font-size: 0.62rem;
	letter-spacing: 1px;
	line-height: 1;
}

#phase-indicator {
	display: flex;
	flex-direction: column;
	gap: 2px;
	align-items: flex-end;
	justify-content: center;
	text-align: right;
}

#dimension-selection-info {
	display: flex;
	align-items: center;
}

#dimension-selection-info.hidden {
	display: none !important;
}

.dimension-selection-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(255, 215, 0, 0.18);
	color: #fff;
	max-width: 100%;
	transform: scale(0.92);
	transform-origin: right center;
}

.dimension-selection-label {
	font-family: var(--font-title);
	font-size: 0.62rem;
	letter-spacing: 1px;
	color: var(--accent);
}

.dimension-selection-name {
	font-family: var(--font-title);
	font-size: 0.72rem;
	letter-spacing: 1px;
	color: #f4fbff;
}

.dimension-selection-change {
	padding: 6px 10px;
	min-height: auto;
}

.phase-indicator-inline {
	justify-self: end;
	padding: 10px 18px;
	border: 1px solid var(--rule);
	background: rgba(255, 255, 255, 0.03);
	font-family: var(--font-mono);
	letter-spacing: 0.08em;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.topbar-end-turn {
	min-width: 170px;
	letter-spacing: 2px;
	color: #fff4f6;
	border-color: rgba(255, 110, 140, 0.9);
	background: linear-gradient(180deg, rgba(170, 18, 52, 0.96), rgba(86, 6, 24, 0.96));
	box-shadow:
		0 0 0 1px rgba(255, 112, 146, 0.45),
		0 0 18px rgba(255, 58, 98, 0.38),
		0 0 42px rgba(156, 14, 44, 0.3);
	text-shadow: 0 0 10px rgba(255, 210, 220, 0.25);
	animation: topbarEndTurnPulse 1.55s ease-in-out infinite;
}

.topbar-end-turn:hover,
.topbar-end-turn:focus-visible {
	border-color: rgba(255, 158, 182, 0.96);
	background: linear-gradient(180deg, rgba(198, 28, 66, 0.98), rgba(104, 10, 30, 0.98));
	box-shadow:
		0 0 0 1px rgba(255, 154, 180, 0.6),
		0 0 24px rgba(255, 80, 118, 0.55),
		0 0 56px rgba(180, 20, 56, 0.44);
}

.topbar-end-turn:disabled {
	animation: none;
	color: var(--ink-mute);
	border-color: var(--rule);
	background: rgba(255, 255, 255, 0.04);
	box-shadow: none;
	text-shadow: none;
}

@keyframes topbarEndTurnPulse {
	0%,
	100% {
		transform: translateY(0) scale(1);
		box-shadow:
			0 0 0 1px rgba(255, 112, 146, 0.45),
			0 0 18px rgba(255, 58, 98, 0.38),
			0 0 42px rgba(156, 14, 44, 0.3);
	}
	50% {
		transform: translateY(-1px) scale(1.035);
		box-shadow:
			0 0 0 1px rgba(255, 168, 188, 0.72),
			0 0 28px rgba(255, 88, 128, 0.62),
			0 0 72px rgba(190, 18, 60, 0.52);
	}
}

#turn-number {
	font-family: var(--font-title);
	font-size: 0.72rem;
	color: var(--text-dim);
	letter-spacing: 1.5px;
}

#phase-name {
	font-family: var(--font-title);
	font-size: 0.9rem;
	font-weight: 700;
	color: var(--primary);
	letter-spacing: 2px;
	animation: phasePulse 2s ease infinite;
}

@keyframes phasePulse {
	0%,
	100% {
		opacity: 1;
	}
	50% {
		opacity: 0.7;
	}
}

/* Player Info */
#player-info,
#enemy-info {
	position: relative;
	top: auto;
	left: auto;
	right: auto;
	min-width: 0;
	max-width: none;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 10px;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 42%),
		radial-gradient(circle at top left, rgba(124, 58, 237, 0.14), transparent 40%), var(--glass-bg);
}

#player-shortcuts-panel {
	position: relative;
	left: auto;
	top: auto;
	min-width: 0;
	max-width: 73%;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
	color: #ffffff;
	z-index: 11;
	pointer-events: auto;
}

.collapsible-panel-header-row {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: space-between;
	margin-bottom: 8px;
}

.collapsible-panel-header {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
	background: transparent;
	border: none;
	color: #8fd5ff;
	cursor: pointer;
	text-align: left;
}

.collapsible-panel-title {
	font-family: var(--font-title);
	font-size: 0.72rem;
	letter-spacing: 2px;
	color: #8fd5ff;
}

.collapsible-panel-arrow {
	font-family: var(--font-title);
	font-size: 0.9rem;
	color: #ffd966;
	flex: 0 0 auto;
}

.collapsible-panel-body {
	min-height: 0;
}

.player-shortcuts-content {
	font-size: 0.82rem;
	line-height: 1.4;
	color: #fff;
}

.player-shortcuts-table {
	display: table;
	width: 100%;
	border-collapse: collapse;
}

.player-shortcut-row {
	display: table-row;
}

.player-shortcut-action,
.player-shortcut-desc {
	display: table-cell;
	padding: 4px 0;
	vertical-align: top;
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.player-shortcut-row:first-child .player-shortcut-action,
.player-shortcut-row:first-child .player-shortcut-desc {
	border-top: none;
}

.player-shortcut-action {
	width: 112px;
	padding-right: 12px;
	color: #ffd966;
	font-family: var(--font-title);
	letter-spacing: 1px;
	white-space: nowrap;
}

.player-shortcut-desc {
	color: #ffffff;
}

.monster-roster-panel {
	min-height: 0;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	overflow: hidden;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 38%),
		radial-gradient(circle at top left, rgba(34, 211, 238, 0.08), transparent 36%), var(--glass-bg);
}

.monster-roster-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-family: var(--font-title);
	font-size: 0.76rem;
	letter-spacing: 1.5px;
	color: #bfeaff;
}

.monster-roster-count {
	padding: 4px 8px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--accent);
}

.monster-roster-list {
	min-height: 0;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
	overflow-y: auto;
	padding-right: 4px;
	/* max-height: 130px; */
}

.monster-roster-list-horizontal {
	flex-direction: row;
	overflow-x: auto;
	overflow-y: hidden;
	padding-right: 0;
	padding-bottom: 8px;
	flex-wrap: nowrap;
	scrollbar-width: auto;
	scrollbar-color: rgba(0, 212, 255, 0.72) rgba(255, 255, 255, 0.08);
}

.monster-roster-list-horizontal::-webkit-scrollbar {
	height: 14px;
}

.monster-roster-list-horizontal::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
}

.monster-roster-list-horizontal::-webkit-scrollbar-thumb {
	background: linear-gradient(90deg, rgba(0, 136, 170, 0.95), rgba(0, 212, 255, 0.95));
	border-radius: 999px;
	border: 3px solid rgba(8, 12, 24, 0.9);
}

.monster-roster-item {
	width: 100%;
	padding: 10px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.04);
	color: var(--text);
	text-align: left;
	cursor: pointer;
	transition:
		transform 0.18s ease,
		border-color 0.18s ease,
		box-shadow 0.18s ease,
		background 0.18s ease;
}

.monster-roster-item:hover,
.monster-roster-item:focus-visible,
.monster-roster-item.is-selected {
	border-color: rgba(0, 212, 255, 0.45);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
	background: rgba(0, 212, 255, 0.08);
}

.monster-roster-item.owner-enemy:hover,
.monster-roster-item.owner-enemy:focus-visible,
.monster-roster-item.owner-enemy.is-selected {
	border-color: rgba(255, 90, 110, 0.42);
	background: rgba(255, 68, 68, 0.08);
}

.monster-roster-item.is-ability-ready {
	border-color: rgba(255, 216, 77, 0.5);
	box-shadow:
		0 0 0 1px rgba(255, 216, 77, 0.22),
		0 0 24px rgba(255, 216, 77, 0.14);
	background: linear-gradient(180deg, rgba(255, 216, 77, 0.08), rgba(255, 255, 255, 0.04));
}

.monster-roster-item.is-graveyard,
.monster-roster-item:disabled {
	cursor: default;
	opacity: 0.48;
	filter: grayscale(1) saturate(0.2);
	background: rgba(255, 255, 255, 0.025);
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: none;
}

.monster-roster-item.is-graveyard:hover,
.monster-roster-item.is-graveyard:focus-visible,
.monster-roster-item:disabled:hover,
.monster-roster-item:disabled:focus-visible {
	transform: none;
	background: rgba(255, 255, 255, 0.025);
	border-color: rgba(255, 255, 255, 0.08);
	box-shadow: none;
}

.monster-roster-item.is-graveyard .monster-roster-portrait,
.monster-roster-item:disabled .monster-roster-portrait {
	filter: grayscale(1) brightness(0.72);
}

.monster-roster-list-horizontal .monster-roster-item {
	flex: 0 0 min(360px, 62vw);
}

.monster-roster-main {
	display: grid;
	grid-template-columns: 60px minmax(0, 1fr);
	gap: 10px;
	align-items: start;
}

.monster-roster-portrait-wrap {
	position: relative;
	width: 60px;
	height: 60px;
}

.monster-roster-portrait {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(0, 0, 0, 0.28);
}

.monster-roster-ready-dot {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 16px;
	height: 16px;
	border-radius: 999px;
	background: #ffd84d;
	border: 2px solid rgba(16, 12, 2, 0.92);
	box-shadow:
		0 0 0 4px rgba(255, 216, 77, 0.18),
		0 0 16px rgba(255, 216, 77, 0.95),
		0 0 28px rgba(255, 216, 77, 0.6);
	animation: abilityReadyPulse 1.6s ease-in-out infinite;
}

.monster-roster-copy {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.monster-roster-topline {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
}

.monster-roster-name {
	font-family: var(--font-title);
	font-size: 0.78rem;
	letter-spacing: 1px;
	color: #f4fbff;
}

.monster-roster-level {
	display: inline-block;
	margin-left: 6px;
	padding: 1px 6px;
	font-size: 0.62rem;
	letter-spacing: 1px;
	color: var(--accent);
	background: rgba(0, 0, 0, 0.4);
	border: 1px solid rgba(255, 215, 0, 0.24);
	border-radius: 999px;
	vertical-align: middle;
}

.monster-roster-position,
.monster-roster-stats,
.monster-roster-move {
	font-size: 1rem;
	color: rgba(235, 243, 255, 1);
}

.monster-roster-position {
	color: var(--accent);
	font-family: var(--font-title);
}

.monster-roster-move {
	color: #8fd5ff;
}

.monster-roster-effect {
	font-size: 0.92rem;
	line-height: 1.35;
	color: rgba(255, 240, 176, 0.88);
}

.monster-roster-actions {
	display: flex;
	justify-content: flex-start;
	margin-top: 4px;
}

.monster-roster-ability-btn {
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid rgba(255, 216, 77, 0.5);
	background: linear-gradient(180deg, rgba(255, 226, 110, 0.22), rgba(255, 184, 44, 0.12));
	color: #ffe38c;
	font-family: var(--font-title);
	font-size: 0.66rem;
	letter-spacing: 0.8px;
	cursor: pointer;
	box-shadow: 0 0 18px rgba(255, 216, 77, 0.18);
}

.monster-roster-ability-btn:hover,
.monster-roster-ability-btn:focus-visible {
	border-color: rgba(255, 224, 120, 0.9);
	box-shadow: 0 0 22px rgba(255, 216, 77, 0.34);
	outline: none;
}

.monster-roster-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 2px;
}

.monster-roster-tag {
	display: inline-flex;
	align-items: center;
	padding: 3px 7px;
	border-radius: 999px;
	font-size: 0.64rem;
	font-family: var(--font-title);
	letter-spacing: 0.8px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.06);
}

.monster-roster-tag.tone-ready {
	color: #8dffb0;
	border-color: rgba(68, 255, 136, 0.3);
}

.monster-roster-tag.tone-attack {
	color: #ffd29e;
	border-color: rgba(255, 148, 68, 0.34);
}

.monster-roster-tag.tone-spent {
	color: rgba(255, 255, 255, 0.55);
}

.monster-roster-tag.tone-buff {
	color: #8fd5ff;
	border-color: rgba(0, 212, 255, 0.3);
}

.monster-roster-tag.tone-status {
	color: #ffd966;
	border-color: rgba(255, 217, 102, 0.28);
}

.monster-roster-tag.tone-graveyard {
	color: #d3d7df;
	border-color: rgba(211, 215, 223, 0.24);
	background: rgba(255, 255, 255, 0.05);
}

.monster-roster-empty {
	padding: 12px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.03);
	color: var(--text-dim);
	font-size: 0.78rem;
}

#player-crest-effects {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 6;
}

#enemy-info {
	margin-left: 0;
}

#field-monster-panel {
	width: 73%;
	margin-top: 0;
	flex: 1 1 auto;
	min-height: 0;
	align-self: flex-start;
	/*! max-height: 550; */
}

#enemy-monster-panel {
	width: 73%;
	min-height: 0;
	flex: 1 1 auto;
	align-self: flex-end;
}

.field-monster-section {
	min-width: 0;
	min-height: 0;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	/* max-height: 180px; */
}

.player-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	margin-bottom: 0;
	position: relative;
	z-index: 2;
}

.hud-top-row {
	width: 100%;
}

.hud-bottom-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	position: relative;
	z-index: 2;
	margin-bottom: 25px;
}

.lord-portrait {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.player-name {
	font-family: var(--font-title);
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 3px;
	color: var(--player);
	text-align: left;
	/*! display: revert-layer; */
	width: 100%;
}

.enemy-name {
	color: var(--enemy) !important;
}

.hearts-display {
	display: flex;
	gap: 8px;
}

.heart {
	font-size: 1.8rem;
	color: #333;
	transition: all 0.3s;
	text-shadow: none;
}

.heart.active {
	color: #ff2244;
	text-shadow: 0 0 10px rgba(255, 34, 68, 0.5);
	animation: heartBeat 1.5s ease infinite;

	width: 50px;
	height: 35px;
	border: 1px solid;
	text-align: center;
	border-radius: 10px;
}

@keyframes heartBeat {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.05);
	}
}

.crests-display {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 8px;
	flex: 1;
	position: relative;
	z-index: 2;
}

.crest-counter {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	min-width: 0;
	padding: 8px 6px;
	border: 1px solid rgba(167, 139, 250, 0.18);
	border-radius: 0;
	background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(36, 17, 56, 0.28));
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
	opacity: 1;
	transition:
		opacity 0.25s ease,
		border-color 0.25s ease,
		background 0.25s ease;
}

.crest-counter.is-zero {
	opacity: 1;
}

/* Per-crest-type colour tinting on HUD counters */
.crest-counter-movement {
	border-color: rgba(68, 170, 255, 0.45);
	background: linear-gradient(135deg, rgba(68, 170, 255, 0.14), rgba(0, 100, 200, 0.18));
}
.crest-counter-attack {
	border-color: rgba(255, 68, 68, 0.45);
	background: linear-gradient(135deg, rgba(255, 68, 68, 0.14), rgba(180, 20, 20, 0.18));
}
.crest-counter-defense {
	border-color: rgba(68, 221, 136, 0.45);
	background: linear-gradient(135deg, rgba(68, 221, 136, 0.14), rgba(20, 140, 70, 0.18));
}
.crest-counter-magic {
	border-color: rgba(204, 68, 255, 0.45);
	background: linear-gradient(135deg, rgba(204, 68, 255, 0.14), rgba(120, 20, 180, 0.18));
}
.crest-counter-trap {
	border-color: rgba(255, 136, 68, 0.45);
	background: linear-gradient(135deg, rgba(255, 136, 68, 0.14), rgba(180, 70, 10, 0.18));
}

.crest-label {
	font-family: var(--font-title);
	font-size: 0.6rem;
	font-weight: 700;
	color: var(--text-dim);
	letter-spacing: 1px;
	line-height: 1;
	text-align: center;
	width: 100%;
}

.crest-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
}

.crest-icon {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-title);
	font-size: 0.65rem;
	font-weight: 900;
	color: #fff;
}

.crest-movement {
	background: linear-gradient(135deg, #ff8800, #ffaa00);
}
.crest-attack {
	background: linear-gradient(135deg, #ff2244, #ff4466);
}
.crest-defense {
	background: linear-gradient(135deg, #2266ff, #44aaff);
}
.crest-magic {
	background: linear-gradient(135deg, #aa44ff, #dd66ff);
}
.crest-trap {
	background: linear-gradient(135deg, #44aa44, #66cc66);
}

.crest-value {
	font-family: var(--font-title);
	font-size: 1.05rem;
	font-weight: 700;
	min-width: 16px;
	color: var(--accent);
	transition:
		transform 0.25s ease,
		color 0.25s ease,
		text-shadow 0.25s ease;
}

.crest-value.crest-pulse {
	animation: crestPulseHold 2s ease forwards;
	color: var(--accent);
	text-shadow: 0 0 18px rgba(255, 215, 0, 0.9);
}

@keyframes crestPulseHold {
	0% {
		transform: scale(1);
	}
	15% {
		transform: scale(1.7);
	}
	85% {
		transform: scale(1.7);
	}
	100% {
		transform: scale(1);
	}
}

@keyframes abilityReadyPulse {
	0%,
	100% {
		transform: scale(1);
		box-shadow:
			0 0 0 4px rgba(255, 216, 77, 0.18),
			0 0 16px rgba(255, 216, 77, 0.95),
			0 0 28px rgba(255, 216, 77, 0.6);
	}
	50% {
		transform: scale(1.08);
		box-shadow:
			0 0 0 6px rgba(255, 216, 77, 0.24),
			0 0 22px rgba(255, 216, 77, 1),
			0 0 34px rgba(255, 216, 77, 0.75);
	}
}

.dice-remaining {
	margin-top: 0;
	font-size: 0.9rem;
	color: var(--text-dim);
	font-family: var(--font-title);
	letter-spacing: 1px;
	white-space: nowrap;
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.dice-resource-box {
	justify-content: center;
	align-self: stretch;
	min-width: 78px;
	padding: 8px 10px;
	border: 1px solid rgba(167, 139, 250, 0.18);
	border-radius: 0;
	background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(36, 17, 56, 0.28));
	color: var(--cyan-soft);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
	font-family: var(--font-mono);
	letter-spacing: 0.08em;
}

.dice-resource-box span {
	color: #ffffff;
}

.crest-gain-popup {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	background: radial-gradient(
		circle,
		rgba(255, 215, 0, 0.22) 0%,
		rgba(255, 215, 0, 0.1) 45%,
		rgba(255, 215, 0, 0) 100%
	);
	font-family: var(--font-title);
	font-weight: 900;
	letter-spacing: 1px;
	color: var(--accent);
	text-shadow: 0 0 18px rgba(255, 215, 0, 0.95);
	animation: crestGainFloat 2.1s ease forwards;
	white-space: nowrap;
	z-index: 4;
}

.crest-gain-plus {
	font-size: 2.6rem;
	line-height: 1;
}

.crest-gain-amount {
	font-size: 3rem;
	line-height: 1;
}

.crest-gain-label {
	font-size: 1.3rem;
	letter-spacing: 2px;
}

.crest-streak {
	position: absolute;
	width: 14px;
	height: 14px;
	margin-left: -7px;
	margin-top: -7px;
	border-radius: 999px;
	background: radial-gradient(
		circle,
		rgba(255, 255, 255, 1) 0%,
		rgba(255, 215, 0, 0.95) 35%,
		rgba(0, 212, 255, 0.85) 70%,
		rgba(0, 212, 255, 0) 100%
	);
	box-shadow:
		0 0 16px rgba(255, 215, 0, 0.85),
		0 0 28px rgba(0, 212, 255, 0.55);
	pointer-events: none;
	z-index: 3;
	animation: crestStreakFly 0.85s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

#player-info.crest-flash::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		110deg,
		transparent 0%,
		rgba(255, 215, 0, 0.14) 35%,
		rgba(0, 212, 255, 0.22) 50%,
		rgba(255, 215, 0, 0.14) 65%,
		transparent 100%
	);
	animation: crestSweep 0.65s ease;
	pointer-events: none;
	z-index: 5;
}

@keyframes crestGainFloat {
	0% {
		opacity: 0;
		transform: translate(-50%, -38%) scale(0.72);
	}
	18% {
		opacity: 1;
		transform: translate(-50%, -50%) scale(1.18);
	}
	72% {
		opacity: 1;
		transform: translate(-50%, -56%) scale(1.08);
	}
	100% {
		opacity: 0;
		transform: translate(-50%, -72%) scale(0.98);
	}
}

@keyframes crestSweep {
	0% {
		opacity: 0;
		transform: translateX(-35%);
	}
	20% {
		opacity: 1;
	}
	100% {
		opacity: 0;
		transform: translateX(35%);
	}
}

@keyframes crestStreakFly {
	0% {
		opacity: 0;
		transform: translate(0, 0) scale(0.45);
	}
	15% {
		opacity: 1;
		transform: translate(calc(var(--dx) * 0.18), calc(var(--dy) * 0.18)) scale(1.1);
	}
	100% {
		opacity: 0;
		transform: translate(var(--dx), var(--dy)) scale(0.35);
	}
}

/* ========================================
   DICE SELECT PANEL
   ======================================== */
#dice-select-panel {
	/* position: absolute; */
	/* top: 0; */
	/* left: auto; */
	/* bottom: 0; */
	/* right: 0; */
	/* transform: none; */
	/* min-width: 0; */
	/* max-width: none; */
	/* width: 100%; */
	/* max-height: none; */
	/* overflow-y: auto; */
	text-align: center;
	z-index: 1;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
	border: 4px solid rgba(68, 170, 255, 0.22);
	padding: 16px;
	scale: 1;
	width: 100%;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

#dice-select-panel::before {
	content: none;
}

#dice-select-panel::after {
	content: '';
	position: absolute;
	inset: 0;
	padding: 1px;
	border-radius: inherit;
	background: linear-gradient(
		130deg,
		rgba(0, 212, 255, 0.1),
		rgba(255, 255, 255, 0),
		rgba(0, 212, 255, 0.9),
		rgba(255, 255, 255, 0)
	);
	background-size: 220% 220%;
	animation: dicePanelBorderFlow 4.5s linear infinite;
	-webkit-mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
	z-index: -1;
}

#dice-select-panel h3 {
	font-family: var(--font-title);
	font-size: 1.15rem;
	color: var(--primary);
	letter-spacing: 3px;
	margin-bottom: 12px;
}

#dice-filter-bar {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	margin-bottom: 0;
	grid-area: filters;
	align-self: start;
}

.dice-filter-title {
	font-family: var(--font-title);
	font-size: 0.68rem;
	letter-spacing: 2px;
	color: rgba(191, 234, 255, 0.78);
	text-align: center;
}

.dice-filter-row {
	display: grid;
	gap: 7px;
	align-items: stretch;
}

.dice-filter-row-summon {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dice-filter-row-crest {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dice-filter-row-options {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.dice-filter-select-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.dice-filter-select-label {
	font-family: var(--font-title);
	font-size: 0.62rem;
	letter-spacing: 1.3px;
	text-transform: uppercase;
	color: rgba(191, 234, 255, 0.78);
	padding-left: 2px;
}

.dice-filter-select {
	width: 100%;
	min-width: 0;
	height: 42px;
	padding: 0 42px 0 14px;
	border-radius: 10px;
	border: 1px solid rgba(0, 212, 255, 0.24);
	background-color: rgba(9, 14, 30, 0.96);
	background-image:
		linear-gradient(45deg, transparent 50%, rgba(143, 224, 255, 0.9) 50%),
		linear-gradient(135deg, rgba(143, 224, 255, 0.9) 50%, transparent 50%),
		linear-gradient(180deg, rgba(7, 12, 28, 0.96), rgba(12, 20, 44, 0.92));
	background-position:
		calc(100% - 18px) calc(50% - 2px),
		calc(100% - 12px) calc(50% - 2px),
		0 0;
	background-size:
		6px 6px,
		6px 6px,
		100% 100%;
	background-repeat: no-repeat;
	color: #dff6ff;
	font-family: var(--font-body);
	font-size: 0.88rem;
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.03),
		0 10px 24px rgba(0, 0, 0, 0.18);
	outline: none;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background 0.2s ease;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
}

.dice-filter-select::-ms-expand {
	display: none;
}

.dice-filter-select option {
	background: #0c142c;
	color: #dff6ff;
}

.dice-filter-select:hover,
.dice-filter-select:focus {
	border-color: rgba(0, 212, 255, 0.55);
	box-shadow:
		inset 0 0 0 1px rgba(0, 212, 255, 0.08),
		0 0 0 3px rgba(0, 212, 255, 0.12);
}

#dice-filter-summary {
	margin: 0;
	font-size: 0.76rem;
	font-family: var(--font-title);
	letter-spacing: 1px;
	color: #8fd5ff;
	text-align: left;
	grid-area: summary;
	align-self: start;
}

/* ---- Crest / Type Reference Bar ---- */
.dice-ref-bar {
	background: rgba(0, 0, 0, 0.22);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 8px;
	padding: 7px 12px;
	margin-bottom: 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	text-align: center;
}

.dice-ref-crests {
	display: flex;
	gap: 8px 14px;
	flex-wrap: wrap;
	justify-content: space-between;
}

.ref-crest {
	display: flex;
	align-items: center;
	gap: 5px;
	font-size: 0.64rem;
	color: rgb(255 255 255);
	font-family: var(--font-title);
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.ref-crest img {
	width: 14px;
	height: 14px;
	object-fit: contain;
	opacity: 0.85;
}

.dice-ref-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	padding-top: 5px;
	text-align: center;
}

.dice-ref-tip {
	font-size: 0.9rem;
	color: rgb(255 215 0);
	font-family: var(--font-body);
	display: block;
	width: 100%;
}

.dice-ref-type-adv {
	font-size: 0.72rem;
	font-family: var(--font-title);
	letter-spacing: 0.5px;
	white-space: nowrap;
	text-align: center;
	display: block;
}

.type-adv-note {
	font-size: 0.9rem;
	color: rgb(255 255 255);
	margin-left: 3px;
	display: block;
	text-align: center;
}

.dice-filter-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	min-width: 0;
	padding: 8px 10px;
	border-radius: 5px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgba(255, 255, 255, 0.04);
	color: var(--text);
	font-family: var(--font-title);
	font-size: 0.72rem;
	letter-spacing: 1px;
	cursor: pointer;
	transition:
		background 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.dice-filter-button:hover,
.dice-filter-button.active {
	border-color: rgba(0, 212, 255, 0.45);
	background: rgba(0, 212, 255, 0.12);
	box-shadow: 0 0 16px rgba(0, 212, 255, 0.16);
}

.dice-filter-button.active {
	color: #bfeaff;
}

.dice-filter-button span {
	/* overflow: hidden; */
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Summon level buttons — yellow base (summon crest colour) */
.dice-filter-summon-lv {
	border-color: rgba(255, 215, 0, 0.35);
	background: rgba(255, 215, 0, 0.1);
	color: #ffe87a;
}
.dice-filter-summon-lv:hover {
	border-color: rgba(255, 215, 0, 0.65);
	background: rgba(255, 215, 0, 0.2);
	box-shadow: 0 0 14px rgba(255, 215, 0, 0.28);
	color: #fff4a0;
}
.dice-filter-summon-lv.active {
	border-color: rgba(255, 215, 0, 0.85);
	background: rgba(255, 215, 0, 0.28);
	box-shadow: 0 0 18px rgba(255, 215, 0, 0.45);
	color: #fff9c0;
}

/* Crest type filter buttons — per-crest colour base */
.dice-filter-crest-attack {
	border-color: rgba(255, 68, 68, 0.35);
	background: rgba(255, 68, 68, 0.1);
	color: #ffaaaa;
}
.dice-filter-crest-attack:hover,
.dice-filter-crest-attack.active {
	border-color: rgba(255, 68, 68, 0.75);
	background: rgba(255, 68, 68, 0.24);
	box-shadow: 0 0 16px rgba(255, 68, 68, 0.35);
	color: #ffcccc;
}

.dice-filter-crest-defense {
	border-color: rgba(68, 221, 136, 0.35);
	background: rgba(68, 221, 136, 0.1);
	color: #88ffbb;
}
.dice-filter-crest-defense:hover,
.dice-filter-crest-defense.active {
	border-color: rgba(68, 221, 136, 0.75);
	background: rgba(68, 221, 136, 0.24);
	box-shadow: 0 0 16px rgba(68, 221, 136, 0.35);
	color: #aaffcc;
}

.dice-filter-crest-movement {
	border-color: rgba(68, 170, 255, 0.35);
	background: rgba(68, 170, 255, 0.1);
	color: #aaddff;
}
.dice-filter-crest-movement:hover,
.dice-filter-crest-movement.active {
	border-color: rgba(68, 170, 255, 0.75);
	background: rgba(68, 170, 255, 0.24);
	box-shadow: 0 0 16px rgba(68, 170, 255, 0.35);
	color: #cceeff;
}

.dice-filter-crest-magic {
	border-color: rgba(204, 68, 255, 0.35);
	background: rgba(204, 68, 255, 0.1);
	color: #ddaaff;
}
.dice-filter-crest-magic:hover,
.dice-filter-crest-magic.active {
	border-color: rgba(204, 68, 255, 0.75);
	background: rgba(204, 68, 255, 0.24);
	box-shadow: 0 0 16px rgba(204, 68, 255, 0.35);
	color: #eeccff;
}

.dice-filter-crest-trap {
	border-color: rgba(255, 136, 68, 0.35);
	background: rgba(255, 136, 68, 0.1);
	color: #ffcc99;
}
.dice-filter-crest-trap:hover,
.dice-filter-crest-trap.active {
	border-color: rgba(255, 136, 68, 0.75);
	background: rgba(255, 136, 68, 0.24);
	box-shadow: 0 0 16px rgba(255, 136, 68, 0.35);
	color: #ffdcaa;
}

.dice-filter-icon {
	width: 20px;
	height: 20px;
}

/* ========================================
   DICE POOL — TWO-PANEL LAYOUT
   ======================================== */
#deck-editor .dice-pool-layout {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin-bottom: 8px;
	text-align: left;
	align-items: stretch;
}

#dice-select-panel .dice-pool-layout {
	display: grid;
	grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
	grid-template-rows: auto auto minmax(0, 1fr);
	grid-template-areas:
		'preview filters'
		'preview summary'
		'preview grid';
	gap: 10px 14px;
	margin-bottom: 12px;
	text-align: left;
	align-items: stretch;
	flex: 1 1 auto;
	min-height: 0;
}

.deck-editor-dice-layout {
	margin-top: 8px;
	grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.6fr) minmax(320px, 1.1fr);
	gap: 14px;
	align-items: start;
}

/* ---- Left: Preview Panel ---- */
.dice-pool-preview {
	border-radius: 12px;
	border: 1px solid rgba(0, 212, 255, 0.14);
	background: rgba(5, 8, 20, 0.75);
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 15px;
	background-size: cover;
	backdrop-filter: blur(128px);
	background-repeat: no-repeat;
	/* opacity: 0.5; */
	/* box-shadow: inset 0 0 20px 20px; */
}

#dice-select-panel .dice-pool-preview {
	grid-area: preview;
}

.dice-preview-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
	gap: 10px;
	color: rgba(255, 255, 255, 0.2);
	font-family: var(--font-title);
	font-size: 0.68rem;
	letter-spacing: 2px;
	padding: 20px;
	text-align: center;
	min-height: 490px;
}

.preview-placeholder-icon {
	font-size: 2.2rem;
	opacity: 0.25;
}

.preview-portrait {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center top;
	opacity: 0.52;
	pointer-events: none;
	z-index: -1;
}

.preview-portrait::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, transparent 20%, rgba(5, 8, 20, 0.97) 100%);
}

.preview-content {
	position: relative;
	z-index: 1;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 212, 255, 0.3) transparent;
	min-height: 490px;
}

.preview-rarity {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	border-radius: 12px 12px 0 0;
}

.preview-name {
	font-family: var(--font-title);
	font-size: 1.3rem;
	letter-spacing: 2px;
	color: #fff;
	line-height: 1.2;
	margin-top: 6px;
	/* min-height: 80%; */
	margin-bottom: 25px;
	padding: 6px 15px;
	background-color: rgb(0 0 0 / 58%);
	border-radius: 6px;
}

#dice-select-panel .preview-name {
	margin-bottom: 0px;
	font-size: 1.05rem;
	letter-spacing: 1.4px;
	padding: 5px 10px;
	background-color: rgb(0 0 0 / 66%);
}

#dice-select-panel .dice-select-preview-card {
	padding: 0;
	gap: 10px;
}

#dice-select-panel .dice-select-preview-media {
	position: relative;
	padding: 14px 14px 0;
}

#dice-select-panel .dice-select-preview-image {
	height: 176px;
	border-radius: 14px;
	background-size: cover;
	background-position: center top;
	border: 1px solid rgba(170, 223, 255, 0.22);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.04),
		0 18px 40px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	position: relative;
	display: flex;
	align-items: flex-end;
}

#dice-select-panel .dice-select-preview-image::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		180deg,
		rgba(6, 10, 18, 0.04) 0%,
		rgba(6, 10, 18, 0.14) 38%,
		rgba(6, 10, 18, 0.82) 100%
	);
}

#dice-select-panel .dice-select-preview-image-overlay {
	position: relative;
	z-index: 1;
	width: 100%;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

#dice-select-panel .dice-select-preview-header {
	padding: 0 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.preview-badges {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
}

.preview-level-badge {
	font-size: 0.82rem;
	padding: 4px 6px;
	border-radius: 4px;
	background: rgb(0 0 0 / 73%);
	color: rgba(255, 255, 255, 1);
	border: 1px solid rgba(255, 255, 255, 0.16);
	letter-spacing: 0.8px;
}

.preview-selected-badge {
	font-size: 0.72rem;
	padding: 9px 6px;
	border-radius: 4px;
	background: rgba(255, 215, 0, 0.15);
	color: var(--accent);
	letter-spacing: 1px;
	border: 1px solid rgba(255, 215, 0, 0.35);
}

.dice-pool-preview .dice-type-badge {
	font-size: 0.74rem;
	padding: 4px 7px;
	letter-spacing: 0.8px;
}

.preview-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	flex: 1;
	align-items: end;
}

.preview-stat {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: rgb(0 0 0 / 73%);
	border-radius: 5px;
	padding: 4px 8px;
	border: 1px solid rgba(255, 255, 255, 0.16);
}

.preview-stat-label {
	font-size: 1rem;
	letter-spacing: 1px;
	color: rgb(255 255 255);
}

.preview-stat-value {
	font-size: 1.3rem;
	font-weight: 700;
	color: var(--primary);
}

.preview-faces {
	display: grid;
	gap: 4px;
	grid-template-columns: repeat(6, 1fr);
	flex-wrap: wrap;
	align-items: flex-start;
	/* flex: 0 0 30%; */
	flex: 1;
	align-items: end;
}

.preview-face {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	background-color: rgba(255, 255, 255, 0.04);
	background-size: 65%;
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid rgba(255, 255, 255, 0.07);
	box-shadow: inset 0 0 8px var(--face-color, rgba(255, 255, 255, 0.08));
	border-radius: 7px;
	padding: 0px;
	width: 55px;
	height: 55px;
	flex: 1;
}

#deck-editor .preview-face {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 16px;
	background-color: rgba(255, 255, 255, 0.04);
	background-size: 65%;
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid rgba(255, 255, 255, 0.07);
	box-shadow: inset 0 0 8px var(--face-color, rgba(255, 255, 255, 0.08));
	border-radius: 7px;
	padding: 0px;
	width: 85px;
	height: 85px;
	flex: 1;
}

.preview-face-count {
	font-size: 2.72rem;
	font-weight: 700;
	color: var(--face-color, #fff);
	line-height: 1;
}

.preview-face-name {
	font-size: 0.82rem;
	color: rgba(255, 255, 255, 1);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	/* padding-top: 13px; */
}

.preview-ability,
.preview-item-desc {
	/* margin-top: auto; */
	padding: 8px;
	background: rgba(255, 215, 0, 0.05);
	border: 1px solid rgba(255, 215, 0, 0.14);
	border-radius: 6px;
	min-height: 100px;
	/* position: absolute; */
	display: grid;
	/* flex: 1; */
	align-items: anchor-center;
	background-color: rgb(0 0 0 / 64%);
	margin: 25px 0;
}

#dice-select-panel .preview-ability,
.preview-item-desc {
	margin: 0;
}

#dice-select-panel .preview-data-card {
	margin: 0 14px 14px;
	padding: 6px 8px;
	border-radius: 12px;
	background: linear-gradient(180deg, rgba(8, 12, 20, 0.92), rgba(8, 12, 20, 0.84));
	border: 1px solid rgba(168, 226, 255, 0.14);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#dice-select-panel .preview-data-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.84rem;
}

#dice-select-panel .preview-data-table th,
#dice-select-panel .preview-data-table td {
	padding: 7px 6px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	vertical-align: top;
}

#dice-select-panel .preview-data-table tr:last-child th,
#dice-select-panel .preview-data-table tr:last-child td {
	border-bottom: none;
}

#dice-select-panel .preview-data-table th {
	width: 68px;
	text-align: left;
	font-family: var(--font-title);
	font-size: 0.66rem;
	letter-spacing: 1.8px;
	color: #8fd5ff;
	font-weight: 700;
}

#dice-select-panel .preview-data-table td {
	color: #eef7ff;
	font-weight: 600;
	line-height: 1.3;
}

#dice-select-panel .preview-data-subline {
	display: block;
	margin-top: 3px;
	font-weight: 500;
	font-size: 0.78rem;
	line-height: 1.3;
	color: rgba(220, 234, 245, 0.82);
}

#dice-select-panel .preview-paired-stats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 6px;
}

#dice-select-panel .preview-paired-stat {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 5px 7px;
	border-radius: 7px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

#dice-select-panel .preview-paired-stat strong {
	font-size: 0.72rem;
	letter-spacing: 1px;
	color: #8fd5ff;
}

#dice-select-panel .preview-paired-stat span {
	font-size: 0.92rem;
	font-weight: 700;
	color: #eef7ff;
}

#dice-select-panel .preview-inline-faces {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 6px;
}

#dice-select-panel .preview-inline-faces .preview-face {
	width: 100%;
	min-width: 0;
	height: 58px;
	gap: 6px;
}

.preview-item-desc {
	font-size: 1rem;
	color: rgba(255, 255, 255, 1);
	line-height: 1.4;
}

.preview-ability-name {
	font-family: var(--font-title);
	font-size: 0.72rem;
	letter-spacing: 1px;
	color: var(--accent);
	margin-bottom: 3px;
}

.preview-ability-desc {
	font-size: 1rem;
	color: rgba(255, 255, 255, 1);
	line-height: 1.4;
}

/* ========================================
   DICE POOL VIEWER — read-only pool overlay
   ======================================== */
.dice-pool-viewer-overlay {
	position: fixed;
	inset: 0;
	z-index: 700;
	background: rgba(0, 0, 10, 0.72);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.dice-pool-viewer-overlay.hidden {
	display: none;
}

.dice-pool-viewer-panel {
	width: min(960px, 96vw);
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 18px 20px 20px;
	overflow: hidden;
}

.dice-pool-viewer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
}

.dice-pool-viewer-title {
	font-family: var(--font-title);
	font-size: 1rem;
	letter-spacing: 3px;
	color: var(--accent);
	text-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}

.pool-viewer-layout {
	display: grid;
	grid-template-columns: 379px 1fr;
	gap: 12px;
	min-height: 400px;
	flex: 1;
	overflow: hidden;
}

#pool-viewer-preview {
	min-height: 530px;
	overflow-y: auto;
}
.preview-meta {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
	align-items: center;
}

#pool-viewer-preview .preview-header {
	background-size: cover;
	opacity: 1;
	/* display: grid; */
	/* flex: 1; */
	/* align-items: end; */
}

#pool-viewer-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 10px;
	background: rgba(0, 0, 0, 0.27);
	padding: 16px;
	border-radius: 12px;
	align-content: start;
	overflow-y: auto;
}

/* die counter boxes are clickable */
.dice-resource-box.clickable {
	cursor: pointer;
	transition:
		border-color 0.2s,
		box-shadow 0.2s,
		background 0.2s;
}

.dice-resource-box.clickable:hover {
	border-color: rgba(0, 212, 255, 0.6);
	background: rgba(0, 212, 255, 0.12);
	box-shadow: 0 0 14px rgba(0, 212, 255, 0.25);
}

/* ---- Right: Slot Grid ---- */
#dice-pool-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 15px;
	/* margin: 25px; */
	background: rgb(0 0 0 / 27%);
	padding: 25px;
	border-radius: 15px;
	grid-column-gap: -10px;
	min-height: 407px;
	grid-auto-rows: min-content;
	grid-area: grid;
	align-content: start;
	min-width: 0;
}

/* Individual die slot — square via aspect-ratio, no min-height to avoid shift */
.dice-slot {
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.07);
	background: rgba(5, 8, 20, 0.65);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	cursor: pointer;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: space-between;
	/*! overflow: hidden; */
	transition:
		transform 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease;
	padding: 10px;
	flex: 1 !important;
	aspect-ratio: 1;
}

#deck-editor .deck-dice-grid .dice-slot,
#deck-editor .deck-current-list .dice-slot {
	align-self: start;
	/*! flex: 0 0 auto !important; */
	height: auto;
	width: 100%;
}

.slot-info-top {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	font-family: var(--font-title);
	font-size: 1rem;
	letter-spacing: 1px;
	line-height: 1;
	pointer-events: none;
	z-index: 5;
}

.slot-lv {
	color: rgb(237 255 0);
	font-weight: bolder;
	background-color: rgb(0 0 0 / 57%);
	padding: 5px;
	border-radius: 5px;
}

.slot-type-lbl {
	color: rgba(255, 255, 255, 0.4);
	font-size: 0.58rem;
}

.slot-name {
	font-family: var(--font-title);
	font-size: 0.9rem;
	letter-spacing: 0.5px;
	color: rgba(255, 255, 255, 0.5);
	width: 100%;
	text-align: center;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	padding: 0 2px;
	pointer-events: none;
	z-index: 5;
}

.dice-slot:not(.used):not(.empty-slot):hover {
	transform: translateY(-2px);
}

.dice-slot.empty-slot {
	cursor: default;
	border-style: dashed;
	opacity: 0.2;
}

.dice-slot.used {
	opacity: 0.42;
	cursor: not-allowed;
	filter: grayscale(0.95) saturate(0.2) brightness(0.7);
	border-color: rgba(180, 190, 205, 0.2) !important;
	box-shadow: inset 0 0 0 999px rgba(10, 12, 18, 0.34);
}

.dice-slot.used .cube {
	filter: grayscale(1) brightness(0.38);
}

.dice-slot.deck-slot-disabled {
	cursor: not-allowed;
}

.dice-slot.deck-slot-disabled .slot-hover-overlay {
	background: rgba(5, 8, 20, 0.56);
}

.dice-slot.deck-db-locked {
	opacity: 0.55;
	filter: grayscale(0.45) saturate(0.6);
}

.dice-slot.selected {
	border-color: var(--accent) !important;
	box-shadow: 0 0 16px rgba(255, 215, 0, 0.35);
}

.dice-slot.selected::before {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(5, 8, 20, 0.62);
	border-radius: inherit;
	z-index: 1;
	pointer-events: none;
}

.dice-slot.selected .cube {
	filter: grayscale(1) brightness(0.45);
}

.dice-slot.dice-type-dragon {
	border-color: rgba(255, 68, 68, 0.45);
}
.dice-slot.dice-type-undead {
	border-color: rgba(204, 204, 68, 0.45);
}
.dice-slot.dice-type-beast {
	border-color: rgba(68, 204, 68, 0.45);
}
.dice-slot.dice-type-warrior {
	border-color: rgba(68, 136, 255, 0.45);
}
.dice-slot.dice-type-spellcaster {
	border-color: rgba(180, 180, 255, 0.45);
}

/* Rarity strip at bottom of slot */
.slot-rarity {
	position: absolute;
	bottom: 0px;
	left: 0;
	right: 0;
	height: 14px;
	border-radius: 0 0 9px 9px;
	pointer-events: none;
	z-index: 0;
}

/* Hover overlay */
.slot-hover-overlay {
	position: absolute;
	inset: 0;
	background: rgba(5, 8, 20, 0.72);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.12s;
	z-index: 20;
	border-radius: 10px;
}

.dice-slot:not(.used):not(.empty-slot):hover .slot-hover-overlay {
	opacity: 1;
}

.slot-action-label {
	font-family: var(--font-title);
	font-size: 0.58rem;
	letter-spacing: 2px;
	padding: 5px 9px;
	border-radius: 5px;
	border: 1px solid var(--accent);
	color: var(--accent);
	pointer-events: none;
}

.dice-slot.selected .slot-action-label {
	border-color: #ff5577;
	color: #ff5577;
}

/* ========================================
   3D DICE CUBE
   ======================================== */
.cube-scene {
	width: 44px;
	height: 44px;
	perspective: 188px;
	pointer-events: none;
	flex-shrink: 0;
	/* margin-top: 5px; */
}

.cube {
	width: 44px;
	height: 44px;
	position: relative;
	transform-style: preserve-3d;
	animation: cubeRotate 10s linear infinite;
	margin-top: 5px;
}

.cube-face {
	position: absolute;
	top: 0;
	left: 0;
	width: 44px;
	height: 44px;
	background-color: rgba(5, 8, 20, 1);
	background-size: 100%;
	background-repeat: no-repeat;
	background-position: center;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: inset 0 0 25px var(--face-color, rgba(255, 255, 255, 0.1));
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding-bottom: 3px;
	transform-origin: center center;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}

.cube-face-front {
	transform: rotateY(0deg) translateZ(22px);
}
.cube-face-back {
	transform: rotateY(180deg) translateZ(22px);
}
.cube-face-left {
	transform: rotateY(-90deg) translateZ(22px);
}
.cube-face-right {
	transform: rotateY(90deg) translateZ(22px);
}
.cube-face-top {
	transform: rotateX(90deg) translateZ(22px);
}
.cube-face-bottom {
	transform: rotateX(-90deg) translateZ(22px);
}

.cube-face-count {
	font-size: 0.55rem;
	font-weight: 700;
	color: #fff;
	line-height: 1;
	text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
}

/* All-axis tumble: X×1, Y×1.5, Z×0.5 per cycle */
@keyframes cubeRotate {
	0% {
		transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
	}
	100% {
		transform: rotateX(360deg) rotateY(540deg) rotateZ(180deg);
	}
}

.dice-pool-item {
	width: 190px;
	flex-shrink: 0;
	min-height: 182px;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background-color: rgba(255, 255, 255, 0.03);
	cursor: pointer;
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	font-size: 0.76rem;
	font-family: var(--font-body);
	font-weight: 600;
	color: #f3f7ff;
	position: relative;
	overflow: hidden;
	padding: 10px;
	text-align: left;
}

.dice-pool-item-background {
	position: relative;
	height: 350px;
}

.dice-pool-item-rarity {
	position: absolute;
	inset: 0 auto 0 0;
	width: 5px;
	pointer-events: none;
	z-index: 1;
}

.dice-rarity-1 {
	background: linear-gradient(180deg, #8aa0b3, #d8e3ec);
}
.dice-rarity-2 {
	background: linear-gradient(180deg, #3cb371, #9cf0be);
}
.dice-rarity-3 {
	background: linear-gradient(180deg, #8f5bff, #d3b4ff);
}
.dice-rarity-4 {
	background: linear-gradient(180deg, #ffb347, #ffe38a);
}

.dice-pool-item-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(5, 8, 18, 0.15) 0%, rgba(5, 8, 18, 0.52) 45%, rgba(5, 8, 18, 0.9) 100%);
	pointer-events: none;
}

.dice-pool-item > * {
	position: relative;
	z-index: 1;
}

.dice-pool-item:hover {
	transform: translateY(-2px);
	border-color: var(--primary);
	box-shadow: 0 0 24px rgba(0, 212, 255, 0.18);
}

.dice-type-dragon {
	box-shadow: inset 0 0 0 1px rgba(255, 68, 68, 1);
	background-color: rgba(255, 68, 68, 0.2);
}
.dice-type-undead {
	box-shadow: inset 0 0 0 1px rgba(204, 204, 68, 1);
	background-color: rgba(204, 204, 68, 0.2);
}
.dice-type-beast {
	box-shadow: inset 0 0 0 1px rgba(68, 204, 68, 1);
	background-color: rgba(68, 204, 68, 0.2);
}
.dice-type-warrior {
	box-shadow: inset 0 0 0 1px rgba(68, 136, 255, 1);
	background-color: rgba(68, 136, 255, 0.1);
}
.dice-type-spellcaster {
	box-shadow: inset 0 0 0 1px rgba(221, 221, 255, 1);
	background-color: rgba(221, 221, 255, 0.1);
}

.dice-pool-item.selected {
	border-color: var(--accent);
	box-shadow:
		0 0 20px rgba(255, 215, 0, 0.26),
		inset 0 0 0 1px rgba(255, 215, 0, 0.18);
}

.dice-pool-item.used {
	opacity: 0.3;
	cursor: not-allowed;
}

.dice-pool-item-topline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	padding: 15px;
}

.deck-current-row .dice-pool-item-topline,
#dice-select-panel .dice-pool-item-topline {
	position: relative;
	padding: 0;
}

.dice-pool-item-main {
	display: grid;
	grid-template-columns: 1fr;
	justify-content: flex-end;
	gap: 25px;
	min-height: 108px;
}

.dice-pool-item .dice-level {
	font-family: var(--font-title);
	font-size: 1rem;
	font-weight: 900;
}

.badge {
	font-family: var(--font-title);
	font-size: 0.54rem;
	letter-spacing: 1px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.16);
	text-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

.dice-type-badge {
	font-family: var(--font-title);
	font-size: 1rem;
	letter-spacing: 1px;
	padding: 6px 12px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.16);
	text-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
}

.dice-type-dragon .dice-type-badge,
.dice-type-badge-dragon {
	color: #ff8f8f;
	background: rgba(255, 143, 143, 0.18);
	border-color: rgba(255, 143, 143, 0.45);
}
.dice-type-undead .dice-type-badge,
.dice-type-badge-undead {
	color: #f0ef87;
	background: rgba(240, 239, 135, 0.18);
	border-color: rgba(240, 239, 135, 0.45);
}
.dice-type-beast .dice-type-badge,
.dice-type-badge-beast {
	color: #8ff39c;
	background: rgba(143, 243, 156, 0.18);
	border-color: rgba(143, 243, 156, 0.45);
}
.dice-type-warrior .dice-type-badge,
.dice-type-badge-warrior {
	color: #8fbdff;
	background: rgba(143, 189, 255, 0.18);
	border-color: rgba(143, 189, 255, 0.45);
}
.dice-type-spellcaster .dice-type-badge,
.dice-type-badge-spellcaster {
	color: #ecebff;
	background: rgba(236, 235, 255, 0.18);
	border-color: rgba(236, 235, 255, 0.45);
}

.dice-move-type-badge {
	font-family: var(--font-title);
	font-size: 1rem;
	letter-spacing: 1px;
	padding: 6px 6px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.45);
	border: 1px solid rgba(255, 255, 255, 0.22);
}
.dice-move-type-flying {
	color: #88ddff;
	border-color: rgba(136, 221, 255, 0.4);
}
.dice-move-type-tunneling {
	color: #cc9944;
	border-color: rgba(204, 153, 68, 0.4);
}

.dice-pool-item .dice-name {
	font-size: 1.2rem;
	text-align: center;
	font-family: var(--font-title);
	letter-spacing: 0.8px;
	line-height: 1.08;
	padding: 10px;
}

.dice-stats,
.dice-crests {
	font-size: 1rem;
	line-height: 1.35;
	color: rgba(236, 242, 255, 0.96);
}

.dice-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
	font-weight: 700;
	text-shadow: 0 0 10px rgba(0, 0, 0, 0.28);
}

.dice-stat-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.38);
	border: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 1rem;
}

.dice-stat-label {
	padding-top: 4px;
	color: rgba(224, 232, 240, 0.82);
	letter-spacing: 0.5px;
}

.dice-stat-value {
	font-size: 1.2rem;
	font-family: var(--font-title);
	color: #78c8ff;
	line-height: 1;
}

.dice-crests {
	display: grid;
	flex-wrap: wrap;
	grid-template-columns: repeat(3, minmax(1px, 1fr));
	gap: 6px;
}

.dice-crest-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 6px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.36);
	border: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 0.6rem;
	line-height: 1;
}

.dice-crest-chip-icon {
	width: 14px;
	height: 14px;
	filter: brightness(1.12);
	margin: auto;
}

.dice-type-dragon .dice-level {
	color: var(--dragon);
}
.dice-type-undead .dice-level {
	color: var(--undead);
}
.dice-type-beast .dice-level {
	color: var(--beast);
}
.dice-type-warrior .dice-level {
	color: var(--warrior);
}
.dice-type-spellcaster .dice-level {
	color: var(--spellcaster);
}

#selected-dice-display {
	display: flex;
	gap: 6px;
	flex: 1;
	min-width: 0;
}

.dice-select-footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 0 0 auto;
	margin-top: auto;
}

/* Reset | S1 S2 S3 | Roll single-row layout */
.dice-select-row {
	display: flex;
	align-items: stretch;
	gap: 8px;
}

.btn-roll-compact {
	flex-shrink: 0;
	padding: 0 14px;
	font-size: 0.88rem;
	letter-spacing: 2px;
	min-width: 58px;
	/* height matches the slot cards via align-items: stretch on parent */
}

.btn-danger {
	background: linear-gradient(135deg, #7a0018, #cc2244);
	color: #fff;
	box-shadow: 0 4px 20px rgba(200, 30, 70, 0.3);
}

.btn-danger:hover {
	box-shadow: 0 4px 30px rgba(200, 30, 70, 0.55);
	transform: translateY(-2px);
}

.btn-danger:disabled {
	background: #333;
	color: #666;
	box-shadow: none;
	transform: none;
	cursor: not-allowed;
}

.selected-dice-slot {
	border-radius: 10px;
	border: 1px solid var(--selected-slot-border, rgba(255, 255, 255, 0.08));
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--selected-slot-border, rgba(255, 255, 255, 0.08)) 28%, transparent);
	height: 80px;
	cursor: pointer;
	overflow: hidden;
	flex: 1;
	background: rgba(255, 255, 255, 0.02);
	min-width: 30%;
}

.selected-dice-slot.empty {
	border-style: dashed;
	background: rgba(255, 255, 255, 0.02);
	width: 260px;
}

.selected-slot-card {
	position: relative;
	height: 100%;
	width: 100%;
	background-size: cover;
	background-position: center top;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	isolation: isolate;
}

.selected-slot-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(5, 8, 20, 0.18), rgba(5, 8, 20, 0.5));
	z-index: -2;
}

.selected-slot-card::after {
	content: '';
	position: absolute;
	inset: 0;
	background: var(--selected-slot-tint, rgba(68, 170, 255, 0.22));
	mix-blend-mode: screen;
	opacity: 0.85;
	z-index: -1;
}

.selected-slot-crests {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 2px;
}

.selected-slot-crest-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 8px;
	border-radius: 999px;
	background: rgba(48, 136, 214, 0.26);
	border: 1px solid rgba(120, 200, 255, 0.28);
	font-size: 0.72rem;
	line-height: 1;
	color: #d9f1ff;
}

.selected-slot-crest-icon {
	width: 16px;
	height: 16px;
	filter: brightness(1.15);
}

.selected-slot-name {
	width: 100%;
	text-align: center;
	font-family: var(--font-title);
	font-size: 0.96rem;
	line-height: 1.1;
	letter-spacing: 1px;
	padding: 5px 10px;
	color: #f4fbff;
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75);
	background: rgb(0 0 0 / 69%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	gap: 3px;
}

.selected-slot-name-text {
	max-width: 100%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding: 7px 0;
}

.selected-slot-type {
	font-size: 0.66rem;
	letter-spacing: 1.4px;
	color: rgb(191 234 255);
	padding: 3px 15px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	background: rgb(0 0 0 / 35%);
	line-height: 1.2;
}

#btn-roll {
	position: relative;
	overflow: hidden;
	padding: 14px 28px;
	font-size: 1rem;
	letter-spacing: 2px;
	background: linear-gradient(135deg, rgba(0, 212, 255, 0.22), rgba(0, 136, 170, 0.46));
	border: 1px solid rgba(0, 212, 255, 0.45);
	box-shadow:
		0 0 18px rgba(0, 212, 255, 0.18),
		inset 0 0 18px rgba(255, 255, 255, 0.04);
}

#btn-roll::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.22) 45%, transparent 100%);
	transform: translateX(-120%);
	animation: rollButtonSweep 2.8s linear infinite;
}

#btn-roll:disabled {
	opacity: 0.45;
	box-shadow: none;
}

@keyframes rollButtonSweep {
	0% {
		transform: translateX(-120%);
	}
	100% {
		transform: translateX(120%);
	}
}

@keyframes dicePanelBorderFlow {
	0% {
		background-position: 0% 50%;
	}
	100% {
		background-position: 200% 50%;
	}
}

/* ========================================
   ROLL RESULTS
   ======================================== */
#roll-results-panel {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: min(800px, calc(100vw - 80px));
	min-width: 0;
	max-width: none;
	max-height: min(80vh, 860px);
	overflow-y: auto;
	text-align: center;
	z-index: 46;
	padding: 18px;
	border: 1px solid rgba(68, 170, 255, 0.22);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.54);
}

#roll-results-panel::before {
	content: '';
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.34);
	backdrop-filter: blur(4px);
	z-index: -2;
}

#roll-results-panel::after {
	content: '';
	position: absolute;
	inset: 0;
	padding: 1px;
	border-radius: inherit;
	background: linear-gradient(
		130deg,
		rgba(255, 215, 0, 0.16),
		rgba(255, 255, 255, 0),
		rgba(0, 212, 255, 0.85),
		rgba(255, 255, 255, 0)
	);
	background-size: 220% 220%;
	animation: dicePanelBorderFlow 4.5s linear infinite;
	-webkit-mask:
		linear-gradient(#fff 0 0) content-box,
		linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	pointer-events: none;
	z-index: -1;
}

#roll-results-panel h3 {
	font-family: var(--font-title);
	font-size: 1.3rem;
	color: var(--accent);
	letter-spacing: 3px;
	margin-bottom: 14px;
}

#roll-results-content {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 14px;
	align-items: stretch;
	margin-bottom: 16px;
}

.roll-results-actions {
	display: flex;
	justify-content: center;
	gap: 12px;
	flex-wrap: wrap;
}

.summon-choice-card {
	appearance: none;
	cursor: pointer;
	min-height: 164px;
	padding: 10px;
	transition:
		transform 0.18s ease,
		border-color 0.18s ease,
		box-shadow 0.18s ease,
		filter 0.18s ease;
}

.summon-choice-card:hover,
.summon-choice-card:focus-visible {
	transform: translateY(-2px);
	border-color: rgba(0, 212, 255, 0.55);
	box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
	filter: brightness(1.04);
}

.summon-choice-card.is-selected {
	border-color: rgba(255, 215, 0, 0.85);
	box-shadow:
		0 0 0 1px rgba(255, 215, 0, 0.3) inset,
		0 18px 38px rgba(255, 215, 0, 0.16);
}

.summon-choice-card.is-selected .roll-result-summary.summon {
	color: #fff3b0;
	text-shadow: 0 0 14px rgba(255, 215, 0, 0.7);
}

.roll-result-die {
	position: relative;
	min-height: 250px;
	padding: 14px;
	background-size: cover;
	background-position: center top;
	border-radius: 14px;
	border: 10px solid var(--glass-border);
	text-align: left;
	overflow: hidden;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.roll-result-die.summon-ready {
	border-color: rgba(255, 215, 0, 0.42);
	box-shadow: 0 14px 30px rgba(255, 215, 0, 0.12);
}

.roll-result-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgb(0 0 0), rgb(255 255 255 / 0%), rgb(0 0 0));
	bottom: 0;
	border-width: 6px;
	border-style: solid;
	border-color: #000000;
}

.roll-result-topline,
.roll-result-main {
	position: relative;
	z-index: 1;
}

.roll-result-topline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-bottom: 94px;
}

.roll-result-main {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.roll-result-die .die-name {
	font-size: 1rem;
	font-family: var(--font-title);
	color: #ecf4ff;
	letter-spacing: 1px;
}

.roll-result-summary {
	font-family: var(--font-title);
	font-size: 1.02rem;
	font-weight: 700;
}

.roll-result-summary.summon {
	color: var(--accent);
	text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.roll-result-summary.movement {
	color: #ffaa00;
}
.roll-result-summary.attack {
	color: #ff4466;
}
.roll-result-summary.defense {
	color: #44aaff;
}
.roll-result-summary.magic {
	color: #dd66ff;
}
.roll-result-summary.trap {
	color: #66cc66;
}

.roll-result-stats {
	font-size: 1.3rem;
	color: rgba(236, 242, 255, 0.86);
}

.roll-result-effect {
	font-size: 1.3rem;
	line-height: 1.35;
	color: rgba(255, 241, 194, 0.88);
}

/* ========================================
   DIMENSION PANEL
   ======================================== */
#dimension-controls-rail {
	position: relative;
	right: auto;
	top: auto;
	transform: none;
	display: none;
	flex-direction: row;
	justify-content: center;
	gap: 10px;
	padding: 10px;
	z-index: 3;
}

.btn-icon {
	width: 52px;
	height: 52px;
	padding: 0;
	font-size: 1.35rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

#dimension-panel h3 {
	font-family: var(--font-title);
	font-size: 1.15rem;
	color: var(--accent);
	letter-spacing: 3px;
	margin-bottom: 8px;
}

#dimension-info {
	font-size: 0.9rem;
	color: var(--text-dim);
	margin-bottom: 8px;
}

/* ========================================
   ACTION INFO
   ======================================== */
#action-info {
	font-size: 0.9rem;
	color: var(--text-dim);
	margin-bottom: 8px;
}

.info-card-with-portrait,
.tooltip-card-with-portrait {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.monster-portrait,
.info-card-portrait,
.tooltip-portrait,
.roll-result-portrait,
.summon-option-portrait,
.selected-dice-portrait,
.dice-portrait {
	display: block;
	object-fit: cover;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
}

.info-card-portrait {
	width: 56px;
	height: 56px;
	flex: 0 0 56px;
}

.tooltip-portrait {
	width: 52px;
	height: 52px;
	flex: 0 0 52px;
}

.roll-result-portrait {
	width: 64px;
	height: 64px;
	margin: 0 auto 8px;
}

.summon-option-portrait {
	width: 40px;
	height: 40px;
	float: left;
	margin-right: 8px;
}

.selected-dice-portrait {
	width: 28px;
	height: 28px;
	margin-right: 8px;
	vertical-align: middle;
	display: inline-block;
}

.dice-portrait {
	width: 34px;
	height: 34px;
	margin-bottom: 4px;
}

/* ========================================
   COMBAT PANEL
   ======================================== */
#combat-panel {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 520px;
	text-align: center;
	z-index: 50;
	animation: combatSlam 0.3s ease;
	padding: 20px 22px 18px;
}

#combat-panel::before,
#crest-trade-panel::before,
#atk-boost-panel::before {
	content: '';
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(6px);
	z-index: -1;
}

@keyframes combatSlam {
	0% {
		transform: translate(-50%, -50%) scale(1.12);
		opacity: 0;
	}
	100% {
		transform: translate(-50%, -50%) scale(1);
		opacity: 1;
	}
}

#combat-panel h3 {
	font-family: var(--font-title);
	font-size: 1.4rem;
	color: var(--danger);
	letter-spacing: 5px;
	margin-bottom: 14px;
	text-shadow: 0 0 22px rgba(255, 68, 102, 0.6);
}

#combat-details {
	margin-bottom: 14px;
}

#combat-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 8px;
}

#combat-crest-spend {
	background: rgba(68, 136, 255, 0.08);
	border: 1px solid rgba(68, 136, 255, 0.28);
	border-radius: 8px;
	padding: 8px 10px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	text-align: center;
	/* margin: 0 auto; */
	width: 100%;
}

.crest-spend-label {
	font-family: var(--font-title);
	font-size: 0.72rem;
	letter-spacing: 1.5px;
	color: rgba(255, 255, 255, 0.55);
	text-transform: uppercase;
}

.crest-spend-hint {
	color: rgba(68, 200, 255, 0.65);
	font-size: 0.68rem;
}

.crest-spend-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 auto;
	padding: 10px 0;
}

.btn-crest-adj {
	width: 30px;
	height: 30px;
	padding: 0;
	border-radius: 6px;
	border: 1px solid rgba(68, 136, 255, 0.45);
	background: rgba(68, 136, 255, 0.15);
	color: #aaddff;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	transition: background 0.12s;
}

.btn-crest-adj:hover:not(:disabled) {
	background: rgba(68, 136, 255, 0.3);
}

.btn-crest-adj:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.crest-spend-amount {
	display: flex;
	align-items: baseline;
	gap: 4px;
	min-width: 48px;
	justify-content: center;
}

#crest-spend-count {
	font-family: var(--font-title);
	font-size: 1.3rem;
	color: #aaddff;
	font-weight: bold;
}

.crest-spend-unit {
	font-family: var(--font-title);
	font-size: 0.7rem;
	color: rgba(170, 220, 255, 0.55);
	letter-spacing: 1px;
}

.crest-spend-preview {
	font-family: var(--font-title);
	font-size: 0.75rem;
	letter-spacing: 0.8px;
	color: rgba(100, 200, 255, 0.75);
}

/* ── Arena layout ─────────────────────────────── */
.combat-arena {
	display: flex;
	align-items: stretch;
	gap: 10px;
	margin-bottom: 12px;
}

.combat-combatant {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 7px;
	padding: 12px 10px 10px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	min-width: 0;
	opacity: 1 !important;
}

.combat-combatant.is-attacker {
	border-color: rgba(255, 80, 80, 0.4);
	background: rgba(255, 60, 60, 0.07);
}

.combat-combatant.is-defender {
	border-color: rgba(68, 136, 255, 0.4);
	background: rgba(68, 136, 255, 0.07);
}

.combat-owner-label {
	font-family: var(--font-title);
	font-size: 0.8rem;
	letter-spacing: 2px;
	color: #fff;
	text-transform: uppercase;
	margin-bottom: 2px;
}

.combat-combatant.is-attacker .combat-owner-label {
	color: var(--danger, #ff4444);
	text-shadow: 0 0 8px rgba(255, 60, 60, 0.5);
}

.combat-combatant.is-defender .combat-owner-label {
	color: #44aaff;
	text-shadow: 0 0 8px rgba(68, 170, 255, 0.5);
}

.combat-role-label {
	font-family: var(--font-title);
	font-size: 0.65rem;
	letter-spacing: 2.5px;
	color: rgba(255, 255, 255, 0.45);
	text-transform: uppercase;
}

.combat-combatant.is-attacker .combat-role-label {
	color: rgba(255, 130, 130, 0.8);
}
.combat-combatant.is-defender .combat-role-label {
	color: rgba(130, 170, 255, 0.8);
}

.combat-portrait-wrap {
	position: relative;
	width: 96px;
	height: 96px;
	border-radius: 8px;
	overflow: hidden;
	border: 2px solid rgba(255, 255, 255, 0.12);
	background: rgba(0, 0, 0, 0.3);
	flex-shrink: 0;
}

.combat-portrait {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.combat-portrait-fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 2.4rem;
}

.combat-monster-name {
	font-family: var(--font-title);
	font-size: 0.78rem;
	letter-spacing: 0.8px;
	line-height: 1.25;
	text-align: center;
	color: #fff;
	max-width: 140px;
	word-break: break-word;
}

.combat-type-badge {
	font-family: var(--font-title);
	font-size: 0.65rem;
	letter-spacing: 1.5px;
	padding: 2px 9px;
	border-radius: 20px;
	border: 1px solid currentColor;
	/* opacity: 0.85; */
}

.combat-stats {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: center;
	width: 100%;
}

.combat-stat-row {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.combat-stat {
	display: flex;
	align-items: baseline;
	gap: 4px;
}

.combat-stat-label {
	font-family: var(--font-title);
	font-size: 0.7rem;
	letter-spacing: 1px;
	color: rgb(255 255 255);
}

.combat-stat-value {
	font-family: var(--font-body);
	font-size: 1.15rem;
	font-weight: 700;
	color: #fff;
	line-height: 1;
}

.combat-stat-value.atk {
	color: #ff7766;
}
.combat-stat-value.def {
	color: #66aaff;
}
.combat-stat-value.hp {
	color: #ff4466;
}

.combat-hp-hearts {
	font-size: 1.05rem;
	letter-spacing: 3px;
	color: #ff4466;
}

.combat-hp-hearts .heart-empty {
	color: rgba(255, 68, 102, 0.25);
}

/* ── VS divider ───────────────────────────────── */
.combat-vs-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-shrink: 0;
	padding: 0 4px;
}

.combat-vs-text {
	font-family: var(--font-title);
	font-size: 1.2rem;
	letter-spacing: 3px;
	color: rgba(255, 255, 255, 0.22);
}

.combat-type-box {
	margin-bottom: 12px;
	padding: 10px 12px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(255, 255, 255, 0.03);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.combat-type-box-title {
	font-family: var(--font-title);
	font-size: 0.68rem;
	letter-spacing: 2px;
	color: rgba(255, 255, 255, 0.72);
}

.combat-type-line {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 10px;
	align-items: baseline;
	font-size: 0.78rem;
	line-height: 1.35;
}

.combat-type-line-title {
	font-family: var(--font-title);
	letter-spacing: 1px;
	color: #ffffff;
}

.combat-type-line-formula {
	color: rgba(235, 243, 255, 0.86);
}

.combat-type-line.advantage .combat-type-line-formula {
	color: #8dffb0;
}

.combat-type-line.disadvantage .combat-type-line-formula {
	color: #ffd29e;
}

.combat-type-line.neutral .combat-type-line-formula {
	color: rgba(235, 243, 255, 0.7);
}

.combat-power-badge {
	font-family: var(--font-title);
	font-size: 0.72rem;
	letter-spacing: 1px;
	color: #ff8866;
	background: rgba(255, 100, 60, 0.12);
	border: 1px solid rgba(255, 100, 60, 0.3);
	border-radius: 6px;
	padding: 3px 7px;
	white-space: nowrap;
}

/* ── Result rows ──────────────────────────────── */
.combat-result-box {
	background: rgba(0, 0, 0, 0.25);
	border-radius: 8px;
	padding: 10px 14px;
	display: flex;
	flex-direction: column;
	gap: 5px;
	text-align: left;
	margin-bottom: 12px;
	text-align: center;
}

.combat-result-line {
	font-family: var(--font-title);
	font-size: 0.9rem;
	letter-spacing: 0.8px;
	line-height: 1.4;
}

.combat-result-line.damage {
	color: #ff6655;
}
.combat-result-line.shield {
	color: #55ccff;
}
.combat-result-line.no-damage {
	color: rgba(255, 255, 255, 0.35);
	font-size: 0.82rem;
}
.combat-result-line.destroyed {
	color: #ff2244;
	font-size: 1.05rem;
	letter-spacing: 2px;
}

@keyframes destroyedPulse {
	0% {
		text-shadow:
			0 0 30px #ff0000,
			0 0 60px #ff0000;
	}
	100% {
		text-shadow: none;
	}
}

.combat-result-line.destroyed {
	animation: destroyedPulse 0.6s ease-out forwards;
}

/* ========================================
   GAME LOG
   ======================================== */
#game-log {
	position: relative;
	width: 100%;
	max-height: 55vh;
	overflow: hidden;
	padding: 10px;
	opacity: 0.95;
	transition: opacity 0.3s;
}

#log-modal {
	z-index: 80;
}

.log-modal-content {
	width: min(760px, 86vw);
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.log-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#game-log:hover {
	opacity: 1;
}

#game-log.collapsed {
	opacity: 0.25;
	pointer-events: none;
	transform: translateY(8px);
}

#hud.ui-mobile #game-log.collapsed {
	max-height: 56px;
	overflow: hidden;
}

#log-content {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-height: 180px;
	overflow-y: auto;
}

.log-entry {
	font-size: 0.8rem;
	color: var(--text-dim);
	padding: 2px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.03);
	animation: logFadeIn 0.3s ease;
}

.log-entry.player-log {
	color: var(--player);
}
.log-entry.enemy-log {
	color: var(--enemy);
}
.log-entry.system-log {
	color: var(--accent);
}
.log-entry.combat-log {
	color: var(--danger);
}

@keyframes logFadeIn {
	from {
		opacity: 0;
		transform: translateX(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ========================================
   AUTO-ATTACK PROMPT
   ======================================== */
.auto-attack-prompt {
	position: fixed;
	top: 70px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	z-index: 600;
	pointer-events: all;
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.auto-attack-prompt.hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(20px);
}

.auto-attack-prompt:not(.hidden) {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.aap-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(10, 0, 20, 0.92);
	border: 1px solid var(--danger);
	border-radius: 10px;
	padding: 10px 16px;
	box-shadow:
		0 0 24px rgba(255, 60, 60, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(8px);
	white-space: nowrap;
	animation: aapSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes aapSlideIn {
	from {
		opacity: 0;
		transform: scale(0.9) translateY(10px);
	}
	to {
		opacity: 1;
		transform: scale(1) translateY(0);
	}
}

.aap-icon {
	font-size: 1.4rem;
	filter: drop-shadow(0 0 6px rgba(255, 80, 80, 0.8));
}

.aap-text {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.aap-monster-name {
	font-family: var(--font-title);
	font-size: 0.8rem;
	letter-spacing: 2px;
	color: #fff;
	text-transform: uppercase;
}

.aap-question {
	font-size: 1rem;
	color: var(--text-dim);
	letter-spacing: 1px;
}

.aap-buttons {
	display: flex;
	gap: 8px;
	margin-left: 8px;
}

.aap-btn {
	padding: 6px 14px !important;
	font-size: 0.72rem !important;
	letter-spacing: 1px;
	min-height: 32px !important;
}

/* ========================================
   GAME NOTICE (top-center event banner)
   ======================================== */
.game-notice {
	--game-notice-top: 20px;
	--game-notice-bottom: auto;
	--game-notice-hidden-transform: translateX(-50%) translateY(20px);
	--game-notice-visible-transform: translateX(-50%) translateY(0);
	position: fixed;
	top: var(--game-notice-top);
	bottom: var(--game-notice-bottom);
	left: 50%;
	transform: var(--game-notice-hidden-transform);
	z-index: 595;
	pointer-events: none;
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.game-notice.hidden {
	opacity: 0;
	transform: var(--game-notice-hidden-transform);
}

.game-notice:not(.hidden) {
	opacity: 1;
	transform: var(--game-notice-visible-transform);
}

.game-notice.interactive {
	pointer-events: all;
}

.game-notice-inner {
	display: flex;
	align-items: center;
	gap: 10px;
	background: rgba(10, 0, 20, 0.92);
	border: 1px solid var(--danger);
	border-radius: 10px;
	padding: 10px 18px;
	box-shadow:
		0 0 24px rgba(255, 60, 60, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(8px);
	white-space: nowrap;
	animation: aapSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
	min-width: 350px;
	max-width: min(92vw, 720px);
}

.game-notice-icon {
	font-size: 1.2rem;
	filter: drop-shadow(0 0 6px rgba(255, 80, 80, 0.8));
	flex-shrink: 0;
	display: none;
}

.game-notice-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	width: 100%;
	text-align: center;
}

.game-notice-title {
	font-family: var(--font-title);
	font-size: 0.75rem;
	letter-spacing: 2px;
	color: #fff;
	text-transform: uppercase;
}

.game-notice-sub {
	font-size: 1rem;
	color: #ffffff;
	letter-spacing: 1px;
	margin: 10px 0;
}

.game-notice-buttons {
	display: flex;
	gap: 8px;
	/* margin-left: 6px; */
	margin: 10px;
}

.game-notice.game-notice-reroll-result {
	--game-notice-top: 50%;
	--game-notice-bottom: auto;
	--game-notice-hidden-transform: translateX(-50%) translateY(-46%);
	--game-notice-visible-transform: translateX(-50%) translateY(-50%);
}

.game-notice.game-notice-reroll-result .game-notice-inner {
	justify-content: center;
	padding: 18px 22px;
	min-width: min(88vw, 460px);
	white-space: normal;
}

.game-notice.game-notice-reroll-result .game-notice-body {
	align-items: center;
	text-align: center;
}

.game-notice.game-notice-reroll-result .game-notice-title {
	display: none;
}

.game-notice.game-notice-reroll-result .game-notice-sub {
	display: none;
	margin: 8px 0 0;
	font-size: 0.92rem;
	max-width: 42ch;
}

.game-notice.game-notice-reroll-result .game-notice-buttons {
	justify-content: center;
	width: 100%;
	margin: 16px 0 0;
}

.game-notice.game-notice-end-turn {
	--game-notice-top: auto;
	--game-notice-bottom: 20px;
	--game-notice-hidden-transform: translateX(-50%) translateY(20px);
	--game-notice-visible-transform: translateX(-50%) translateY(0);
}

.game-notice.game-notice-end-turn .game-notice-inner {
	justify-content: center;
	min-width: 320px;
	max-width: min(90vw, 420px);
}

.game-notice.game-notice-end-turn .game-notice-body {
	align-items: center;
	text-align: center;
}

.game-notice-end-turn-btn {
	margin-top: 0;
	align-self: center;
	font-size: 0.95rem !important;
	padding: 7px 18px !important;
}

.game-notice.end-turn-mode .game-notice-inner {
	background: rgba(200, 20, 20, 0.92);
	border-color: rgba(255, 80, 80, 0.7);
	box-shadow:
		0 0 32px rgba(255, 40, 40, 0.6),
		inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.game-notice.end-turn-mode .game-notice-icon {
	filter: drop-shadow(0 0 8px rgba(255, 200, 200, 0.9));
}

.game-notice.end-turn-mode .game-notice-title {
	font-size: 1rem;
	letter-spacing: 3px;
	display: none;
}

.game-notice.end-turn-mode .game-notice-sub {
	display: none;
}

.game-notice-btn {
	padding: 5px 12px !important;
	font-size: 0.7rem !important;
	letter-spacing: 1px;
	min-height: 28px !important;
	min-width: 50%;
}

.destroy-target-panel {
	position: fixed;
	top: 70px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	z-index: 600;
	pointer-events: all;
	transition:
		opacity 0.25s ease,
		transform 0.25s ease;
}

.destroy-target-panel.hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(20px);
}

.destroy-target-panel:not(.hidden) {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.destroy-target-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(10, 0, 20, 0.92);
	border: 1px solid var(--danger);
	border-radius: 10px;
	padding: 10px 16px;
	box-shadow:
		0 0 24px rgba(255, 60, 60, 0.4),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	backdrop-filter: blur(8px);
	max-width: min(92vw, 820px);
}

.destroy-target-icon {
	font-size: 1.3rem;
	color: #ff8f8f;
	filter: drop-shadow(0 0 6px rgba(255, 80, 80, 0.8));
}

.destroy-target-copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.destroy-target-title {
	font-family: var(--font-title);
	font-size: 0.8rem;
	letter-spacing: 2px;
	color: #fff;
	text-transform: uppercase;
}

.destroy-target-subtitle {
	font-size: 0.65rem;
	color: var(--text-dim);
	letter-spacing: 1px;
}

.destroy-target-list {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-left: 8px;
}

.destroy-target-btn {
	padding: 6px 14px !important;
	font-size: 0.72rem !important;
	letter-spacing: 1px;
	min-height: 32px !important;
	white-space: nowrap;
}

/* ========================================
   MONSTER TOOLTIP
   ======================================== */
#monster-tooltip {
	position: absolute;
	z-index: 30;
	padding: 12px;
	min-width: 180px;
	pointer-events: none;
}

#tooltip-content {
	font-size: 0.9rem;
	line-height: 1.5;
}

.tooltip-name {
	font-family: var(--font-title);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 1px;
	margin-bottom: 4px;
}

.tooltip-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2px 8px;
	margin-top: 4px;
}

.tooltip-stat {
	font-size: 0.85rem;
}

.stat-atk {
	color: var(--danger);
}
.stat-def {
	color: var(--player);
}
.stat-hp {
	color: var(--success);
}
.stat-type {
	color: var(--accent);
}

/* ========================================
   GAME OVER
   ======================================== */
.game-over-content {
	text-align: center;
	animation: fadeInUp 0.8s ease;
}

#game-over-title {
	font-family: var(--font-title);
	font-size: 4rem;
	font-weight: 900;
	letter-spacing: 6px;
	margin-bottom: 16px;
}

.game-over-content.victory #game-over-title {
	background: linear-gradient(135deg, var(--accent), var(--primary));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	text-shadow: none;
}

#game-over-subtitle {
	font-size: 1.2rem;
	color: var(--text-dim);
	margin-bottom: 32px;
	letter-spacing: 2px;
}

.game-over-content .menu-buttons {
	display: flex;
	gap: 16px;
	justify-content: center;
}

/* ========================================
   REWARD SCREEN
   ======================================== */
.reward-section,
.defeat-consolation {
	margin: 0 0 28px;
	animation: fadeInUp 0.6s ease both;
}

.reward-row {
	display: flex;
	gap: 24px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.reward-label {
	font-size: 1rem;
	letter-spacing: 3px;
	color: var(--text-dim);
	text-transform: uppercase;
	margin-bottom: 8px;
}

/* Currency block */
.reward-currency-block {
	text-align: center;
	min-width: 140px;
}

.reward-currency-amount {
	font-family: var(--font-title);
	font-size: 2.8rem;
	font-weight: 900;
	letter-spacing: 3px;
	background: linear-gradient(135deg, #ffd700, #ffaa00);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	animation: currencyPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s both;
}

.reward-currency-amount.defeat {
	background: linear-gradient(135deg, #888, #aaa);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	font-size: 2rem;
}

.reward-total {
	font-size: 0.75rem;
	color: var(--text-dim);
	margin-top: 4px;
	letter-spacing: 1px;
}

/* Die drop card */
.reward-drop-block {
	text-align: center;
	min-width: 160px;
}

.reward-die-card {
	background: linear-gradient(135deg, rgba(30, 0, 60, 0.9), rgba(10, 0, 30, 0.95));
	border: 1px solid var(--primary);
	border-radius: 12px;
	padding: 14px 18px;
	box-shadow:
		0 0 20px rgba(140, 0, 255, 0.35),
		inset 0 1px 0 rgba(255, 255, 255, 0.05);
	animation: cardReveal 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s both;
	min-width: 150px;
}

.reward-die-portrait {
	width: 90px;
	height: 90px;
	border-radius: 8px;
	background-size: cover;
	background-position: center top;
	background-color: rgba(0, 0, 0, 0.4);
	margin: 0 auto 10px;
	border: 1px solid rgba(140, 0, 255, 0.3);
}

.reward-die-name {
	font-family: var(--font-title);
	font-size: 1rem;
	letter-spacing: 2px;
	color: #fff;
	margin-bottom: 4px;
}

.reward-die-level {
	font-size: 0.65rem;
	letter-spacing: 2px;
	color: var(--text-dim);
	margin-bottom: 6px;
	text-transform: uppercase;
}

.reward-die-type {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.reward-die-stats {
	font-size: 0.72rem;
	color: #bbb;
	letter-spacing: 1px;
	margin-bottom: 6px;
}

.reward-die-ability {
	font-size: 0.65rem;
	color: var(--accent);
	letter-spacing: 1px;
	font-style: italic;
}

.reward-die-crests {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
	margin-top: 8px;
}

/* Match stats row */
.reward-match-stats {
	display: flex;
	gap: 24px;
	justify-content: center;
	font-size: 0.72rem;
	color: var(--text-dim);
	letter-spacing: 1px;
	margin-bottom: 8px;
}

.reward-breakdown-actions {
	display: flex;
	justify-content: center;
	margin-top: 16px;
}

.reward-breakdown {
	width: min(560px, 92vw);
	margin: 14px auto 0;
	padding: 14px;
	border: 1px solid rgba(167, 139, 250, 0.22);
	background: linear-gradient(180deg, rgba(8, 10, 20, 0.82), rgba(8, 10, 20, 0.94));
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28);
	text-align: left;
	border-radius: 14px;
}

.reward-breakdown-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 8px 2px;
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	color: var(--text-dim);
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.reward-breakdown-row:last-child {
	border-bottom: none;
}

.reward-breakdown-row.is-total {
	padding-top: 12px;
	font-family: var(--font-title);
	font-size: 0.95rem;
	color: var(--accent);
}

.reward-stat-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	background: rgba(0, 0, 0, 0.5);
	min-width: 75px;
	/* min-height: 75px; */
	padding: 10px 0;
	border-radius: 6px;
}

.reward-stat-value {
	font-family: var(--font-title);
	font-size: 1.2rem;
	color: var(--text);
	letter-spacing: 2px;
}

/* Keyframes */
@keyframes currencyPop {
	from {
		opacity: 0;
		transform: scale(0.5);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes cardReveal {
	from {
		opacity: 0;
		transform: rotateY(90deg) scale(0.8);
	}
	to {
		opacity: 1;
		transform: rotateY(0deg) scale(1);
	}
}

/* ========================================
   LOADING SCREEN
   ======================================== */
.loading-content {
	text-align: center;
	width: min(420px, 90vw);
}

.loading-title {
	font-family: var(--font-title);
	font-size: 1.6rem;
	letter-spacing: 6px;
	color: var(--primary);
	text-shadow: 0 0 24px rgba(0, 212, 255, 0.6);
	margin-bottom: 32px;
}

.loading-bar-track {
	width: 100%;
	height: 6px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 3px;
	overflow: hidden;
	margin-bottom: 14px;
}

.loading-bar-fill {
	height: 100%;
	width: 0%;
	background: linear-gradient(90deg, var(--primary-dark), var(--primary));
	border-radius: 3px;
	box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
	transition: width 0.35s ease;
}

.loading-status {
	font-family: var(--font-title);
	font-size: 0.7rem;
	letter-spacing: 2px;
	color: var(--text-dim);
	margin-bottom: 6px;
	min-height: 1.2em;
}

.loading-pct {
	font-family: var(--font-title);
	font-size: 1.1rem;
	letter-spacing: 2px;
	color: var(--primary);
	opacity: 0.8;
}

/* ========================================
   MONSTER MOSAIC — main menu background reel
   ======================================== */
#monster-mosaic {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 50vw;
	height: 50vh;
	overflow: hidden;
	pointer-events: none;
	display: flex;
	gap: 6px;
	/* fade out edges so it blends into the background */
	-webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 50%, black 30%, transparent 75%);
	mask-image: radial-gradient(ellipse 90% 85% at 50% 50%, black 30%, transparent 75%);
	z-index: 0;
}

.mosaic-col {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
	min-width: 0;
	/* start mid-scroll so columns don't all begin at the same point */
	will-change: transform;
}

/* staggered speeds — slower = more dreamy */
.mosaic-col:nth-child(1) {
	animation: mosaicScroll 32s linear infinite;
}
.mosaic-col:nth-child(2) {
	animation: mosaicScroll 24s linear infinite;
	animation-delay: -8s;
}
.mosaic-col:nth-child(3) {
	animation: mosaicScroll 38s linear infinite;
	animation-delay: -15s;
}
.mosaic-col:nth-child(4) {
	animation: mosaicScroll 28s linear infinite;
	animation-delay: -4s;
}
.mosaic-col:nth-child(5) {
	animation: mosaicScroll 20s linear infinite;
	animation-delay: -12s;
}

@keyframes mosaicScroll {
	from {
		transform: translateY(0);
	}
	to {
		transform: translateY(-50%);
	}
}

.mosaic-img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	display: block;
	filter: grayscale(100%);
	opacity: 0.18;
	flex-shrink: 0;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
	width: 4px;
}

::-webkit-scrollbar-track {
	background: transparent;
}

::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.1);
	border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.2);
}

/* ========================================
   SUMMON SELECTOR (Dimension Phase)
   ======================================== */
#summon-selector {
	margin-bottom: 10px;
	padding: 8px;
	background: rgba(255, 215, 0, 0.05);
	border: 1px solid rgba(255, 215, 0, 0.15);
	border-radius: 6px;
}

#summon-selector p {
	font-size: 0.75rem;
	color: var(--accent);
	margin-bottom: 6px;
	letter-spacing: 1px;
}

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

.dimension-summon-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.dimension-summon-bar {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-top: 0;
}

.dimension-skip-button {
	min-width: 84px;
	align-self: stretch;
}

.dimension-summon-slot {
	min-height: 68px;
	padding: 8px;
	border-radius: 10px;
	border: 1px solid rgba(80, 170, 255, 0.35);
	background: rgba(25, 75, 130, 0.18);
	color: #dff1ff;
	transition: all 0.2s ease;
	appearance: none;
	text-align: left;
	width: 100%;
}

.dimension-summon-slot.available {
	cursor: pointer;
}

.dimension-summon-slot.available:hover {
	background: rgba(45, 110, 190, 0.28);
	border-color: rgba(120, 200, 255, 0.65);
}

.dimension-summon-slot.selected {
	border-color: rgba(255, 215, 0, 0.8);
	background: rgba(255, 215, 0, 0.18);
	box-shadow: 0 0 14px rgba(255, 215, 0, 0.2);
	color: #fff3b0;
}

.dimension-summon-slot.empty {
	border-style: dashed;
	border-color: rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.03);
	color: rgba(255, 255, 255, 0.35);
}

.dimension-summon-slot:disabled {
	cursor: default;
	opacity: 1;
}

.dimension-summon-mini-card {
	display: flex;
	align-items: center;
	gap: 8px;
}

.dimension-summon-mini-copy {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.dimension-summon-mini-name {
	font-family: var(--font-title);
	font-size: 0.78rem;
	line-height: 1.05;
}

.dimension-summon-mini-stats {
	font-size: 1.2rem;
	color: rgba(230, 242, 255, 0.82);
	line-height: 1.1;
}

.summon-option {
	text-align: left;
	padding: 6px 10px;
	font-size: 0.78rem;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	cursor: pointer;
	transition: all 0.2s;
}

.summon-option:hover {
	background: rgba(255, 215, 0, 0.1);
	border-color: rgba(255, 215, 0, 0.3);
}

.summon-option.active {
	border-color: var(--accent);
	background: rgba(255, 215, 0, 0.15);
	box-shadow: 0 0 8px rgba(255, 215, 0, 0.15);
}

.summon-option .summon-die-level {
	font-weight: 700;
	margin-right: 6px;
}

.summon-option .summon-die-stats {
	font-size: 0.65rem;
	color: var(--text-dim);
	display: block;
	margin-top: 2px;
}

/* ========================================
   HUD CREST ICON IMAGES
   ======================================== */
.crest-icon-img {
	width: 20px;
	height: 20px;
	vertical-align: middle;
	filter: brightness(1.2);
	margin-right: 2px;
}

/* ========================================
   ABILITY BUTTON
   ======================================== */
.btn-ability {
	font-family: var(--font-title);
	font-size: 0.9rem;
	font-weight: 700;
	letter-spacing: 2px;
	padding: 10px 24px;
	border: 1px solid var(--accent);
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: uppercase;
	background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 170, 0, 0.3));
	color: var(--accent);
	box-shadow: 0 2px 12px rgba(255, 215, 0, 0.2);
}

.btn-ability:hover {
	background: linear-gradient(135deg, rgba(255, 215, 0, 0.35), rgba(255, 170, 0, 0.45));
	box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
	transform: translateY(-1px);
}

.btn-ability:disabled {
	background: #222;
	color: #555;
	border-color: #333;
	box-shadow: none;
	cursor: not-allowed;
	transform: none;
}

/* ========================================
   EFFECT MODAL PANELS
   ======================================== */
#crest-trade-panel,
#atk-boost-panel {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 380px;
	text-align: center;
	z-index: 55;
	animation: combatSlam 0.3s ease;
}

#crest-trade-panel h3,
#atk-boost-panel h3 {
	font-family: var(--font-title);
	font-size: 1.3rem;
	color: var(--accent);
	letter-spacing: 3px;
	margin-bottom: 8px;
}

.modal-desc {
	font-size: 0.85rem;
	color: var(--text-dim);
	margin-bottom: 12px;
}

.modal-buttons {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 12px;
}

/* Crest trade spend/gain rows */
#crest-trade-spend,
#crest-trade-gain {
	display: flex;
	gap: 6px;
	justify-content: center;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.trade-crest-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 6px 10px;
	border: 1px solid var(--glass-border);
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.03);
	cursor: pointer;
	transition: all 0.2s;
	font-family: var(--font-body);
	font-size: 0.8rem;
	color: var(--text);
	min-width: 52px;
}

.trade-crest-btn:hover {
	border-color: var(--accent);
	background: rgba(255, 215, 0, 0.1);
}

.trade-crest-btn.selected {
	border-color: var(--accent);
	background: rgba(255, 215, 0, 0.2);
	box-shadow: 0 0 8px rgba(255, 215, 0, 0.2);
}

.trade-crest-btn .trade-count {
	font-family: var(--font-title);
	font-size: 1rem;
	font-weight: 700;
}

/* ATK boost slider */
#atk-boost-slider {
	width: 80%;
	margin: 8px auto;
	display: block;
}

#atk-boost-preview {
	font-family: var(--font-title);
	font-size: 1.1rem;
	color: var(--danger);
	letter-spacing: 1px;
	margin: 4px 0;
}

#atk-boost-info {
	font-size: 0.85rem;
	color: var(--text-dim);
	margin-bottom: 8px;
}

/* ========================================
   EFFECT TOAST
   ======================================== */
#effect-toast {
	position: absolute;
	top: 80px;
	left: 50%;
	transform: translateX(-50%);
	padding: 10px 28px;
	border-radius: 6px;
	font-family: var(--font-title);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 2px;
	color: #fff;
	z-index: 60;
	pointer-events: none;
	background: rgba(10, 10, 30, 0.85);
	border: 1px solid rgba(255, 215, 0, 0.3);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
	animation:
		toastSlideIn 0.4s ease,
		toastFadeOut 0.5s ease 2s forwards;
}

body.reduced-vfx .heart.active,
body.reduced-vfx .game-title,
body.reduced-vfx .title-accent,
body.reduced-vfx #effect-toast {
	animation: none !important;
}

body.reduced-vfx .glass-panel {
	backdrop-filter: blur(8px);
}

.orientation-hint-content {
	max-width: 320px;
	text-align: center;
}

.orientation-hint-content h2 {
	font-family: var(--font-title);
	font-size: 1.5rem;
	color: var(--accent);
	letter-spacing: 3px;
	margin-bottom: 12px;
}

.orientation-hint-content p {
	color: var(--text-dim);
	margin-bottom: 16px;
	line-height: 1.5;
}

@media (pointer: coarse) {
	.btn:active,
	.btn-small:active,
	.summon-option:active,
	.trade-crest-btn:active,
	.dice-pool-item:active {
		transform: scale(0.98);
		filter: brightness(1.08);
	}
}

@keyframes toastSlideIn {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

@keyframes toastFadeOut {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
	}
}

/* ========================================
   TURN BANNER
   ======================================== */
#turn-banner {
	position: fixed;
	top: 50%;
	left: 0;
	width: 100%;
	transform: translateY(-50%);
	text-align: center;
	z-index: 9999;
	pointer-events: none;
}

#turn-banner-text {
	display: inline-block;
	font-size: 4.2rem;
	font-weight: 700;
	letter-spacing: 6px;
	color: #fff;
	text-transform: uppercase;
	opacity: 0;
}

@keyframes turnBannerAnim {
	0% {
		transform: translateX(-120vw);
		opacity: 0;
	}
	18% {
		transform: translateX(0);
		opacity: 1;
	}
	72% {
		transform: translateX(0);
		opacity: 1;
	}
	100% {
		transform: translateX(120vw);
		opacity: 0;
	}
}

#turn-banner.show #turn-banner-text {
	animation: turnBannerAnim 1.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ========================================
   TOOLTIP BUFFS
   ======================================== */
.tooltip-ability {
	font-size: 0.72rem;
	color: var(--accent);
	margin-top: 4px;
	padding: 3px 0;
	border-top: 1px solid rgba(255, 215, 0, 0.15);
}

.tooltip-buffs {
	margin-top: 3px;
}

.tooltip-buff {
	font-size: 0.7rem;
	color: var(--success);
	padding: 1px 0;
}

/* ========================================
   DICE FACE TOOLTIP
   ======================================== */
.tooltip-faces {
	font-size: 0.65rem;
	color: var(--text-dim);
	margin-top: 4px;
	line-height: 1.4;
}

/* ========================================
   INTRO OVERLAY — Dramatic camera drop + who goes first
   ======================================== */
#intro-overlay {
	position: fixed;
	inset: 0;
	z-index: 9500;
	background: rgba(0, 2, 10, 0.88);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.55s ease;
	backdrop-filter: blur(6px);
}

#intro-overlay.intro-show {
	opacity: 1;
}

#intro-overlay.intro-hide {
	opacity: 0;
}

#intro-content {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 28px;
	text-align: center;
}

#intro-title {
	font-family: var(--font-title);
	font-size: 2.4rem;
	font-weight: 900;
	color: var(--accent);
	letter-spacing: 0.4em;
	text-transform: uppercase;
	text-shadow:
		0 0 20px var(--accent),
		0 0 50px rgba(255, 215, 0, 0.4);
	animation: introTitleAppear 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#intro-subtitle {
	font-family: var(--font-title);
	font-size: 0.95rem;
	color: var(--text-dim);
	letter-spacing: 0.35em;
	text-transform: uppercase;
	animation: introTitleAppear 0.7s 0.15s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#intro-card {
	width: 320px;
	height: 110px;
	background: var(--glass-bg);
	border: 2px solid var(--accent);
	border-radius: 14px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow:
		0 0 30px rgba(255, 215, 0, 0.2),
		inset 0 1px 0 rgba(255, 255, 255, 0.07);
	animation: introTitleAppear 0.7s 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
	transition:
		border-color 0.35s ease,
		box-shadow 0.35s ease;
}

#intro-card.intro-player-win {
	border-color: var(--player);
	box-shadow:
		0 0 50px rgba(68, 170, 255, 0.55),
		0 0 90px rgba(68, 170, 255, 0.25),
		inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

#intro-card.intro-enemy-win {
	border-color: var(--enemy);
	box-shadow:
		0 0 50px rgba(255, 68, 68, 0.55),
		0 0 90px rgba(255, 68, 68, 0.25),
		inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

#intro-card-name {
	font-family: var(--font-title);
	font-size: 2.6rem;
	font-weight: 900;
	color: var(--text);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	transition: color 0.3s ease;
}

#intro-card.intro-player-win #intro-card-name {
	color: var(--player);
	text-shadow: 0 0 18px rgba(68, 170, 255, 0.7);
}

#intro-card.intro-enemy-win #intro-card-name {
	color: var(--enemy);
	text-shadow: 0 0 18px rgba(255, 68, 68, 0.7);
}

#intro-goes-first {
	font-family: var(--font-title);
	font-size: 1.4rem;
	font-weight: 700;
	letter-spacing: 0.35em;
	color: var(--text);
	opacity: 0;
	transform: scale(0.7) translateY(10px);
	transition:
		opacity 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
		transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
	text-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

#intro-goes-first.intro-result-show {
	opacity: 1;
	transform: scale(1) translateY(0);
}

#intro-card.intro-player-win ~ #intro-goes-first {
	color: var(--player);
}

#intro-card.intro-enemy-win ~ #intro-goes-first {
	color: var(--enemy);
}

/* Card name flip pulse — flashes on each cycle */
@keyframes introCardFlip {
	0% {
		transform: scaleY(0.6);
		opacity: 0.3;
	}
	40% {
		transform: scaleY(1.08);
		opacity: 1;
	}
	100% {
		transform: scaleY(1);
		opacity: 1;
	}
}

.intro-card-cycling #intro-card-name {
	animation: introCardFlip 0.12s ease;
}

@keyframes introTitleAppear {
	from {
		opacity: 0;
		transform: translateY(22px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* HUD fade-in on game start */
#hud.intro-fadein {
	animation: introHudFadeIn 0.7s ease both;
}

@keyframes introHudFadeIn {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
	.game-title {
		font-size: 4rem;
	}
	.title-accent {
		font-size: 5rem;
	}
	.subtitle {
		font-size: 0.8rem;
		letter-spacing: 6px;
	}
	#dice-select-panel {
		min-width: 90vw;
	}
	#roll-results-panel {
		min-width: 90vw;
	}
	.rules-grid {
		grid-template-columns: 1fr;
	}
}

/* ========================================
   MOBILE-FIRST RESPONSIVE (Complete Overhaul)
   ======================================== */

/* Tablet and below */
@media (max-width: 1024px) {
	.deck-editor-header,
	.deck-editor-actions,
	.deck-select-actions,
	.deck-editor-meta,
	.deck-editor-buttons {
		flex-direction: column;
		align-items: stretch;
	}

	.deck-editor-layout,
	.deck-select-grid,
	.deck-editor-dice-layout {
		grid-template-columns: 1fr;
	}

	.deck-editor-preview,
	.deck-editor-current-sticky {
		position: static;
		max-height: none;
	}

	.deck-editor-preview-column,
	.deck-editor-database-column,
	.deck-editor-current-column {
		grid-column: auto;
	}

	.deck-editor-filters {
		grid-template-columns: 1fr;
	}

	.deck-dice-grid,
	.deck-current-list {
		padding-bottom: 12px;
	}

	#deck-select,
	#player-deck-select,
	#ai-deck-select {
		width: 100%;
	}
	#top-bar {
		grid-template-columns: auto 1fr auto;
		gap: 10px;
	}

	#phase-indicator {
		justify-content: center;
		align-items: flex-end;
		flex-wrap: wrap;
	}

	#player-info,
	#enemy-info {
		font-size: 0.85rem;
		min-width: 0;
		max-width: calc(50vw - 24px);
	}

	.hud-bottom-row {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
	}

	#roll-results-panel {
		width: min(92vw, 860px);
		min-width: 0;
		bottom: 96px;
	}

	#dimension-controls-rail:not(.hidden) {
		display: flex;
	}

	#action-panel {
		width: 240px;
		bottom: 96px;
	}
}

/* Mobile phones */
@supports (-moz-appearance: none) {
	#deck-editor .deck-current-list .cube-scene {
		perspective: none;
	}

	#deck-editor .deck-current-list .cube,
	#deck-editor .deck-current-list .cube-face {
		will-change: transform;
	}
}

@media (max-width: 767px) {
	.deck-editor-content {
		width: 100vw;
		height: 100vh;
		max-height: 100vh;
		padding: 14px;
	}

	.deck-select-content {
		width: calc(100vw - 16px);
		max-height: calc(100vh - 16px);
		padding: 14px;
	}

	#dice-filter-summary {
		font-size: 0.72rem;
	}

	.deck-dice-grid,
	.deck-current-list {
		grid-template-columns: 1fr 1fr;
	}

	.deck-editor-column {
		gap: 10px;
	}
	#top-bar {
		bottom: 8px;
		left: 8px;
		right: 8px;
		padding: 10px 12px;
		grid-template-columns: auto 1fr auto;
		align-items: end;
	}

	#top-bar-left {
		gap: 8px;
	}

	#top-bar-center {
		justify-content: center;
	}

	#top-bar-right {
		justify-content: flex-end;
	}

	#phase-indicator {
		gap: 6px 10px;
		align-items: flex-end;
		text-align: right;
	}

	#btn-end-turn-topbar {
		min-width: 140px;
		padding-inline: 14px;
	}

	#turn-number {
		font-size: 0.78rem;
	}

	#phase-name {
		font-size: 0.95rem;
	}

	#player-info,
	#enemy-info {
		position: absolute;
		min-width: 0;
		max-width: none;
		padding: 10px;
		font-size: 0.78rem;
		left: 8px;
		right: 8px;
		width: auto;
		gap: 10px;
	}

	.hud-bottom-row {
		gap: 10px;
	}

	.dice-resource-box {
		align-self: stretch;
	}

	.crests-display {
		gap: 6px;
	}

	.crest-counter {
		padding: 6px 4px;
	}

	#player-info {
		top: 8px;
	}

	#enemy-info {
		top: 86px;
	}

	#dice-select-panel {
		min-width: 0;
		width: calc(100vw - 16px);
		max-height: 62vh;
		padding: 16px;
		border-radius: 16px;
	}

	#roll-results-panel {
		left: 8px;
		right: 8px;
		bottom: 92px;
		transform: none;
		width: auto;
		min-width: 0;
		max-width: none;
		padding: 14px;
		border-radius: 16px;
		max-height: 38vh;
		overflow-y: auto;
	}

	#dimension-controls-rail {
		left: 8px;
		right: 8px;
		top: auto;
		bottom: 48vh;
		transform: none;
		flex-direction: row;
		justify-content: center;
	}

	#action-panel {
		left: 8px;
		right: 8px;
		bottom: 92px;
		width: auto;
		padding: 14px;
		border-radius: 16px;
		max-height: 30vh;
		overflow-y: auto;
	}

	#dice-pool-grid {
		gap: 8px;
	}

	.dice-pool-item {
		width: 100%;
		height: 64px;
	}

	#roll-results-content {
		gap: 8px;
	}

	.roll-result-die {
		flex: 1 1 calc(50% - 8px);
		min-width: 120px;
	}

	#combat-panel,
	#crest-trade-panel,
	#atk-boost-panel {
		width: 96vw;
		max-width: 420px;
		padding: 16px 14px;
	}

	.combat-portrait-wrap {
		width: 76px;
		height: 76px;
	}

	.combat-monster-name {
		font-size: 0.72rem;
	}
	.combat-stat-value {
		font-size: 1rem;
	}

	#combat-choices {
		flex-direction: column;
		gap: 8px;
	}

	.btn {
		min-height: 46px;
		padding: 12px 22px;
		font-size: 0.95rem;
	}

	.btn-small {
		min-height: 42px;
		padding: 9px 12px;
		font-size: 0.82rem;
	}

	#monster-tooltip {
		max-width: 280px;
		font-size: 0.85rem;
	}

	.heart {
		font-size: 1.4rem;
	}

	.crest-icon-img {
		width: 20px;
		height: 20px;
	}

	.crest-label {
		font-size: 0.6rem;
	}

	.crest-value {
		font-size: 1rem;
	}

	.settings-content {
		max-width: 90vw;
		padding: 24px;
	}

	.how-to-content {
		max-width: 90vw;
		max-height: 80vh;
		padding: 20px;
	}

	.controls-list {
		font-size: 0.75rem;
	}

	.key-badge {
		font-size: 0.65rem;
		padding: 2px 6px;
	}

	.menu-buttons {
		gap: 12px;
	}

	.btn-primary,
	.btn-secondary {
		width: 280px !important;
	}

	#summon-options {
		max-height: 140px;
		overflow-y: auto;
	}
}

@media (max-width: 767px) {
	.pool-viewer-layout {
		grid-template-columns: 1fr;
	}
	#pool-viewer-preview {
		max-height: 180px;
	}
	#pool-viewer-grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 7px;
		padding: 10px;
	}
	.dice-pool-viewer-panel {
		padding: 12px;
		max-height: 92vh;
	}
}

/* Small phones */
@media (max-width: 400px) {
	.game-title {
		font-size: 3rem;
	}
	.title-accent {
		font-size: 3.5rem;
	}

	#player-info,
	#enemy-info {
		font-size: 0.8rem;
	}

	.dice-pool-item {
		width: 48px;
		height: 44px;
		font-size: 0.6rem;
	}

	.btn {
		min-height: 44px;
		padding: 12px 24px;
		font-size: 0.95rem;
	}
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
	#player-info,
	#enemy-info {
		width: 320px;
		flex-wrap: nowrap;
	}

	#player-info {
		top: 8px;
		left: 8px;
		right: auto;
	}

	#enemy-info {
		top: 8px;
		right: 8px;
		left: auto;
	}

	#roll-results-panel {
		left: 50%;
		right: auto;
		bottom: 88px;
		transform: translateX(-50%);
		width: min(560px, calc(100vw - 32px));
		max-height: 48vh;
	}

	#dimension-controls-rail {
		right: 8px;
		left: auto;
		top: 50%;
		bottom: auto;
		transform: translateY(-50%);
		flex-direction: column;
	}

	#action-panel {
		left: auto;
		right: 8px;
		bottom: 88px;
		width: 260px;
		max-height: 42vh;
	}

	#dice-select-panel {
		width: min(720px, calc(100vw - 24px));
		max-height: 70vh;
	}
}

/* Touch-friendly spacing */
@media (pointer: coarse) {
	/* Increase spacing between interactive elements */
	.btn {
		margin: 4px 0;
	}

	.crest-counter {
		gap: 6px;
	}

	.dice-pool-item {
		margin: 2px;
	}

	/* Larger hit areas */
	.trade-crest-btn {
		min-width: 60px;
		min-height: 44px;
	}

	.summon-option {
		min-height: 44px;
		padding: 8px 12px;
	}
}

/* ========================================
   INLINE GAME LOG PANEL
   ======================================== */
.inline-log-panel {
	position: relative;
	left: auto;
	top: auto;
	bottom: auto;
	width: 73%;
	max-height: 200px;
	min-height: 100px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	padding: 8px 10px;
	z-index: 1;
	pointer-events: auto;
	border: 1px solid rgba(0, 212, 255, 0.25);
}

.inline-log-panel.is-collapsed {
	min-height: 0;
	flex: 0 0 auto;
}

.log-save-btn {
	align-self: flex-end;
	margin-top: 8px;
	font-size: 0.6rem;
	padding: 2px 7px;
	letter-spacing: 1px;
	opacity: 0.8;
}

.inline-log-content {
	overflow-y: auto;
	flex: 1;
	min-height: 0;
	font-size: 0.7rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.75);
	scrollbar-width: thin;
	scrollbar-color: rgba(0, 212, 255, 0.3) transparent;
}

#inline-log-panel .collapsible-panel-header {
	margin-bottom: 0;
}

.inline-log-content .log-entry {
	padding: 2px 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.inline-log-content .log-entry:last-child {
	border-bottom: none;
	color: #fff;
}

/* Hide the top-bar LOG button when inline log is active */
body.inline-log-active .log-btn-inline-hidden {
	display: none;
}

/* ========================================
   ITEM SYSTEM
   ======================================== */

/* Resurrection panel — centred modal like combat-panel */
#resurrection-panel {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	min-width: 320px;
	max-width: 480px;
	width: min(480px, 80vw);
	z-index: 55;
	text-align: center;
	border: 1px solid rgba(255, 255, 255, 0.18);
	box-shadow: 0 0 40px rgba(255, 255, 255, 0.12);
}

#resurrection-panel h3 {
	font-family: var(--font-title);
	font-size: 1rem;
	color: #fff;
	letter-spacing: 3px;
	margin-bottom: 10px;
	text-shadow: 0 0 14px rgba(255, 255, 255, 0.6);
}

.resurrection-choices {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 12px 0;
	max-height: 260px;
	overflow-y: auto;
}

.resurrection-btn {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 16px;
	text-align: left;
	border-color: rgba(255, 255, 255, 0.2) !important;
	transition:
		border-color 0.2s,
		background 0.2s;
}

.resurrection-btn:hover {
	border-color: rgba(255, 255, 255, 0.6) !important;
	background: rgba(255, 255, 255, 0.1) !important;
}

.resurrection-btn strong {
	font-family: var(--font-title);
	font-size: 0.82rem;
	color: #fff;
	letter-spacing: 1px;
}

.res-stats {
	font-size: 0.72rem;
	color: var(--text-dim);
	font-family: var(--font-title);
	letter-spacing: 0.5px;
}

/* Deck editor — item dice show with item badge */
.deck-die-card.is-item .dice-type-badge {
	background: linear-gradient(135deg, rgba(100, 60, 180, 0.5), rgba(140, 80, 255, 0.3));
	border-color: rgba(160, 100, 255, 0.5);
	color: #ddaaff;
}

/* Gluminizer active indicator in HUD */
.gluminizer-active-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 3px 8px;
	border-radius: 999px;
	background: rgba(68, 204, 204, 0.2);
	border: 1px solid rgba(68, 204, 204, 0.4);
	font-family: var(--font-title);
	font-size: 0.62rem;
	color: #44cccc;
	letter-spacing: 1px;
	white-space: nowrap;
}

/* Re-roll dialog */
#reroll-panel {
	text-align: center;
	min-width: 280px;
}
#reroll-panel h3 {
	font-size: 2rem;
	letter-spacing: 3px;
	color: var(--gold);
	margin-bottom: 6px;
	font-weight: bold;
	color: rgb(255 249 0);
}
#reroll-desc {
	font-size: 1.75rem;
	color: #ffffff;
	margin-bottom: 14px;
}

.reroll-summary {
	margin-top: 14px;
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px;
	text-align: left;
	/* max-width: 520px; */
	width: 100%;
}

.reroll-summary-empty {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	width: 100%;
}

.reroll-crest-tag {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 10px;
	border-radius: 20px;
	background: color-mix(in srgb, var(--crest-color) 18%, transparent);
	border: 1px solid color-mix(in srgb, var(--crest-color) 55%, transparent);
}

.reroll-crest-img {
	width: 100px;
	height: 100px;
	object-fit: contain;
}

.reroll-crest-count {
	font-size: 3.78rem;
	font-weight: 700;
	color: var(--crest-color);
	position: absolute;
	/* margin: auto; */
	left: 40px;
	right: 0;
	top: -30px;
	width: 100%;
	display: block;
	text-align: center;
}

.reroll-die-card {
	flex: 1 1 0;
	min-width: 0;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid rgba(255, 215, 100, 0.22);
	background-color: rgb(0 0 0 / 70%);
	background-size: cover;
	background-position: center top;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
	background-size: cover;
	background-position: top;
	min-height: 115px;
}

.reroll-die-topline {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	align-items: baseline;
	margin-bottom: 6px;
}

.reroll-die-name {
	font-family: var(--font-title);
	font-size: 0.88rem;
	letter-spacing: 0.8px;
	color: #f7fbff;
}

.reroll-die-level,
.reroll-die-stats {
	font-size: 1rem;
	color: rgb(255 255 255);
}

.reroll-die-level {
	color: #ffd966;
	white-space: nowrap;
}

.reroll-die-effect {
	margin-top: 6px;
	font-size: 0.98rem;
	line-height: 1.35;
	color: rgb(255 233 170);
}

/* Main menu profile row */
.menu-profile-row {
	display: flex;
	gap: 10px;
	justify-content: center;
}
.menu-profile-row .btn {
	min-width: 130px;
}

.btn-danger {
	border-color: #cc2244;
}
