﻿/* TRUTH OR DARE */

/* =========================
   ROOT
   ========================= */

:root {
	--truth1: #d98ce2;
	--truth2: #bb62cc;
	--dare1: #ff7aa5;
	--dare2: #f04e83;
	--random1: #8c8ce2;
	--random2: #6262cc;
	--female: #ff99cc;
	--male: #99c7ff;
	--other: #c9c9d1;
}

	:root[data-dark-mode="true"] {
		--truth1: #a875b0;
		--truth2: #895394;
		--dare1: #c47b98;
		--dare2: #a95377;
		--random1: #7777b0;
		--random2: #55558f;
		--female: #b87596;
		--male: #7296bf;
		--other: #92929f;
	}

/* =========================
   ANIMATIONS
	--gray: #E5E7EB;
	--gray-light: #F3F4F6;
	--gray-dark: #9CA3AF;
	--gray-border: #D1D5DB;
   ========================= */

/* CARD ENTER */
@keyframes cardEnter {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* =========================
   PLAYER SCREEN
   ========================= */

#playerScreen {
	justify-content: flex-start;
	height: auto;
	min-height: calc(100dvh - 96px);
	overflow: visible;
}

	#playerScreen .fw-color-select {
		display: flex;
		flex-wrap: wrap;
		justify-content: start;
		gap: 12px;
		width: 100%;
		min-width: 0;
	}

/* ADD PLAYER */
.add-player {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	width: 100%;
	min-width: 0;
	gap: 12px;
}

/* PLAYER GENDER */
.gender-select {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	width: 100%;
	min-width: 0;
	gap: 8px;
}

.gender-option {
	cursor: pointer;
	min-width: 0;
}

	.gender-option input {
		display: none;
	}

	.gender-option span {
		display: flex;
		min-width: 0;
		min-height: 50px;
		text-align: center;
		justify-content: center;
		align-items: center;
		overflow-wrap: anywhere;
		padding: 10px;
		border: 1px solid var(--border);
		border-radius: 14px;
		background: var(--surface);
		color: var(--text);
		font-size: 0.9rem;
		font-weight: 600;
		transition: all 0.18s ease;
	}

	.gender-option input:checked + span {
		border-color: #f05b9d;
		background: #ffe1ed;
		color: #c73e7c;
		box-shadow: inset 0 0 0 1px rgba(240, 91, 157, 0.1);
	}

/* PLAYER LIST */
.player-list {
	display: grid;
	gap: 8px;
	margin: 24px 0;
}

.player {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 15px 16px;
	border: none;
	border-radius: 15px;
	animation: playerIn 0.2s ease;
}

	.player.female {
		background: linear-gradient( 135deg, var(--female), var(--surface) );
	}

	.player.male {
		background: linear-gradient( 135deg, var(--male), var(--surface) );
	}

	.player.other {
		background: linear-gradient( 135deg, var(--other), var(--surface) );
	}

.player-info {
	display: flex;
	align-items: center;
	font-family: "Emilys Candy", serif;
	font-weight: 800;
	gap: 12px;
	min-width: 0;
}

.player-color-dot {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	border: 2px solid var(--border);
	border-radius: 50%;
}

.remove-player {
	padding: 7px 10px;
	border: none;
	border-radius: 9px;
	background: rgba(238, 77, 98, 0.12);
	color: #ff8292;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
}

/* =========================
   CARD SET SCREEN
   ========================= */

#setScreen {
	position: relative;
}

.back-to-players {
	position: absolute;
	top: 0;
	left: 0;
	width: auto;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
}

.set-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.selected-card-count {
	padding: 7px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.78rem;
	font-weight: 600;
}

.toggle-all-sets {
	width: auto;
	padding: 7px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.78rem;
	font-weight: 600;
	cursor: pointer;
}

.set-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 24px;
	max-height: none;
	overflow: visible;
	padding: 2px;
}

.set-option {
	display: flex;
	align-items: center;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: 14px;
	background: var(--surface);
	cursor: pointer;
}

	.set-option:hover {
		background: var(--surface-light);
	}

	.set-option span {
		font-weight: 600;
	}

	.set-option input {
		appearance: none;
		-webkit-appearance: none;
		position: relative;
		width: 22px;
		height: 22px;
		flex-shrink: 0;
		margin: 0 14px 0 0;
		border: 2px solid #d9a9bd;
		border-radius: 7px;
		background: transparent;
		cursor: pointer;
		transition: background 0.18s ease, border-color 0.18s ease;
	}

		.set-option input::after {
			content: "✓";
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%) scale(0);
			color: white;
			font-size: 15px;
			font-weight: bold;
			line-height: 1;
			transition: transform 0.18s ease;
		}

		.set-option input:checked {
			border-color: var(--pink);
			background: var(--pink);
		}

			.set-option input:checked::after {
				transform: translate(-50%, -50%) scale(1);
			}

.set-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	gap: 3px;
}

.set-name {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--header);
	line-height: 1.15;
}

.set-count {
	margin-left: 0;
	font-size: 0.72rem;
	font-weight: 500;
	color: var(--text);
	line-height: 1;
}

/* =========================
   TURN SCREEN
   ========================= */

#turnScreen {
	position: relative;
}

	#turnScreen h1 {
		margin-bottom: 18px;
		font-size: clamp(3.2rem, 15vw, 5rem);
		line-height: 1.15;
		padding-bottom: 0.08em;
	}

.back-to-sets {
	position: absolute;
	top: 0;
	left: 0;
	width: auto;
	padding: 8px 12px;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--surface);
	color: var(--text);
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
}

.turn-label {
	margin: 0 0 12px;
	color: var(--text);
	text-align: center;
	font-size: 0.85rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

#currentPlayer {
	font-family: "Emilys Candy", serif;
	font-weight: 400;
	font-size: 3rem;
}

/* T/D BUTTONS */
.choice-buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 10px;
}

.truth-button {
	background: linear-gradient( 145deg, var(--truth1), var(--truth2) );
}

.dare-button {
	background: linear-gradient( 145deg, var(--dare1), var(--dare2) );
}

.random-button {
	background: linear-gradient( 145deg, var(--random1), var(--random2) );
	margin-top: 12px;
}

.truth-button,
.dare-button,
.random-button {
	position: relative;
	min-height: 150px;
	overflow: hidden;
	font-size: 1.85rem;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 15px 35px rgba(0, 0, 0, 0.25);
	transition: transform 0.12s ease, opacity 0.12s ease;
}

	.truth-button:active,
	.dare-button:active,
	.random-button:active {
		transform: scale(0.97);
	}

	.truth-button::after,
	.dare-button::after,
	.random-button::after {
		content: "";
		position: absolute;
		width: 120px;
		height: 120px;
		top: -60px;
		right: -50px;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.08);
	}

/* =========================
   CARD SCREEN
   ========================= */

#cardScreen {
	position: relative;
}

.card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 340px;
	margin: 20px 0;
	padding: 38px 28px;
	overflow: hidden;
	border: 1px solid rgba(224, 91, 147, 0.12);
	border-radius: 26px;
	background: linear-gradient( 145deg, var(--surface), var(--background) );
	text-align: center;
	box-shadow: 0 20px 60px rgba(157, 72, 108, 0.12);
}

	.card::before {
		content: "";
		position: absolute;
		width: 200px;
		height: 200px;
		top: -120px;
		left: 50%;
		transform: translateX(-50%);
		border-radius: 50%;
		background: rgba(255, 105, 165, 0.25);
		filter: blur(35px);
	}

	.card h2 {
		position: relative;
		margin: 0;
		color: var(--pink);
		font-size: 0.85rem;
		font-weight: 800;
		letter-spacing: 0.22em;
	}

	.card p {
		color: var(--header);
	}

	.card.card-enter {
		animation: cardEnter 0.28s ease-out;
	}

.card-player-name {
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

#cardDescription {
	position: relative;
	margin: 42px 0;
	font-size: clamp(1.6rem, 7vw, 2.1rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.025em;
}

.card-set-info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
}

.card-set {
	position: relative;
	display: inline-block;
	align-self: center;
	padding: 7px 12px;
	border: 1px solid #f3c9da;
	border-radius: 100px;
	background: #fff0f6;
	color: #b96a8c;
	font-size: 0.75rem;
	font-weight: 600;
}

.cards-remaining {
	color: var(--text);
	font-size: 0.72rem;
	font-weight: 500;
}

/* RESULT BUTTONS */
.result-buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.didit-button {
	background: var(--green);
	border: 2px solid var(--green-border);
	box-shadow: 0 0.3em 0 var(--green-light);
}

	.didit-button:hover {
		background: var(--green-medium);
	}

	.didit-button:active {
		box-shadow: 0 0 0 var(--green-light);
	}

.pass-button {
	background: var(--red);
	border: 2px solid var(--red-border);
	box-shadow: 0 0.3em 0 var(--red-light);
}

	.pass-button:hover {
		background: var(--red-medium);
	}

	.pass-button:active {
		box-shadow: 0 0 0 var(--red-light);
	}

/* =========================
   PUNISHMENT SCREEN
   ========================= */

#punishmentScreen {
	position: relative;
}

#punishmentDescription {
	position: relative;
	margin: 42px 0;
	font-size: clamp(1.6rem, 7vw, 2.1rem);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.025em;
}

.punishment-card {
	border-color: rgba(238, 77, 98, 0.25);
}

	.punishment-card::before {
		background: rgba(238, 77, 98, 0.18);
	}

	.punishment-card h2 {
		color: #ff7183;
	}

/* =========================
   INFO MODAL
   ========================= */

.tod-language-setting {
	max-width: 52px;
}

/* =========================
   TYPOGRAPHY
   ========================= */
.tod-label {
	margin: 14px 0 32px;
	color: var(--text);
	text-align: center;
	font-size: 1.05rem;
}

/* =========================
   BUTTONS
   ========================= */

.didit,
.pass,
.truth-button,
.dare-button,
.random-button {
	border: none;
	border-radius: 16px;
	padding: 17px 20px;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

	.didit:hover:not(:disabled),
	.pass:hover:not(:disabled),
	.truth-button:hover:not(:disabled),
	.dare-button:hover:not(:disabled),
	.random-button:hover:not(:disabled) {
		transform: translateY(-2px);
	}

	.didit:active:not(:disabled),
	.pass:active:not(:disabled),
	.truth-button:active:not(:disabled),
	.dare-button:active:not(:disabled),
	.random-button:active:not(:disabled) {
		transform: translateY(0);
	}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 380px) {
	.color-select {
		grid-template-columns: repeat(7, 36px);
		gap: 12px 8px;
	}

	.truth-button,
	.dare-button,
	.random-button {
		min-height: 125px;
	}

	.card {
		min-height: 300px;
		padding: 30px 20px;
	}
}

@media (max-width: 440px) {
	.color-select {
		grid-template-columns: repeat(8, 36px);
	}
}

@media (max-width: 380px) {
	.color-select {
		grid-template-columns: repeat(7, 36px);
	}
}
