/* =====================================================================
   Toon Brawl - dark fantasy arena theme
   ===================================================================== */
:root {
	--bg: #0d0a13;
	--bg-2: #140f1d;
	--panel: #1b1527;
	--panel-2: #231b33;
	--panel-hi: #2d2342;
	--border: #3a2d55;
	--border-hi: #5b4785;
	--text: #efe8ff;
	--muted: #a99cc4;
	--dim: #6f6390;
	--gold: #f6b93b;
	--gold-2: #ffd97a;
	--gold-dark: #b87a14;
	--red: #ef4444;
	--red-2: #ff7a6b;
	--green: #3ddc84;
	--blue: #4cc9f0;
	--purple: #a78bfa;
	--hp: #3ddc84;
	--xp: #8b5cf6;
	--radius: 14px;
	--radius-sm: 9px;
	--shadow: 0 10px 30px rgba(0, 0, 0, .45);
	--font-display: 'Cinzel', 'Georgia', serif;
	--font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
	--c-strength: #ff7a6b;
	--c-agility: #3ddc84;
	--c-speed: #ffd166;
	--c-intelligence: #4cc9f0;
	--c-health: #ff5d8f;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 15px; -webkit-text-size-adjust: 100%; }
@media (min-width: 768px) { html { font-size: 16px; } }

body {
	margin: 0;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background:
		radial-gradient(1200px 600px at 50% -200px, rgba(139, 92, 246, .18), transparent 70%),
		radial-gradient(800px 400px at 100% 100%, rgba(239, 68, 68, .08), transparent 70%),
		var(--bg);
	background-attachment: fixed;
	color: var(--text);
	font-family: var(--font-body);
	line-height: 1.5;
	overflow-x: hidden;
}

a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff; }

h1, h2, h3, h4, .display { font-family: var(--font-display); letter-spacing: .02em; margin: 0 0 .5rem; line-height: 1.15; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }

.muted { color: var(--muted); }
.dim { color: var(--dim); }
.gold { color: var(--gold); }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }

.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 16px 60px; flex: 1; }
.page-narrow { max-width: 860px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin: 0; color: var(--muted); }
.eyebrow { font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); font-weight: 800; margin-bottom: 6px; }

/* ---------------------------------------------------------------- nav */
.topbar {
	position: sticky; top: 0; z-index: 50;
	background: rgba(13, 10, 19, .82);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
}
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; color: var(--text); white-space: nowrap; }
.brand:hover { color: var(--gold-2); }
.brand-mark {
	width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
	background: linear-gradient(135deg, var(--gold), var(--red)); color: #1a0f00; font-size: 1.1rem;
	box-shadow: 0 0 18px rgba(246, 185, 59, .35);
}
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { color: var(--muted); font-weight: 700; padding: 8px 12px; border-radius: 10px; transition: .2s; white-space: nowrap; }
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--panel-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
	width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel);
	color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 1rem; transition: .2s;
}
.icon-btn:hover { border-color: var(--border-hi); background: var(--panel-2); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 5px 10px 5px 5px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; font-weight: 700; max-width: 220px; }
.user-chip .avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, var(--purple), var(--blue)); display: grid; place-items: center; font-size: .8rem; color: #0d0a13; font-weight: 900; flex-shrink: 0; }
.user-chip span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-menu { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.dropdown-item { color: var(--text); border-radius: 8px; font-weight: 600; padding: 8px 12px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--panel-hi); color: #fff; }

.nav-toggle { display: none; }
@media (max-width: 760px) {
	.nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 8px 16px 14px; margin: 0; }
	.nav-links.open { display: flex; }
	.nav-toggle { display: grid; }
	.user-chip span.name { display: none; }
	.user-chip { padding: 5px; }
}

/* ---------------------------------------------------------------- footer */
.footer { border-top: 1px solid var(--border); color: var(--dim); font-size: .9rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 22px 16px; display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.footer a { color: var(--muted); }

/* ---------------------------------------------------------------- buttons */
.btn-game {
	--btn-bg: linear-gradient(180deg, var(--panel-hi), var(--panel-2));
	--btn-fg: var(--text);
	--btn-border: var(--border-hi);
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 20px; border-radius: 12px; border: 1px solid var(--btn-border);
	background: var(--btn-bg); color: var(--btn-fg);
	font-family: var(--font-body); font-weight: 800; font-size: 1rem; letter-spacing: .02em;
	cursor: pointer; text-decoration: none; transition: transform .12s, box-shadow .2s, filter .2s;
	box-shadow: 0 4px 0 rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
	user-select: none; white-space: nowrap; min-height: 44px;
}
.btn-game:hover { color: var(--btn-fg); filter: brightness(1.12); transform: translateY(-1px); }
.btn-game:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .35); }
.btn-game[disabled], .btn-game.disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; pointer-events: none; }
.btn-gold { --btn-bg: linear-gradient(180deg, var(--gold-2), var(--gold) 55%, var(--gold-dark)); --btn-fg: #2a1600; --btn-border: #ffe3a1; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.btn-red { --btn-bg: linear-gradient(180deg, #ff7a6b, var(--red) 55%, #a61b1b); --btn-fg: #fff; --btn-border: #ff9b8f; text-shadow: 0 1px 1px rgba(0, 0, 0, .35); }
.btn-green { --btn-bg: linear-gradient(180deg, #7cf0b0, var(--green) 55%, #16925a); --btn-fg: #06240f; --btn-border: #a6ffd0; }
.btn-purple { --btn-bg: linear-gradient(180deg, #c4b5fd, var(--purple) 55%, #6d4ad8); --btn-fg: #16092e; --btn-border: #ddd3ff; }
.btn-ghost { --btn-bg: transparent; --btn-border: var(--border); box-shadow: none; }
.btn-sm { padding: 7px 12px; font-size: .88rem; min-height: 36px; border-radius: 10px; }
.btn-lg { padding: 14px 28px; font-size: 1.12rem; }
.btn-block { width: 100%; }

.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 0 0 rgba(246, 185, 59, .55); } 50% { box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 0 10px rgba(246, 185, 59, 0); } }

/* ---------------------------------------------------------------- panels & cards */
.panel {
	background: linear-gradient(180deg, var(--panel), var(--bg-2));
	border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel-pad { padding: 20px; }
.panel-title { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

.grid { display: grid; gap: 18px; }
.grid-fighters { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid-opponents { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.fighter-card {
	position: relative; overflow: hidden;
	background: linear-gradient(180deg, var(--panel-2), var(--panel) 45%, var(--bg-2));
	border: 1px solid var(--border); border-radius: var(--radius);
	box-shadow: var(--shadow); transition: transform .2s, border-color .2s, box-shadow .2s;
	display: flex; flex-direction: column;
}
.fighter-card:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: 0 16px 40px rgba(0, 0, 0, .55); }
.fighter-card.is-ready { border-color: rgba(246, 185, 59, .55); }
.fighter-card.is-levelup { border-color: var(--purple); box-shadow: 0 0 0 1px var(--purple), 0 0 30px rgba(167, 139, 250, .3); }
.fighter-card .card-top { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 14px 0; gap: 8px; }
.fighter-card .fname { font-family: var(--font-display); font-weight: 900; font-size: 1.2rem; line-height: 1.1; word-break: break-word; }
.fighter-card .fname a { color: var(--text); }
.fighter-card .fname a:hover { color: var(--gold-2); }
.fighter-card .stage {
	position: relative; height: 150px; display: grid; place-items: end center; margin-top: 4px;
	background: radial-gradient(closest-side at 50% 88%, rgba(0, 0, 0, .55), transparent 80%), radial-gradient(120px 90px at 50% 70%, rgba(167, 139, 250, .16), transparent 70%);
}
.fighter-card .card-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.fighter-card .card-actions { padding: 0 14px 14px; display: flex; gap: 8px; }
.fighter-card .card-actions > * { flex: 1; }

.level-badge {
	display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 6px;
	border-radius: 12px; background: linear-gradient(180deg, var(--gold-2), var(--gold-dark)); color: #2a1600;
	font-family: var(--font-display); font-weight: 900; font-size: 1.15rem; flex-shrink: 0;
	box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2), 0 0 16px rgba(246, 185, 59, .25);
	flex-direction: column; line-height: 1;
}
.level-badge small { font-size: .52rem; letter-spacing: .1em; font-family: var(--font-body); font-weight: 900; }

.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .75rem; font-weight: 800; background: var(--panel-hi); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tag-gold { color: var(--gold-2); border-color: rgba(246, 185, 59, .4); background: rgba(246, 185, 59, .1); }
.tag-purple { color: #d7c9ff; border-color: rgba(167, 139, 250, .5); background: rgba(167, 139, 250, .14); }
.tag-green { color: #b6ffd7; border-color: rgba(61, 220, 132, .4); background: rgba(61, 220, 132, .1); }
.tag-red { color: #ffc2bb; border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .12); }
.tag-bot { color: #9fe7ff; border-color: rgba(76, 201, 240, .4); background: rgba(76, 201, 240, .1); }

/* ---------------------------------------------------------------- bars */
.bar { position: relative; height: 10px; border-radius: 999px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 1px solid rgba(255, 255, 255, .06); }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #6d4ad8, var(--xp), #c4b5fd); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.bar.bar-hp > span { background: linear-gradient(90deg, #16925a, var(--green)); }
.bar-label { display: flex; justify-content: space-between; font-size: .75rem; font-weight: 800; color: var(--muted); margin-bottom: 4px; }

.pips { display: flex; gap: 4px; align-items: center; }
.pip { width: 12px; height: 12px; border-radius: 4px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .08); transform: rotate(45deg); }
.pip.on { background: linear-gradient(135deg, var(--gold-2), var(--gold-dark)); border-color: #ffe3a1; box-shadow: 0 0 8px rgba(246, 185, 59, .5); }

/* ---------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stat { background: rgba(0, 0, 0, .25); border: 1px solid rgba(255, 255, 255, .05); border-radius: 10px; padding: 6px 4px; text-align: center; }
.stat .v { font-weight: 900; font-size: 1.05rem; line-height: 1.1; }
.stat .k { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); font-weight: 800; }
.stat.hp .v { color: var(--c-health); }
.stat.str .v { color: var(--c-strength); }
.stat.agi .v { color: var(--c-agility); }
.stat.spd .v { color: var(--c-speed); }
.stat.int .v { color: var(--c-intelligence); }

.gear { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.gear-item {
	position: relative; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 1.05rem;
	background: rgba(0, 0, 0, .3); border: 1px solid var(--border); cursor: help;
}
.gear-item.ability { border-color: rgba(246, 185, 59, .5); background: rgba(246, 185, 59, .1); }
.gear-item.technique { border-color: rgba(255, 122, 107, .45); background: rgba(255, 122, 107, .08); }
.gear-item.pet { border-color: rgba(61, 220, 132, .45); }
.gear-item.skill { border-color: rgba(167, 139, 250, .5); }
.gear-empty { font-size: .8rem; color: var(--dim); align-self: center; }

/* tooltip: a single floating element positioned by site.js so it's never clipped by a card */
.game-tip {
	position: fixed; top: 0; left: 0; z-index: 1000; pointer-events: none;
	background: #0b0810; color: var(--text); border: 1px solid var(--border-hi); padding: 7px 10px; border-radius: 8px;
	font-size: .8rem; font-weight: 600; white-space: pre-line; max-width: min(260px, calc(100vw - 16px)); text-align: left;
	box-shadow: var(--shadow); line-height: 1.35; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.game-tip.show { opacity: 1; transform: none; }
.game-tip b { color: var(--gold-2); }

/* ---------------------------------------------------------------- sprites (animated by site.js) */
.sprite {
	--size: 150px;
	width: var(--size); height: var(--size);
	background-repeat: no-repeat;
	background-size: calc(var(--size) * 9) calc(var(--size) * 8);
	image-rendering: auto;
	filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5));
	flex-shrink: 0;
}
.sprite.flip { transform: scaleX(-1); }
/* Placeholder while the full sprite sheet downloads (site.js swaps it out) */
.sprite.sprite-loading { background-size: 56% auto !important; background-position: 50% 84% !important; animation: spritePulse 1.2s ease-in-out infinite; }
@keyframes spritePulse { 50% { opacity: .7; } }
.sprite-sm { --size: 72px; }
.sprite-md { --size: 110px; }
.sprite-lg { --size: 200px; }
.sprite-xl { --size: 260px; }

/* ---------------------------------------------------------------- toast */
.toast-stack { position: fixed; top: 76px; right: 16px; left: 16px; z-index: 200; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast-game {
	pointer-events: auto; max-width: 420px; background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--gold);
	border-radius: 12px; padding: 12px 16px; box-shadow: var(--shadow), 0 0 24px rgba(246, 185, 59, .25); font-weight: 700;
	animation: toastIn .45s cubic-bezier(.2, 1.4, .4, 1) both; display: flex; gap: 10px; align-items: flex-start;
}
.toast-game.hide { animation: toastOut .35s ease forwards; }
.toast-game button { background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; margin-left: auto; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ---------------------------------------------------------------- empty / callouts */
.callout { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(246, 185, 59, .35); background: rgba(246, 185, 59, .08); }
.callout .ico { font-size: 1.6rem; }
.callout.purple { border-color: rgba(167, 139, 250, .45); background: rgba(167, 139, 250, .1); }

.add-card {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 380px;
	border: 2px dashed var(--border-hi); border-radius: var(--radius); color: var(--muted); font-weight: 800; transition: .2s;
	background: rgba(255, 255, 255, .015);
}
.add-card:hover { color: var(--gold-2); border-color: var(--gold); background: rgba(246, 185, 59, .05); }
.add-card .plus { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: var(--panel-2); border: 1px solid var(--border-hi); }

/* ---------------------------------------------------------------- tables / lists */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: rgba(255, 255, 255, .025); }
.result-badge { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: .8rem; flex-shrink: 0; }
.result-badge.win { background: rgba(61, 220, 132, .15); color: var(--green); border: 1px solid rgba(61, 220, 132, .4); }
.result-badge.loss { background: rgba(239, 68, 68, .12); color: var(--red-2); border: 1px solid rgba(239, 68, 68, .4); }
.sprite-thumb { width: 44px; height: 44px; border-radius: 10px; background: rgba(0, 0, 0, .35); overflow: hidden; display: grid; place-items: center; flex-shrink: 0; }

.two-col { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 960px) { .two-col { grid-template-columns: minmax(0, 1fr) 340px; } }

/* ---------------------------------------------------------------- forms */
.input {
	width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border-hi); background: #0f0b17; color: var(--text);
	font-size: 1.05rem; font-weight: 700; outline: none; transition: border-color .2s, box-shadow .2s; font-family: var(--font-body);
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(246, 185, 59, .2); }
.input.ok { border-color: var(--green); }
.input.bad { border-color: var(--red); }

/* ---------------------------------------------------------------- misc animation */
.fade-up { animation: fadeUp .6s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
.stagger > * { animation: fadeUp .55s cubic-bezier(.2, .8, .2, 1) both; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .12s; }
.stagger > *:nth-child(4) { animation-delay: .18s; }
.stagger > *:nth-child(5) { animation-delay: .24s; }
.stagger > *:nth-child(6) { animation-delay: .30s; }
.stagger > *:nth-child(7) { animation-delay: .36s; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* bootstrap overrides for old markup */
.text-danger { color: var(--red-2) !important; }
.validation-summary-valid { display: none; }

/* ---------------------------------------------------------------- admin */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.admin-nav a.tab { padding: 8px 14px; border-radius: 999px; font-weight: 800; font-size: .9rem; color: var(--muted); border: 1px solid var(--border); background: var(--panel); }
.admin-nav a.tab.active, .admin-nav a.tab:hover { color: var(--gold-2); border-color: rgba(246, 185, 59, .5); background: rgba(246, 185, 59, .08); }
.admin-nav form { display: flex; gap: 8px; margin-left: auto; min-width: min(100%, 360px); flex: 1 1 280px; max-width: 460px; }
.input-sm { padding: 9px 11px; border-radius: 10px; font-size: .95rem; }
textarea.input { resize: vertical; min-height: 64px; }
.admin-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .7rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: #ffd9a8; background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .45); }
.admin-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.admin-grid label, .admin-field label { display: block; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 5px; }
.admin-field { margin-bottom: 12px; }
.admin-section { padding: 16px 18px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.admin-section:last-child { border-bottom: 0; }
.admin-section h3 { font-size: 1rem; margin: 0 0 12px; }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.check-pill { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: rgba(0, 0, 0, .2); cursor: pointer; font-weight: 700; font-size: .9rem; }
.check-pill:has(input:checked) { border-color: rgba(246, 185, 59, .6); background: rgba(246, 185, 59, .1); color: var(--gold-2); }
.check-pill input { accent-color: var(--gold); }
.admin-error { padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; background: rgba(239, 68, 68, .12); border: 1px solid rgba(239, 68, 68, .45); color: #ffc2bb; font-weight: 700; }
.admin-error ul { margin: 0; padding-left: 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); font-weight: 800; }
.kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.log-entry { padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, .05); display: grid; gap: 6px; }
.log-entry:last-child { border-bottom: 0; }
.log-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .88rem; }
.log-head time { color: var(--muted); font-weight: 700; }
.log-details { white-space: pre-line; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; color: var(--text); background: rgba(0, 0, 0, .3); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
.log-reason { font-size: .88rem; color: var(--muted); }
.log-reason b { color: var(--text); }
.stat-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-tile { padding: 14px; text-align: center; }
.stat-tile .v { font-family: var(--font-display); font-weight: 900; font-size: 1.6rem; color: var(--gold-2); }
.stat-tile .k { font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.coin-ico { display: inline-block; width: 1em; height: 1em; border-radius: 50%; vertical-align: -.15em; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 50%, var(--gold-dark)); box-shadow: inset 0 0 0 .12em rgba(184, 122, 20, .6); }

/* ---------------------------------------------------------------- coins & shop */
/* Coins are drawn with CSS: the coin emoji isn't available in Windows 10's emoji font. */
.coin { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 45%, var(--gold-dark)); box-shadow: 0 0 18px rgba(246, 185, 59, .45), inset 0 -3px 0 rgba(0, 0, 0, .2), inset 0 0 0 4px rgba(184, 122, 20, .55); }
.coin span { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; color: #7a4a00; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.coin.coin-lg { width: 72px; height: 72px; }
.coin.coin-lg span { font-size: 1.9rem; }
.wallet { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; background: radial-gradient(160px 80px at 20% 50%, rgba(246, 185, 59, .18), transparent 70%), rgba(0, 0, 0, .25); border: 1px solid rgba(246, 185, 59, .3); margin-bottom: 14px; }
.wallet .bal { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; line-height: 1; }
.coin-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 900; color: var(--gold-2); background: rgba(246, 185, 59, .1); border: 1px solid rgba(246, 185, 59, .4); white-space: nowrap; }
.final-note { font-size: .82rem; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: rgba(0, 0, 0, .25); border: 1px dashed var(--border-hi); }
.final-note b { color: var(--text); }

/* ---- confirmation dialogs (native <dialog>) */
.confirm-dialog { width: min(440px, calc(100vw - 32px)); border: 1px solid var(--border-hi, rgba(255,255,255,.18)); border-radius: 18px; padding: 22px; color: var(--text); background: linear-gradient(180deg, var(--panel-2), var(--bg-2)); box-shadow: 0 30px 80px rgba(0,0,0,.7); }
.confirm-dialog::backdrop { background: rgba(5, 3, 10, .72); backdrop-filter: blur(3px); }
.retire-zone { border-color: rgba(255, 107, 91, .35); }

/* ---- share sheet (fight replays / invites) */
.share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.share-row .btn-game { flex: 1 1 140px; justify-content: center; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }

/* ---- "Continue with Google" button (login page + guest account linking) */
.google-btn { width: 100%; background: #fff; color: #1f1f1f; border: 0; border-radius: 12px; padding: 13px 16px; font-weight: 800; font-size: 1rem; display: flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.35); transition: .15s; min-height: 48px; }
.google-btn:hover { transform: translateY(-1px); filter: brightness(.97); }

/* ---- lists that page in place (fight history, coin history) */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 12px 16px; }
.pager-info { color: var(--dim); font-size: .82rem; font-weight: 800; text-align: center; flex: 1; }
[data-ajax-list].loading { opacity: .5; pointer-events: none; transition: opacity .15s; }
.coin-hist-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); font-size: .9rem; }
.coin-hist-row:last-child { border-bottom: 0; }
.coin-hist + .pager { padding: 12px 0 0; }

/* ---- achievement titles, next-up hint, revenge */
.ftitle { font-style: italic; font-weight: 800; color: var(--gold-2); font-size: .9em; }
.fname + .ftitle { font-size: .85rem; margin-top: 2px; }
.next-up { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; border: 1px dashed rgba(167,139,250,.6); background: rgba(167,139,250,.08); color: #d7c9ff; font-size: .82rem; text-decoration: none; }
.next-up:hover { background: rgba(167,139,250,.16); color: #fff; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(246,185,59,.1); border: 1px solid rgba(246,185,59,.45); font-weight: 800; font-size: .82rem; }
.badge-chip small { color: var(--dim); font-weight: 800; }
