/* CSS Custom Properties for Film Themes */
:root {
	/* Botan Theme */
	--botan-bg-start: #E6A8D8;
	--botan-bg-end: #B8A8E8;
	--botan-card-start: #E6A8D8;
	--botan-card-mid: #D8A8E6;
	--botan-card-end: #B8A8E8;
	--botan-button-start: #4ECDC4;
	--botan-button-end: #44A08D;
	--botan-button-shadow: rgba(78, 205, 196, 0.3);
	--botan-button-shadow-hover: rgba(78, 205, 196, 0.4);

	/* Chi Theme */
	--chi-bg-start: #3A8FB7;
	--chi-bg-end: #5BA8C7;
	--chi-card-start: #3A8FB7;
	--chi-card-mid: #4A9FC7;
	--chi-card-end: #5AAFD7;
	--chi-button-start: #3A8FB7;
	--chi-button-end: #2A7FA7;
	--chi-button-shadow: rgba(58, 143, 183, 0.3);
	--chi-button-shadow-hover: rgba(58, 143, 183, 0.4);

	/* Hoho Theme - White base */
	--hoho-bg-start: #FFFFFF;
	--hoho-bg-end: #E9ECEF;
	--hoho-card-start: #FFFFFF;
	--hoho-card-mid: #F8F9FA;
	--hoho-card-end: #E9ECEF;
	--hoho-button-start: #6C757D;
	--hoho-button-end: #495057;
	--hoho-button-shadow: rgba(108, 117, 125, 0.3);
	--hoho-button-shadow-hover: rgba(108, 117, 125, 0.4);
}

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

html {
	font-size: 100%;
	scroll-behavior: smooth;
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	min-height: 100vh;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
}

/* Background image + soft radial accents for botan pages (reference-inspired) */
body.botan {
	/* base gradient kept for theme compatibility, image layered on top */
	background: linear-gradient(135deg, var(--botan-bg-start) 0%, var(--botan-bg-end) 100%);
	background-image: url('https://images.unsplash.com/photo-1539635278303-d4002c07eae3?crop=entropy&cs=srgb&fm=jpg&ixid=M3wzMjM4NDZ8MHwxfHJhbmRvbXx8fHx8fHx8fDE3NDk1Njc4NTB8&ixlib=rb-4.1.0&q=85');
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	/* Use scroll attachment for better mobile performance and consistent material behavior */
	background-attachment: scroll;
	padding: 1.25rem;
}

/* background pattern overlays to add depth */
body.botan::before {
	content: '';
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-image:
		radial-gradient(circle at 20% 50%, rgba(120, 119, 198, 0.14) 0%, transparent 50%),
		radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.12) 0%, transparent 50%),
		radial-gradient(circle at 40% 80%, rgba(120, 219, 255, 0.10) 0%, transparent 50%);
	/* subtle overlay to help with legibility; avoid heavy shadows */
	pointer-events: none;
	z-index: 0;
}

/* Botan Theme Body */
body.botan {
	background: linear-gradient(135deg, var(--botan-bg-start) 0%, var(--botan-bg-end) 100%);
}

/* Chi Theme Body */
body.chi {
	background: linear-gradient(135deg, var(--chi-bg-start) 0%, var(--chi-bg-end) 100%);
}

/* Hoho Theme Body */
body.hoho {
	background: linear-gradient(135deg, var(--hoho-bg-start) 0%, var(--hoho-bg-end) 100%);
}

/* Theme-driven text color for legibility on different materials */
body.botan {
	--text-color: white;
}

body.chi {
	--text-color: white;
}

body.hoho {
	--text-color: rgba(22, 24, 30, 0.95);
}

.card-container {
	--glass-bg: rgba(255, 255, 255, 0.44);
	--glass-border: rgba(255, 255, 255, 0.6);

	max-width: 420px;
	width: 100%;
	position: relative;
	border-radius: 22px;
	overflow: visible;
	cursor: pointer;
	transition: transform 0.22s ease, box-shadow 0.22s ease;
	/* Subtler shadow aligns with HIG guidance for materials */
	box-shadow: 0 8px 24px rgba(18, 22, 30, 0.08);
}

/* Make outer container a solid themed surface; inner .card remains the glass layer */
.botan .card-container {
	background: linear-gradient(180deg, var(--botan-bg-start), var(--botan-bg-end));
	color: var(--text-color, white);
}

.chi .card-container {
	background: linear-gradient(180deg, var(--chi-bg-start), var(--chi-bg-end));
	color: var(--text-color, white);
}

.hoho .card-container {
	background: linear-gradient(180deg, var(--hoho-bg-start), var(--hoho-bg-end));
	color: var(--text-color, rgba(22, 24, 30, 0.95));
}

.card-container:hover {
	transform: translateY(-4px) scale(1.005);
}

.card {
	padding: 48px 36px;
	text-align: center;
	position: relative;
	border-radius: 18px;
	margin: 22px;
	/* inner card is intentionally transparent so the .glass utility provides the frosted look */
	background: transparent;
	border: none;
	box-shadow: 0 6px 18px rgba(14, 18, 30, 0.06);
}

/* Reusable glassmorphism utility (from provided reference) */
.glass {
	position: relative;
	background: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(6px) saturate(120%);
	-webkit-backdrop-filter: blur(6px) saturate(120%);
	border: 0.0625rem solid rgba(255, 255, 255, 0.22);
	border-radius: 1rem;
	padding: 1.5rem;
	box-shadow: 0 10px 30px rgba(31, 38, 135, 0.06), inset 0 4px 16px rgba(255, 255, 255, 0.06);
}

.glass::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.03);
	border-radius: 2rem;
	/* lower accent overlay and remove heavy drop-shadow for clarity */
	backdrop-filter: blur(0.6px);
	opacity: 0.32;
	z-index: -1;
	pointer-events: none;
}

/* Card content helpers inspired by the reference */
.card-header {
	display: flex;
	align-items: center;
	gap: 0.9375rem;
	margin-bottom: 0.9375rem;
}

.icon {
	position: relative;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.625rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.25rem;
}

.card-title {
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--text-color, white);
	margin: 0;
}

.card-subtitle {
	font-size: 1.1rem;
	color: var(--text-color, white);
	margin: 0.3125rem 0 0 0;
}

.card-content {
	color: var(--text-color, white);
	line-height: 1.6;
}

.card-content-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.938rem;
	margin-top: 0.938rem;
}

.card-content-icon {
	background: rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	margin: 0 auto 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
}

/* Map btn-glass behavior to existing action button for consistency */
.btn-glass {
	position: relative;
	color: white;
	padding: 0.75rem 1.5rem;
	border-radius: 0.75rem;
	cursor: pointer;
	transition: all 0.3s ease;
	margin-top: 0.9375rem;
	display: inline-block;
	text-decoration: none;
}

.btn-glass::after {
	border-radius: 0.75rem;
}

.btn-glass:hover {
	background: rgba(255, 255, 255, 0.12);
	transform: scale(1.03);
}

/* Music widget helpers from reference (optional use) */
.music-widget {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0.9375rem;
	padding: 0.9375rem;
	border-radius: 0.9375rem;
	margin-top: 0.9375rem;
}

.album-cover {
	width: 3.125rem;
	height: 3.125rem;
	background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
	border-radius: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-weight: bold;
}

.play-btn {
	width: 2.5rem;
	height: 2.5rem;
	background: rgba(255, 255, 255, 0.18);
	border: none;
	border-radius: 50%;
	color: white;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.play-btn:hover {
	background: rgba(255, 255, 255, 0.32);
	transform: scale(1.08);
}

.horika-title {
	font-size: 32px;
	font-weight: 900;
	color: #2D2D2D;
	margin-bottom: 30px;
	letter-spacing: 2px;
}

.film-cylinder {
	position: relative;
	width: 120px;
	height: 180px;
	margin: 0 auto 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.roll-svg {
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.film-text {
	position: absolute;
	color: #2D2D2D;
	font-size: 18px;
	font-weight: 900;
	letter-spacing: 4px;
	transform: rotate(90deg);
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
	z-index: 10;
}

.subtitle {
	font-size: 24px;
	color: #666;
	font-weight: 500;
	margin-top: 10px;
}

.action-button {
	color: white;
	border: none;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 700;
	border-radius: 999px;
	margin: 20px 20px 22px;
	cursor: pointer;
	width: calc(100% - 40px);
	transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.18s ease;
	backdrop-filter: none;
	position: relative;
	overflow: hidden;
}

/* Botan Theme Button */
.botan .action-button {
	/* Use a solid, vibrant button for the Botan theme (not liquid glass) */
	background: linear-gradient(135deg, var(--botan-button-start), var(--botan-button-end));
	border: none;
	color: white;
	box-shadow: 0 6px 18px var(--botan-button-shadow);
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

.botan .action-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px var(--botan-button-shadow-hover);
}

.botan .action-button:active {
	transform: translateY(-1px);
	opacity: 0.98;
}

.action-button:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(78, 204, 196, 0.14);
}

/* Chi Theme Button */
.chi .action-button {
	background: linear-gradient(135deg, var(--chi-button-start), var(--chi-button-end));
	box-shadow: 0 4px 15px var(--chi-button-shadow);
}

.chi .action-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px var(--chi-button-shadow-hover);
}

/* Hoho Theme Button */
.hoho .action-button {
	background: linear-gradient(135deg, var(--hoho-button-start), var(--hoho-button-end));
	box-shadow: 0 4px 15px var(--hoho-button-shadow);
}

.hoho .action-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px var(--hoho-button-shadow-hover);
}

.cta {
	text-align: center;
	margin: 20px;
}

.app-store-button {
	display: inline-block;
	transition: transform 0.3s ease;
}

.app-store-button:hover {
	transform: translateY(-2px);
}

/* Decorative blobs removed - keep reduced-motion compatibility without rules */

/* slightly darker theme-aware tint behind the frosted panel */
.botan .card::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 18px;
	background: linear-gradient(135deg, rgba(136, 84, 208, 0.06), rgba(78, 204, 196, 0.06));
	pointer-events: none;
}

/* Typography tweaks to match iOS liquid aesthetic */
.horika-title {
	font-size: 30px;
	font-weight: 800;
	color: white;
	margin-bottom: 18px;
	letter-spacing: 2px;
}

.botan .horika-title,
.chi .horika-title {
	color: white;
}

.hoho .horika-title {
	color: rgba(22, 24, 30, 0.95);
}

.subtitle {
	font-size: 18px;
	color: white;
	font-weight: 600;
	margin-top: 8px;
	opacity: 0.9;
}

.botan .subtitle,
.chi .subtitle {
	color: white;
}

.hoho .subtitle {
	color: rgba(34, 34, 34, 0.7);
}

.app-info {
	margin-top: 10px;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.8);
}

.botan .app-info,
.chi .app-info {
	color: rgba(255, 255, 255, 0.8);
}

.hoho .app-info {
	color: #666;
}

/* Back navigation link */
.back-nav {
	position: absolute;
	top: 20px;
	left: 20px;
	z-index: 100;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 12px;
	color: white;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.22s ease;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.back-link:hover {
	background: rgba(255, 255, 255, 0.25);
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.back-link::before {
	content: '←';
	font-size: 18px;
}

.hoho .back-link {
	color: rgba(22, 24, 30, 0.95);
	background: rgba(0, 0, 0, 0.08);
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.hoho .back-link:hover {
	background: rgba(0, 0, 0, 0.12);
}

/* Responsive Design */
@media (max-width: 480px) {
	.card {
		padding: 30px 18px;
	}

	.horika-title {
		font-size: 24px;
	}

	.film-cylinder {
		width: 100px;
		height: 150px;
	}

	.film-text {
		font-size: 16px;
		letter-spacing: 3px;
	}

	.back-nav {
		top: 10px;
		left: 10px;
	}

	.back-link {
		padding: 8px 12px;
		font-size: 13px;
	}
}

/* Shared JavaScript Animation Styles */
.card-container.pressed {
	transform: translateY(-3px) scale(0.98);
}

.card-container.hover {
	transform: translateY(-5px) scale(1);
}

.card-container.normal {
	transform: translateY(0) scale(1);
}

/* Respect users' reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

	.card-container,
	.card-container:hover,
	.card-container.pressed,
	.card-container.hover,
	.btn-glass,
	.app-store-button,
	.play-btn,
	.botan .action-button,
	.chi .action-button,
	.hoho .action-button,
	.back-link,
	.back-link:hover {
		transition: none !important;
		animation: none !important;
		transform: none !important;
	}

	/* blob rules removed */
}

/* Index Page Styles */
body.index {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	min-height: 100vh;
	padding: 40px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	position: relative;
}

body.index .back-nav {
	position: fixed;
}

body.index .back-link {
	color: white;
	background: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.25);
}

body.index .back-link:hover {
	background: rgba(255, 255, 255, 0.25);
}

.page-header {
	text-align: center;
	margin-bottom: 50px;
	color: white;
}

.page-title {
	font-size: 48px;
	font-weight: 900;
	margin-bottom: 10px;
	letter-spacing: 3px;
}

.page-subtitle {
	font-size: 20px;
	font-weight: 500;
	opacity: 0.9;
}

.cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(320px, 380px));
	gap: 30px;
	max-width: 1200px;
	width: 100%;
	justify-content: center;
	margin-bottom: 50px;
}

.film-card {
	position: relative;
	border-radius: 22px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.22s ease, box-shadow 0.22s ease;
	box-shadow: 0 8px 24px rgba(18, 22, 30, 0.2);
	text-decoration: none;
	display: block;
}

.film-card:hover {
	transform: translateY(-8px) scale(1.02);
	box-shadow: 0 12px 36px rgba(18, 22, 30, 0.3);
}

.film-card.botan {
	background: linear-gradient(135deg, var(--botan-bg-start) 0%, var(--botan-bg-end) 100%);
}

.film-card.chi {
	background: linear-gradient(135deg, var(--chi-bg-start) 0%, var(--chi-bg-end) 100%);
}

.film-card.hoho {
	background: linear-gradient(135deg, var(--hoho-bg-start) 0%, var(--hoho-bg-end) 100%);
}

.film-card-inner {
	padding: 40px 30px;
	text-align: center;
	position: relative;
	border-radius: 18px;
	margin: 20px;
	background: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(6px) saturate(120%);
	-webkit-backdrop-filter: blur(6px) saturate(120%);
	border: 0.0625rem solid rgba(255, 255, 255, 0.22);
}

.film-card.hoho .film-card-inner {
	color: rgba(22, 24, 30, 0.95);
}

.film-card.botan .film-card-inner,
.film-card.chi .film-card-inner {
	color: white;
}

.film-card-title {
	font-size: 28px;
	font-weight: 800;
	margin-bottom: 20px;
	letter-spacing: 2px;
}

.film-card .film-cylinder {
	position: relative;
	width: 100px;
	height: 150px;
	margin: 0 auto 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.film-card .roll-svg {
	width: 100%;
	height: 100%;
	filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.film-card .film-text {
	position: absolute;
	font-size: 16px;
	font-weight: 900;
	letter-spacing: 3px;
	transform: rotate(90deg);
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
	z-index: 10;
}

.film-card.hoho .film-text {
	color: rgba(22, 24, 30, 0.95);
}

.film-card.botan .film-text,
.film-card.chi .film-text {
	color: white;
}

.film-card-subtitle {
	font-size: 18px;
	font-weight: 600;
	margin-top: 10px;
	opacity: 0.8;
}

.app-store-section {
	text-align: center;
	margin-top: 30px;
	color: white;
}

.app-store-section a {
	display: inline-block;
	transition: transform 0.3s ease;
}

.app-store-section a:hover {
	transform: translateY(-2px);
}

.app-store-section .app-info {
	margin-top: 15px;
	font-size: 16px;
	opacity: 0.9;
}

/* Index Page Responsive Styles */
@media (max-width: 768px) {
	.page-title {
		font-size: 36px;
	}

	.page-subtitle {
		font-size: 18px;
	}

	.cards-grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}

	body.index {
		padding: 60px 20px 40px;
	}

	body.index .page-header {
		margin-top: 20px;
	}
}

/* Index Page Reduced Motion */
@media (prefers-reduced-motion: reduce) {

	.film-card,
	.film-card:hover,
	.app-store-section a {
		transition: none !important;
		transform: none !important;
	}
}