/* ============================================================
   MarioMon Characters Pro — Frontend Styles
   All rules scoped under .mm- prefix.
   No global overrides. No external fonts or libraries.
   ============================================================ */

/* ── Grid ──────────────────────────────────────────────────── */
.mm-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 180px, 1fr ) );
	gap: 18px;
	margin: 28px 0;
}

/* ── Card ──────────────────────────────────────────────────── */
.mm-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	background: #ffffff;
	border: 1px solid #e8e8e8;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,.06);
	transition: transform .18s ease, box-shadow .18s ease;
	position: relative;
}

.mm-card:hover,
.mm-card:focus-visible {
	transform: translateY(-5px);
	box-shadow: 0 8px 24px rgba(0,0,0,.13);
	outline: none;
}

/* Rarity top accent bar */
.mm-card::before {
	content: '';
	display: block;
	height: 4px;
	width: 100%;
	background: #ddd;
}
.mm-rarity-common::before    { background: #b0b0b0; }
.mm-rarity-rare::before      { background: linear-gradient(90deg,#4a90d9,#74b9ff); }
.mm-rarity-epic::before      { background: linear-gradient(90deg,#9b59b6,#d7a4f8); }
.mm-rarity-legendary::before { background: linear-gradient(90deg,#f39c12,#f5d06a,#f39c12); }

/* ── Card Image Wrapper ─────────────────────────────────────── */
.mm-card__img-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #f6f6f6;
	overflow: hidden;
}

.mm-card__img-wrap img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .22s ease;
}

.mm-card:hover .mm-card__img-wrap img {
	transform: scale(1.05);
}

/* Fallback SVG container (shown only if real image fails) */
.mm-card__fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	box-sizing: border-box;
}
.mm-card__fallback svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Rarity gem in corner */
.mm-card__rarity-gem {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1.5px solid rgba(255,255,255,.7);
	display: block;
}
.mm-rarity-common    { background: #b0b0b0; }
.mm-rarity-rare      { background: #4a90d9; }
.mm-rarity-epic      { background: #9b59b6; }
.mm-rarity-legendary { background: #f39c12; box-shadow: 0 0 6px #f39c12; }

/* ── Card Body ──────────────────────────────────────────────── */
.mm-card__body {
	padding: 10px 12px 14px;
	flex: 1;
}

.mm-card__name {
	margin: 0 0 7px;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.25;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mm-card__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 8px;
}

/* ── Badges ─────────────────────────────────────────────────── */
.mm-badge {
	display: inline-block;
	padding: 2px 9px;
	border-radius: 999px;
	font-size: .7em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	background: #eee;
	color: #444;
}

/* Type badge colors */
.mm-type-fire     { background: #ffe1d6; color: #b3401a; }
.mm-type-water    { background: #dbeeff; color: #0b5fa3; }
.mm-type-grass    { background: #e2f6df; color: #2c7a1f; }
.mm-type-electric { background: #fff6d1; color: #8a6d00; }
.mm-type-ghost    { background: #ece1ff; color: #5a2d9c; }

/* Rarity badge */
.mm-rarity-badge { background: #f0f0f0; color: #555; }

/* ── Power Bar ──────────────────────────────────────────────── */
.mm-card__power-row {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: .72em;
}

.mm-card__power-label {
	color: #888;
	font-weight: 700;
	flex-shrink: 0;
}

.mm-card__power-bar {
	flex: 1;
	height: 6px;
	background: #ebebeb;
	border-radius: 999px;
	overflow: hidden;
}

.mm-card__power-fill {
	height: 100%;
	border-radius: 999px;
	background: #999;
}
/* Type-colored power fills */
.mm-type-fire.mm-card__power-fill     { background: linear-gradient(90deg,#ff6b35,#ffa45c); }
.mm-type-water.mm-card__power-fill    { background: linear-gradient(90deg,#2f8fd6,#74d0f8); }
.mm-type-grass.mm-card__power-fill    { background: linear-gradient(90deg,#4caf3c,#8de87a); }
.mm-type-electric.mm-card__power-fill { background: linear-gradient(90deg,#e0b800,#ffe566); }
.mm-type-ghost.mm-card__power-fill    { background: linear-gradient(90deg,#8b4fe0,#c99ef8); }

.mm-card__power-val {
	color: #555;
	font-weight: 700;
	flex-shrink: 0;
	min-width: 20px;
	text-align: right;
}

/* ── Empty state ────────────────────────────────────────────── */
.mm-empty {
	padding: 20px;
	text-align: center;
	color: #888;
	font-size: 1.05em;
}

/* ── Pagination ─────────────────────────────────────────────── */
.mm-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 20px 0;
}
.mm-page-link {
	display: inline-block;
	padding: 7px 14px;
	border: 1px solid #ddd;
	border-radius: 8px;
	text-decoration: none;
	color: #333;
	font-size: .9em;
	font-weight: 600;
	transition: background .15s;
}
.mm-page-link.is-active,
.mm-page-link:hover {
	background: #333;
	color: #fff;
	border-color: #333;
}

/* ── Single Character Page ──────────────────────────────────── */
.mm-single {
	display: flex;
	flex-wrap: wrap;
	gap: 28px;
	margin: 28px 0;
	padding: 24px;
	background: #fafafa;
	border: 1px solid #e8e8e8;
	border-radius: 16px;
}

.mm-single__img-col {
	flex: 0 0 280px;
	max-width: 100%;
}

.mm-single__img {
	width: 100%;
	height: auto;
	border-radius: 12px;
	display: block;
	box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.mm-single__img-fallback {
	width: 100%;
	max-width: 280px;
	border-radius: 12px;
	overflow: hidden;
}
.mm-single__img-fallback svg {
	width: 100%;
	height: auto;
	display: block;
}

.mm-single__info {
	flex: 1 1 260px;
	min-width: 220px;
}

.mm-single__badges {
	display: flex;
	gap: 8px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}
.mm-single__badges .mm-badge {
	font-size: .82em;
	padding: 4px 14px;
}

.mm-single__stat {
	margin-bottom: 18px;
}

.mm-single__stat-label {
	display: block;
	font-size: .78em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #888;
	margin-bottom: 6px;
}

.mm-single__stat-val {
	font-size: 1em;
	color: #222;
}

.mm-single__power-bar {
	width: 100%;
	height: 12px;
	background: #ebebeb;
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 4px;
}

.mm-single__power-fill {
	height: 100%;
	border-radius: 999px;
	background: #999;
}
/* Reuse type-colored fills for single page */
.mm-type-fire.mm-single__power-fill     { background: linear-gradient(90deg,#ff6b35,#ffa45c); }
.mm-type-water.mm-single__power-fill    { background: linear-gradient(90deg,#2f8fd6,#74d0f8); }
.mm-type-grass.mm-single__power-fill    { background: linear-gradient(90deg,#4caf3c,#8de87a); }
.mm-type-electric.mm-single__power-fill { background: linear-gradient(90deg,#e0b800,#ffe566); }
.mm-type-ghost.mm-single__power-fill    { background: linear-gradient(90deg,#8b4fe0,#c99ef8); }

.mm-single__skills {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.mm-skill-tag {
	display: inline-block;
	padding: 4px 12px;
	background: #eef;
	color: #334;
	border-radius: 999px;
	font-size: .82em;
	font-weight: 600;
}

/* Rarity glow on single page */
.mm-single.mm-rarity-epic      { box-shadow: 0 0 0 3px #9b59b640; }
.mm-single.mm-rarity-legendary { box-shadow: 0 0 0 4px #f39c1240; }

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.mm-grid {
		grid-template-columns: repeat( auto-fill, minmax( 145px, 1fr ) );
		gap: 12px;
	}
	.mm-single {
		flex-direction: column;
		padding: 16px;
	}
	.mm-single__img-col {
		flex-basis: auto;
	}
}
