:root {
	--bg-1: #140f28;
	--bg-2: #29184a;
	--panel: rgba(255,255,255,0.10);
	--panel-strong: rgba(255,255,255,0.15);
	--panel-soft: rgba(255,255,255,0.07);
	--text: #f8f5ff;
	--muted: #d2c6f5;
	--accent: #b388ff;
	--accent-2: #ff9ed1;
	--good: #7de3b1;
	--warn: #ffd36e;
	--bad: #ff8a9a;
	--shadow: 0 20px 60px rgba(0,0,0,0.35);
	--radius: 24px;
	--radius-sm: 16px;
	--border: 1px solid rgba(255,255,255,0.14);
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	min-height: 100%;
}

body {
	font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
	color: var(--text);
	background:
		radial-gradient(circle at top left, rgba(255,158,209,0.18), transparent 35%),
		radial-gradient(circle at top right, rgba(179,136,255,0.22), transparent 30%),
		linear-gradient(160deg, var(--bg-1), var(--bg-2));
}

.shell {
	min-height: 100vh;
	padding: 24px 16px 40px;
	display: flex;
	align-items: flex-start;
	justify-content: center;
}

.container {
	width: 100%;
	max-width: 1080px;
}

.hero {
	margin-bottom: 18px;
	background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
	border: var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.hero-band {
	padding: 24px 24px 18px;
	background: linear-gradient(90deg, rgba(179,136,255,0.18), rgba(255,158,209,0.18));
	border-bottom: 1px solid rgba(255,255,255,0.10);
}

.hero h1 {
	margin: 0 0 10px;
	font-size: clamp(2rem, 4vw, 3rem);
}

.hero p {
	margin: 0;
	color: var(--muted);
	line-height: 1.6;
}

.panel {
	background: linear-gradient(180deg, rgba(255,255,255,0.13), rgba(255,255,255,0.07));
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.progress-panel {
	margin-bottom: 18px;
}

.progress-main {
	padding: 10px 24px !important;
}

.overall-progress-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
}

.overall-progress-title {
	font-weight: 800;
	font-size: 1rem;
	color: var(--text);
}

.overall-progress-meta {
	color: var(--muted);
	font-size: 0.95rem;
	font-weight: 700;
}

.stats-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 18px;
}

.stat-card {
	padding: 18px;
	background: var(--panel-soft);
	border: var(--border);
	border-radius: 22px;
	position: relative;
	overflow: hidden;
}

.stat-card-tone {
	box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}

.tone-good {
	background:
		linear-gradient(180deg, rgba(125,227,177,0.10), rgba(255,255,255,0.05)),
		rgba(255,255,255,0.06);
}

.tone-warn {
	background:
		linear-gradient(180deg, rgba(255,211,110,0.10), rgba(255,255,255,0.05)),
		rgba(255,255,255,0.06);
}

.tone-bad {
	background:
		linear-gradient(180deg, rgba(255,138,154,0.12), rgba(255,255,255,0.05)),
		rgba(255,255,255,0.06);
}

.stat-top {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	margin-bottom: 12px;
}

.stat-title {
	font-weight: 800;
	font-size: 1rem;
	line-height: 1.3;
	color: #f7f1ff;
}

.stat-title .icon {
	margin-left: 6px;
}

.tag {
	display: inline-flex;
	align-items: center;
	border-radius: 10px;
	padding: 5px 10px;
	font-size: 0.84rem;
	font-weight: 800;
	border: 1px solid rgba(255,255,255,0.10);
	white-space: nowrap;
}

.tag-good {
	background: rgba(125, 227, 177, 0.18);
	color: #dffcec;
}

.tag-warn {
	background: rgba(255, 211, 110, 0.18);
	color: #fff0c2;
}

.tag-bad {
	background: rgba(255, 138, 154, 0.18);
	color: #ffd6dc;
}

.progress {
	height: 22px;
	border-radius: 18px;
	overflow: hidden;
	background: rgba(255,255,255,0.09);
	border: 1px solid rgba(255,255,255,0.10);
	margin-bottom: 0;
}

.progress-tall {
	height: 50px;
	border-radius: 16px;
}

.progress-overall {
	height: 22px;
	border-radius: 999px;
	background: rgba(255,255,255,0.08);
}

.progress-bar {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: flex-start;
	padding-left: 16px;
	font-size: 0.98rem;
	font-weight: 900;
	color: #1f1237;
	transition: width .25s ease;
}

.bar-good {
	background: linear-gradient(90deg, #7de3b1, #c1ffd3);
}

.bar-warn {
	background: linear-gradient(90deg, #ffd36e, #ffe8a8);
}

.bar-bad {
	background: linear-gradient(90deg, #ff8a9a, #ffc0c8);
}

.bar-overall {
	justify-content: center;
	padding-left: 0;
	color: #1f1237;
	background: linear-gradient(90deg, #b388ff, #ff9ed1);
}

.stat-below {
	margin-top: 12px;
	margin-bottom: 8px;
}

.stat-flavor {
	color: var(--muted);
	font-size: 0.95rem;
	line-height: 1.45;
	min-height: 2.8em;
}

.main {
	padding: 24px;
}

.scene-number {
	color: var(--muted);
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	margin-bottom: 10px;
}

.scene-title {
	margin: 0 0 12px;
	font-size: clamp(1.4rem, 2.8vw, 2rem);
	line-height: 1.25;
}

.scene-text {
	margin: 0 0 18px;
	color: var(--text);
	font-size: 1.06rem;
	line-height: 1.7;
}

.media-wrap {
	margin: 0 0 18px;
}

.scene-media {
	display: block;
	width: 100%;
	max-height: 420px;
	object-fit: cover;
	border-radius: 20px;
	border: 1px solid rgba(255,255,255,0.14);
	background: rgba(0,0,0,0.25);
	box-shadow: 0 10px 25px rgba(0,0,0,0.24);
}

.choices {
	display: grid;
	gap: 12px;
}

.choice-card {
	display: block;
	cursor: pointer;
	border-radius: 18px;
	border: 1px solid rgba(255,255,255,0.12);
	background: rgba(255,255,255,0.06);
	transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.choice-card:hover {
	transform: translateY(-2px);
	border-color: rgba(179,136,255,0.55);
	background: rgba(255,255,255,0.09);
}

.choice-card input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.choice-inner {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 16px 18px;
}

.choice-mark {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(135deg, rgba(179,136,255,0.85), rgba(255,158,209,0.85));
}

.choice-text {
	font-size: 1.02rem;
	line-height: 1.55;
	color: var(--text);
}

.choice-card:has(input:checked) {
	border-color: rgba(179,136,255,0.9);
	background: rgba(179,136,255,0.12);
	box-shadow: 0 0 0 2px rgba(179,136,255,0.22) inset;
}

.submit-row {
	margin-top: 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	justify-content: space-between;
}

.btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	border-radius: 999px;
	padding: 14px 22px;
	font-size: 1rem;
	font-weight: 800;
	transition: transform .16s ease, opacity .16s ease;
}

.btn:hover {
	transform: translateY(-1px);
}

.btn-primary {
	color: #1c1234;
	background: linear-gradient(90deg, #b388ff, #ff9ed1);
	box-shadow: 0 10px 24px rgba(179,136,255,0.28);
}

.btn-secondary {
	color: var(--text);
	background: rgba(255,255,255,0.10);
	border: 1px solid rgba(255,255,255,0.12);
}

.muted-note {
	color: var(--muted);
	font-size: 0.92rem;
}

.alert {
	margin-bottom: 18px;
	padding: 14px 16px;
	border-radius: 18px;
	border: 1px solid rgba(255,255,255,0.12);
}

.alert-error {
	background: rgba(255, 138, 154, 0.14);
	color: #ffe0e5;
}

.outcome {
	margin-bottom: 18px;
	padding: 18px;
	border-radius: 22px;
	background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.08));
	border: 1px solid rgba(255,255,255,0.12);
}

.outcome h3 {
	margin: 0 0 8px;
	font-size: 1.2rem;
}

.outcome-meta {
	color: var(--muted);
	font-size: 0.95rem;
	margin-bottom: 10px;
}

.outcome p {
	margin: 0;
	line-height: 1.65;
	font-size: 1rem;
}

.ending {
	padding: 14px 0 2px;
}

.ending-box {
	padding: 22px;
	border-radius: 22px;
	border: 1px solid rgba(255,255,255,0.12);
	background: rgba(255,255,255,0.08);
	margin-bottom: 18px;
}

.ending-box h2 {
	margin: 0 0 10px;
	font-size: clamp(1.5rem, 3vw, 2rem);
}

.ending-box p {
	margin: 0;
	line-height: 1.7;
	color: var(--text);
}

.end-good {
	background: rgba(125, 227, 177, 0.12);
}

.end-warn {
	background: rgba(255, 211, 110, 0.12);
}

.end-bad {
	background: rgba(255, 138, 154, 0.12);
}

.end-neutral {
	background: rgba(179, 136, 255, 0.10);
}

.footer-note {
	margin-top: 18px;
	color: var(--muted);
	font-size: 0.95rem;
	text-align: center;
	opacity: 0.95;
}

@media (max-width: 980px) {
	.stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.shell {
		padding: 14px 10px 28px;
	}

	.hero-band,
	.main,
	.progress-main {
		padding: 18px;
	}

	.stats-grid {
		grid-template-columns: 1fr;
	}

	.choice-inner {
		padding: 14px;
	}

	.submit-row {
		flex-direction: column;
		align-items: stretch;
	}

	.btn {
		width: 100%;
	}

	.overall-progress-head {
		flex-direction: column;
		align-items: flex-start;
	}
}




.footer-note a {
	color: #eadbff;
	text-decoration: none;
	font-weight: 700;
	border-bottom: 1px solid rgba(179,136,255,0.45);
	transition: color .16s ease, border-color .16s ease, opacity .16s ease;
}

.footer-note a:hover {
	color: #ffb7dd;
	border-bottom-color: rgba(255,158,209,0.75);
}

.footer-note a:visited {
	color: #e3d2ff;
}

.footer-note a:active {
	color: #ffd3e8;
	border-bottom-color: rgba(255,158,209,0.95);
}

.footer-note strong {
	color: var(--text);
}

.video-box {
    position: relative;
}

.video-replay-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    height: 100%;
    border: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    font: inherit;
    z-index: 5;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.video-replay-overlay:hover {
    background: rgba(0, 0, 0, 0.52);
}

.video-replay-overlay.is-visible {
    display: flex;
}

.video-replay-icon {
    font-size: 72px;
    line-height: 1;
    font-weight: bold;
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}

.video-replay-text {
    font-size: 22px;
    font-weight: 700;
    text-shadow: 0 2px 12px rgba(0,0,0,0.45);
}