/* Dark background */
html, body {
	background: #0d1117;
}

.bg-dark-void {
	background: radial-gradient(1200px circle at 20% -10%, #0d1117 10%, #0b0f14 40%, #06080a 75%, #000 100%) fixed;
	min-height: 100vh;
	color: #e6edf3;
}

/* Slightly larger base font for readability */
body { font-size: 1.0625rem; }

.app-title {
	font-weight: 700;
	letter-spacing: 0.3px;
}

/* Ensure muted text is readable on dark */
.bg-dark-void .text-muted { color: rgba(230, 237, 243, 0.65) !important; }

/* Rooms grid */
.rooms-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	max-width: 1000px;
	margin: 0 auto 3rem;
}

/* Users grid */
.users-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	max-width: 800px;
	margin: 0 auto 3rem;
}

/* Ensure maximum 3 columns on larger screens */
@media (min-width: 700px) {
	.users-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Card styles (MD3-esque) */
.room-card, .user-card {
	appearance: none;
	border: none;
	background: transparent;
	padding: 0;
	text-align: left;
	width: 100%;
	color: #e6edf3;
}

.room-card__content, .user-card__content {
	background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
	border-radius: 16px;
	padding: 26px 18px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 1px 0 rgba(255,255,255,0.04) inset;
	transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
	position: relative;
	border: 1px solid rgba(255,255,255,0.08);
	color: #e6edf3;
	max-width: 640px;
	margin: 0 auto;
	min-height: 90px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

/* User card with color gradient */
.user-card__content {
	background: linear-gradient(180deg, 
		rgba(255,255,255,0.08) 0%, 
		rgba(255,255,255,0.04) 50%, 
		rgba(255,255,255,0.02) 100%);
}

.user-card__content::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(0deg, 
		var(--user-color, rgba(255,255,255,0.1)) 0%, 
		transparent 100%);
	border-radius: 16px;
	pointer-events: none;
	opacity: 0.15;
}

/* Room card with color gradient */
.room-card__content {
	background: linear-gradient(180deg, 
		rgba(255,255,255,0.08) 0%, 
		rgba(255,255,255,0.04) 50%, 
		rgba(255,255,255,0.02) 100%);
}

.room-card__content::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(0deg, 
		var(--room-color, rgba(255,255,255,0.1)) 0%, 
		transparent 100%);
	border-radius: 16px;
	pointer-events: none;
	opacity: 0.15;
}

.room-card__content:hover, .user-card__content:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 32px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.04) inset;
	cursor: pointer;
}

.room-card__title, .user-card__title {
	font-size: 1.15rem;
	font-weight: 600;
}

/* Chips */
.room-chip, .user-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 999px;
	font-size: 0.95rem;
	font-weight: 700;
	color: #ffffff !important;
	text-shadow: -0.5px -0.5px 0 #000, 0.5px -0.5px 0 #000, -0.5px 0.5px 0 #000, 0.5px 0.5px 0 #000;
	border: 1px solid rgba(0,0,0,0.6);
	background: #3b82f6;
}
.room-chip .text-muted, .user-chip .text-muted { color: #ffffff !important; opacity: 1 !important; }

.room-card__meta { font-style: italic; font-size: 0.9rem; opacity: 0.8; margin-top: 8px; }

.room-card--button .room-card__content { background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01)); }

/* User card specifics */
.user-card__content { padding: 18px; }

/* Hearts */
.user-hearts { font-size: 1.2rem; letter-spacing: 2px; }

/* Active user highlight - brighter background and persistent glow */
.user-card__content.user-active {
	background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.06));
	border-color: rgba(255,255,255,0.35);
	box-shadow: 0 0 0 3px #ffffff, 0 0 26px rgba(255,255,255,0.4), 0 16px 36px rgba(0,0,0,0.65);
}
.user-card__content.user-active:hover {
	box-shadow: 0 0 0 3px #ffffff, 0 0 30px rgba(255,255,255,0.5), 0 20px 42px rgba(0,0,0,0.75);
}

/* User card footer layout */
.user-card__footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 10px;
}

/* Answer history dots */
.answer-dots {
	display: flex;
	gap: 3px;
	flex-wrap: wrap;
	max-width: 50%;
}
.answer-dot {
	font-size: 0.8rem;
	line-height: 1;
	opacity: 0.8;
	transition: opacity 0.2s ease;
}
.answer-dot:hover {
	opacity: 1;
}
.answer-dot-correct {
	color: #28a745;
}
.answer-dot-wrong {
	color: #dc3545;
}
.answer-dot-skipped {
	color: #6c757d;
}

/* Vote display */
.vote-display {
	font-size: 0.9rem;
	line-height: 1;
	opacity: 0.9;
}

/* Round dots area starts empty; dots will be appended when answers are tracked */
.hp-dots { display: flex; gap: 6px; min-height: 12px; }
.hp-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.2); }
.hp-dot--filled { background: #ffffff; }
.hp-dot--green { background: #22c55e; }
.hp-dot--red { background: #ef4444; }

/* Questions section */
.questions-list { max-width: 800px; margin: 0 auto; }
.question-item { margin-bottom: 1rem; }
.question-active { 
	background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
	border: 1px solid rgba(255,255,255,0.2);
	border-radius: 12px;
	padding: 16px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.question-answered { 
	background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
	border: 1px solid rgba(255,255,255,0.08);
	border-radius: 8px;
	padding: 12px;
	opacity: 0.7;
}
.question-text { font-size: 1.1rem; font-weight: 500; margin-bottom: 8px; }
.question-status { font-size: 0.9rem; opacity: 0.8; }
.moderator-controls { background: rgba(255,255,255,0.02); border-radius: 8px; padding: 12px; }
.form-label--small { font-size: 0.85rem; margin-bottom: 4px; }
.form-control--small { font-size: 0.9rem; padding: 6px 10px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; pointer-events: auto; }
.hidden { display: none; }

.modal-dialog { width: min(500px, 92vw); pointer-events: auto; max-height: 90vh; display: flex; flex-direction: column; }
.modal-dialog--wide { width: min(860px, 94vw); }
.modal-card { background: #0f141b; border: 1px solid rgba(255,255,255,0.08); border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,0.6); padding: 18px; pointer-events: auto; display: flex; flex-direction: column; max-height: 100%; }
.modal-header { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
.modal-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.modal-header .btn { font-size: 0.85rem; padding: 4px 8px; }
.modal-body { margin-bottom: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0; }

.modal-close { appearance: none; border: none; background: transparent; color: rgba(230,237,243,0.8); font-size: 1.25rem; line-height: 1; padding: 2px 6px; border-radius: 8px; cursor: pointer; }
.modal-close:hover { color: #ffffff; background: rgba(255,255,255,0.06); }

/* Moderation toolbar */
.moderator-toolbar { max-width: 800px; margin: 0 auto; }

/* Questions section */
.questions-container { max-width: 800px; margin: 0 auto; }
.questions-list { display: flex; flex-direction: column; gap: 12px; }
.question-card { 
	background: rgba(255,255,255,0.03); 
	border: 1px solid rgba(255,255,255,0.08); 
	border-radius: 12px; 
	padding: 16px; 
	transition: all 0.2s ease;
}
.question-card:hover { 
	background: rgba(255,255,255,0.05); 
	border-color: rgba(255,255,255,0.12);
}
.question-active { 
	background: rgba(255,255,255,0.08); 
	border-color: rgba(255,255,255,0.2); 
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.question-content { margin-bottom: 12px; }
.question-text { 
	color: #e6edf3; 
	font-size: 1rem; 
	line-height: 1.4; 
	margin-bottom: 8px;
}
.question-answer { 
	color: rgba(230,237,243,0.7); 
	font-size: 0.9rem; 
	font-style: italic;
}
.question-controls { 
	border-top: 1px solid rgba(255,255,255,0.1); 
	padding-top: 12px; 
	margin-top: 12px;
}
.moderator-controls .form-control { 
	background: rgba(255,255,255,0.05); 
	border: 1px solid rgba(255,255,255,0.15); 
	color: #e6edf3;
}
.moderator-controls .form-control:focus { 
	background: rgba(255,255,255,0.08); 
	border-color: rgba(255,255,255,0.25); 
	box-shadow: 0 0 0 2px rgba(255,255,255,0.1);
}
.moderator-controls .btn-sm { 
	padding: 6px 12px; 
	font-size: 0.85rem;
}

/* Answered questions section */
.answered-questions-container { max-width: 800px; margin: 0 auto; }
.answered-questions-list { display: flex; flex-direction: column; gap: 12px; }
.answered-question-card { 
	background: rgba(255,255,255,0.03); 
	border: 1px solid rgba(255,255,255,0.08); 
	border-radius: 12px; 
	padding: 16px; 
	transition: all 0.2s ease;
}
.answered-question-card.has-custom-answer {
	border-color: rgba(255,255,255,0.15);
	background: rgba(255,255,255,0.06);
}
.answered-question-content { }
.answered-question-header { 
	display: flex; 
	justify-content: space-between; 
	align-items: center; 
	margin-bottom: 12px;
}
.answered-question-user { 
	color: #e6edf3; 
	font-weight: 600; 
	font-size: 1rem;
}
.answered-question-status { 
	font-size: 1.4rem;
}

/* Subtle card tinting based on correctness */
.answered-question-card.correct {
	border-left: 4px solid rgba(34, 197, 94, 0.3);
	background: linear-gradient(90deg, rgba(34, 197, 94, 0.02), rgba(255,255,255,0.03));
}
.answered-question-card.wrong {
	border-left: 4px solid rgba(239, 68, 68, 0.3);
	background: linear-gradient(90deg, rgba(239, 68, 68, 0.02), rgba(255,255,255,0.03));
}
.answered-question-main {
	flex: 1;
}
.answered-question-text { 
	color: #e6edf3; 
	font-size: 1.1rem; 
	font-weight: 500;
	line-height: 1.5; 
	margin-bottom: 12px;
}
.answered-question-answer { 
	color: rgba(230,237,243,0.9); 
	font-size: 1rem; 
	font-weight: 500;
	margin-bottom: 8px;
}
.custom-answer-container {
	margin-top: 12px;
	padding: 12px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
}
.custom-answer-label {
	color: rgba(230,237,243,0.8);
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.custom-answer-text {
	color: #e6edf3;
	font-size: 0.95rem;
	font-weight: 500;
	line-height: 1.4;
}

/* User questions modal */
.user-question-item {
	padding: 8px 0;
}
.user-question-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}
.user-question-round {
	color: rgba(230,237,243,0.7);
	font-size: 0.85rem;
	font-weight: 600;
}
.user-question-status {
	font-size: 1.1rem;
}
.user-question-text {
	color: #e6edf3;
	font-size: 0.95rem;
	line-height: 1.4;
	margin-bottom: 6px;
}
.user-question-answer {
	color: rgba(230,237,243,0.8);
	font-size: 0.9rem;
	margin-bottom: 6px;
}
.custom-answer-display {
	color: rgba(230,237,243,0.7);
	font-size: 0.85rem;
	font-style: italic;
	margin-top: 4px;
	padding-left: 12px;
	border-left: 2px solid rgba(255,255,255,0.2);
}

/* User controls */
.user-controls {
	padding: 12px;
	background: rgba(255,255,255,0.05);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 8px;
	margin-top: 8px;
}
.user-controls h6 {
	color: #e6edf3;
	font-weight: 600;
	margin-bottom: 8px;
}
.user-controls .btn {
	font-size: 0.85rem;
	padding: 6px 12px;
}

/* User card with 0 hitpoints - greyed out */
.user-card.user-dead .user-card__content {
	opacity: 0.4;
	background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
	border-color: rgba(255,255,255,0.04);
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.user-card.user-dead .user-card__content:hover {
	transform: none;
	box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* User card animations */
.user-card.wiggle {
	animation: wiggle 2s ease-in-out;
}

@keyframes wiggle {
	0%, 100% { transform: translateX(0); }
	10% { transform: translateX(-3px) rotate(-1deg); }
	20% { transform: translateX(3px) rotate(1deg); }
	30% { transform: translateX(-3px) rotate(-1deg); }
	40% { transform: translateX(3px) rotate(1deg); }
	50% { transform: translateX(-2px) rotate(-0.5deg); }
	60% { transform: translateX(2px) rotate(0.5deg); }
	70% { transform: translateX(-1px) rotate(-0.25deg); }
	80% { transform: translateX(1px) rotate(0.25deg); }
	90% { transform: translateX(-0.5px) rotate(-0.1deg); }
}
