.pph-pity-tracker-page {
	--ppt-gold: var(--pph-gold, #ffd400);
	--ppt-panel: #0b151f;
	--ppt-panel-2: #101e2a;
	--ppt-line: rgba(134, 166, 198, .21);
	--ppt-muted: #9eafbd;
}

.pph-pity-page-center { min-width: 0; }

.pph-pity-heading h1 {
	flex: 0 0 auto;
}

.pph-pity-tracker,
.pph-pity-tracker * { box-sizing: border-box; }

.pph-pity-tracker {
	padding: 12px;
	color: #f5f8fb;
}

.pph-pity-save-banner {
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr) auto;
	align-items: center;
	gap: 11px;
	margin-bottom: 12px;
	padding: 11px 12px;
	border: 1px solid rgba(255, 212, 0, .28);
	border-radius: 9px;
	background: linear-gradient(100deg, rgba(255, 212, 0, .095), rgba(255, 212, 0, .018));
}

.pph-pity-save-banner > .dashicons {
	display: grid;
	width: 34px;
	height: 34px;
	place-items: center;
	border: 1px solid rgba(255, 212, 0, .26);
	border-radius: 50%;
	background: rgba(255, 212, 0, .1);
	color: var(--ppt-gold);
	font-size: 17px;
}

.pph-pity-save-banner strong { display: block; color: #fff; font-size: 11px; }
.pph-pity-save-banner p { margin: 3px 0 0 !important; color: var(--ppt-muted); font-size: 9px; line-height: 1.45; }
.pph-pity-save-banner > a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 35px;
	padding: 7px 11px;
	border: 1px solid rgba(255, 212, 0, .36);
	border-radius: 6px;
	background: rgba(255, 212, 0, .08);
	color: var(--ppt-gold) !important;
	font-size: 9px;
	font-weight: 900;
	text-decoration: none !important;
}

.pph-pity-topline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 1px 9px;
}

.pph-pity-topline > div strong,
.pph-pity-topline > div span { display: block; }
.pph-pity-topline > div strong { color: #fff; font-size: 11px; }
.pph-pity-topline > div span { margin-top: 2px; color: var(--ppt-muted); font-size: 8px; }

.pph-pity-double {
	display: grid;
	grid-template-columns: 30px auto;
	grid-template-rows: auto auto;
	column-gap: 8px;
	align-items: center;
	cursor: pointer;
}

.pph-pity-double input { position: absolute; opacity: 0; pointer-events: none; }
.pph-pity-double > span {
	position: relative;
	grid-row: 1 / 3;
	width: 30px;
	height: 18px;
	border: 1px solid #465969;
	border-radius: 999px;
	background: #172633;
}

.pph-pity-double > span::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: #a8b5c0;
	transition: transform .18s ease, background .18s ease;
}

.pph-pity-double input:checked + span { border-color: var(--ppt-gold); background: rgba(255,212,0,.16); }
.pph-pity-double input:checked + span::after { transform: translateX(12px); background: var(--ppt-gold); }
.pph-pity-double input:focus-visible + span { outline: 2px solid var(--ppt-gold); outline-offset: 2px; }
.pph-pity-double b { color: #fff; font-size: 9px; line-height: 1.1; }
.pph-pity-double small { color: var(--ppt-muted); font-size: 7px; line-height: 1.1; }

.pph-pity-types {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px;
	margin-bottom: 10px;
}

.pph-pity-type {
	display: grid;
	grid-template-columns: 58px minmax(0, 1fr);
	align-items: center;
	gap: 9px;
	min-width: 0;
	min-height: 76px;
	padding: 8px;
	border: 1px solid var(--ppt-line);
	border-radius: 9px;
	background: #0d1a25;
	color: #fff;
	cursor: pointer;
	text-align: left;
	transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.pph-pity-type:hover,
.pph-pity-type:focus-visible { border-color: rgba(255,212,0,.62); transform: translateY(-1px); }
.pph-pity-type.is-active { border-color: var(--ppt-gold); background: linear-gradient(135deg, rgba(255,212,0,.12), #101f2a 58%); box-shadow: inset 0 0 0 1px rgba(255,212,0,.13); }
.pph-pity-type img { display: block; width: 58px; height: 58px; object-fit: contain; }
.pph-pity-type > span { min-width: 0; }
.pph-pity-type strong,
.pph-pity-type small,
.pph-pity-type em { display: block; }
.pph-pity-type strong { overflow: hidden; color: #fff; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pph-pity-type small { margin-top: 3px; color: #c7d2db; font-size: 8px; }
.pph-pity-type small b { color: var(--ppt-gold); font-size: 11px; }
.pph-pity-type em { margin-top: 3px; color: var(--ppt-muted); font-size: 7px; font-style: normal; font-weight: 800; text-transform: uppercase; }

.pph-pity-workspace {
	padding: 13px;
	border: 1px solid var(--ppt-line);
	border-radius: 10px;
	background: linear-gradient(145deg, rgba(255,255,255,.02), transparent 50%), #09131d;
}

.pph-pity-workspace-head {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	padding-bottom: 11px;
	border-bottom: 1px solid var(--ppt-line);
}

.pph-pity-workspace-head > img { width: 48px; height: 48px; object-fit: contain; }
.pph-pity-workspace-head span { display: block; color: var(--ppt-gold); font-size: 7px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.pph-pity-workspace-head h2 { margin: 2px 0 1px !important; color: #fff; font-size: 18px; line-height: 1.1; }
.pph-pity-workspace-head p { margin: 0 !important; color: var(--ppt-muted); font-size: 8px; }

.pph-pity-save-status {
	min-width: 94px;
	color: #8ed6a0;
	font-size: 8px;
	font-weight: 800;
	text-align: right;
}
.pph-pity-save-status[data-state="saving"] { color: #cbd6df; }
.pph-pity-save-status[data-state="error"] { color: #ff8e8e; }

.pph-pity-count-panel {
	display: grid;
	grid-template-columns: minmax(150px, .7fr) minmax(330px, 1.3fr);
	align-items: center;
	gap: 15px;
	padding: 14px 0;
}

.pph-pity-count-panel label span,
.pph-pity-count-panel label small { display: block; }
.pph-pity-count-panel label span { color: #fff; font-size: 12px; font-weight: 900; }
.pph-pity-count-panel label small { margin-top: 3px; color: var(--ppt-muted); font-size: 8px; }

.pph-pity-count-control {
	display: grid;
	grid-template-columns: 52px 52px minmax(74px, 1fr) 52px 52px;
	gap: 5px;
}

.pph-pity-count-control button,
.pph-pity-count-control input {
	min-width: 0;
	height: 44px;
	border: 1px solid #334958;
	border-radius: 6px;
	background: #101f2b;
	color: #fff;
	font-weight: 900;
	text-align: center;
}

.pph-pity-count-control button { padding: 0 5px; font-size: 10px; cursor: pointer; }
.pph-pity-count-control button:hover,
.pph-pity-count-control button:focus-visible { border-color: var(--ppt-gold); }
.pph-pity-count-control button.is-primary { border-color: rgba(255,212,0,.64); background: rgba(255,212,0,.12); color: var(--ppt-gold); }
.pph-pity-count-control input { padding: 0 4px; font-size: 22px; appearance: textfield; }
.pph-pity-count-control input::-webkit-inner-spin-button,
.pph-pity-count-control input::-webkit-outer-spin-button { margin: 0; appearance: none; }

.pph-pity-stats {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 7px;
}

.pph-pity-stats > div {
	min-width: 0;
	padding: 10px;
	border: 1px solid var(--ppt-line);
	border-radius: 8px;
	background: rgba(16, 30, 42, .67);
}

.pph-pity-stats span,
.pph-pity-stats strong,
.pph-pity-stats small { display: block; }
.pph-pity-stats span { color: var(--ppt-muted); font-size: 7px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.pph-pity-stats strong { margin-top: 5px; color: #fff; font-size: clamp(15px, 2vw, 21px); line-height: 1; }
.pph-pity-stats > div:first-child strong { color: var(--ppt-gold); }
.pph-pity-stats small { min-height: 12px; margin-top: 5px; color: #91a5b4; font-size: 7px; line-height: 1.35; }

.pph-pity-progress {
	position: relative;
	height: 9px;
	margin-top: 12px;
	overflow: visible;
	border: 1px solid #324858;
	border-radius: 99px;
	background: #101f2b;
}

.pph-pity-progress > div { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c29200, var(--ppt-gold)); transition: width .2s ease; }
.pph-pity-progress > i {
	position: absolute;
	top: -8px;
	width: 24px;
	height: 23px;
	margin-left: -12px;
	cursor: help;
}

.pph-pity-progress > i::after {
	content: "";
	position: absolute;
	top: 4px;
	left: 11px;
	width: 2px;
	height: 15px;
	border-radius: 2px;
	background: #fff;
	box-shadow: 0 0 0 2px rgba(6,14,21,.8);
}

.pph-pity-progress > i > span {
	position: absolute;
	right: -8px;
	bottom: calc(100% + 5px);
	z-index: 5;
	width: max-content;
	max-width: min(220px, 75vw);
	padding: 6px 8px;
	border: 1px solid rgba(255,212,0,.5);
	border-radius: 5px;
	background: #07111a;
	box-shadow: 0 6px 18px rgba(0,0,0,.36);
	color: #fff;
	font-size: 8px;
	font-style: normal;
	font-weight: 900;
	line-height: 1.3;
	opacity: 0;
	pointer-events: none;
	transform: translateY(3px);
	transition: opacity .15s ease, transform .15s ease;
}

.pph-pity-progress > i:hover > span,
.pph-pity-progress > i:focus-visible > span {
	opacity: 1;
	transform: translateY(0);
}

.pph-pity-progress > i:focus-visible { outline: 2px solid var(--ppt-gold); outline-offset: 1px; }
.pph-pity-summary { margin: 8px 0 0 !important; color: #c8d2da; font-size: 9px; line-height: 1.5; }

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

.pph-pity-actions button,
.pph-pity-reset-confirm button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 38px;
	padding: 7px 11px;
	border: 1px solid #344a59;
	border-radius: 6px;
	background: #101f2b;
	color: #edf3f7;
	font-size: 8px;
	font-weight: 900;
	cursor: pointer;
}

.pph-pity-actions button:hover,
.pph-pity-actions button:focus-visible,
.pph-pity-reset-confirm button:hover,
.pph-pity-reset-confirm button:focus-visible { border-color: var(--ppt-gold); color: var(--ppt-gold); }
.pph-pity-reset-trigger { border-color: rgba(255, 116, 116, .3) !important; }

.pph-pity-reset-confirm {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 8px;
	margin-top: 9px;
	padding: 10px;
	border: 1px solid rgba(255, 107, 107, .38);
	border-radius: 8px;
	background: rgba(111, 22, 22, .15);
}

.pph-pity-reset-confirm[hidden],
.pph-pity-rules[hidden] { display: none !important; }
.pph-pity-reset-confirm strong { color: #fff; font-size: 10px; }
.pph-pity-reset-confirm p { margin: 2px 0 0 !important; color: var(--ppt-muted); font-size: 8px; }
.pph-pity-reset-confirm button.is-danger { border-color: #b44b4b; background: #7e2525; }

.pph-pity-rules {
	margin-top: 9px;
	padding: 12px;
	border: 1px solid rgba(255,212,0,.27);
	border-radius: 8px;
	background: rgba(255,212,0,.035);
}

.pph-pity-rules > div span { color: var(--ppt-gold); font-size: 7px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.pph-pity-rules h3 { margin: 2px 0 8px !important; color: #fff; font-size: 15px; }
.pph-pity-rules ol { margin: 0; padding-left: 20px; color: #c8d3db; font-size: 9px; line-height: 1.55; }
.pph-pity-rules li + li { margin-top: 5px; }
.pph-pity-rules > p { margin: 9px 0 0 !important; padding-top: 8px; border-top: 1px solid var(--ppt-line); color: #91a5b4; font-size: 8px; line-height: 1.5; }

.pph-pity-help-card { padding-bottom: 12px; }
.pph-pity-help-card ol { margin: 10px 13px 0; padding-left: 15px; color: #c8d3db; font-size: 8px; line-height: 1.55; }
.pph-pity-help-card li + li { margin-top: 5px; }
.pph-pity-help-card p { margin: 9px 13px 0 !important; padding-top: 8px; border-top: 1px solid var(--ppt-line); color: var(--ppt-muted); font-size: 8px; line-height: 1.5; }

.pph-pity-shortcode { max-width: 820px; margin: 20px auto; }

@media (max-width: 980px) {
	.pph-pity-type { grid-template-columns: 45px minmax(0, 1fr); }
	.pph-pity-type img { width: 45px; height: 45px; }
	.pph-pity-count-panel { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 760px) {
	body.pph-pity-tracker-active .pph-pity-tracker-page.pph-home:not(.pph-shortcode-home).pph-blocksy-container-width {
		left: auto !important;
		width: calc(100vw - 10px) !important;
		max-width: calc(100vw - 10px) !important;
		margin-right: 5px !important;
		margin-left: 5px !important;
		transform: none !important;
	}

	body.pph-pity-tracker-active .pph-pity-tracker-page .pph-pity-page-grid,
	body.pph-pity-tracker-active .pph-pity-tracker-page .pph-pity-page-center {
		width: 100% !important;
		min-width: 0 !important;
		max-width: 100% !important;
		margin: 0 !important;
	}

	.pph-pity-heading { padding: 13px 10px 12px; }
	.pph-pity-heading h1 { font-size: 25px; }
	.pph-pity-tracker { padding: 9px 7px 10px; }
	.pph-pity-save-banner { grid-template-columns: 30px minmax(0, 1fr); gap: 9px; padding: 10px; }
	.pph-pity-save-banner > .dashicons { width: 30px; height: 30px; }
	.pph-pity-save-banner > a { grid-column: 1 / -1; min-height: 38px; }
	.pph-pity-types { gap: 5px; }
	.pph-pity-type { display: block; min-height: 110px; padding: 7px 4px; text-align: center; }
	.pph-pity-type img { width: 48px; height: 48px; margin: 0 auto 3px; }
	.pph-pity-type strong { font-size: 10px; }
	.pph-pity-type small { font-size: 7px; }
	.pph-pity-type em { font-size: 6px; }
	.pph-pity-workspace { padding: 10px 7px; }
	.pph-pity-workspace-head { grid-template-columns: 41px minmax(0, 1fr); }
	.pph-pity-workspace-head > img { width: 41px; height: 41px; }
	.pph-pity-workspace-head h2 { font-size: 16px; }
	.pph-pity-save-status { grid-column: 1 / -1; min-width: 0; min-height: 11px; text-align: left; }
	.pph-pity-count-panel { padding: 11px 0; }
	.pph-pity-count-control { grid-template-columns: 45px 45px minmax(62px, 1fr) 45px 45px; gap: 4px; }
	.pph-pity-count-control button,
	.pph-pity-count-control input { height: 42px; }
	.pph-pity-count-control input { font-size: 19px; }
	.pph-pity-stats { gap: 4px; }
	.pph-pity-stats > div { padding: 8px 5px; }
	.pph-pity-stats span { min-height: 18px; font-size: 6px; }
	.pph-pity-stats strong { font-size: 14px; }
	.pph-pity-stats small { font-size: 6px; }
	.pph-pity-actions { align-items: stretch; }
	.pph-pity-actions button { flex: 1 1 50%; min-height: 42px; padding: 6px; }
	.pph-pity-reset-confirm { grid-template-columns: 1fr 1fr; }
	.pph-pity-reset-confirm > div { grid-column: 1 / -1; }
}

@media (max-width: 390px) {
	.pph-pity-topline { align-items: flex-start; }
	.pph-pity-topline > div span,
	.pph-pity-double small { display: none; }
	.pph-pity-type { min-height: 104px; }
	.pph-pity-type img { width: 44px; height: 44px; }
	.pph-pity-count-control { grid-template-columns: 41px 41px minmax(58px, 1fr) 41px 41px; }
	.pph-pity-count-control button { font-size: 9px; }
	.pph-pity-stats strong { font-size: 12px; }
	.pph-pity-actions { flex-direction: column; }
}
