/*
 * Tiger Love Mini Game - styles
 * すべてのクラスに tlg- 接頭辞を付け、既存テーマと干渉しないようにする。
 */

.tlg-game,
.tlg-game * {
	box-sizing: border-box;
}

.tlg-game {
	max-width: 700px;
	margin: 1.5em auto;
	padding: 16px;
	border: 3px solid #ffb3c8;
	border-radius: 16px;
	background: linear-gradient(180deg, #fff7fa 0%, #ffeef4 100%);
	font-family: inherit;
	color: #4a3038;
	line-height: 1.6;
	overflow: hidden;           /* 横スクロール禁止 */
	touch-action: manipulation; /* ダブルタップズーム抑制 */
	text-align: center;
}

/* ---------- 共通パーツ ---------- */

.tlg-title {
	margin: 0 0 8px;
	font-size: 1.4em;
	font-weight: 700;
	color: #e04a7a;
}

.tlg-subtitle {
	margin: 0 0 6px;
	font-size: 1.1em;
	font-weight: 700;
	color: #d3567f;
}

.tlg-desc {
	margin: 0 0 12px;
	font-size: 0.95em;
}

.tlg-button {
	display: inline-block;
	min-width: 200px;
	margin: 8px 4px 0;
	padding: 14px 28px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(180deg, #ff7ea6 0%, #f0568a 100%);
	color: #fff;
	font-size: 1.05em;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 0 #c73f6d;
	transition: transform 0.08s ease, box-shadow 0.08s ease;
	-webkit-tap-highlight-color: transparent;
}

.tlg-button:hover { filter: brightness(1.05); }
.tlg-button:active {
	transform: translateY(3px);
	box-shadow: 0 1px 0 #c73f6d;
}
.tlg-button:focus-visible {
	outline: 3px solid #7ec3ff;
	outline-offset: 2px;
}

.tlg-hud {
	display: flex;
	justify-content: center;
	gap: 16px;
	flex-wrap: wrap;
	margin: 0 0 10px;
	font-weight: 700;
	font-size: 0.95em;
}

.tlg-hud-item {
	background: #fff;
	border: 2px solid #ffc7d8;
	border-radius: 999px;
	padding: 4px 14px;
	color: #d3567f;
}

.tlg-message {
	min-height: 1.8em;
	margin: 10px 0 0;
	font-weight: 700;
	color: #b8446c;
	font-size: 0.98em;
}

/* ---------- キャラクター ---------- */

.tlg-character-area {
	display: flex;
	justify-content: center;
	align-items: flex-end;
	gap: 24px;
	margin: 12px 0;
}

.tlg-char {
	width: 120px;
	height: 120px;
	object-fit: contain;
}

.tlg-char-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 120px;
	height: 120px;
	font-size: 64px;
	line-height: 1;
}

/* ---------- ミニゲーム1: タイミングバー ---------- */

.tlg-timing-wrap {
	margin: 16px auto;
	max-width: 480px;
}

.tlg-timing-bar {
	position: relative;
	height: 44px;
	border-radius: 999px;
	background: #ffe1ea;
	border: 2px solid #ffb3c8;
	overflow: hidden;
}

.tlg-timing-zone {
	position: absolute;
	top: 0;
	bottom: 0;
	background: rgba(126, 217, 132, 0.55);
}

.tlg-timing-zone--perfect {
	background: rgba(255, 205, 84, 0.9);
}

.tlg-timing-cursor {
	position: absolute;
	top: 2px;
	bottom: 2px;
	width: 10px;
	border-radius: 6px;
	background: #e04a7a;
	will-change: transform;
}

.tlg-timing-round {
	margin-top: 8px;
	font-weight: 700;
	color: #d3567f;
}

/* ---------- ミニゲーム2: 落ちゲー ---------- */

.tlg-falling-area {
	position: relative;
	height: 340px;
	margin: 10px auto 0;
	border-radius: 12px;
	background: linear-gradient(180deg, #e8f4ff 0%, #fdeef5 100%);
	border: 2px solid #ffc7d8;
	overflow: hidden;
	touch-action: none; /* スワイプ操作用 */
}

.tlg-falling-item {
	position: absolute;
	width: 44px;
	height: 44px;
	will-change: transform;
	pointer-events: none;
	font-size: 34px;
	line-height: 44px;
	text-align: center;
}

.tlg-falling-item img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.tlg-player {
	position: absolute;
	bottom: 4px;
	width: 72px;
	height: 72px;
	will-change: transform;
	font-size: 56px;
	line-height: 72px;
	text-align: center;
}

.tlg-player img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.tlg-touch-controls {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin-top: 10px;
}

.tlg-touch-btn {
	flex: 1;
	padding: 16px 0;
	font-size: 1.3em;
	font-weight: 700;
	border: 0;
	border-radius: 12px;
	background: #ffd3e0;
	color: #b8446c;
	cursor: pointer;
	box-shadow: 0 3px 0 #f0a9c0;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	-webkit-user-select: none;
}

.tlg-touch-btn:active {
	transform: translateY(2px);
	box-shadow: 0 1px 0 #f0a9c0;
}

/* ---------- ミニゲーム3: タップゲー ---------- */

.tlg-tap-area {
	position: relative;
	height: 320px;
	margin: 10px auto 0;
	border-radius: 12px;
	background: linear-gradient(180deg, #fff0f5 0%, #ffe3ec 100%);
	border: 2px solid #ffc7d8;
	overflow: hidden;
}

.tlg-tap-heart {
	position: absolute;
	width: 56px;
	height: 56px;
	border: 0;
	padding: 0;
	background: transparent;
	cursor: pointer;
	font-size: 44px;
	line-height: 56px;
	-webkit-tap-highlight-color: transparent;
	animation: tlg-pop 0.18s ease-out;
}

.tlg-tap-heart img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	pointer-events: none;
}

.tlg-tap-heart--gold {
	filter: drop-shadow(0 0 6px #ffcf3f) saturate(1.4) hue-rotate(300deg) brightness(1.2);
}

@keyframes tlg-pop {
	from { transform: scale(0.4); opacity: 0; }
	to   { transform: scale(1);   opacity: 1; }
}

/* ---------- 結果画面 ---------- */

.tlg-result-score {
	font-size: 1.5em;
	font-weight: 700;
	color: #e04a7a;
	margin: 8px 0;
}

.tlg-result-level {
	font-size: 1.15em;
	font-weight: 700;
	margin: 4px 0;
}

.tlg-result-hearts {
	font-size: 1.4em;
	letter-spacing: 2px;
	margin: 6px 0;
}

.tlg-result-message {
	margin: 10px auto;
	max-width: 480px;
	font-size: 0.98em;
}

.tlg-best {
	margin-top: 8px;
	font-size: 0.85em;
	color: #a06a7d;
}

/* ---------- 演出(軽量) ---------- */

.tlg-fade {
	animation: tlg-fadein 0.25s ease-out;
}

@keyframes tlg-fadein {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.tlg-game * {
		animation: none !important;
		transition: none !important;
	}
}

/* ---------- スマホ対応 ---------- */

@media (max-width: 600px) {
	.tlg-game {
		width: 100%;
		padding: 12px;
	}

	.tlg-char,
	.tlg-char-fallback {
		width: 88px;
		height: 88px;
		font-size: 48px;
	}

	.tlg-falling-area { height: 300px; }
	.tlg-tap-area     { height: 280px; }

	.tlg-button {
		min-width: 0;
		width: 100%;
	}
}
